Index: /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25850)
+++ /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25851)
@@ -333,8 +333,8 @@
 			}
 			// dendricity and sphericity can not be > 1 or < 0
-         if (gdn[i]<0.0+Gdntol)gdn[i]=0.0;
-         if (gsp[i]<0.0+Gdntol)gsp[i]=0.0;
-         if (gdn[i]>1.0-Gdntol)gdn[i]=1.0;
-         if (gsp[i]>1.0-Gdntol)gsp[i]=1.0;
+         if (gdn[i]<=0.0+Gdntol)gdn[i]=0.0;
+         if (gsp[i]<=0.0+Gdntol)gsp[i]=0.0;
+         if (gdn[i]>=1.0-Gdntol)gdn[i]=1.0;
+         if (gsp[i]>=1.0-Gdntol)gsp[i]=1.0;
 
          // determine new grain size (mm)
@@ -344,7 +344,4 @@
 		else{
 
-			//When the state of "faceted crystals" (gsp==0) is fully reached,
-			// snow evolves towards depth hoar if the gradient is
-			// higher than 15 degC m-1 (Brun et al., 1992)
 			//When wet-snow grains (class 6) are submitted to a
 			// temperature gradient higher than 5 degC m-1, their sphericity
@@ -352,15 +349,26 @@
 			// reaches 0, their size increases according to the functions
 			// determined by Marbouty. (Brun et al., 1992)
-			if(gsp[i]>0.0+Gdntol && gsp[i]<1.0-Gdntol && (dT[i]>15.0+Ttol || (dT[i]>5.0+Ttol && W[i]>0.0+Wtol)) ){
-				//determine coefficients
-				IssmDouble C = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4);
-				gsp[i] +=C;
-				if (gsp[i]<0.0+Gdntol)gsp[i]=0.0;
-				//determine new grain size (mm)
-				gsz[i] = 0.35 + (0.5-gsp[i])*0.1;
-			}
+			if(gsp[i]>0.0+Gdntol && gsp[i]<1.0-Gdntol){
+
+				IssmDouble F = 0.0;
+
+				if (dT[i]>5.0+Ttol){
+					F = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4);
+				}
+				else if (W[i]>0.0+Wtol){
+					F = (1.0/16.0) * pow(lwc[i],3.0) * dt;
+				}
+				else{
+					F = 1e9 * exp(-6e3 / T[i]) * dt;
+				}
+				gsp[i] +=F;
+
+			}
+			if (gsp[i]<=0.0+Gdntol)gsp[i]=0.0;
+			if (gsp[i]>=1.0-Gdntol)gsp[i]=1.0;
+
 			/*Dry snow metamorphism (Marbouty, 1980) grouped model coefficents
 			 *from Marbouty, 1980: Figure 9*/
-			else if(W[i]<=0.0+Wtol || (gsp[i]<=0.0+Gdntol && dT[i]>15.0+Ttol) || (gsp[i]<=0.0+Gdntol && dT[i]>5.0+Ttol && W[i]>0.0+Wtol)){
+			if(W[i]<=0.0+Wtol || (gsp[i]<=0.0+Gdntol && dT[i]>5.0+Ttol)){
 				//_printf_("Nondendritic snow metamorphism\n");
 				Q = Marbouty(T[i],d[i],dT[i]);
