Index: /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 25436)
+++ /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 25437)
@@ -614,6 +614,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(4);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -752,6 +751,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGaussBase(4);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
@@ -836,6 +834,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(4);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -964,7 +961,5 @@
 	Gauss* gauss=element->NewGaussBase(4);
 	Gauss* gaussup=element->NewGaussTop(4);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
-		gaussup->GaussPoint(ig);
+	while(gauss->next() && gaussup->next()){
 
 		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
@@ -1051,6 +1046,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGaussBase(4);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
Index: /issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 25436)
+++ /issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 25437)
@@ -259,6 +259,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -367,6 +366,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
Index: /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 25436)
+++ /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 25437)
@@ -196,6 +196,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(1);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -271,6 +270,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -509,6 +507,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
Index: /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25436)
+++ /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25437)
@@ -1320,6 +1320,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss = basalelement->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -2089,7 +2088,5 @@
 	Gauss* gauss      = element->NewGauss(5);
 	Gauss* gauss_base = basalelement->NewGauss();
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 		gauss->SynchronizeGaussBase(gauss_base);
 
@@ -2175,8 +2172,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
-
+	while(gauss->next()){
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
 		element->NodalFunctions(basis, gauss);
@@ -2232,7 +2226,5 @@
 	/*Start looping on Gaussian points*/
 	Gauss* gauss=element->NewGauss(xyz_list,xyz_list_front,3);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 		thickness_input->GetInputValue(&thickness,gauss);
 		base_input->GetInputValue(&bed,gauss);
@@ -2384,6 +2376,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss = element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -2482,6 +2473,5 @@
 
 	/* Start  looping on the number of gaussian points: */
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		friction->GetAlpha2(&alpha2,gauss);
@@ -2557,6 +2547,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss = element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -2629,6 +2618,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(3);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -2702,6 +2690,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(3);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -2769,7 +2756,5 @@
 
 	/* Start  looping on the number of gaussian points: */
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 		surface_input->GetInputValue(&surface,gauss);
 		sealevel_input->GetInputValue(&sealevel,gauss);
@@ -3077,6 +3062,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss = element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -3198,6 +3182,5 @@
 	/* Start  looping on the number of gaussian points: */
 	gauss=element->NewGaussBase(3);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		base_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
@@ -3259,6 +3242,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss = element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -3356,6 +3338,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss = element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -3410,6 +3391,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss = element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -3483,6 +3463,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss = element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -3526,6 +3505,5 @@
 		delete gauss;
 		gauss = element->NewGaussBase(5);
-		for(int ig=gauss->begin();ig<gauss->end();ig++){
-			gauss->GaussPoint(ig);
+		while(gauss->next()){
 
 			element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
@@ -3608,6 +3586,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss = element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -3677,6 +3654,5 @@
 	/* Start  looping on the number of gaussian points: */
 	gauss=element->NewGaussBase(10);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		x_coord=element->GetXcoord(xyz_list,gauss);
@@ -3752,6 +3728,5 @@
 	/* Start  looping on the number of gaussian points: */
 	gauss=element->NewGaussBase(3);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		alpha2_input->GetInputValue(&alpha2, gauss);
@@ -3808,6 +3783,5 @@
 	/* Start  looping on the number of gaussian points: */
 	gauss=element->NewGaussBase(3);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		sigmann_input->GetInputValue(&sigmann, gauss);
@@ -3866,6 +3840,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -3966,6 +3939,5 @@
 
 	/* Start  looping on the number of gaussian points: */
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		friction->GetAlpha2(&alpha2,gauss);
@@ -4097,6 +4069,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -4178,6 +4149,5 @@
 
 	/* Start  looping on the number of gaussian points: */
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminantSurface(&Jdet,xyz_list_front,gauss);
@@ -4241,6 +4211,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGaussBase(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
@@ -4262,6 +4231,5 @@
 		IssmDouble  dt,mb;
 		element->FindParam(&dt,TimesteppingTimeStepEnum);
-		for(int ig=gauss->begin();ig<gauss->end();ig++){
-			gauss->GaussPoint(ig);
+		while(gauss->next()){
 			element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
 			element->NodalFunctionsVelocity(vbasis,gauss);
@@ -4314,6 +4282,5 @@
 
 	gauss=element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
 
@@ -4337,6 +4304,5 @@
 		delete gauss;
 		gauss=element->NewGaussBase(5);
-		for(int ig=gauss->begin();ig<gauss->end();ig++){
-			gauss->GaussPoint(ig);
+		while(gauss->next()){
 
 			element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
@@ -4448,6 +4414,5 @@
 	delete gauss;
 	gauss=element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
 
@@ -5380,6 +5345,5 @@
 
 		Gauss* gauss=element->NewGauss(5);
-		for(int ig=gauss->begin();ig<gauss->end();ig++){
-			gauss->GaussPoint(ig);
+		while(gauss->next()){
 			element->JacobianDeterminant(&Jdet,xyz_list,gauss);
 			element->NodalFunctionsTensor(tbasis,gauss);
@@ -5813,7 +5777,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGaussBase(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminantBase(&Jdet2d,xyz_list_tria,gauss);
@@ -5932,7 +5894,5 @@
 	Gauss* gauss=element->NewGauss(5);
 	Gauss* gauss_tria=new GaussTria();
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 		gauss->SynchronizeGaussBase(gauss_tria);
 
@@ -6034,7 +5994,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGaussBase(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		/*Friction: */
@@ -6118,7 +6076,5 @@
 	Gauss* gauss=element->NewGauss(5);
 	Gauss* gauss_tria=new GaussTria();
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 		gauss->SynchronizeGaussBase(gauss_tria);
 
@@ -6276,7 +6232,5 @@
 	Gauss* gauss=element->NewGauss(5);
 	Gauss* gauss_tria=new GaussTria();
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 		gauss->SynchronizeGaussBase(gauss_tria);
 
@@ -6381,7 +6335,5 @@
 	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
 	Gauss* gauss=element->NewGaussBase(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminantBase(&Jdet2d,xyz_list_tria,gauss);
@@ -6457,7 +6409,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet, xyz_list,gauss);
@@ -6548,7 +6498,5 @@
 	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
 	Gauss* gauss=element->NewGaussBase(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminantBase(&Jdet2d,xyz_list_tria,gauss);
@@ -6623,7 +6571,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(5);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
 		element->NodalFunctionsP1(&basis[0], gauss);
Index: /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 25436)
+++ /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 25437)
@@ -209,6 +209,5 @@
 	Gauss* gauss = element->NewGaussBase(2);
 	element->NormalBase(&normal[0],xyz_list);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminantBase(&Jdet,xyz_list,gauss);
@@ -246,6 +245,5 @@
 	Gauss* gauss = element->NewGaussTop(2);
 	element->NormalTop(&normal[0],xyz_list);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminantTop(&Jdet,xyz_list,gauss);
@@ -281,6 +279,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss = element->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -360,6 +357,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGaussBase(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		groundedice_melting_input->GetInputValue(&gmb,gauss);
@@ -424,6 +420,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGaussTop(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		smb_input->GetInputValue(&smb,gauss);
@@ -477,6 +472,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
Index: /issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.cpp	(revision 25436)
+++ /issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.cpp	(revision 25437)
@@ -156,7 +156,5 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=basalelement->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		/* Get Jacobian determinant: */
Index: /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25436)
+++ /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25437)
@@ -2101,5 +2101,5 @@
 				// ERA5 new aIdx=1, swIdx=0
 				if (aIdx==1 && swIdx==0){
-					if (abs(adThresh - 820) < Dtol){
+					if (fabs(adThresh - 820) < Dtol){
 						// ERA5 new aIdx=1, swIdx=0, MODIS 820
 						M0 = max(1.8230 - (0.1645 * log(C)),0.25);
