Index: /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13460)
+++ /issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h	(revision 13461)
@@ -27,4 +27,5 @@
 	AutodiffDriverEnum,
 	AutodiffFosForwardIndexEnum,
+	AutodiffFovForwardIndicesEnum,
 	BalancethicknessSpcthicknessEnum,
 	BalancethicknessStabilizationEnum,
Index: /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13460)
+++ /issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp	(revision 13461)
@@ -14,16 +14,17 @@
 
 
+	/*diverse: */
 	int         i;
 	int         dummy;
+
 	bool        isautodiff         = false;
 	int         num_dependents;
 	int         num_independents;
+	char*       driver=NULL;
+
+	/*state variables: */
 	IssmDouble *axp                = NULL;
 	double     *xp                 = NULL;
-	int         anIndepIndex;
-	unsigned int * indepIndices    = NULL;
-	int         tangentDirNum = 2;  // <----------- set this via config
-
-	
+
 	/*AD mode on?: */
 	parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
@@ -33,13 +34,11 @@
 		#ifdef _HAVE_ADOLC_
 
+			if(VerboseAutodiff())_pprintLine_("   start AD driver");
+
+			/*preliminary checks: */
 			parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
 			parameters->FindParam(&num_independents,AutodiffNumIndependentsEnum);
-
 			if(!(num_dependents*num_independents)) return;
-
-			if (tangentDirNum<1 || tangentDirNum>num_independents) {
-			  _error_("tangentDirNum should be in [1,num_independents]"); // <------------ fix this error message to relate to config
-			}
-
+			
 			/*retrieve state variable: */
 			parameters->FindParam(&axp,&dummy,AutodiffXpEnum);
@@ -54,83 +53,141 @@
 			ext_diff_fct *anEDF_for_solverx_p=dynamic_cast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p;
 
-			/*set the forward method function pointers: */
-			anEDF_for_solverx_p->zos_forward=EDF_for_solverx;
-			anEDF_for_solverx_p->fos_forward=EDF_fos_forward_for_solverx;
-			anEDF_for_solverx_p->fov_forward=EDF_fov_forward_for_solverx;
-			anEDF_for_solverx_p->fos_reverse=EDF_fos_reverse_for_solverx;
-			// anEDF_for_solverx_p->fov_reverse=EDF_fov_reverse_for_solverx;
+			/*Branch according to AD driver: */
+			parameters->FindParam(&driver,AutodiffDriverEnum);
+
+			if (strcmp(driver,"fos_forward")==0){
+				
+				int     anIndepIndex;
+				double *tangentDir=NULL;
+				double *jacTimesTangentDir=NULL;
+				double *theOutput=NULL;
+				
+				/*retrieve direction index: */
+				parameters->FindParam(&anIndepIndex,AutodiffFosForwardIndexEnum);
+				
+				tangentDir=xNewZeroInit<double>(num_independents);
+				tangentDir[anIndepIndex]=1.0;
 			
-			/*allocate the space for the parameters to invoke the forward methods:*/
-			anEDF_for_solverx_p->dp_x=xNew<double>(anEDF_for_solverx_p->max_n);
-			anEDF_for_solverx_p->dp_X=xNew<double>(anEDF_for_solverx_p->max_n);
-			anEDF_for_solverx_p->dpp_X=xNew<double>(anEDF_for_solverx_p->max_n, tangentDirNum);
-			anEDF_for_solverx_p->dp_y=xNew<double>(anEDF_for_solverx_p->max_m);
-			anEDF_for_solverx_p->dp_Y=xNew<double>(anEDF_for_solverx_p->max_m);
-			anEDF_for_solverx_p->dpp_Y=xNew<double>(anEDF_for_solverx_p->max_m, tangentDirNum);
-			/*allocate the space for the parameters to invoke the reverse methods:*/
-			anEDF_for_solverx_p->dp_U=xNew<double>(anEDF_for_solverx_p->max_m);
-			anEDF_for_solverx_p->dpp_U=xNew<double>(num_dependents,anEDF_for_solverx_p->max_m);
-			anEDF_for_solverx_p->dp_Z=xNew<double>(anEDF_for_solverx_p->max_n);
-			anEDF_for_solverx_p->dpp_Z=xNew<double>(num_dependents,anEDF_for_solverx_p->max_n);
-
-			/* Call AD driver:*/
-			if (tangentDirNum==1) {
-			  // single direction:
-			  double *tangentDir=xNewZeroInit<double>(num_independents);
-			  parameters->FindParam(&anIndepIndex,AutodiffFosForwardIndexEnum);
-			  tangentDir[anIndepIndex]=1.0;
-			  double *jacTimesTangentDir=xNew<double>(num_dependents);
-			  double *theOutput=xNew<double>(num_dependents);
-			  if (fos_forward(1,num_dependents,num_independents, 0, xp, tangentDir, theOutput, jacTimesTangentDir ))
-			    _error_("fos_forward returned non-zero error code");
-			  results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,jacTimesTangentDir,num_dependents,1,1,0.0));
-                          xDelete(theOutput);
-                          xDelete(jacTimesTangentDir);
-                          xDelete(tangentDir);
+				jacTimesTangentDir=xNew<double>(num_dependents);
+				theOutput=xNew<double>(num_dependents);
+				
+				/*set the forward method function pointers: */
+				anEDF_for_solverx_p->zos_forward=EDF_for_solverx;
+				anEDF_for_solverx_p->fos_forward=EDF_fos_forward_for_solverx;
+				anEDF_for_solverx_p->fos_reverse=EDF_fos_reverse_for_solverx;
+
+				/*allocate the space for the parameters to invoke the forward methods:*/
+				anEDF_for_solverx_p->dp_x=xNew<double>(anEDF_for_solverx_p->max_n);
+				anEDF_for_solverx_p->dp_X=xNew<double>(anEDF_for_solverx_p->max_n);
+				anEDF_for_solverx_p->dpp_X=xNew<double>(anEDF_for_solverx_p->max_n, 1);
+				anEDF_for_solverx_p->dp_y=xNew<double>(anEDF_for_solverx_p->max_m);
+				anEDF_for_solverx_p->dp_Y=xNew<double>(anEDF_for_solverx_p->max_m);
+				anEDF_for_solverx_p->dpp_Y=xNew<double>(anEDF_for_solverx_p->max_m, 1);
+
+				/*allocate the space for the parameters to invoke the reverse methods:*/
+				anEDF_for_solverx_p->dp_U=xNew<double>(anEDF_for_solverx_p->max_m);
+				anEDF_for_solverx_p->dpp_U=xNew<double>(num_dependents,anEDF_for_solverx_p->max_m);
+				anEDF_for_solverx_p->dp_Z=xNew<double>(anEDF_for_solverx_p->max_n);
+				anEDF_for_solverx_p->dpp_Z=xNew<double>(num_dependents,anEDF_for_solverx_p->max_n);
+
+				/*call driver: */
+				if (fos_forward(1,num_dependents,num_independents, 0, xp, tangentDir, theOutput, jacTimesTangentDir )) _error_("fos_forward returned non-zero error code");
+
+				/*add to results*/
+				results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,jacTimesTangentDir,num_dependents,1,1,0.0));
+				
+				/*free ressources :*/
+				xDelete(theOutput);
+				xDelete(jacTimesTangentDir);
+				xDelete(tangentDir);
 			}
-			else {
-			  // full Jacobian or Jacobian projection:
-			  double **jacTimesSeed=xNew<double>(num_dependents,tangentDirNum);
-			  if (tangentDirNum<num_independents) {
-			    double **seed=xNewZeroInit<double>(num_independents,tangentDirNum);
-
-			    // <<<<<<< from here <<<<<<<<<<<<
-			    unsigned int * indepIndices=xNew<unsigned int>(tangentDirNum);
-			    for(int i =0; i< tangentDirNum;++i) {
-			      indepIndices[i]=i;
-			    }
-			    // <<<<<<<< to here << get this vector of independent indices from the config - should be 0 based and ideally also unsigned
-
-			    // collect indices in a set to prevent accidental duplicates as long as we don't do compression:
-			    std::set<unsigned int> anIndexSet;
-			    for (int i=0; i<tangentDirNum; ++i) {
-			      // make sure the index is in range
-			      if (indepIndices[i]>num_independents) {
-			        _error_("indepIndices values must be in [0,num_independents-1]");
-			      }
-			      if (anIndexSet.find(indepIndices[i])!=anIndexSet.end()) {
-			        _error_("duplicate indepIndices values are not allowed until we implement Jacobian decompression");
-			      }
-			      anIndexSet.insert(indepIndices[i]);
-	                      // now populate the seed matrix from the set of independent indices;
-			      // simple setup with a single 1.0 per column and at most a single 1.0 per row
-			      seed[indepIndices[i]][i]=1.0;
-			    }
-			    double *theOutput=xNew<double>(num_dependents);
-			    if (fov_forward(1,num_dependents,num_independents, tangentDirNum, xp, seed, theOutput, jacTimesSeed )) {
-			      _error_("fov_forward returned non-zero error code");
-			    }
-			    xDelete(theOutput);
-			    xDelete(indepIndices);
-			    xDelete(seed);
-			  }
-			  else {
-			    if (jacobian(1,num_dependents,num_independents,xp,jacTimesSeed)) {
-	                        _error_("jacobian returned non-zero error code");
-			    }
-			  }
-			  results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,*jacTimesSeed,num_dependents*tangentDirNum,1,1,0.0));
-			  xDelete(jacTimesSeed);
+			else if ((strcmp(driver,"fov_forward")==0) || (strcmp(driver,"fov_forward")==0)){
+				
+				int* indepIndices=NULL;
+				int tangentDirNum;
+				int dummy;
+				double **jacTimesSeed=NULL;
+				double **seed=NULL;
+				double *theOutput=NULL;
+				std::set<unsigned int> anIndexSet;
+
+					
+				/*retrieve directions:*/
+				if (strcmp(driver,"jacobian")==0){
+					tangentDirNum=num_independents;
+					indepIndices=xNewZeroInit<int>(tangentDirNum);
+					for(i=0;i<num_independents;i++)indepIndices[i]=1;
+				}
+				else{
+					parameters->FindParam(&indepIndices,&tangentDirNum,&dummy,AutodiffFovForwardIndicesEnum);
+				}
+
+				/*Some checks: */
+				if (tangentDirNum<1 || tangentDirNum>num_independents) _error_("tangentDirNum should be in [1,num_independents]");
+
+				/* full Jacobian or Jacobian projection:*/
+				jacTimesSeed=xNew<double>(num_dependents,tangentDirNum);
+				
+				/*set the forward method function pointers: */
+				anEDF_for_solverx_p->zos_forward=EDF_for_solverx;
+				anEDF_for_solverx_p->fov_forward=EDF_fov_forward_for_solverx;
+				// anEDF_for_solverx_p->fov_reverse=EDF_fov_reverse_for_solverx;
+
+				/*allocate the space for the parameters to invoke the forward methods:*/
+				anEDF_for_solverx_p->dp_x=xNew<double>(anEDF_for_solverx_p->max_n);
+				anEDF_for_solverx_p->dp_X=xNew<double>(anEDF_for_solverx_p->max_n);
+				anEDF_for_solverx_p->dpp_X=xNew<double>(anEDF_for_solverx_p->max_n, tangentDirNum);
+				anEDF_for_solverx_p->dp_y=xNew<double>(anEDF_for_solverx_p->max_m);
+				anEDF_for_solverx_p->dp_Y=xNew<double>(anEDF_for_solverx_p->max_m);
+				anEDF_for_solverx_p->dpp_Y=xNew<double>(anEDF_for_solverx_p->max_m, tangentDirNum);
+
+				/*allocate the space for the parameters to invoke the reverse methods:*/
+				anEDF_for_solverx_p->dp_U=xNew<double>(anEDF_for_solverx_p->max_m);
+				anEDF_for_solverx_p->dpp_U=xNew<double>(num_dependents,anEDF_for_solverx_p->max_m);
+				anEDF_for_solverx_p->dp_Z=xNew<double>(anEDF_for_solverx_p->max_n);
+				anEDF_for_solverx_p->dpp_Z=xNew<double>(num_dependents,anEDF_for_solverx_p->max_n);
+
+				/*seed matrix: */
+				seed=xNewZeroInit<double>(num_independents,tangentDirNum);
+
+				/*collect indices in a set to prevent accidental duplicates as long as we don't do compression:*/
+				for (int i=0; i<tangentDirNum; ++i) {
+					/* make sure the index is in range*/
+					if (indepIndices[i]>num_independents) {
+						_error_("indepIndices values must be in [0,num_independents-1]");
+					}
+					if (anIndexSet.find(indepIndices[i])!=anIndexSet.end()) {
+						_error_("duplicate indepIndices values are not allowed until we implement Jacobian decompression");
+					}
+					anIndexSet.insert(indepIndices[i]);
+					/* now populate the seed matrix from the set of independent indices;
+					 * simple setup with a single 1.0 per column and at most a single 1.0 per row*/
+					seed[indepIndices[i]][i]=1.0;
+				}
+
+				/*allocate output: */
+				theOutput=xNew<double>(num_dependents);
+
+				/*call driver: */
+				if (strcmp(driver,"fov_forward")==0){
+					if (fov_forward(1,num_dependents,num_independents, tangentDirNum, xp, seed, theOutput, jacTimesSeed )) _error_("fov_forward returned non-zero error code");
+				}
+				else{
+					if (jacobian(1,num_dependents,num_independents,xp,jacTimesSeed))  _error_("jacobian returned non-zero error code");
+				}
+
+				/*Free ressources: */
+				xDelete(theOutput);
+				xDelete(indepIndices);
+				xDelete(seed);
+
+				/*add to results: */
+				results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,*jacTimesSeed,num_dependents*tangentDirNum,1,1,0.0));
+
+				/*Free ressources: */
+				xDelete(jacTimesSeed);
+				xDelete<int>(indepIndices);
 			}
+			else _error_("driver: " << driver << " not yet supported!");
 
 			/* delete the allocated space for the parameters:*/
@@ -149,4 +206,6 @@
 			xDelete(xp);
 			xDelete(axp); 
+			
+			if(VerboseAutodiff())_pprintLine_("   end AD driver");
 
 		#else
Index: /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13460)
+++ /issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 13461)
@@ -32,4 +32,5 @@
 		case AutodiffDriverEnum : return "AutodiffDriver";
 		case AutodiffFosForwardIndexEnum : return "AutodiffFosForwardIndex";
+		case AutodiffFovForwardIndicesEnum : return "AutodiffFovForwardIndices";
 		case BalancethicknessSpcthicknessEnum : return "BalancethicknessSpcthickness";
 		case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization";
Index: /issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 13460)
+++ /issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp	(revision 13461)
@@ -22,4 +22,7 @@
 	int*        types=NULL;
 	int         dummy;
+	char*       autodiff_driver=NULL;
+	int*        indices=NULL;
+	int         num_indices;
 	
 	IssmDouble* xp=NULL;
@@ -37,6 +40,16 @@
 
 		/*retrieve driver: */
+		iomodel->Constant(&autodiff_driver,AutodiffDriverEnum);
 		parameters->AddObject(iomodel->CopyConstantObject(AutodiffDriverEnum));
-		parameters->AddObject(iomodel->CopyConstantObject(AutodiffFosForwardIndexEnum));
+		
+		if(strcmp(autodiff_driver,"fos_forward")==0){
+			parameters->AddObject(iomodel->CopyConstantObject(AutodiffFosForwardIndexEnum));
+		}
+		else if(strcmp(autodiff_driver,"fov_forward")==0){
+			/*Retrieve list of indices: */
+			iomodel->FetchData(&indices,&num_indices,&dummy,AutodiffFovForwardIndicesEnum);
+			parameters->AddObject(new IntMatParam(AutodiffFovForwardIndicesEnum,indices,num_indices,1));
+			xDelete<int>(indices);
+		}
 
 		/*Deal with dependents first: {{{*/
@@ -92,4 +105,5 @@
 		/*Assign output pointer: */
 		*pparameters=parameters;
+
 	}
 }
Index: /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13460)
+++ /issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 13461)
@@ -33,4 +33,5 @@
 	      else if (strcmp(name,"AutodiffDriver")==0) return AutodiffDriverEnum;
 	      else if (strcmp(name,"AutodiffFosForwardIndex")==0) return AutodiffFosForwardIndexEnum;
+	      else if (strcmp(name,"AutodiffFovForwardIndices")==0) return AutodiffFovForwardIndicesEnum;
 	      else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum;
 	      else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
@@ -137,9 +138,9 @@
 	      else if (strcmp(name,"MeshElementonsurface")==0) return MeshElementonsurfaceEnum;
 	      else if (strcmp(name,"MeshElements2d")==0) return MeshElements2dEnum;
-	      else if (strcmp(name,"MeshElements")==0) return MeshElementsEnum;
          else stage=2;
    }
    if(stage==2){
-	      if (strcmp(name,"MeshLowerelements")==0) return MeshLowerelementsEnum;
+	      if (strcmp(name,"MeshElements")==0) return MeshElementsEnum;
+	      else if (strcmp(name,"MeshLowerelements")==0) return MeshLowerelementsEnum;
 	      else if (strcmp(name,"MeshNumberofedges")==0) return MeshNumberofedgesEnum;
 	      else if (strcmp(name,"MeshNumberofelements2d")==0) return MeshNumberofelements2dEnum;
@@ -260,9 +261,9 @@
 	      else if (strcmp(name,"TransientSolution")==0) return TransientSolutionEnum;
 	      else if (strcmp(name,"Approximation")==0) return ApproximationEnum;
-	      else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum;
          else stage=3;
    }
    if(stage==3){
-	      if (strcmp(name,"HutterApproximation")==0) return HutterApproximationEnum;
+	      if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum;
+	      else if (strcmp(name,"HutterApproximation")==0) return HutterApproximationEnum;
 	      else if (strcmp(name,"MacAyealApproximation")==0) return MacAyealApproximationEnum;
 	      else if (strcmp(name,"MacAyealPattynApproximation")==0) return MacAyealPattynApproximationEnum;
@@ -383,9 +384,9 @@
 	      else if (strcmp(name,"TemperatureOld")==0) return TemperatureOldEnum;
 	      else if (strcmp(name,"TemperaturePicard")==0) return TemperaturePicardEnum;
-	      else if (strcmp(name,"TemperatureSurface")==0) return TemperatureSurfaceEnum;
          else stage=4;
    }
    if(stage==4){
-	      if (strcmp(name,"TemperatureBasal")==0) return TemperatureBasalEnum;
+	      if (strcmp(name,"TemperatureSurface")==0) return TemperatureSurfaceEnum;
+	      else if (strcmp(name,"TemperatureBasal")==0) return TemperatureBasalEnum;
 	      else if (strcmp(name,"ThicknessAbsMisfit")==0) return ThicknessAbsMisfitEnum;
 	      else if (strcmp(name,"Type")==0) return TypeEnum;
@@ -506,9 +507,9 @@
 	      else if (strcmp(name,"Option")==0) return OptionEnum;
 	      else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum;
-	      else if (strcmp(name,"OptionCell")==0) return OptionCellEnum;
          else stage=5;
    }
    if(stage==5){
-	      if (strcmp(name,"OptionChar")==0) return OptionCharEnum;
+	      if (strcmp(name,"OptionCell")==0) return OptionCellEnum;
+	      else if (strcmp(name,"OptionChar")==0) return OptionCharEnum;
 	      else if (strcmp(name,"OptionStruct")==0) return OptionStructEnum;
 	      else if (strcmp(name,"OptionDouble")==0) return OptionDoubleEnum;
Index: /issm/trunk-jpl/src/m/classes/autodiff.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/autodiff.m	(revision 13460)
+++ /issm/trunk-jpl/src/m/classes/autodiff.m	(revision 13461)
@@ -29,5 +29,16 @@
 
 			%Driver value:
-			md = checkfield(md,'autodiff.driver','values',{'fos_forward'});
+			md = checkfield(md,'autodiff.driver','values',{'fos_forward','fov_forward'});
+
+			%go through our dependents and independents and check consistency: 
+			for i=1:numel(obj.dependents),
+				dep=obj.dependents{i};
+				md=checkconsistency(dep,md,solution,analyses);
+			end
+			for i=1:numel(obj.independents),
+				indep=obj.independents{i};
+				md=checkconsistency(indep,md,i,solution,analyses,obj.driver);
+			end
+
 
 		end % }}}
@@ -37,5 +48,5 @@
 			fielddisplay(obj,'dependents','list of dependent variables');
 			fielddisplay(obj,'independents','list of independent variables');
-			fielddisplay(obj,'driver','ADOLC driver');
+			fielddisplay(obj,'driver','ADOLC driver (''fos_forward'' or ''fov_forward''');
 		end % }}}
 		function marshall(obj,fid) % {{{
@@ -101,6 +112,29 @@
 					end
 				end
-				WriteData(fid,'data',index-1,'enum',AutodiffFosForwardIndexEnum(),'format','Integer'); %c-index numbering.
+				index=index-1; %get c-index numbering going
+				WriteData(fid,'data',index,'enum',AutodiffFosForwardIndexEnum(),'format','Integer'); 
 			end
+			%if driver is fov_forward, build indices: 
+			if strcmpi(obj.driver,'fov_forward'),
+				indices=0;
+				
+				for i=1:num_independent_objects,
+					indep=obj.independents{i};
+					if ~isempty(indep.fos_forward_index),
+						indices=indices+indep.fov_forward_indices;
+						break;
+					else
+						if strcmpi(indep.type,'scalar'),
+							indices=indices+1;
+						else
+							indices=indices+indep.nods;
+						end
+					end
+				end
+				indices=indices-1; %get c-indices numbering going
+
+				WriteData(fid,'data',indices,'enum',AutodiffFovForwardIndicesEnum,'format','IntMat','mattype',3);
+			end
+
 		end % }}}
 	end
Index: /issm/trunk-jpl/src/m/classes/independent.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/independent.m	(revision 13460)
+++ /issm/trunk-jpl/src/m/classes/independent.m	(revision 13461)
@@ -9,4 +9,5 @@
 		type                 = '';
 		fos_forward_index    = NaN;
+		fov_forward_indices  = [];
 		nods                 = 0;
 	end
@@ -26,11 +27,26 @@
 
 		end % }}}
-		function md = checkconsistency(obj,md,solution,analyses) % {{{
+		function md = checkconsistency(obj,md,i,solution,analyses,driver) % {{{
 			%do nothing for now
 			if ~isnan(obj.fos_forward_index),
+				if ~strcmpi(driver,'fos_forward'),
+					error('cannot declare an independent with a fos_forward_index when the driver is not fos_forward!');
+				end
 				if obj.nods==0,
 					error('independent checkconsistency error: nods should be set to the size of the independent variable');
 				end
 			end
+
+			if ~isempty(obj.fov_forward_indices),
+				if ~strcmpi(driver,'fov_forward'),
+					error('cannot declare an independent with fov_forward_indices when the driver is not fov_forward!');
+				end
+
+				if obj.nods==0,
+					error('independent checkconsistency error: nods should be set to the size of the independent variable');
+				end
+				md = checkfield(md,['autodiff.independents{' num2str(i) '}.fov_forward_indices'],'>=',1,'<=',obj.nods,'size',[NaN 1]);
+			end
+
 
 		end % }}}
@@ -43,5 +59,7 @@
 				fielddisplay(obj,'fos_forward_index','index for fos_foward driver of ADOLC');
 			end
-
+			if ~isnan(obj.fov_forward_indices),
+				fielddisplay(obj,'fov_forward_indices','indices for fov_foward driver of ADOLC');
+			end
 		end % }}}
 		function scalar=typetoscalar(obj) % {{{
Index: /issm/trunk-jpl/src/m/enum/AutodiffFovForwardIndicesEnum.m
===================================================================
--- /issm/trunk-jpl/src/m/enum/AutodiffFovForwardIndicesEnum.m	(revision 13461)
+++ /issm/trunk-jpl/src/m/enum/AutodiffFovForwardIndicesEnum.m	(revision 13461)
@@ -0,0 +1,11 @@
+function macro=AutodiffFovForwardIndicesEnum()
+%AUTODIFFFOVFORWARDINDICESENUM - Enum of AutodiffFovForwardIndices
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=AutodiffFovForwardIndicesEnum()
+
+macro=StringToEnum('AutodiffFovForwardIndices');
Index: /issm/trunk-jpl/src/m/enum/EnumDefinitions.py
===================================================================
--- /issm/trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13460)
+++ /issm/trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 13461)
@@ -159,4 +159,14 @@
 	return StringToEnum('AutodiffFosForwardIndex')[0]
 
+def AutodiffFovForwardIndicesEnum():
+	"""
+	AUTODIFFFOVFORWARDINDICESENUM - Enum of AutodiffFovForwardIndices
+
+	   Usage:
+	      macro=AutodiffFovForwardIndicesEnum()
+	"""
+
+	return StringToEnum('AutodiffFovForwardIndices')[0]
+
 def BalancethicknessSpcthicknessEnum():
 	"""
@@ -4877,4 +4887,4 @@
 	"""
 
-	return 486
-
+	return 487
+
Index: /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
===================================================================
--- /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13460)
+++ /issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m	(revision 13461)
@@ -9,3 +9,3 @@
 %      macro=MaximumNumberOfEnums()
 
-macro=486;
+macro=487;
Index: /issm/trunk-jpl/test/NightlyRun/ad.m
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/ad.m	(revision 13460)
+++ /issm/trunk-jpl/test/NightlyRun/ad.m	(revision 13461)
@@ -6,13 +6,17 @@
 
 md.autodiff.isautodiff=true;
+md.verbose.autodiff=true;
 index=1;
 md.autodiff.independents={...
-	independent('name','Thickness','type','vertex','nods',md.mesh.numberofvertices,'fos_forward_index',index)
+	independent('name','Thickness','type','vertex','nods',md.mesh.numberofvertices,'fov_forward_indices',(1:md.mesh.numberofvertices)')
+	%independent('name','Thickness','type','vertex','nods',md.mesh.numberofvertices,'fos_forward_index',index)
 	};
 
 md.autodiff.dependents={...
 	dependent('name','IceVolume','type','scalar')...
+	dependent('name','MaxVel','type','scalar')...
 	};
-md.autodiff.driver='fos_forward';
+%md.autodiff.driver='fos_forward';
+md.autodiff.driver='fov_forward';
 
 md=solve(md,TransientSolutionEnum);
