anchor.diff:        end if
   
         ! set values of m%BEMT_u(2) from inputs interpolated at t+dt:
  +      ! NOTE: framework has t+dt at u(1)
      call AD_Input_ExtrapInterp(u,utimes,uInterp,t+p%DT, errStat2, errMsg2)
         call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
   
  
positive.code:                   
     call SetOutputsFromBEMT(p, m, y )
  
  !!!   REAL(ReKi)                 :: Vind_FVW(3)
  !!!
  !!!   WakeCalc = p%UseFVW  ! WakeCalc is used to easily switch the Freewake on and off in this routine
  !!!
  !!!   ! ---  Copy of Rotor Mesh to FVW
  !!!   IF (WakeCalc) THEN
  !!!       ! Setting u%FVW
  !!!       call AD14_to_FVW_u(u,p,u%FVW,ErrStat,ErrMess)
  !!!       IF (ErrStat >= AbortErrLev) THEN
  !!!          CALL CleanUp()
  !!!          RETURN
  !!!       END IF
     if (p%WakeMod == WakeMod_FVW) then
           ! This needs to extract the inputs from the AD data types (mesh) and copy pieces for the FVW module
        call SetInputsForFVW(p, (/u/), m, errStat2, errMsg2)
           call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
         ! -- Calc Output
         CALL FVW_CalcOutput( t, m%FVW_u(1), p%FVW, x%FVW, xd%FVW, z%FVW, OtherState%FVW, m%FVW_y, m%FVW, ErrStat, ErrMsg2 )
           call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
     endif
  !!!       IF (ErrStat >= AbortErrLev) THEN
  !!!          CALL CleanUp()
  !!!          RETURN
  !!!       END IF
  !!!   endif
  !!!
  !!!            ! --- FVW - Vortex code
  !!!            Vind_FVW = y%FVW%Vind(:, IElement, IBlade)
  !!!            VT_ind = DOT_PRODUCT( tang_Vector, Vind_FVW)
  !!!            VN_ind = DOT_PRODUCT( norm_Vector, Vind_FVW)
  !!!            ! Normal and tangential induction factors
  !!!            m%Element%A (IElement,IBLADE) = - VN_ind / VNWind
  !!!            m%Element%AP(IElement,IBLADE) =   VT_ind / VTTotal
  !!!            ! Copy over any outputs (y%FVW%) or miscvars (m%FVW%) needed by AD14 and anything else here
  !!!         IF ( p%UseFVW ) THEN
  !!!            VelocityVec = VelocityVec+Vind_FVW ! TODO this might not be what's really intended for
  !!!         END IF
              
     if ( p%TwrAero ) then
        call ADTwr_CalcOutput(p, u, m, y, ErrStat2, ErrMsg2 )
  
negative.code:          
                          
        ! Call into the BEMT update states    NOTE:  This is a non-standard framework interface!!!!!  GJH
        ! Also note BEMT_u(1) and BEMT_u(2) are not following the framework convention for t+dt, t
     call BEMT_UpdateStates(t, n, m%BEMT_u(1), m%BEMT_u(2),  p%BEMT, x%BEMT, xd%BEMT, z%BEMT, OtherState%BEMT, p%AFI%AFInfo, m%BEMT, errStat2, errMsg2)
        call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
           
  