Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 17456)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 17457)
@@ -215,4 +215,5 @@
 					./shared/Sorting/sorting.h\
 					./shared/Elements/elements.h\
+					./shared/Elements/Cuffey.cpp\
 					./shared/Elements/Paterson.cpp\
 					./shared/Elements/Arrhenius.cpp\
Index: /issm/trunk-jpl/src/c/shared/Elements/Cuffey.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/Cuffey.cpp	(revision 17457)
+++ /issm/trunk-jpl/src/c/shared/Elements/Cuffey.cpp	(revision 17457)
@@ -0,0 +1,57 @@
+/* \file Cuffey.cpp
+ * \brief figure out B of ice for a certain temperature
+ *	  INPUT function B=Cuffey(temperature)
+ *    where rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Cuffey, p75). 
+ */
+
+#include <math.h>
+
+#include "../Numerics/types.h"
+
+IssmDouble Cuffey(IssmDouble temperature){
+
+	/*output: */
+	IssmDouble B,T;
+
+	/*Switch to celsius from Kelvin: */
+	T=temperature-273.15;
+
+	if(T<=-45.0){
+		B=1.e+8*(-0.000396645116301*pow(T+50.,3)+ 0.013345579471334*pow(T+50.,2) -0.356868703259105*(T+50.)+7.272363035371383);
+	}
+	else if((T>=-45.0) && (T<=-40.0)){
+		B=1.e+8*(-0.000396645116301*pow(T+45.,3)+ 0.007395902726819*pow(T+45.,2) -0.253161292268336*(T+45.)+5.772078366321591);
+	}
+	else if((T>=-40.0) && (T<=-35.0)){
+		B=1.e+8*(0.000408322072669*pow(T+40.,3)+  0.001446225982305*pow(T+40.,2)  -0.208950648722716*(T+40.)+4.641588833612773);
+	}
+	else if((T>=-35.0) && (T<=-30.0)){
+		B=1.e+8*(-0.000423888728124*pow(T+35.,3)+ 0.007571057072334*pow(T+35.,2)  -0.163864233449525*(T+35.)+3.684031498640382);
+	}
+	else if((T>=-30.0) && (T<=-25.0)){
+		B=1.e+8*(0.000147154327025*pow(T+30.,3)+ 0.001212726150476*pow(T+30.,2) -0.119945317335478*(T+30.)+3.001000667185614);
+	}
+	else if((T>=-25.0) && (T<=-20.0)){
+		B=1.e+8*(-0.000193435838672*pow(T+25.,3)+ 0.003420041055847*pow(T+25.,2)  -0.096781481303861*(T+25.)+2.449986525148220);
+	}
+	else if((T>=-20.0) && (T<=-15.0)){
+		B=1.e+8*(0.000219771255067*pow(T+20.,3)+  0.000518503475772*pow(T+20.,2)  -0.077088758645767*(T+20.)+2.027400665191131);
+	}
+	else if((T>=-15.0) && (T<=-10.0)){
+		B=1.e+8*(-0.000653438900191*pow(T+15.,3)+ 0.003815072301777*pow(T+15.,2)  -0.055420879758021*(T+15.)+1.682390865739973);
+	}
+	else if((T>=-10.0) && (T<=-5.0)){
+		B=1.e+8*(0.000692439419762*pow(T+10.,3) -0.005986511201093 *pow(T+10.,2) -0.066278074254598*(T+10.)+1.418983411970382);
+	}
+	else if((T>=-5.0) && (T<=-2.0)){
+		B=1.e+8*(-0.000132282004110*pow(T+5.,3) +0.004400080095332*pow(T+5.,2)    -0.074210229783403*(T+5.)+ 1.024485188140279);
+	}
+	else{
+		B=1.e+8*(-0.000132282004110*pow(T+2.,3) +0.003209542058346*pow(T+2.,2)    -0.051381363322371*(T+2.)+ 0.837883605537096);
+	}
+
+	/*B cannot be negative!*/
+	if(B<0) B=1.e+6;
+
+	return B;
+}
Index: /issm/trunk-jpl/src/c/shared/Elements/Paterson.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/Paterson.cpp	(revision 17456)
+++ /issm/trunk-jpl/src/c/shared/Elements/Paterson.cpp	(revision 17457)
@@ -11,59 +11,46 @@
 IssmDouble Paterson(IssmDouble temperature){
 
-	/*output: */
-	IssmDouble B;
-	IssmDouble T;
+	IssmDouble B,T;
 
 	/*Switch to celsius from Kelvin: */
 	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 B 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');
-//	% B=fittedmodel(temperature);
 
 	if(T<=-45.0){
-		B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000292866376675*pow(T+50,3)+ 0.011672640664130*pow(T+50,2)  -0.325004442485481*(T+50)+  6.524779401948101);
+		B=1.e+8*(-0.000292866376675*pow(T+50.,3)+ 0.011672640664130*pow(T+50.,2)  -0.325004442485481*(T+50.)+  6.524779401948101);
 	}
 	else if((T>=-45.0) && (T<=-40.0)){
-		B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000292866376675*pow(T+45,3)+ 0.007279645014004*pow(T+45,2)  -0.230243014094813*(T+45)+  5.154964909039554);
+		B=1.e+8*(-0.000292866376675*pow(T+45.,3)+ 0.007279645014004*pow(T+45.,2)  -0.230243014094813*(T+45.)+  5.154964909039554);
 	}
 	else if((T>=-40.0) && (T<=-35.0)){
-		B=pow((IssmPDouble)10,(IssmPDouble)8)*(0.000072737147457*pow(T+40,3)+  0.002886649363879*pow(T+40,2)  -0.179411542205399*(T+40)+  4.149132666831214);
+		B=1.e+8*(0.000072737147457*pow(T+40.,3)+  0.002886649363879*pow(T+40.,2)  -0.179411542205399*(T+40.)+  4.149132666831214);
 	}
 	else if((T>=-35.0) && (T<=-30.0)){
-		B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000086144770023*pow(T+35,3)+ 0.003977706575736*pow(T+35,2)  -0.145089762507325*(T+35)+  3.333333333333331);
+		B=1.e+8*(-0.000086144770023*pow(T+35.,3)+ 0.003977706575736*pow(T+35.,2)  -0.145089762507325*(T+35.)+  3.333333333333331);
 	}
 	else if((T>=-30.0) && (T<=-25.0)){
-		B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000043984685769*pow(T+30,3)+ 0.002685535025386*pow(T+30,2)  -0.111773554501713*(T+30)+  2.696559088937191);
+		B=1.e+8*(-0.000043984685769*pow(T+30.,3)+ 0.002685535025386*pow(T+30.,2)  -0.111773554501713*(T+30.)+  2.696559088937191);
 	}
 	else if((T>=-25.0) && (T<=-20.0)){
-		B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000029799523463*pow(T+25,3)+ 0.002025764738854*pow(T+25,2)  -0.088217055680511*(T+25)+  2.199331606342181);
+		B=1.e+8*(-0.000029799523463*pow(T+25.,3)+ 0.002025764738854*pow(T+25.,2)  -0.088217055680511*(T+25.)+  2.199331606342181);
 	}
 	else if((T>=-20.0) && (T<=-15.0)){
-		B=pow((IssmPDouble)10,(IssmPDouble)8)*(0.000136920904777*pow(T+20,3)+  0.001578771886910*pow(T+20,2)  -0.070194372551690*(T+20)+  1.805165505978111);
+		B=1.e+8*(0.000136920904777*pow(T+20.,3)+  0.001578771886910*pow(T+20.,2)  -0.070194372551690*(T+20.)+  1.805165505978111);
 	}
 	else if((T>=-15.0) && (T<=-10.0)){
-		B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000899763781026*pow(T+15,3)+ 0.003632585458564*pow(T+15,2)  -0.044137585824322*(T+15)+  1.510778053489523);
+		B=1.e+8*(-0.000899763781026*pow(T+15.,3)+ 0.003632585458564*pow(T+15.,2)  -0.044137585824322*(T+15.)+  1.510778053489523);
 	}
 	else if((T>=-10.0) && (T<=-5.0)){
-		B=pow((IssmPDouble)10,(IssmPDouble)8)*(0.001676964325070*pow(T+10,3)-  0.009863871256831*pow(T+10,2)  -0.075294014815659*(T+10)+  1.268434288203714);
+		B=1.e+8*(0.001676964325070*pow(T+10.,3)-  0.009863871256831*pow(T+10.,2)  -0.075294014815659*(T+10.)+  1.268434288203714);
 	}
 	else if((T>=-5.0) && (T<=-2.0)){
-		B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.003748937622487*pow(T+5,3)+0.015290593619213*pow(T+5,2)  -0.048160403003748*(T+5)+  0.854987973338348);
+		B=1.e+8*(-0.003748937622487*pow(T+5.,3)+0.015290593619213*pow(T+5.,2)  -0.048160403003748*(T+5.)+  0.854987973338348);
 	}
 	else{
-		B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.003748937622488*pow(T+2,3)-0.018449844983174*pow(T+2,2)  -0.057638157095631*(T+2)+  0.746900791092860);
+		B=1.e+8*(-0.003748937622488*pow(T+2.,3)-0.018449844983174*pow(T+2.,2)  -0.057638157095631*(T+2.)+  0.746900791092860);
 	}
 
 	/*B cannot be negative!*/
-	if(B<0) B=pow((IssmPDouble)10,(IssmPDouble)6);
+	if(B<0) B=1.e+6;
 
 	return B;
Index: /issm/trunk-jpl/src/c/shared/Elements/elements.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Elements/elements.h	(revision 17456)
+++ /issm/trunk-jpl/src/c/shared/Elements/elements.h	(revision 17457)
@@ -8,4 +8,5 @@
 #include "../Numerics/types.h"
 
+IssmDouble Cuffey(IssmDouble temperature);
 IssmDouble Paterson(IssmDouble temperature);
 IssmDouble Arrhenius(IssmDouble temperature,IssmDouble depth,IssmDouble n);
Index: /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 17456)
+++ /issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp	(revision 17457)
@@ -46,5 +46,5 @@
 	file_line= what_line;
 	/*When error messages are not shown properly, uncomment the following line*/
-	this->Report();
+	//this->Report();
 
 }/*}}}*/
