Index: /issm/trunk-jpl/src/c/CMakeLists.txt
===================================================================
--- /issm/trunk-jpl/src/c/CMakeLists.txt	(revision 16236)
+++ /issm/trunk-jpl/src/c/CMakeLists.txt	(revision 16237)
@@ -57,5 +57,4 @@
                           $ENV{ISSM_DIR}/src/c/modules/GetVectorFromInputsx 
                           $ENV{ISSM_DIR}/src/c/modules/InputUpdateFromVectorx 
-                          $ENV{ISSM_DIR}/src/c/modules/InputArtificialNoisex 
                           $ENV{ISSM_DIR}/src/c/modules/ConfigureObjectsx 
                           $ENV{ISSM_DIR}/src/c/modules/ComputeBasalStressx 
@@ -206,5 +205,4 @@
 					./modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
 					./modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp
-					./modules/InputArtificialNoisex/InputArtificialNoisex.cpp
 					./modules/ConfigureObjectsx/ConfigureObjectsx.cpp
 					./modules/ComputeBasalStressx/ComputeBasalStressx.cpp
Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 16236)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 16237)
@@ -298,6 +298,4 @@
 					./modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h\
 					./modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp\
-					./modules/InputArtificialNoisex/InputArtificialNoisex.h\
-					./modules/InputArtificialNoisex/InputArtificialNoisex.cpp\
 					./modules/ConfigureObjectsx/ConfigureObjectsx.h\
 					./modules/ConfigureObjectsx/ConfigureObjectsx.cpp\
Index: /issm/trunk-jpl/src/c/bamg/EigenMetric.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/EigenMetric.cpp	(revision 16236)
+++ /issm/trunk-jpl/src/c/bamg/EigenMetric.cpp	(revision 16237)
@@ -99,15 +99,7 @@
 		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 {{{*/
Index: /issm/trunk-jpl/src/c/bamg/Geometry.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Geometry.cpp	(revision 16236)
+++ /issm/trunk-jpl/src/c/bamg/Geometry.cpp	(revision 16237)
@@ -463,30 +463,4 @@
 		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(){
Index: /issm/trunk-jpl/src/c/bamg/Geometry.h
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Geometry.h	(revision 16236)
+++ /issm/trunk-jpl/src/c/bamg/Geometry.h	(revision 16237)
@@ -60,6 +60,5 @@
 			long             GetId(const Curve *c) const;
 			void             UnMarkEdges();
-			GeomEdge *ProjectOnCurve(const Edge &,double,BamgVertex &,VertexOnGeom &) const;
-			GeomEdge *Containing(const R2 P, GeomEdge *start) const;
+			GeomEdge        *ProjectOnCurve(const Edge &,double,BamgVertex &,VertexOnGeom &) const;
 			void             WriteGeometry(BamgGeom *bamggeom, BamgOpts*bamgopts);
 	};
Index: /issm/trunk-jpl/src/c/bamg/Mesh.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Mesh.cpp	(revision 16236)
+++ /issm/trunk-jpl/src/c/bamg/Mesh.cpp	(revision 16237)
@@ -139,7 +139,4 @@
 				nbt++;           
 			  }
-		  if (kt!=nbt){
-			  _error_("kt!=nbt");
-		  }
 		  if (nbt==0 && nbv==0) {
 			  _error_("All triangles have been removed");
@@ -148,5 +145,4 @@
 		  delete [] reft;
 		  delete [] refv;
-		  //double cutoffradian = 10.0/180.0*Pi;
 		  BuildGeometryFromMesh(bamgopts);
 		  Gh.PostRead(); 
@@ -154,11 +150,8 @@
 		  ReconstructExistingMesh();
 
-		  if (!nbsubdomains){
-			  _error_("nbsubdomains==0");
-		  }
-		  if (!subdomains[0].head || !subdomains[0].head->link){
-			  _error_("!subdomains[0].head || !subdomains[0].head->link");
-		  }
-
+		  /*Final checks*/
+		  _assert_(kt==nbt);
+		  _assert_(nbsubdomains);
+		  _assert_(subdomains[0].head && subdomains[0].head->link); 
 	  }
 	/*}}}*/
@@ -1725,14 +1718,11 @@
 			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
-			 _error_("%i should be >=0");
-		  }
+			_assert_(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;
+		}
 
 		delete edge4;
Index: /issm/trunk-jpl/src/c/bamg/Metric.h
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Metric.h	(revision 16236)
+++ /issm/trunk-jpl/src/c/bamg/Metric.h	(revision 16237)
@@ -77,6 +77,4 @@
 			double lmin()   const;
 			double Aniso2() const;
-			double Aniso()  const;
-			void   BoundAniso(const  double c);
 			inline void BoundAniso2(const double coef);
 
Index: /issm/trunk-jpl/src/c/bamg/Triangle.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Triangle.cpp	(revision 16236)
+++ /issm/trunk-jpl/src/c/bamg/Triangle.cpp	(revision 16237)
@@ -251,8 +251,4 @@
 			t->AdjEdgeIndex[aat]=a;
 		}
-	}/*}}}*/
-	/*FUNCTION Triangle::SetAllFlag{{{*/
-	void   Triangle::SetAllFlag(int a,int f){
-		AdjEdgeIndex[a] = (AdjEdgeIndex[a] &3) + (1020 & f);
 	}/*}}}*/
 	/*FUNCTION Triangle::SetHidden{{{*/
Index: /issm/trunk-jpl/src/c/bamg/Triangle.h
===================================================================
--- /issm/trunk-jpl/src/c/bamg/Triangle.h	(revision 16236)
+++ /issm/trunk-jpl/src/c/bamg/Triangle.h	(revision 16237)
@@ -46,5 +46,4 @@
 			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;
Index: /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 16236)
+++ /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 16237)
@@ -733,125 +733,4 @@
 }
 /*}}}*/
-/*FUNCTION Riftfront::PotentialUnstableConstraint {{{*/
-int   Riftfront::PotentialUnstableConstraint(int* punstable){
-
-	IssmDouble  penetration;
-	int         unstable;
-	IssmDouble  vx1;
-	IssmDouble  vy1;
-	IssmDouble  vx2;
-	IssmDouble  vy2;
-
-	/*Objects: */
-	Tria       *tria1 = NULL;
-	Tria       *tria2 = NULL;
-
-	/*enum of element? */
-	if(elements[0]->ObjectEnum()!=TriaEnum)_error_("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){
-
-	IssmDouble  penetration;
-	int         unstable;
-	IssmDouble  vx1;
-	IssmDouble  vy1;
-	IssmDouble  vx2;
-	IssmDouble  vy2;
-
-	/*Objects: */
-	Tria *tria1 = NULL;
-	Tria *tria2 = NULL;
-
-	/*enum of element? */
-	if(elements[0]->ObjectEnum()!=TriaEnum)_error_("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){
Index: /issm/trunk-jpl/src/c/classes/Loads/Riftfront.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Riftfront.h	(revision 16236)
+++ /issm/trunk-jpl/src/c/classes/Loads/Riftfront.h	(revision 16237)
@@ -85,16 +85,11 @@
 		/*}}}*/
 		/*Riftfront specific routines: {{{*/
-		bool  PreStable();
 		ElementMatrix* PenaltyCreateKMatrixStressbalanceHoriz(IssmDouble kmax);
 		ElementVector* PenaltyCreatePVectorStressbalanceHoriz(IssmDouble kmax);
-		void  SetPreStable();
-		int   PreConstrain(int* punstable);
 		int   Constrain(int* punstable);
 		void  FreezeConstraints(void);
 		bool  IsFrozen(void);
-		int   PotentialUnstableConstraint(int* punstable);
 		bool  IsInput(int name);
 		/*}}}*/
 };
-
 #endif  /* _RIFTFRONT_H_ */
Index: /issm/trunk-jpl/src/c/modules/modules.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/modules.h	(revision 16236)
+++ /issm/trunk-jpl/src/c/modules/modules.h	(revision 16237)
@@ -51,5 +51,4 @@
 #include "./InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h"
 #include "./InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.h"
-#include "./InputArtificialNoisex/InputArtificialNoisex.h"
 #include "./IoModelToConstraintsx/IoModelToConstraintsx.h"
 #include "./KMLFileReadx/KMLFileReadx.h"
