Index: /issm/trunk-jpl/src/c/classes/IndependentObject.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/IndependentObject.cpp	(revision 15316)
+++ /issm/trunk-jpl/src/c/classes/IndependentObject.cpp	(revision 15317)
@@ -18,15 +18,14 @@
 	this->name=NoneEnum;
 	this->type=0;
-	this->numberofvertices=0;
-}
-/*}}}*/
-/*FUNCTION IndependentObject::IndependentObject(int in_name, int in_type,int in_numberofvertices){{{*/
-IndependentObject::IndependentObject(int in_name, int in_type,int in_numberofvertices){
-
-	this->numberofvertices=0;
+	this->numberofindependents=0;
+}
+/*}}}*/
+/*FUNCTION IndependentObject::IndependentObject(int in_name, int in_type){{{*/
+IndependentObject::IndependentObject(int in_name, int in_type){
+
+	this->numberofindependents=0;
 	this->name=in_name;
 	this->type=in_type;
 	if(in_type!=0 && in_type!=1)_error_("cannot create an IndependentObject of type " << in_type);
-	if(this->type==1)this->numberofvertices=in_numberofvertices;
 
 }
@@ -49,5 +48,5 @@
 	else
 		_error_(" unknown type: " << this->type);
-	_printf_("   numberofvertices: " << this->numberofvertices << "\n");
+	_printf_("   numberofindependents: " << this->numberofindependents << "\n");
 }
 /*}}}*/
@@ -69,5 +68,5 @@
 /*FUNCTION IndependentObject::copy{{{*/
 Object* IndependentObject::copy(void) { 
-	return new IndependentObject(name,type,numberofvertices);
+	return new IndependentObject(name,type,numberofindependents);
 } /*}}}*/
 
@@ -118,4 +117,7 @@
 		iomodel->data[name]=scalar_slot;
 		iomodel->independents[name]=true;
+
+		//finally, record the number of independents:
+		this->numberofindependents=1;
 
 	} /*}}}*/
@@ -173,4 +175,8 @@
 		iomodel->data[name]=matrix;
 		iomodel->independents[name]=true;
+		
+		//Finally, record the number of independents created: 
+		this->numberofindependents=M*N;
+
 	}/*}}}*/
 	else _error_("should not have a type of " << type);
@@ -182,12 +188,5 @@
 int  IndependentObject::NumIndependents(void){
 
-	/*Branch according to the type of variable: */
-	if(type==0){ /*scalar:*/
-		return 1;
-	}
-	else if(type==1){ /* vector:*/
-		return this->numberofvertices;
-	}
-	else _error_("should not have a type of " << type);
+	return this->numberofindependents;;
 }
 /*}}}*/
@@ -203,5 +202,5 @@
 	else if(type==1){ /* vector:*/
 		IssmDouble* values=data[name];
-		for(i=0;i<this->numberofvertices;i++){
+		for(i=0;i<this->numberofindependents;i++){
 			xp[i]=values[i];
 		}
Index: /issm/trunk-jpl/src/c/classes/IndependentObject.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/IndependentObject.h	(revision 15316)
+++ /issm/trunk-jpl/src/c/classes/IndependentObject.h	(revision 15317)
@@ -18,5 +18,5 @@
 		int name;
 		int type;  /*0: scalar, 1: vertex*/
-		int numberofvertices;
+		int numberofindependents;
 
 		/*IndependentObject constructors, destructors {{{*/
