Index: issm/trunk-jpl/src/m/classes/inversion.js
===================================================================
--- issm/trunk-jpl/src/m/classes/inversion.js	(revision 19901)
+++ issm/trunk-jpl/src/m/classes/inversion.js	(revision 20690)
@@ -120,39 +120,34 @@
 			var yts=365.0*24.0*3600.0;
 
-			WriteData(fid,'enum',InversionTypeEnum(),'data',0,'format','Integer');
-			WriteData(fid,'object',this,'fieldname','iscontrol','format','Boolean');
-			WriteData(fid,'object',this,'fieldname','incomplete_adjoint','format','Boolean');
+			WriteData(fid,prefix,'name','md.inversion.type','data',0,'format','Integer');
+			WriteData(fid,prefix,'object',this,'fieldname','iscontrol','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','incomplete_adjoint','format','Boolean');
 			if (!this.iscontrol) return;
-			WriteData(fid,'object',this,'fieldname','nsteps','format','Integer');
-			WriteData(fid,'object',this,'fieldname','maxiter_per_step','format','IntMat','mattype',3);
-			WriteData(fid,'object',this,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
-			WriteData(fid,'object',this,'fieldname','gradient_scaling','format','DoubleMat','mattype',3);
-			WriteData(fid,'object',this,'fieldname','cost_function_threshold','format','Double');
-			WriteData(fid,'object',this,'fieldname','min_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,'object',this,'fieldname','max_parameters','format','DoubleMat','mattype',3);
-			WriteData(fid,'object',this,'fieldname','step_threshold','format','DoubleMat','mattype',3);
-			WriteData(fid,'object',this,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,'object',this,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
-			WriteData(fid,'object',this,'fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+			WriteData(fid,prefix,'object',this,'fieldname','nsteps','format','Integer');
+			WriteData(fid,prefix,'object',this,'fieldname','maxiter_per_step','format','IntMat','mattype',3);
+			WriteData(fid,prefix,'object',this,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',this,'fieldname','gradient_scaling','format','DoubleMat','mattype',3);
+			WriteData(fid,prefix,'object',this,'fieldname','cost_function_threshold','format','Double');
+			WriteData(fid,prefix,'object',this,'fieldname','min_parameters','format','DoubleMat','mattype',3);
+			WriteData(fid,prefix,'object',this,'fieldname','max_parameters','format','DoubleMat','mattype',3);
+			WriteData(fid,prefix,'object',this,'fieldname','step_threshold','format','DoubleMat','mattype',3);
+			WriteData(fid,prefix,'object',this,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+			WriteData(fid,prefix,'object',this,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+			WriteData(fid,prefix,'object',this,'fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
 			if(this.thickness_obs.length==md.mesh.numberofelements) mattype=2;
 			else mattype=1;
-			WriteData(fid,'object',this,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
-			WriteData(fid,'object',this,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);
-
+			WriteData(fid,prefix,'object',this,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
+			WriteData(fid,prefix,'object',this,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);
 
 			//process control parameters
 			num_control_parameters=this.control_parameters.length;
-			data=NewArrayFill(num_control_parameters,0);
-			for (var i=0;i<num_control_parameters;i++){
-				data[i]=StringToEnum(this.control_parameters[i]);
-			}
-			WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3);
-			WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer');
+			WriteData(fid,prefix,'object',this,'fieldname','control_parameters','format','StringArray');
+			WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer');
 
 			//process cost functions
 			num_cost_functions=this.cost_functions[0].length;
 			data=marshallcostfunctions(this.cost_functions);
-			WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);
-			WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');
+			WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','DoubleMat','mattype',3);
+			WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer');
 		}//}}}
 		this.fix=function() { //{{{
