anchor.diff:     INTEGER(IntKi)                  :: nelem
      INTEGER(IntKi)                  :: j
      INTEGER(IntKi)                  :: temp_id
  +   INTEGER(IntKi)                  :: temp_id2
      INTEGER(IntKi)                  :: ErrStat2                     ! Temporary Error status
      CHARACTER(ErrMsgLen)            :: ErrMsg2                      ! Temporary Error message
      CHARACTER(*), PARAMETER         :: RoutineName = 'BD_GenerateStaticElement'
  
positive.code:    INTEGER(IntKi)                  :: nelem
     INTEGER(IntKi)                  :: j
     INTEGER(IntKi)                  :: temp_id
     INTEGER(IntKi)                  :: ErrStat2                     ! Temporary Error status
     CHARACTER(ErrMsgLen)            :: ErrMsg2                      ! Temporary Error message
     CHARACTER(*),          PARAMETER:: RoutineName = 'BD_GenerateDynamicElementGA2'
  
negative.code:            CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
         IF(quadrature .EQ. 1) THEN
             temp_id = (nelem-1)*ngp + 1
             temp_id2 = (nelem-1)*ngp
         ELSEIF(quadrature .EQ. 2) THEN
             temp_id = (nelem-1)*ngp
             temp_id2= temp_id
         ENDIF
  
         DO j=1,ngp
             EStif0_GL(1:6,1:6,j) = Stif0(1:6,1:6,temp_id2+j)
             EMass0_GL(1:6,1:6,j) = Mass0(1:6,1:6,temp_id2+j)
             DistrLoad_GL(1:3,j) = u%DistrLoad%Force(1:3,temp_id+j)
             DistrLoad_GL(4:6,j) = u%DistrLoad%Moment(1:3,temp_id+j)
         ENDDO
  