Index: /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 8697)
+++ /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.cpp	(revision 8698)
@@ -3,13 +3,9 @@
 
 #include "./Ll2xyx.h"
+#include "../../include/include.h"
 #include "../../shared/shared.h"
-#include "../../include/include.h"
-#include "../../toolkits/toolkits.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
+#include <math.h>
 
-int Ll2xyx(double* x, double* y,
-		   double* lat, double* lon, int ncoord,
-		   int sgn){
-
+int Ll2xyx(double* x, double* y, double* lat, double* lon, int ncoord, int sgn){
 /*  This is a cpp conversion of the following:
 %LL2XY - converts lat long to polar stereographic
@@ -26,31 +22,24 @@
 %                               -1 : south latitude (default is mer=0  lat=71)
 */
-
 	double  delta,slat;
 	bool    flag=true;
 
 	/*  Get central_meridian and standard_parallel depending on hemisphere  */
-	if      (sgn ==  1) {
-		delta = 45;
+	if (sgn ==  1) {
+		delta= 45;
 		slat = 70;
 		_printf_(flag,"Info: creating coordinates in polar stereographic (Std Latitude: 70N Meridian: 45).\n");
 	}
 	else if (sgn == -1) {
-		delta = 0;
+		delta= 0;
 		slat = 71;
 		_printf_(flag,"Info: creating coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).\n");
 	}
-	else
-		_error_("Sign should be either +1 or -1.\n");
+	else _error_("Sign should be either +1 or -1.\n");
 
-	return(Ll2xyx(x,y,
-				  lat,lon,ncoord,
-				  sgn,delta,slat));
+	return(Ll2xyx(x,y, lat,lon,ncoord, sgn,delta,slat));
 }
 
-int Ll2xyx(double* x, double* y,
-		   double* lat, double* lon, int ncoord,
-		   int sgn, double central_meridian, double standard_parallel){
-
+int Ll2xyx(double* x, double* y, double* lat, double* lon, int ncoord, int sgn, double central_meridian, double standard_parallel){
 /*  This is a cpp conversion of the following:
 %LL2XY - converts lat long to polar stereographic
@@ -74,6 +63,10 @@
 	double  T,rho,sl,tc,mc;
 
+<<<<<<< .mine
+	if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1");
+=======
 	if      ((sgn !=  1) && (sgn != -1))
 		_error_("Sign should be either +1 or -1.\n");
+>>>>>>> .r8690
 
 	delta = central_meridian;
@@ -81,36 +74,33 @@
 
 	/*  Conversion constant from degrees to radians  */
-	cde  = 57.29577951;
+	cde = 57.29577951;
 	/*  Radius of the earth in meters  */
-	re   = 6378.273*pow(10.,3.);
+	re  = 6378.273*pow(10.,3.);
 	/*  Eccentricity of the Hughes ellipsoid squared  */
-	ex2   = .006693883;
+	ex2 = 0.006693883;
 	/*  Eccentricity of the Hughes ellipsoid  */
-	ex    =  sqrt(ex2);
-	/*  pi is not defined in cpp  */
-	pi   = 4.*atan(1.);
+	ex  =  sqrt(ex2);
 
 	/*  loop over all the coordinate pairs  */
-
-	for (i=0; i<ncoord; i++) {
-		latitude  = fabs(lat[i]) * pi/180.;
-		longitude = (lon[i] + delta) * pi/180.;
+	for(i=0; i<ncoord; i++){
+		latitude  = fabs(lat[i]) * PI/180.;
+		longitude = (lon[i] + delta) * PI/180.;
 
 		/*  compute X and Y in grid coordinates.  */
-		T = tan(pi/4.-latitude/2.) / pow(((1.-ex*sin(latitude))/(1.+ex*sin(latitude))),(ex/2.));
+		T = tan(PI/4.-latitude/2.) / pow(((1.-ex*sin(latitude))/(1.+ex*sin(latitude))),(ex/2.));
 
-		if ((90. - slat) <  1.e-5)
+		if ((90. - slat) < 1.e-5)
 			rho = 2.*re*T/sqrt(pow((1.+ex),(1.+ex))*pow((1.-ex),(1.-ex)));
 		else {
-			sl  = slat*pi/180.;
-			tc  = tan(pi/4.-sl/2.)/pow(((1.-ex*sin(sl))/(1.+ex*sin(sl))),(ex/2.));
+			sl  = slat*PI/180.;
+			tc  = tan(PI/4.-sl/2.)/pow(((1.-ex*sin(sl))/(1.+ex*sin(sl))),(ex/2.));
 			mc  = cos(sl)/sqrt(1.0-ex2*(pow(sin(sl),2.)));
 			rho = re*mc*T/tc;
 		}
 
-		y[i] = -rho * (double)sgn * cos((double)sgn*longitude);
-		x[i] =  rho * (double)sgn * sin((double)sgn*longitude);
+		y[i]= -rho*(double)sgn*cos(sgn*longitude);
+		x[i]=  rho*(double)sgn*sin(sgn*longitude);
 
-		if (latitude >= pi / 2.) {
+		if (latitude>= PI/2.){
 			x[i] = 0.0;
 			y[i] = 0.0;
@@ -118,6 +108,4 @@
 		}
 	}
-
 	return(iret);
 }
-
Index: /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.h
===================================================================
--- /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.h	(revision 8697)
+++ /issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.h	(revision 8698)
@@ -7,12 +7,6 @@
 
 /* local prototypes: */
-int Ll2xyx(double* x, double* y,
-		   double* lat, double* lon, int ncoord,
-		   int sgn);
-
-int Ll2xyx(double* x, double* y,
-		   double* lat, double* lon, int ncoord,
-		   int sgn, double central_meridian, double standard_parallel);
+int Ll2xyx(double* x, double* y, double* lat, double* lon, int ncoord, int sgn);
+int Ll2xyx(double* x, double* y, double* lat, double* lon, int ncoord, int sgn, double central_meridian, double standard_parallel);
 
 #endif  /* _LL2XYX_H */
-
Index: /issm/trunk/src/c/modules/Xy2llx/Xy2llx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 8697)
+++ /issm/trunk/src/c/modules/Xy2llx/Xy2llx.cpp	(revision 8698)
@@ -3,13 +3,9 @@
 
 #include "./Xy2llx.h"
+#include "../../include/include.h"
 #include "../../shared/shared.h"
-#include "../../include/include.h"
-#include "../../toolkits/toolkits.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
+#include <math.h>
 
-int Xy2llx(double* lat, double* lon,
-		   double* x, double* y, int ncoord,
-		   int sgn){
-
+int Xy2llx(double* lat, double* lon, double* x, double* y, int ncoord, int sgn){
 /*  This is a cpp conversion of the following:
 %XY2LL - converts xy to lat long
@@ -32,26 +28,20 @@
 
 	/*  Get central_meridian and standard_parallel depending on hemisphere  */
-	if      (sgn ==  1) {
-		delta = 45;
+	if (sgn == 1) {
+		delta= 45;
 		slat = 70;
 		_printf_(flag,"Warning: expecting coordinates in polar stereographic (Std Latitude: 70N Meridian: 45).\n");
 	}
 	else if (sgn == -1) {
-		delta = 0;
+		delta= 0;
 		slat = 71;
 		_printf_(flag,"Warning: expecting coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).\n");
 	}
-	else
-		_error_("Sign should be either +1 or -1.\n");
+	else _error_("Sign should be either +1 or -1.\n");
 
-	return(Xy2llx(lat,lon,
-				  x,y,ncoord,
-				  sgn,delta,slat));
+	return(Xy2llx(lat,lon,x,y,ncoord,sgn,delta,slat));
 }
 
-int Xy2llx(double* lat, double* lon,
-		   double* x, double* y, int ncoord,
-		   int sgn, double central_meridian, double standard_parallel){
-
+int Xy2llx(double* lat, double* lon, double* x, double* y, int ncoord, int sgn, double central_meridian, double standard_parallel){
 /*  This is a cpp conversion of the following:
 %XY2LL - converts xy to lat long
@@ -75,6 +65,5 @@
 	double  sl,rho,cm,T,chi;
 
-	if      ((sgn !=  1) && (sgn != -1))
-		_error_("Sign should be either +1 or -1.\n");
+	if((sgn!=1) && (sgn!=-1)) _error_("Sign should be either +1 or -1.\n");
 
 	delta = central_meridian;
@@ -86,24 +75,21 @@
 	re   = 6378.273*pow(10.,3.);
 	/*  Eccentricity of the Hughes ellipsoid squared  */
-	ex2   = .006693883;
+	ex2  = 0.006693883;
 	/*  Eccentricity of the Hughes ellipsoid  */
-	ex    =  sqrt(ex2);
-	/*  pi is not defined in cpp  */
-	pi   = 4.*atan(1.);
+	ex   =  sqrt(ex2);
 
 	/*  loop over all the coordinate pairs  */
+	for(i=0; i<ncoord; i++){
+		sl = slat*PI/180.;
+		cm = cos(sl)/sqrt(1.0-ex2*(pow(sin(sl),2.)));
+		rho= sqrt(pow(x[i],2.) + pow(y[i],2.));
+		T  = tan((PI/4.0) - (sl/2.0))/pow(((1.0-ex*sin(sl))/(1.0+ex*sin(sl))),(ex/2.0));
 
-	for (i=0; i<ncoord; i++) {
-		sl  = slat*pi/180.;
-		cm = cos(sl) / sqrt(1.0 - ex2 * (pow(sin(sl),2.)));
-		rho = sqrt(pow(x[i],2.) + pow(y[i],2.));
-		T = tan((pi / 4.0) - (sl / 2.0)) / pow(((1.0 - ex * sin(sl)) / (1.0 + ex * sin(sl))),(ex / 2.0));
+		if(fabs(slat-90.) < 1.e-5)
+			T =rho*sqrt(pow((1.+ex),(1.+ex))*pow((1.-ex),(1.-ex)))/2./re;
+		else
+			T =rho*T/(re*cm);
 
-		if  (fabs(slat-90.) < 1.e-5)
-			T = rho * sqrt(pow((1. + ex),(1. + ex)) * pow((1. - ex),(1. - ex))) / 2. / re;
-		else
-			T = rho * T / (re * cm);
-
-		chi = (pi / 2.0) - 2.0 * atan(T);
+		chi = (PI / 2.0) - 2.0 * atan(T);
 		lat[i] = chi + ((ex2 / 2.0) + (5.0 * pow(ex2,2.0) / 24.0) + (pow(ex2,3.0) / 12.0)) *
 			   sin(2.0 * chi) + ((7.0 * pow(ex2,2.0) / 48.0) + (29.0 * pow(ex2,3.0) / 240.0)) *
@@ -114,5 +100,5 @@
 		lon[i] = (double)sgn * lon[i];
 
-		if (rho <= 0.1) {
+		if(rho <= 0.1){
 			lat[i] = 90. * (double)sgn;
 			lon[i] = 0.0;
@@ -127,3 +113,2 @@
 	return(iret);
 }
-
Index: /issm/trunk/src/c/modules/Xy2llx/Xy2llx.h
===================================================================
--- /issm/trunk/src/c/modules/Xy2llx/Xy2llx.h	(revision 8697)
+++ /issm/trunk/src/c/modules/Xy2llx/Xy2llx.h	(revision 8698)
@@ -7,12 +7,6 @@
 
 /* local prototypes: */
-int Xy2llx(double* lat, double* lon,
-		   double* x, double* y, int ncoord,
-		   int sgn);
-
-int Xy2llx(double* lat, double* lon,
-		   double* x, double* y, int ncoord,
-		   int sgn, double central_meridian, double standard_parallel);
+int Xy2llx(double* lat, double* lon, double* x, double* y, int ncoord, int sgn);
+int Xy2llx(double* lat, double* lon, double* x, double* y, int ncoord, int sgn, double central_meridian, double standard_parallel);
 
 #endif  /* _XY2LLX_H */
-
