anchor.diff:     INTEGER(IntKi)                             :: temp_id
      REAL(ReKi)                                 :: temp3(3)
      REAL(ReKi)                                 :: temp_p0(3)
  +   REAL(ReKi)                                 :: temp_ref(3)
  +   REAL(ReKi)                                 :: temp_root(3)
      REAL(ReKi)                                 :: temp_glb(3)
      TYPE(BD_InputType)                         :: u_tmp
      INTEGER(IntKi)                             :: ErrStat2                     ! Temporary Error status
  
positive.code: 
     call BD_Input_extrapinterp( u, utimes, u_interp, t+p%dt, ErrStat2, ErrMsg2 )
        call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
                   
  !WRITE(*,*) 'x%q'
  !WRITE(*,*) x%q(:)
  !WRITE(*,*) 'x%dqdt'
  !WRITE(*,*) x%dqdt(:)
  !WRITE(*,*) 'OS%acc'
  !WRITE(*,*) OS_tmp%acc
  !WRITE(*,*) 'OS%xcc'
  !WRITE(*,*) OS_tmp%xcc
     ! GA2: prediction        
     CALL BD_TiSchmPredictorStep( x_tmp%q,x_tmp%dqdt,OS_tmp%acc,OS_tmp%xcc,             &
                                  p%coef,p%dt,x%q,x%dqdt,OtherState%acc,OtherState%xcc, &
  
negative.code:    ! Incorporate boundary conditions
     CALL BD_BoundaryGA2(x,p,u_interp,t+p%dt,OtherState,ErrStat2,ErrMsg2)
           call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
  !WRITE(*,*) 'x%q'
  !WRITE(*,*) x%q(:)
  !WRITE(*,*) 'x%dqdt'
  !WRITE(*,*) x%dqdt(:)
  !WRITE(*,*) 'OS%acc'
  !WRITE(*,*) OS_tmp%acc
  !WRITE(*,*) 'OS%xcc'
  !WRITE(*,*) OS_tmp%xcc
  
     ! find x, acc, and xcc at t+dt
     CALL BD_DynamicSolutionGA2( p%uuN0,x%q,x%dqdt,OtherState%acc,OtherState%xcc,&
  