anchor.diff:     
      call PackMotionMesh_dY(y_p%PlatformPtMesh, y_m%PlatformPtMesh, dY, indx_first)                  
      call PackMotionMesh_dY(y_p%TowerLn2Mesh,   y_m%TowerLn2Mesh,   dY, indx_first)                  
  -   call PackMotionMesh_dY(y_p%HubPtMotion,    y_m%HubPtMotion,    dY, indx_first, SkipAcc=.true.)  
  +   call PackMotionMesh_dY(y_p%HubPtMotion,    y_m%HubPtMotion,    dY, indx_first, FieldMask=Mask)  
      do k=1,p%NumBl
         call PackMotionMesh_dY(y_p%BladeRootMotion(k),   y_m%BladeRootMotion(k),   dY, indx_first)                  
      end do
      call PackMotionMesh_dY(y_p%NacelleMotion,  y_m%NacelleMotion,  dY, indx_first)                  
                        
  -   dY(indx_first:indx_first) = y_p%Yaw     - y_m%Yaw;       indx_first = indx_first + 1    
  -   dY(indx_first:indx_first) = y_p%YawRate - y_m%YawRate;   indx_first = indx_first + 1    
  -   dY(indx_first:indx_first) = y_p%HSS_Spd - y_m%HSS_Spd;   indx_first = indx_first + 1
  +   dY(indx_first) = y_p%Yaw     - y_m%Yaw;       indx_first = indx_first + 1    
  +   dY(indx_first) = y_p%YawRate - y_m%YawRate;   indx_first = indx_first + 1    
  +   dY(indx_first) = y_p%HSS_Spd - y_m%HSS_Spd;   indx_first = indx_first + 1
      
      !indx_last = indx_first + p%NumOuts - 1
  -   dY(indx_first:) = y_p%WriteOutput - y_m%WriteOutput
  +   do k=1,p%NumOuts
  +      dY(k+indx_first-1) = y_p%WriteOutput(k) - y_m%WriteOutput(k)
  +   end do   
      
      dY = dY / (2.0*delta)
      
  
positive.code:             return
           end if
           
        do i=1,p%DOFs%NActvDOF*2
           
              ! get x_op + delta x
  
negative.code:          call cleanup()
           return
        end if
        call ED_DestroyOutput( y_p, ErrStat2, ErrMsg2 ) ! we don't need this any more
        call ED_DestroyOutput( y_m, ErrStat2, ErrMsg2 ) ! we don't need this any more
        
  
  