Index: ../trunk-jpl/src/m/classes/massfluxatgate.m
===================================================================
--- ../trunk-jpl/src/m/classes/massfluxatgate.m	(revision 18880)
+++ ../trunk-jpl/src/m/classes/massfluxatgate.m	(revision 18881)
@@ -2,12 +2,13 @@
 %
 %   Usage:
 %      massfluxatgate=massfluxatgate();
-%      massfluxatgate=massfluxatgate('GateName','PathToExpFile');
+%      massfluxatgate=massfluxatgate('name','GateName','definitionname',Outputdefinition1Enum,'profilename','PathToExpFile');
 
 classdef massfluxatgate
 	properties (SetAccess=public)  
 		%massfluxatgate 
 		name                = '';
+		definitionenum     = NaN; %enum that identifies this output definition uniquely, from Outputdefinition[1-10]Enum
 		profilename            = ''; 
 	end
 	properties (SetAccess=private)  
@@ -15,16 +16,16 @@
 	end
 	methods
 		function obj = massfluxatgate(varargin) % {{{
-			switch nargin
-				case 0
-					obj=setdefaultparameters(obj);
-				case 1
-					obj.name=varargin{1};
-				case 2
-					obj.name=varargin{1};
-					obj.profilename=varargin{2};
-				otherwise
-					error('constructor not supported');
+			if nargin==0,
+				obj=setdefaultparameters(obj);
+			else
+				%use provided options to change fields
+				options=pairoptions(varargin{:});
+
+				%get name
+				obj.name=getfieldvalue(options,'name','');
+				obj.definitionenum=getfieldvalue(options,'definitionenum');
+				obj.profilename=getfieldvalue(options,'profilename');
 			end
 		end % }}}
 		function obj = setdefaultparameters(obj) % {{{
@@ -37,6 +38,8 @@
 			if ~ischar(obj.profilename),
 				error('massfluxatgate error message: ''profilename'' field should be a string!');
 			end
+			
+			md = checkfield(md,'fieldname','obj.definitionenum','field',obj.definitionenum,'values',[Outputdefinition1Enum,Outputdefinition2Enum,Outputdefinition3Enum,Outputdefinition4Enum,Outputdefinition5Enum,Outputdefinition6Enum,Outputdefinition7Enum,Outputdefinition8Enum,Outputdefinition9Enum,Outputdefinition10Enum]);
 
 			%check the profilename points to a file!: 
 			if exist(obj.profilename,'file')~=2,
Index: ../trunk-jpl/src/m/classes/misfit.m
===================================================================
--- ../trunk-jpl/src/m/classes/misfit.m	(revision 18880)
+++ ../trunk-jpl/src/m/classes/misfit.m	(revision 18881)
@@ -3,7 +3,7 @@
 %   Usage:
 %      misfit=misfit();
 %      misfit=misfit('name','SurfaceAltimetry',...
-%                    'model_enum',SurfaceEnum,...
+%                    'definitionenum',Outputdefinition1Enum, 'model_enum',SurfaceEnum,...
 %                    'observation_enum',SurfaceObservationsEnum,...
 %                    'observation',md.geometry.surface,...
 %                    'timeinterpolation','nearestneighbor',...
@@ -16,6 +16,7 @@
 	properties (SetAccess=public)
 		%misfit
 		name              = '';
+		definitionenum   = NaN; %enum that identifies this output definition uniquely, from Outputdefinition[1-10]Enum
 		model_enum        = NaN; %enum for field that is modeled
 		observation       = NaN; %observed field that we compare the model against
 		observation_enum  = NaN; %enum for observed field.
@@ -35,6 +36,7 @@
 
 				%get name
 				obj.name=getfieldvalue(options,'name','');
+				obj.definitionenum=getfieldvalue(options,'definitionenum');
 				obj.model_enum=getfieldvalue(options,'model_enum');
 				obj.observation=getfieldvalue(options,'observation',NaN);
 				obj.observation_enum=getfieldvalue(options,'observation_enum');
@@ -52,6 +54,7 @@
 			if ~ischar(obj.name),
 				error('misfit error message: ''name'' field should be a string!');
 			end
+			md = checkfield(md,'fieldname','obj.definitionenum','field',obj.definitionenum,'values',[Outputdefinition1Enum,Outputdefinition2Enum,Outputdefinition3Enum,Outputdefinition4Enum,Outputdefinition5Enum,Outputdefinition6Enum,Outputdefinition7Enum,Outputdefinition8Enum,Outputdefinition9Enum,Outputdefinition10Enum]);
 
 			if ~ischar(obj.timeinterpolation),
 				error('misfit error message: ''timeinterpolation'' field should be a string!');
@@ -66,6 +69,7 @@
 			disp(sprintf('   Misfit:\n'));
 
 			fielddisplay(obj,'name','identifier for this misfit response');
+			fielddisplay(obj,'definitionenum','enum that identifies this output definition uniquely, from Outputdefinition[1-10]Enum');
 			fielddisplay(obj,'model_enum','enum for field that is modeled');
 			fielddisplay(obj,'observation','observed field that we compare the model against');
 			fielddisplay(obj,'observation_enum','observation enum');
@@ -77,6 +81,7 @@
 		function md = marshall(obj,md,fid) % {{{
 
 		WriteData(fid,'object',obj,'fieldname','name','format','String');
+		WriteData(fid,'object',obj,'fieldname','definitionenum','format','Integer');
 		WriteData(fid,'object',obj,'fieldname','model_enum','format','Integer');
 		WriteData(fid,'object',obj,'fieldname','observation','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
 		WriteData(fid,'object',obj,'fieldname','observation_enum','format','Integer');
Index: ../trunk-jpl/src/m/classes/massconaxpby.m
===================================================================
--- ../trunk-jpl/src/m/classes/massconaxpby.m	(revision 18880)
+++ ../trunk-jpl/src/m/classes/massconaxpby.m	(revision 18881)
@@ -14,6 +14,7 @@
 	properties (SetAccess=public)
 		%masscon axpby
 		name              = '';
+		definitionenum   = NaN; %enum that identifies this output definition uniquely, from Outputdefinition[1-10]Enum
 		namex              = '';
 		namey              = '';
 		alpha              = NaN;
@@ -30,6 +31,7 @@
 
 				%get names
 				obj.name=getfieldvalue(options,'name','');
+				obj.definitionenum=getfieldvalue(options,'definitionenum');
 				obj.namex=getfieldvalue(options,'namex');
 				obj.namey=getfieldvalue(options,'namey');
 
@@ -47,6 +49,8 @@
 			if ~ischar(obj.name), error('masscon error message: ''name'' field should be a string!'); end
 			if ~ischar(obj.namex), error('masscon error message: ''namex'' field should be a string!'); end
 			if ~ischar(obj.namey), error('masscon error message: ''namey'' field should be a string!'); end
+			
+			md = checkfield(md,'fieldname','obj.definitionenum','field',obj.definitionenum,'values',[Outputdefinition1Enum,Outputdefinition2Enum,Outputdefinition3Enum,Outputdefinition4Enum,Outputdefinition5Enum,Outputdefinition6Enum,Outputdefinition7Enum,Outputdefinition8Enum,Outputdefinition9Enum,Outputdefinition10Enum]);
 
 			md = checkfield(md,'fieldname','obj.alpha','field',obj.alpha,'NaN',1,'size',[1 1]);
 			md = checkfield(md,'fieldname','obj.betaa','field',obj.beta,'NaN',1,'size',[1 1]);
@@ -57,6 +61,7 @@
 			disp(sprintf('   Misfit:\n'));
 
 			fielddisplay(obj,'name','name');
+			fielddisplay(obj,'definitionenum','enum that identifies this output definition uniquely, from Outputdefinition[1-10]Enum');
 			fielddisplay(obj,'namex','identifier for the first masscon');
 			fielddisplay(obj,'alpha','first masscon multiplicator');
 			fielddisplay(obj,'namey','identifier for the second masscon');
@@ -66,6 +71,7 @@
 		function md = marshall(obj,md,fid) % {{{
 
 		WriteData(fid,'object',obj,'fieldname','name','format','String');
+		WriteData(fid,'object',obj,'fieldname','definitionenum','format','Integer');
 		WriteData(fid,'object',obj,'fieldname','namex','format','String');
 		WriteData(fid,'object',obj,'fieldname','namey','format','String');
 		WriteData(fid,'object',obj,'fieldname','alpha','format','Double');
Index: ../trunk-jpl/src/m/classes/masscon.m
===================================================================
--- ../trunk-jpl/src/m/classes/masscon.m	(revision 18880)
+++ ../trunk-jpl/src/m/classes/masscon.m	(revision 18881)
@@ -13,6 +13,7 @@
 	properties (SetAccess=public)
 		%masscon
 		name              = '';
+		definitionenum   = NaN; %enum that identifies this output definition uniquely, from Outputdefinition[1-10]Enum
 		levelset          = NaN; %levelset vectorial field which identifies the boundaries of the masscon
 	end
 	
@@ -27,6 +28,7 @@
 				%get name
 				obj.name=getfieldvalue(options,'name','');
 				obj.levelset=getfieldvalue(options,'levelset');
+				obj.definitionenum=getfieldvalue(options,'definitionenum');
 
 			end
 		end % }}}
@@ -37,6 +39,8 @@
 			if ~ischar(obj.name),
 				error('masscon error message: ''name'' field should be a string!');
 			end
+			
+			md = checkfield(md,'fieldname','obj.definitionenum','field',obj.definitionenum,'values',[Outputdefinition1Enum,Outputdefinition2Enum,Outputdefinition3Enum,Outputdefinition4Enum,Outputdefinition5Enum,Outputdefinition6Enum,Outputdefinition7Enum,Outputdefinition8Enum,Outputdefinition9Enum,Outputdefinition10Enum]);
 
 			md = checkfield(md,'fieldname','obj.levelset','field',obj.levelset,'forcing',1,'NaN',1);
 
@@ -46,12 +50,14 @@
 			disp(sprintf('   Misfit:\n'));
 
 			fielddisplay(obj,'name','identifier for this masscon response');
+			fielddisplay(obj,'definitionenum','enum that identifies this output definition uniquely, from Outputdefinition[1-10]Enum');
 			fielddisplay(obj,'levelset','levelset vectorial field which identifies the boundaries of the masscon');
 
 		end % }}}
 		function md = marshall(obj,md,fid) % {{{
 
 		WriteData(fid,'object',obj,'fieldname','name','format','String');
+		WriteData(fid,'object',obj,'fieldname','definitionenum','format','Integer');
 		WriteData(fid,'object',obj,'fieldname','levelset','format','DoubleMat','mattype',1);
 
 		end % }}}
