Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp	(revision 317)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp	(revision 318)
@@ -208,5 +208,5 @@
 					beam_id=i+1; 
 					beam_mid=i+1; //refers to the corresponding material property card
-					beam_mparid=model->numberofnodes+1;//refers to the corresponding matpar property card
+					beam_mparid=model->numberofnodes-model->numberofnodes2d+1;//refers to the corresponding matpar property card
 					beam_g[0]=i+1;
 					beam_g[1]=(int)model->uppernodes[i]; //grid that lays right on top
@@ -262,5 +262,5 @@
 
 	/*Add one constant material property to materials: */
-	matpar_mid=model->numberofnodes+1; //put it at the end of the materials
+	matpar_mid=model->numberofnodes-model->numberofnodes2d+1; //put it at the end of the materials
 	matpar_g=model->g; 
 	matpar_rho_ice=model->rho_ice; 
@@ -274,4 +274,11 @@
 	matpar_thermal_exchange_velocity=model->thermal_exchange_velocity; 
 
+	/*Create matpar object using its constructor: */
+	matpar=new Matpar(matpar_mid,matpar_rho_ice,matpar_rho_water,matpar_heatcapacity,matpar_thermalconductivity,
+			matpar_latentheat,matpar_beta,matpar_meltingpoint,matpar_mixed_layer_capacity,
+			matpar_thermal_exchange_velocity,matpar_g);
+		
+	/*Add to materials datset: */
+	materials->AddObject(matpar);
 	
 	/*Create nodes from x,y,z, as well as the spc values on those grids: */
