anchor.diff:             y%BldMotion%Orientation(1:3,1:3,temp_id2) = temp_R(1:3,1:3)
   
              temp_id = ((i-1)*(p%node_elem-1)+j-1)*p%dof_node
  -           temp6(:) = 0.0D0
  -           temp6(1:3) = x%dqdt(temp_id+1:temp_id+3)
  -           temp6(4:6) = x%dqdt(temp_id+4:temp_id+6)
  -           temp6(:) = MATMUL(MoTens,temp6)
  -           y%BldMotion%TranslationVel(1:3,temp_id2) = temp6(1:3)
  -           y%BldMotion%RotationVel(1:3,temp_id2) = temp6(4:6)
  +           y%BldMotion%TranslationVel(1:3,temp_id2) = MATMUL(p%GlbRot,x%dqdt(temp_id+1:temp_id+3))
  +           y%BldMotion%RotationVel(1:3,temp_id2) = MATMUL(p%GlbRot,x%dqdt(temp_id+4:temp_id+6))
          ENDDO
      ENDDO
   
      CALL BD_InputGlobalLocal(p,u_tmp,0)
      CALL BD_BoundaryGA2(x_tmp,p,u_tmp,t,OS_tmp,ErrStat,ErrMsg)
      IF(p%analysis_type .EQ. 2) THEN
  -!WRITE(*,*) 'u_tmp%a'
  -!WRITE(*,*) u_tmp%RootMotion%TranslationDisp(:,1)
  -!WRITE(*,*) u_tmp%RootMotion%Orientation(:,:,1)
  -!WRITE(*,*) u_tmp%RootMotion%TranslationVel(:,1)
  -!WRITE(*,*) u_tmp%RootMotion%RotationVel(:,1)
  -!WRITE(*,*) u_tmp%RootMotion%TranslationAcc(:,1)
  -!WRITE(*,*) u_tmp%RootMotion%RotationAcc(:,1)
  -!WRITE(*,*) u_tmp%PointLoad%Force(:,:)
  -!WRITE(*,*) u_tmp%PointLoad%Moment(:,:)
  -!       CALL BD_CalcAcc(u_tmp,p,x_tmp,OS_tmp)
          CALL BD_CalcForceAcc(u_tmp,p,x_tmp,OS_tmp)
  -!WRITE(*,*) 'OS_tmp'
  -!WRITE(*,*) OS_tmp%Acc(:)
          DO i=1,p%elem_total
              DO j=1,p%node_elem
                  temp_id = ((i-1)*(p%node_elem-1)+j-1)*p%dof_node
  
positive.code:    CALL BD_CopyOtherState(OtherState, OS_tmp, MESH_NEWCOPY, ErrStat, ErrMsg)
     CALL BD_CopyInput(u, u_tmp, MESH_NEWCOPY, ErrStat, ErrMsg)
  
     CALL BD_MotionTensor(p%GlbRot,p%GlbPos,MoTens,0)
     DO i=1,p%elem_total
         DO j=1,p%node_elem
             temp_id = ((i-1)*(p%node_elem-1)+j-1)*p%dof_node
  
negative.code:                    temp6(1:3) = OS_tmp%Acc(temp_id+1:temp_id+3)
                     temp6(4:6) = OS_tmp%Acc(temp_id+4:temp_id+6)
                 ENDIF
                     y%BldMotion%TranslationAcc(1:3,temp_id2) = MATMUL(p%GlbRot,temp6(1:3))
                     y%BldMotion%RotationAcc(1:3,temp_id2) = MATMUL(p%GlbRot,temp6(4:6))
             ENDDO
         ENDDO
         CALL BD_DynamicSolutionForce(p%uuN0,x_tmp%q,x_tmp%dqdt,OS_tmp%Acc,                              &
  