anchor.diff:  
         end subroutine Cleanup
   
  -   END SUBROUTINE BD_GenerateDynamicElementGA2
  -
  -   SUBROUTINE BD_InputGlobalLocal( p, u, ErrStat, ErrMsg)
  -   !-----------------------------------------------------------------------------
  -   ! This subroutine tranforms the folloing quantities in Input data structure
  -   ! from global frame to local (blade) frame:
  -   ! 1 Displacements; 2 Linear/Angular velocities; 3 Linear/Angular accelerations
  -   ! 4 Piont forces/moments; 5 Distributed forces/moments
  -   ! It also transforms the DCM to rotation tensor in the input data structure
  -   !-----------------------------------------------------------------------------
  +END SUBROUTINE BD_GenerateDynamicElementGA2
  +
  +SUBROUTINE BD_InputGlobalLocal( p, u, ErrStat, ErrMsg)
  +!-----------------------------------------------------------------------------
  +! This subroutine tranforms the folloing quantities in Input data structure
  +! from global frame to local (blade) frame:
  +! 1 Displacements; 2 Linear/Angular velocities; 3 Linear/Angular accelerations
  +! 4 Piont forces/moments; 5 Distributed forces/moments
  +! It also transforms the DCM to rotation tensor in the input data structure
  +!-----------------------------------------------------------------------------
      TYPE(BD_ParameterType), INTENT(IN   ):: p
      TYPE(BD_InputType),     INTENT(INOUT):: u
      INTEGER(IntKi),         INTENT(  OUT):: ErrStat       ! Error status of the operation
  
positive.code:    TYPE(BD_ConstraintStateType), INTENT(IN   )  :: z           ! Constraint states at t
     TYPE(BD_OtherStateType),      INTENT(INOUT)  :: OtherState  ! Other/optimization states
     TYPE(BD_OutputType),          INTENT(INOUT)  :: y           ! Outputs computed at t (Input only so that mesh con-
                                                                      !   nectivity information does not have to be recalculated)
     INTEGER(IntKi),                 INTENT(  OUT)  :: ErrStat     ! Error status of the operation
     CHARACTER(*),                   INTENT(  OUT)  :: ErrMsg      ! Error message if ErrStat /= ErrID_None
  
     TYPE(BD_OtherStateType):: OS_tmp
     TYPE(BD_ContinuousStateType):: x_tmp
     TYPE(BD_InputType):: u_tmp
     INTEGER(IntKi):: i
     INTEGER(IntKi):: j
     INTEGER(IntKi):: temp_id
     INTEGER(IntKi):: temp_id2
     REAL(ReKi):: cc(3)
     REAL(ReKi):: cc0(3)
     REAL(ReKi):: temp_cc(3)
     REAL(ReKi):: temp_glb(3)
     REAL(ReKi):: temp_R(3,3)
     REAL(ReKi):: temp6(6)
     REAL(ReKi):: temp_Force(p%dof_total)
     REAL(ReKi):: temp_ReactionForce(6)
     INTEGER(IntKi)          :: ErrStat2                     ! Temporary Error status
     CHARACTER(ErrMsgLen)    :: ErrMsg2                      ! Temporary Error message
     CHARACTER(*), PARAMETER :: RoutineName = 'BD_CalcOutput'
     
     ! Initialize ErrStat
  
  
negative.code:               call Cleanup()
                return
            end if
  !DO j=1,dof_total
  !WRITE(QiMass,6000) MassM(:,j)
  !WRITE(QiStif,6000) StifK(:,j)
  !ENDDO
  !6000 FORMAT (18ES21.12)
  !CLOSE (QiMass)
  !CLOSE (QiStif)
  !STOP
         StifK = MassM + coef(7) * DampG + coef(8) * StifK
         DO j=1,node_total
             temp_id = (j-1)*dof_node
  