anchor.diff:     INTEGER(IntKi),INTENT(IN   ):: dof_node
      REAL(ReKi),    INTENT(  OUT):: elk(:,:)
      REAL(ReKi),    INTENT(  OUT):: elf(:)
  -
  -   REAL(ReKi)                  :: gp(ngp)
  -   REAL(ReKi)                  :: gw(ngp)
  -   REAL(ReKi)                  :: hhx(node_elem)
  -   REAL(ReKi)                  :: hpx(node_elem)
  -   REAL(ReKi)                  :: GLL_temp(node_elem)
  -   REAL(ReKi)                  :: w_temp(node_elem)
  +   INTEGER(IntKi),INTENT(  OUT):: ErrStat       ! Error status of the operation
  +   CHARACTER(*),  INTENT(  OUT):: ErrMsg        ! Error message if ErrStat /= ErrID_None
  +
  +   REAL(ReKi),      ALLOCATABLE:: gp(:)
  +   REAL(ReKi),      ALLOCATABLE:: gw(:)
  +   REAL(ReKi),      ALLOCATABLE:: hhx(:)
  +   REAL(ReKi),      ALLOCATABLE:: hpx(:)
  +   REAL(ReKi),      ALLOCATABLE:: GLL_temp(:)
  +   REAL(ReKi),      ALLOCATABLE:: w_temp(:)
  +   REAL(ReKi),      ALLOCATABLE:: temp_Nvvv(:)
  +   REAL(ReKi),      ALLOCATABLE:: temp_Naaa(:)
      REAL(ReKi)                  :: uu0(6)
      REAL(ReKi)                  :: E10(3)
      REAL(ReKi)                  :: RR0(3,3)
  
positive.code:    INTEGER(IntKi)                  :: j
     INTEGER(IntKi)                  :: temp_id
     INTEGER(IntKi)                  :: allo_stat
     INTEGER(IntKi)          :: ErrStat2                     ! Temporary Error status
     CHARACTER(ErrMsgLen)    :: ErrMsg2                      ! Temporary Error message
     CHARACTER(*), PARAMETER :: RoutineName = 'BD_GenerateStaticElement'
  
     dof_elem = dof_node * node_elem
     rot_elem = (dof_node/2) * node_elem
  
negative.code:    END SUBROUTINE BD_GenerateStaticElement
  
     SUBROUTINE BD_StaticElementMatrix(Nuu0,Nuuu,Nrr0,Nrrr,Distr_GL,gravity,&
                                       EMass0_GL,EStif0_GL,ngp,node_elem,dof_node,elk,elf,&
                                       ErrStat,ErrMsg)
  
     REAL(ReKi),    INTENT(IN   ):: Nuu0(:)
     REAL(ReKi),    INTENT(IN   ):: Nuuu(:)
  