Index: /issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp	(revision 12571)
+++ /issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp	(revision 12572)
@@ -15,5 +15,5 @@
 	int i;
 	int      found=0;
-	double   numberofelements;
+	IssmDouble   numberofelements;
 	Element* element=NULL;
 
@@ -25,5 +25,5 @@
 
 	/*Allocate sigma on numberofelements: */
-	sigma=new Vector((int)numberofelements);
+	sigma=new Vector(reCast<int>(numberofelements));
 
 	/*Compute basal stress for each element: */
Index: /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 12571)
+++ /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp	(revision 12572)
@@ -36,5 +36,5 @@
 		for (i=0;i<numberofelements;i++){
 			for (j=0;j<elements_width;j++){
-				*(index+elements_width*i+j)=(int)*(elements+elements_width*i+j)-1; //-1 for C indexing in Metis
+				*(index+elements_width*i+j)=reCast<int>(*(elements+elements_width*i+j))-1; //-1 for C indexing in Metis
 			}
 		}
@@ -63,5 +63,5 @@
 		for (i=0;i<numberofelements2d;i++){
 			for (j=0;j<3;j++){
-				*(index2d+3*i+j)=(int)*(elements2d+3*i+j)-1; //-1 for C indexing in Metis
+				*(index2d+3*i+j)=reCast<int>(*(elements2d+3*i+j))-1; //-1 for C indexing in Metis
 			}
 		}
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp	(revision 12571)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp	(revision 12572)
@@ -56,5 +56,5 @@
 	for (i=0;i<numberofelements;i++){
 		for (j=0;j<elementswidth;j++){
-			vertexid=(int)elements[elementswidth*i+j];
+			vertexid=reCast<int>(elements[elementswidth*i+j]);
 			_assert_(vertexid>0 && vertexid-1<numberofvertices);
 			connectivity[vertexid-1]+=1;
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp	(revision 12571)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp	(revision 12572)
@@ -59,5 +59,5 @@
 		if(iomodel->my_elements[i]){
 			for (j=0;j<elementswidth;j++){
-				vertexid=(int)elements[elementswidth*i+j];
+				vertexid=reCast<int>(elements[elementswidth*i+j]);
 				_assert_(vertexid>0 && vertexid-1<numberofvertices);
 				connectivity[vertexid-1]=i+1;
Index: /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 12571)
+++ /issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp	(revision 12572)
@@ -27,5 +27,5 @@
 
 	/*intermediary: */
-	IssmPDouble* analyses=NULL;
+	IssmDouble* analyses=NULL;
 	char** strings=NULL;
 	int numanalyses;
@@ -48,5 +48,5 @@
 
 		/*Now, allocate analyses and strings: */
-		analyses=xNew<IssmPDouble>(numanalyses);
+		analyses=xNew<IssmDouble>(numanalyses);
 		strings=xNew<char*>(numanalyses);
 		for(i=0;i<numanalyses;i++)strings[i]=NULL; 
@@ -106,5 +106,5 @@
 		char* string=strings[i];
 		if(my_rank==0){
-			if(string==NULL) _error2_("PETSc options for analysis " << EnumToStringx((int)analyses[i]) << " have been declared but were not found");
+			if(string==NULL) _error2_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found");
 		}
 		if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char);
@@ -124,5 +124,5 @@
 	for(i=0;i<numanalyses;i++) xDelete<char>(strings[i]);
 	xDelete<char*>(strings);
-	xDelete<IssmPDouble>(analyses);
+	xDelete<IssmDouble>(analyses);
 	return;
 }
Index: /issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp	(revision 12571)
+++ /issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp	(revision 12572)
@@ -54,5 +54,5 @@
   PDup = siglimc+PDCUT;
 
-  itm = (int)(2*siglim/DT + 1.5);
+  itm = reCast<int,IssmDouble>((2*siglim/DT + 1.5));
   
   if (itm >= NPDMAX){
@@ -81,5 +81,5 @@
   snormfac = 1.0/(signormc*sqrt(2.0*acos(-1.0)));
   siglimc = 2.5*signormc ;
-  itm = (int)((PDCUT+2.*siglimc)/DT + 1.5);
+  itm = reCast<int,IssmDouble>((PDCUT+2.*siglimc)/DT + 1.5);
   if (itm >= NPDCMAX){
     _printLine_("'increase NPDCMAX in p35com'");
Index: /issm/trunk-jpl/src/c/objects/Options/OptionDouble.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Options/OptionDouble.cpp	(revision 12571)
+++ /issm/trunk-jpl/src/c/objects/Options/OptionDouble.cpp	(revision 12572)
@@ -129,5 +129,5 @@
 
 	/*Assign output pointer*/
-	*pvalue=(int)this->values[0];
+	*pvalue=reCast<int>(values[0]);
 }
 /*}}}*/
Index: /issm/trunk-jpl/src/c/objects/Options/OptionUtilities.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Options/OptionUtilities.cpp	(revision 12571)
+++ /issm/trunk-jpl/src/c/objects/Options/OptionUtilities.cpp	(revision 12572)
@@ -31,6 +31,6 @@
 	/*calculate the dimensions (being careful of integer division)  */
 	for (i=ndims-1; i>=0; i--) {
-		aprod=(int)(((IssmDouble)aprod+0.5)/(IssmDouble)size[i]);
-		dims[i]=(int)floor(((IssmDouble)index+0.5)/(IssmDouble)aprod);
+		aprod=reCast<int>(((IssmPDouble)aprod+0.5)/(IssmPDouble)size[i]);
+		dims[i]=(int)floor(((IssmPDouble)index+0.5)/(IssmPDouble)aprod);
 		index-=dims[i]*aprod;
 	}
@@ -69,6 +69,6 @@
 	/*calculate the dimensions (being careful of integer division)  */
 	for (i=0; i<ndims; i++) {
-		aprod=(int)(((IssmDouble)aprod+0.5)/(IssmDouble)size[i]);
-		dims[i]=(int)floor(((IssmDouble)index+0.5)/(IssmDouble)aprod);
+		aprod=(int)(((IssmPDouble)aprod+0.5)/(IssmPDouble)size[i]);
+		dims[i]=(int)floor(((IssmPDouble)index+0.5)/(IssmPDouble)aprod);
 		index-=dims[i]*aprod;
 	}
