Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 20022)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 20023)
@@ -3558,5 +3558,8 @@
 	/*recover legendre coefficients if they have been precomputed:*/
 	this->parameters->FindParam(&legendre_precompute,SealevelriseLegendrePrecomputeEnum);
-	if(legendre_precompute)this->parameters->FindParam(&legendre_coefficients,&M,NULL,SealevelriseLegendreCoefficientsEnum);
+	if(legendre_precompute){
+		DoubleMatParam* parameter = static_cast<DoubleMatParam*>(this->parameters->FindParamObject(SealevelriseLegendreCoefficientsEnum)); _assert_(parameter);
+		parameter->GetParameterValueByPointer(&legendre_coefficients,NULL,&M);
+	}
 
 	/*how many dofs are we working with here? */
@@ -3644,5 +3647,6 @@
 				G_elastic = (love_k[nl-1]-love_h[nl-1])/2.0/sin(alpha/2.0);
 				if(legendre_precompute){
-					for(int n=0;n<nl;n++) G_elastic += deltalove[n]*legendre_coefficients[reCast<int,IssmDouble>((M-1)*(cosalpha+1.0)/2.0)*nl+n];
+					int index=reCast<int,IssmDouble>((M-1)*(1-alpha/PI));
+					for(int n=0;n<nl;n++) G_elastic += deltalove[n]*legendre_coefficients[M*n + index];
 				}
 				else{
@@ -3804,5 +3808,8 @@
 		/*recover legendre coefficients if they have been precomputed:*/
 		this->parameters->FindParam(&legendre_precompute,SealevelriseLegendrePrecomputeEnum);
-		if(legendre_precompute)this->parameters->FindParam(&legendre_coefficients,&M,NULL,SealevelriseLegendreCoefficientsEnum);
+		if(legendre_precompute){
+			DoubleMatParam* parameter = static_cast<DoubleMatParam*>(this->parameters->FindParamObject(SealevelriseLegendreCoefficientsEnum)); _assert_(parameter);
+			parameter->GetParameterValueByPointer(&legendre_coefficients,NULL,&M);
+		}
 
 		/*Speed up of love number comutation for elastic mode: */
@@ -3845,5 +3852,6 @@
 				G_elastic[i] = (love_k[nl-1]-love_h[nl-1])/2.0/sin(alpha/2.0);
 				if(legendre_precompute){
-					for(int n=0;n<nl;n++) G_elastic[i] += deltalove[n]*legendre_coefficients[reCast<int,IssmDouble>((M-1)*(cosalpha+1.0)/2.0)*nl+n];
+					int index=reCast<int,IssmDouble>((M-1)*(1-alpha/PI));
+					for(int n=0;n<nl;n++) G_elastic[i] += deltalove[n]*legendre_coefficients[M*n + index];
 				}
 				else{
