Index: /issm/trunk/src/c/parallel/GradJCompute.cpp
===================================================================
--- /issm/trunk/src/c/parallel/GradJCompute.cpp	(revision 1207)
+++ /issm/trunk/src/c/parallel/GradJCompute.cpp	(revision 1208)
@@ -22,4 +22,5 @@
 	int sub_analysis_type;
 	int numberofnodes;
+	int numberofdofspernode;
 	char* solverstring=NULL;
 	char* control_type=NULL;
Index: /issm/trunk/src/c/parallel/objectivefunctionC.cpp
===================================================================
--- /issm/trunk/src/c/parallel/objectivefunctionC.cpp	(revision 1207)
+++ /issm/trunk/src/c/parallel/objectivefunctionC.cpp	(revision 1208)
@@ -27,4 +27,5 @@
 	double* grad_g=NULL;
 	ParameterInputs* inputs=NULL;
+	int numberofdofspernode;
 	int n;
 
@@ -60,4 +61,5 @@
 	femmodel->parameters->FindParam((void*)&sub_analysis_type,"sub_analysis_type");
 	femmodel->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
+	femmodel->parameters->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
 
 	/*First copy param_g so we don't modify it: */
@@ -77,5 +79,5 @@
 	diagnostic_core_nonlinear(&u_g,NULL,NULL,femmodel,inputs,analysis_type,sub_analysis_type);
 	VecToMPISerial(&u_g_double,u_g); VecFree(&u_g);
-	inputs->Add("velocity",u_g_double,2,numberofnodes);
+	inputs->Add("velocity",u_g_double,numberofdofspernode,numberofnodes);
 
 	//Compute misfit for this velocity field. 
