anchor.diff:     TYPE(BD_ConstraintStateType), INTENT(IN   )  :: z           ! Constraint states at t
      TYPE(BD_OtherStateType),      INTENT(INOUT)  :: OtherState  ! Other/optimization states
      TYPE(BD_OutputType),          INTENT(INOUT)  :: y           ! Outputs computed at t (Input only so that mesh con-
  -                                                                    !   nectivity information does not have to be recalculated)
  -   INTEGER(IntKi),                 INTENT(  OUT)  :: ErrStat     ! Error status of the operation
  -   CHARACTER(*),                   INTENT(  OUT)  :: ErrMsg      ! Error message if ErrStat /= ErrID_None
  -
  -   TYPE(BD_OtherStateType):: OS_tmp
  -   TYPE(BD_ContinuousStateType):: x_tmp
  -   TYPE(BD_InputType):: u_tmp
  -   INTEGER(IntKi):: i
  -   INTEGER(IntKi):: j
  -   INTEGER(IntKi):: temp_id
  -   INTEGER(IntKi):: temp_id2
  -   REAL(ReKi):: cc(3)
  -   REAL(ReKi):: cc0(3)
  -   REAL(ReKi):: temp_cc(3)
  -   REAL(ReKi):: temp_glb(3)
  -   REAL(ReKi):: temp_R(3,3)
  -   REAL(ReKi):: temp6(6)
  -   REAL(ReKi):: temp_Force(p%dof_total)
  -   REAL(ReKi):: temp_ReactionForce(6)
  -   INTEGER(IntKi)          :: ErrStat2                     ! Temporary Error status
  -   CHARACTER(ErrMsgLen)    :: ErrMsg2                      ! Temporary Error message
  -   CHARACTER(*), PARAMETER :: RoutineName = 'BD_CalcOutput'
  +                                                               !   nectivity information does not have to be recalculated)
  +   INTEGER(IntKi),               INTENT(  OUT)  :: ErrStat     ! Error status of the operation
  +   CHARACTER(*),                 INTENT(  OUT)  :: ErrMsg      ! Error message if ErrStat /= ErrID_None
  +
  +   TYPE(BD_OtherStateType)                      :: OS_tmp
  +   TYPE(BD_ContinuousStateType)                 :: x_tmp
  +   TYPE(BD_InputType)                           :: u_tmp
  +   INTEGER(IntKi)                               :: i
  +   INTEGER(IntKi)                               :: j
  +   INTEGER(IntKi)                               :: temp_id
  +   INTEGER(IntKi)                               :: temp_id2
  +   REAL(ReKi)                                   :: cc(3)
  +   REAL(ReKi)                                   :: cc0(3)
  +   REAL(ReKi)                                   :: temp_cc(3)
  +   REAL(ReKi)                                   :: temp_glb(3)
  +   REAL(ReKi)                                   :: temp_R(3,3)
  +   REAL(ReKi)                                   :: temp6(6)
  +   REAL(ReKi)                                   :: temp_Force(p%dof_total)
  +   REAL(ReKi)                                   :: temp_ReactionForce(6)
  +   INTEGER(IntKi)                               :: ErrStat2                     ! Temporary Error status
  +   CHARACTER(ErrMsgLen)                         :: ErrMsg2                      ! Temporary Error message
  +   CHARACTER(*), PARAMETER                      :: RoutineName = 'BD_CalcOutput'
      
      ! Initialize ErrStat
   
  
positive.code:        ENDDO
     ENDDO
  
     DEALLOCATE(gp)
     DEALLOCATE(gw)
     DEALLOCATE(hhx)
     DEALLOCATE(hpx)
     DEALLOCATE(GLL_temp)
     DEALLOCATE(w_temp)
  
     9999 IF(allo_stat/=0) THEN
              IF(ALLOCATED(gp))  DEALLOCATE(gp)
              IF(ALLOCATED(gw))  DEALLOCATE(gw)
              IF(ALLOCATED(hhx)) DEALLOCATE(hhx)
              IF(ALLOCATED(hpx)) DEALLOCATE(hpx)
              IF(ALLOCATED(GLL_temp)) DEALLOCATE(GLL_temp)
              IF(ALLOCATED(w_temp)) DEALLOCATE(w_temp)
          ENDIF
  
     END SUBROUTINE BD_StaticElementMatrixForce
  
  SUBROUTINE BD_GA2(t,n,u,utimes,p,x,xd,z,OtherState,ErrStat,ErrMsg)
  !-------------------------------------------------------
  
negative.code:    REAL(ReKi),        INTENT(IN   ):: gravity(:)
     TYPE(BD_InputType),INTENT(IN   ):: u
     INTEGER(IntKi),    INTENT(IN   ):: niter
     REAL(ReKi),        INTENT(IN   ):: tol
     INTEGER(IntKi),    INTENT(IN   ):: elem_total
     INTEGER(IntKi),    INTENT(IN   ):: node_elem
     INTEGER(IntKi),    INTENT(IN   ):: dof_node
  