Index: /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12552)
+++ /issm/trunk-jpl/src/c/objects/Elements/Tria.cpp	(revision 12553)
@@ -1649,11 +1649,11 @@
 	
 	if ((code==5) || (code==1)){ //boolean
-		this->inputs->AddInput(new BoolInput(name,(bool)scalar));
+		this->inputs->AddInput(new BoolInput(name,reCast<bool>(scalar)));
 	}
 	else if ((code==6) || (code==2)){ //integer
-		this->inputs->AddInput(new IntInput(name,(int)scalar));
+		this->inputs->AddInput(new IntInput(name,reCast<int>(scalar)));
 	}
 	else if ((code==7) || (code==3)){ //IssmDouble
-		this->inputs->AddInput(new DoubleInput(name,(int)scalar));
+		this->inputs->AddInput(new DoubleInput(name,reCast<int>(scalar)));
 	}
 	else _error2_("could not recognize nature of vector from code " << code);
@@ -1686,5 +1686,5 @@
 		/*Recover vertices ids needed to initialize inputs*/
 		for(i=0;i<3;i++){ 
-			tria_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
+			tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*index+i]); //ids for vertices are in the elements array from Matlab
 		}
 
@@ -1731,11 +1731,11 @@
 
 			if (code==5){ //boolean
-				this->inputs->AddInput(new BoolInput(vector_enum,(bool)vector[index]));
+				this->inputs->AddInput(new BoolInput(vector_enum,reCast<bool>(vector[index])));
 			}
 			else if (code==6){ //integer
-				this->inputs->AddInput(new IntInput(vector_enum,(int)vector[index]));
+				this->inputs->AddInput(new IntInput(vector_enum,reCast<int>(vector[index])));
 			}
 			else if (code==7){ //IssmDouble
-				this->inputs->AddInput(new DoubleInput(vector_enum,(IssmDouble)vector[index]));
+				this->inputs->AddInput(new DoubleInput(vector_enum,vector[index]));
 			}
 			else _error2_("could not recognize nature of vector from code " << code);
@@ -1823,5 +1823,5 @@
 
 	for(i=0;i<NUMVERTICES;i++){
-		if (flags[nodes[i]->Sid()]){
+		if (reCast<bool>(flags[nodes[i]->Sid()])){
 			shelf=true;
 			break;
@@ -1914,5 +1914,5 @@
 	for(i=0;i<NUMVERTICES;i++){
 		/*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
-		if(old_floating_ice[nodes[i]->Sid()]){
+		if(reCast<bool>(old_floating_ice[nodes[i]->Sid()])){
 			if(b[i]<=ba[i]){ 
 				b[i]=ba[i];
@@ -1934,5 +1934,5 @@
 					nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
 				}
-				else if(migration_style==SoftMigrationEnum && sheet_ungrounding[nodes[i]->Sid()]){
+				else if(migration_style==SoftMigrationEnum && reCast<bool>(sheet_ungrounding[nodes[i]->Sid()])){
 					s[i]=(1-density)*h[i];
 					b[i]=-density*h[i];
@@ -2187,5 +2187,5 @@
        if (tstar < PDup){
 	 pd = 1;
-	 if (tstar >= -siglimc){ pd = pds[int(tstar/DT + siglim0c)];}}
+	 if (tstar >= -siglimc){ pd = pds[reCast<int,IssmDouble>(tstar/DT + siglim0c)];}}
        else { 
 	 pd = 0;}
@@ -2207,5 +2207,5 @@
        if (tstar >= siglim) {pdd[i] = pdd[i] + tstar*deltm;}
        else if (tstar> -siglim){
-	 pddsig=pdds[int(tstar/DT + siglim0)];
+	 pddsig=pdds[reCast<int,IssmDouble>(tstar/DT + siglim0)];
 	 pdd[i] = pdd[i] + pddsig*deltm;
 	 frzndd[i] = frzndd[i] - (tstar-pddsig)*deltm;}
@@ -2521,5 +2521,5 @@
 	/*Recover vertices ids needed to initialize inputs*/
 	for(i=0;i<3;i++){ 
-		tria_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
+		tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*index+i]); //ids for vertices are in the elements array from Matlab
 	}
 
@@ -2534,5 +2534,5 @@
 		/*Continuous Galerkin*/
 		for(i=0;i<3;i++){ 
-			tria_node_ids[i]=iomodel->nodecounter+(int)*(iomodel->Data(MeshElementsEnum)+3*index+i); //ids for vertices are in the elements array from Matlab
+			tria_node_ids[i]=iomodel->nodecounter+reCast<int,IssmDouble>(*(iomodel->Data(MeshElementsEnum)+3*index+i)); //ids for vertices are in the elements array from Matlab
 		}
 	}
@@ -2592,5 +2592,5 @@
 	/*Go through nodes, and whoever is on the potential_sheet_ungrounding, ends up in nodes_on_iceshelf: */
 	for(i=0;i<3;i++){
-		if (vertices_potentially_ungrounding[nodes[i]->Sid()]){
+		if (reCast<bool>(vertices_potentially_ungrounding[nodes[i]->Sid()])){
 			vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
 		
