Index: issm/trunk-jpl/src/m/classes/numberedcostfunction.m
===================================================================
--- issm/trunk-jpl/src/m/classes/numberedcostfunction.m	(revision 22387)
+++ issm/trunk-jpl/src/m/classes/numberedcostfunction.m	(revision 22402)
@@ -6,4 +6,6 @@
 classdef numberedcostfunction
 	properties (SetAccess=public) 
+		name								 = '';
+		definitionstring				 = '';
 		cost_functions              = NaN
 		cost_functions_coefficients = NaN
@@ -23,5 +25,5 @@
 					self=structtoobj(numberedcostfunction(),varargin{1});
 				otherwise
-					error('constructor not supported');
+					error('construtor not supported yet');
 			end
 		end % }}}
@@ -32,6 +34,4 @@
 			self.thickness_obs=project3d(md,'vector',self.thickness_obs,'type','node');
 			if numel(self.cost_functions_coefficients)>1,self.cost_functions_coefficients=project3d(md,'vector',self.cost_functions_coefficients,'type','node');end;
-			if numel(self.min_parameters)>1,self.min_parameters=project3d(md,'vector',self.min_parameters,'type','node');end;
-			if numel(self.max_parameters)>1,self.max_parameters=project3d(md,'vector',self.max_parameters,'type','node');end;
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
@@ -39,4 +39,5 @@
 			%several responses can be used:
 			self.cost_functions=101;
+			
 
 		end % }}}
@@ -84,10 +85,12 @@
 			yts=md.constants.yts;
 
-			WriteData(fid,prefix,'name','md.inversion.type','data',2,'format','Integer');
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vel_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+			WriteData(fid,prefix,'data',self.name,'name','md.numberedcostfunction.name','format','String');
+			WriteData(fid,prefix,'data',self.definitionstring,'name','md.numberedcostfunction.definitionstring','format','String');
+
+			WriteData(fid,prefix,'data',self.cost_functions_coefficients,'name','md.numberedcostfunction.cost_functions_coefficients','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'data',self.vx_obs,'name','md.numberedcostfunction.vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+			WriteData(fid,prefix,'data',self.vy_obs,'name','md.numberedcostfunction.vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+			WriteData(fid,prefix,'data',self.vz_obs,'name','md.numberedcostfunction.vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+			WriteData(fid,prefix,'data',self.vel_obs,'name','md.numberedcostfunction.vel_obs','format','DoubleMat','mattype',1,'scale',1./yts);
 			if(numel(self.thickness_obs)==md.mesh.numberofelements),
 				mattype=2;
@@ -95,12 +98,12 @@
 				mattype=1;
 			end
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
-			WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);
+			WriteData(fid,prefix,'data',self.thickness_obs,'name','md.numberedcostfunction.thickness_obs','format','DoubleMat','mattype',mattype);
+			WriteData(fid,prefix,'data',self.surface_obs,'name','md.numberedcostfunction.surface_obs','format','DoubleMat','mattype',mattype);
 
 			%process cost functions
 			num_cost_functions=size(self.cost_functions,2);
 			data=marshallcostfunctions(self.cost_functions);
-			WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','StringArray');
-			WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer');
+			WriteData(fid,prefix,'data',data,'name','md.numberedcostfunction.cost_functions','format','StringArray');
+			WriteData(fid,prefix,'data',num_cost_functions,'name','md.numberedcostfunction.num_cost_functions','format','Integer');
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
