Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp
===================================================================
--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp	(revision 18940)
+++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp	(revision 18941)
@@ -27,7 +27,7 @@
 				/*Deal with mass flux gates:{{{ */
 				
 				/*massfluxatgate variables: */
-				int          numgates;
+				int          temp,numgates;
 				char       **gatenames               = NULL;
 				int        *gatedefinitionenums      = NULL;
 				IssmDouble **gatesegments            = NULL;
@@ -36,8 +36,8 @@
 
 				/*Fetch segments and names: */
 				iomodel->FetchMultipleData(&gatenames,&numgates,MassfluxatgateNameEnum);
-				iomodel->FetchMultipleData(&gatedefinitionenums,&numgates,MassfluxatgateDefinitionenumEnum);
-				iomodel->FetchMultipleData(&gatesegments,&gatesegments_M,NULL,&numgates,MassfluxatgateSegmentsEnum);
+				iomodel->FetchMultipleData(&gatedefinitionenums,&temp,MassfluxatgateDefinitionenumEnum); _assert_(temp==numgates);
+				iomodel->FetchMultipleData(&gatesegments,&gatesegments_M,NULL,&temp,MassfluxatgateSegmentsEnum);_assert_(temp==numgates); 
 
 				for(j=0;j<numgates;j++){
 					output_definitions->AddObject(new Massfluxatgate<IssmDouble>(gatenames[j],gatedefinitionenums[j],gatesegments_M[j],gatesegments[j]));
