anchor.diff:        END DO
   
         ! call CalcContStateDeriv in order to run model and calculate dynamics with provided x and u
  -      CALL MD_CalcContStateDeriv( t2, u, p, x, xd, z, other, m, dxdt, ErrStat, ErrMsg )
  +      CALL MD_CalcContStateDeriv( t, u, p, x, xd, z, other, m, dxdt, ErrStat, ErrMsg )
   
   
         ! assign net force on fairlead Connects to the output mesh
  
positive.code: 
  
        ! calculate outputs (y%WriteOutput) for glue code and write any m outputs to MoorDyn output files
        CALL MDIO_WriteOutputs(REAL(t,DbKi) , p, m, y, ErrStat2, ErrMsg2)
        CALL CheckError(ErrStat2, 'In MDIO_WriteOutputs: '//trim(ErrMsg2))
        IF ( ErrStat >= AbortErrLev ) RETURN
  
  
negative.code: 
           ! step 1
  
           CALL MD_Input_ExtrapInterp(u, utimes, u_interp, t          , ErrStat, ErrMsg)   ! interpolate input mesh to correct time (t)
        
           CALL MD_CalcContStateDeriv( t, u_interp, p, x, xd, z, other, m, dxdt, ErrStat, ErrMsg )
           DO J = 1, Nx
  