Index: /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 3448)
+++ /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 3449)
@@ -13,5 +13,5 @@
 void	CreateLoadsMelting(DataSet** ploads, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
-	int i,j,counter;
+	int i;
 	int element;
 
@@ -35,16 +35,14 @@
 
 	for (i=0;i<iomodel->numberofvertices;i++){
-	/*keep only this partition's nodes:*/
-	if((iomodel->my_vertices[i]==1)){
+		/*keep only this partition's nodes:*/
+		if((iomodel->my_vertices[i]==1)){
 
-		if (iomodel->gridonbed[i]){ 
-		
-			loads->AddObject( new Pengrid(count+1, i+1,iomodel->numberofelements+1, 1, 0, iomodel->penalty_offset, pengrid_thermal_steadystate, iomodel->stabilize_constraints));
-			
-			count++;
-		}
-	#ifdef _PARALLEL_
-	} //if((iomodel->my_vertices[i]==1))
-	#endif
+			if (iomodel->gridonbed[i]){ 
+
+				loads->AddObject( new Pengrid(count+1, i+1,iomodel->numberofelements+1, 1, 0, iomodel->penalty_offset, pengrid_thermal_steadystate, iomodel->stabilize_constraints));
+
+				count++;
+			}
+		} //if((iomodel->my_vertices[i]==1))
 	}
 	xfree((void**)&iomodel->gridonbed);
Index: /issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 3448)
+++ /issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 3449)
@@ -13,37 +13,19 @@
 void	CreateLoadsThermal(DataSet** ploads, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
-	int i,j,counter;
-	int element;
+	int i;
 
-	extern int my_rank;
-	extern int num_procs;
-	
 	DataSet*    loads    = NULL;
 	Pengrid*    pengrid  = NULL;
 
-	int segment_width;
-	int i1,i2,i3,i4;
-	int i0,range;
-	int grid1,grid2;
+	/*pengrid intermediary data: */
+	int pengrid_thermal_steadystate=1;
 
-	/*pengrid intermediary data: */
-	int pengrid_id;
-	int pengrid_mparid;
-	int pengrid_node_id;
-	int pengrid_dof;
-	double pengrid_penalty_offset;
-	int pengrid_active=0;
-	int pengrid_thermal_steadystate=1;
-	int pengrid_stabilize_constraints=0;
+	int count=0;
 
-	int numberofsegs_diag_stokes;
-	int count;
+	/*return if 2d mesh*/
+	if (strcmp(iomodel->meshtype,"2d")==0)goto cleanup_and_return;
 
 	/*Create loads: */
 	loads   = new DataSet(LoadsEnum());
-	count=0;
-
-	/*return if 2d mesh*/
-	if (strcmp(iomodel->meshtype,"2d")==0)goto cleanup_and_return;
 
 	//create penalties for grids: no grid can have a temperature over the melting point
@@ -51,27 +33,14 @@
 
 	for (i=0;i<iomodel->numberofvertices;i++){
-	#ifdef _PARALLEL_
-	/*keep only this partition's nodes:*/
-	if((iomodel->my_vertices[i]==1)){
-	#endif
+		/*keep only this partition's nodes:*/
+		if((iomodel->my_vertices[i]==1)){
 
-		if (!iomodel->spctemperature[2*i]){ //No penalty applied on spc grids!
-		
-			pengrid_id=count+1; //matlab indexing
-			pengrid_node_id=i+1;
-			pengrid_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
-			pengrid_dof=1;
-			pengrid_penalty_offset=iomodel->penalty_offset;
-			pengrid_active=0;
-			pengrid_stabilize_constraints=iomodel->stabilize_constraints;
-			
-			pengrid= new Pengrid(pengrid_id, pengrid_node_id,pengrid_mparid,pengrid_dof, pengrid_active, pengrid_penalty_offset,pengrid_thermal_steadystate,pengrid_stabilize_constraints);
-			
-			loads->AddObject(pengrid);
-			count++;
-		}
-	#ifdef _PARALLEL_
-	} //if((iomodel->my_vertices[i]==1))
-	#endif
+			if (!iomodel->spctemperature[2*i]){ //No penalty applied on spc grids!
+
+				loads->AddObject( new Pengrid(count+1, i+1,iomodel->numberofelements+1,1, 0, iomodel->penalty_offset,pengrid_thermal_steadystate,iomodel->stabilize_constraints));
+
+				count++;
+			}
+		} //if((iomodel->my_vertices[i]==1))
 	}
 	xfree((void**)&iomodel->spctemperature);
