anchor.diff:     PUBLIC :: BD_CrvCompose                ! Tight coupling routine for updating discrete states
      PUBLIC :: BD_CrvExtractCrv                ! Tight coupling routine for updating discrete states
      PUBLIC :: BD_Tilde
  -   PUBLIC :: BD_Norm
      PUBLIC :: ludcmp
      PUBLIC :: lubksb
      PUBLIC :: BD_MotionTensor
  
positive.code:        e1(i) = Coef(i,2) + 2.0D0*Coef(i,3)*temp + 3.0D0*Coef(i,4)*temp*temp
     ENDDO
  !   WRITE(*,*) "e1",e1(:)
     e1(:) = e1(:)/BD_Norm(e1)
     Twist_Angle = 0.0D0
     Twist_Angle = Coef(4,1) + Coef(4,2)*temp + Coef(4,3)*temp*temp + Coef(4,4)*temp*temp*temp
  !   WRITE(*,*) "e1",e1(:)
  
  
     END SUBROUTINE BD_ComputeIniNodalPosition
  
     FUNCTION BD_Norm(vector)
  
     REAL(ReKi),INTENT(IN):: vector(:)
     REAL(ReKi)           :: BD_Norm
  
     BD_Norm = SQRT(DOT_PRODUCT(vector,vector))
  
     END FUNCTION BD_Norm
  
     FUNCTION BD_CrossProduct(a,b)
  
     REAL(ReKi),INTENT(IN):: a(3),b(3)
     REAL(ReKi)           :: BD_CrossProduct(3)
  
     BD_CrossProduct(1) = a(2) * b(3) - a(3) * b(2)
     BD_CrossProduct(2) = a(3) * b(1) - a(1) * b(3)
     BD_CrossProduct(3) = a(1) * b(2) - a(2) * b(1)
  
     END FUNCTION BD_CrossProduct
  
     SUBROUTINE BD_CrvExtractCrv(Rr,cc,ErrStat,ErrMsg)
     !--------------------------------------------------
  
negative.code:            ui(j+6) = ui_temp(j)
         ENDDO
  
         temp = TwoNorm(feqv)
         WRITE(13,*) i,temp
         piter=i !! ADDED BY NJ 3/18/14
  !       IF(i==1) Eref = SQRT(DOT_PRODUCT(ui_temp,feqv)*TOLF)
  