anchor.diff:         ENDDO
      ENDDO
   
  -   CALL BD_InputGlobalLocal(p,u_tmp,0,ErrStat2,ErrMsg2)
  +   CALL BD_InputGlobalLocal(p,u_tmp,ErrStat2,ErrMsg2)
         CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
      CALL BD_BoundaryGA2(x_tmp,p,u_tmp,t,OS_tmp,ErrStat2,ErrMsg2)
         CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
  
positive.code:    ErrMsg  = ""
  
     RotTen(1:3,1:3) = p%GlbRot(:,:)
     IF (flag .EQ. 0) THEN
         ! Transform Root Motion from Global to Local (Blade) frame
         u%RootMotion%TranslationDisp(:,1) = MATMUL(TRANSPOSE(RotTen),u%RootMotion%TranslationDisp(:,1))
         u%RootMotion%TranslationVel(:,1)  = MATMUL(TRANSPOSE(RotTen),u%RootMotion%TranslationVel(:,1))
         u%RootMotion%RotationVel(:,1)     = MATMUL(TRANSPOSE(RotTen),u%RootMotion%RotationVel(:,1))
         u%RootMotion%TranslationAcc(:,1)  = MATMUL(TRANSPOSE(RotTen),u%RootMotion%TranslationAcc(:,1))
         u%RootMotion%RotationAcc(:,1)     = MATMUL(TRANSPOSE(RotTen),u%RootMotion%RotationAcc(:,1))
         ! Transform DCM to Rotation Tensor (RT)
         u%RootMotion%Orientation(:,:,1) = TRANSPOSE(u%RootMotion%Orientation(:,:,1))
         ! Transform Applied Forces from Global to Local (Blade) frame
         DO i=1,p%node_total
             u%PointLoad%Force(1:3,i)  = MATMUL(TRANSPOSE(RotTen),u%PointLoad%Force(:,i))
             u%PointLoad%Moment(1:3,i) = MATMUL(TRANSPOSE(RotTen),u%PointLoad%Moment(:,i))
         ENDDO
         DO i=1,p%ngp * p%elem_total + 2
             u%DistrLoad%Force(1:3,i)  = MATMUL(TRANSPOSE(RotTen),u%DistrLoad%Force(:,i))
             u%DistrLoad%Moment(1:3,i) = MATMUL(TRANSPOSE(RotTen),u%DistrLoad%Moment(:,i))
         ENDDO
     ELSEIF(flag .EQ. 1) THEN
  
     ENDIF
  
     END SUBROUTINE BD_InputGlobalLocal
  
  
negative.code:                                p%Stif0_GL,p%Mass0_GL,p%gravity,u_interp,       &
                                 p%damp_flag,p%beta,                             &
                                 p%node_elem,p%dof_node,p%elem_total,p%dof_total,&
                                 p%node_total,p%niter,p%tol,p%ngp,p%coef, ErrStat2, ErrMsg2)
        call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
  
     call cleanup()
  