Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 2282)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp	(revision 2283)
@@ -16,14 +16,64 @@
 void	CreateConstraintsDiagnosticVert(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
+	int i;
+	int count;
 
 	DataSet* constraints = NULL;
+	Spc*    spc  = NULL;
+
+	/*spc intermediary data: */
+	int spc_sid;
+	int spc_node;
+	int spc_dof;
+	double spc_value;
+
+	double* spcvelocity=NULL;
 
 	/*Create constraints: */
 	constraints = new DataSet(ConstraintsEnum());
 
-	/*Now, is the iomodel running in 3d? : */
+	/*return if 2d mesh*/
 	if (strcmp(iomodel->meshtype,"2d")==0)goto cleanup_and_return;
-	
-	cleanup_and_return:	
+
+	/*Fetch data: */
+	IoModelFetchData((void**)&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity","Matrix","Mat");
+
+	count=0;
+
+	/*Create spcs from x,y,z, as well as the spc values on those spcs: */
+	for (i=0;i<iomodel->numberofnodes;i++){
+      #ifdef _PARALLEL_
+		/*keep only this partition's nodes:*/
+		if((iomodel->my_grids[i]==1)){
+      #endif
+
+			if ((int)spcvelocity[6*i+2]){
+
+				/*This grid needs to be spc'd to vx_obs and vy_obs:*/
+
+				spc_sid=count;
+				spc_node=i+1;
+				spc_dof=1; //we enforce first translation degree of freedom, for velocity
+				spc_value=spcvelocity[6*i+5];
+
+				spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
+				constraints->AddObject(spc);
+				count++;
+
+			}
+
+      #ifdef _PARALLEL_
+		} //if((my_grids[i]==1))
+      #endif
+	}
+
+	/*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these 
+	 * datasets, it will not be redone: */
+	constraints->Presort();
+
+	cleanup_and_return:
+
+	/*Free data: */
+	xfree((void**)&spcvelocity);
 	
 	/*Assign output pointer: */
