Index: /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 3447)
+++ /issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 3448)
@@ -20,29 +20,14 @@
 	
 	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_id;
-	int pengrid_node_id;
-	int pengrid_mparid;
-	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 count;
+	/*if 2d: return*/
+	if (strcmp(iomodel->meshtype,"2d")==0)goto cleanup_and_return;
 
 	/*Create loads: */
 	loads   = new DataSet(LoadsEnum());
-	count=0;
-
-	/*if 2d: return*/
-	if (strcmp(iomodel->meshtype,"2d")==0)goto cleanup_and_return;
 
 	//create penalties for grids: no grid can have a temperature over the melting point
@@ -50,22 +35,11 @@
 
 	for (i=0;i<iomodel->numberofvertices;i++){
-	#ifdef _PARALLEL_
 	/*keep only this partition's nodes:*/
 	if((iomodel->my_vertices[i]==1)){
-	#endif
 
 		if (iomodel->gridonbed[i]){ 
 		
-			pengrid_id=count+1; //matlab indexing
-			pengrid_node_id=i+1;
-			pengrid_dof=1;
-			pengrid_penalty_offset=iomodel->penalty_offset;
-			pengrid_active=0;
-			pengrid_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
-			pengrid_stabilize_constraints=iomodel->stabilize_constraints;
+			loads->AddObject( new Pengrid(count+1, i+1,iomodel->numberofelements+1, 1, 0, iomodel->penalty_offset, pengrid_thermal_steadystate, 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++;
 		}
