module CDownHoleVariables
    use CDownHoleTypes
    ! use CStringConfigurationVariables
    ! use CDownHoleActions
    use CLog4
    implicit none    
    public
    !!!!!!!!!!!!!!!!!!!!!
    ! Outputs to user interface
    !!!!!!!!!!!!!!!!!!!!!
    type :: DownHoleType
        logical :: AnnDrillMud
        logical :: AnnCirculateMud
        
        integer :: AnnalusFluidsCount = 0
        integer :: StringFluidsCount = 0
        type(CFluid), allocatable :: AnnalusFluids(:) !, target
        type(CFluid), allocatable :: StringFluids(:)
        
        integer :: StringCount = 0
        type(CStringComponent), allocatable :: String(:)
        
        type(CBopElement), allocatable :: BopElements(:)
        
        real(8) :: DrillPipePressure
        real(8) :: CasingPressure
        real(8) :: ShoePressure
        real(8) :: BottomHolePressure
        real(8) :: FormationPressure
        real :: InfluxRate
        real :: KickVolume
        real :: SecondKickVolume
        real :: PermeabilityExposedHeight
        
        real(8) :: Density
        real(8) :: Pressure
        real(8) :: Temperature
        real(8) :: Height
        real(8) :: Volume
    end type DownHoleType
    type(DownHoleType):: DownHole
    contains         
end module CDownHoleVariables