@@ -1,10 +1,13 @@ | |||
################################################################################ | |||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio. | |||
################################################################################ | |||
/.vs/SimulationCore2/FileContentIndex | |||
/.vs/SimulationCore2/v17 | |||
/.vs | |||
/x64 | |||
/x64/Debug | |||
*.rar | |||
################################################################################ | |||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio. | |||
################################################################################ | |||
/.vs/SimulationCore2/FileContentIndex | |||
/.vs/SimulationCore2/v17 | |||
/.vs | |||
/x64 | |||
/x64/Debug | |||
*.rar | |||
/mod | |||
/obj | |||
./*.mod |
@@ -1,53 +1,53 @@ | |||
module CStringConfiguration | |||
use CStringConfigurationVariables | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine StringConfigurationToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: pitems,pitem,pbit,p | |||
integer:: i | |||
! 1. create new node | |||
call json%create_object(p,'StringConfiguration') | |||
call json%create_array(pitems,'StringConfigurationItems') | |||
! 2. add member of data type to new node | |||
do i=1,data%Configuration%StringConfiguration%StringConfigurationCount | |||
call json%create_object(pitem,'StringConfigurationItem') | |||
call json%add(pitem,"ComponentLength",data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentLength) | |||
call json%add(pitem,"ComponentType",data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentType) | |||
call json%add(pitem,"Grade",data%Configuration%StringConfiguration%StringConfigurations(i)%Grade) | |||
call json%add(pitem,"LengthPerJoint",data%Configuration%StringConfiguration%StringConfigurations(i)%LengthPerJoint) | |||
call json%add(pitem,"NominalId",data%Configuration%StringConfiguration%StringConfigurations(i)%NominalId) | |||
call json%add(pitem,"NominalOd",data%Configuration%StringConfiguration%StringConfigurations(i)%NominalOd) | |||
call json%add(pitem,"NominalToolJointOd",data%Configuration%StringConfiguration%StringConfigurations(i)%NominalToolJointOd) | |||
call json%add(pitem,"NumberOfJoint",data%Configuration%StringConfiguration%StringConfigurations(i)%NumberOfJoint) | |||
call json%add(pitem,"WeightPerLength",data%Configuration%StringConfiguration%StringConfigurations(i)%WeightPerLength) | |||
call json%add(pitems,pitem) | |||
end do | |||
call json%create_object(pbit,"BitDefenition") | |||
call json%add(pbit,"BitCodeHundreds",data%Configuration%StringConfiguration%BitDefinition%BitCodeHundreds) | |||
call json%add(pbit,"BitCodeOnes",data%Configuration%StringConfiguration%BitDefinition%BitCodeOnes) | |||
call json%add(pbit,"BitCodeTens",data%Configuration%StringConfiguration%BitDefinition%BitCodeTens) | |||
call json%add(pbit,"BitLength",data%Configuration%StringConfiguration%BitDefinition%BitLength) | |||
call json%add(pbit,"BitNozzleNo",data%Configuration%StringConfiguration%BitDefinition%BitNozzleNo) | |||
call json%add(pbit,"BitNozzleSize",data%Configuration%StringConfiguration%BitDefinition%BitNozzleSize) | |||
call json%add(pbit,"BitSize",data%Configuration%StringConfiguration%BitDefinition%BitSize) | |||
call json%add(pbit,"BitType",data%Configuration%StringConfiguration%BitDefinition%BitType) | |||
call json%add(pbit,"BitWeightPerLength",data%Configuration%StringConfiguration%BitDefinition%BitWeightPerLength) | |||
call json%add(pbit,"FloatValve",data%Configuration%StringConfiguration%BitDefinition%FloatValve) | |||
! call json%add(p,"StringConfigurationCount",dat%Configuration%StringConfiguration%StringConfigurationCount) | |||
! 3. add new node to parent | |||
call json%add(p,pitems) | |||
call json%add(p,pbit) | |||
call json%add(parent,p) | |||
end subroutine | |||
module CStringConfiguration | |||
use CStringConfigurationVariables | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine StringConfigurationToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: pitems,pitem,pbit,p | |||
integer:: i | |||
! 1. create new node | |||
call json%create_object(p,'StringConfiguration') | |||
call json%create_array(pitems,'StringConfigurationItems') | |||
! 2. add member of data type to new node | |||
do i=1,data%Configuration%StringConfiguration%StringConfigurationCount | |||
call json%create_object(pitem,'StringConfigurationItem') | |||
call json%add(pitem,"ComponentLength",data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentLength) | |||
call json%add(pitem,"ComponentType",data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentType) | |||
call json%add(pitem,"Grade",data%Configuration%StringConfiguration%StringConfigurations(i)%Grade) | |||
call json%add(pitem,"LengthPerJoint",data%Configuration%StringConfiguration%StringConfigurations(i)%LengthPerJoint) | |||
call json%add(pitem,"NominalId",data%Configuration%StringConfiguration%StringConfigurations(i)%NominalId) | |||
call json%add(pitem,"NominalOd",data%Configuration%StringConfiguration%StringConfigurations(i)%NominalOd) | |||
call json%add(pitem,"NominalToolJointOd",data%Configuration%StringConfiguration%StringConfigurations(i)%NominalToolJointOd) | |||
call json%add(pitem,"NumberOfJoint",data%Configuration%StringConfiguration%StringConfigurations(i)%NumberOfJoint) | |||
call json%add(pitem,"WeightPerLength",data%Configuration%StringConfiguration%StringConfigurations(i)%WeightPerLength) | |||
call json%add(pitems,pitem) | |||
end do | |||
call json%create_object(pbit,"BitDefenition") | |||
call json%add(pbit,"BitCodeHundreds",data%Configuration%StringConfiguration%BitDefinition%BitCodeHundreds) | |||
call json%add(pbit,"BitCodeOnes",data%Configuration%StringConfiguration%BitDefinition%BitCodeOnes) | |||
call json%add(pbit,"BitCodeTens",data%Configuration%StringConfiguration%BitDefinition%BitCodeTens) | |||
call json%add(pbit,"BitLength",data%Configuration%StringConfiguration%BitDefinition%BitLength) | |||
call json%add(pbit,"BitNozzleNo",data%Configuration%StringConfiguration%BitDefinition%BitNozzleNo) | |||
call json%add(pbit,"BitNozzleSize",data%Configuration%StringConfiguration%BitDefinition%BitNozzleSize) | |||
call json%add(pbit,"BitSize",data%Configuration%StringConfiguration%BitDefinition%BitSize) | |||
call json%add(pbit,"BitType",data%Configuration%StringConfiguration%BitDefinition%BitType) | |||
call json%add(pbit,"BitWeightPerLength",data%Configuration%StringConfiguration%BitDefinition%BitWeightPerLength) | |||
call json%add(pbit,"FloatValve",data%Configuration%StringConfiguration%BitDefinition%FloatValve) | |||
! call json%add(p,"StringConfigurationCount",dat%Configuration%StringConfiguration%StringConfigurationCount) | |||
! 3. add new node to parent | |||
call json%add(p,pitems) | |||
call json%add(p,pbit) | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CStringConfiguration |
@@ -1,53 +1,53 @@ | |||
module CStringConfigurationVariables | |||
! !@use ConfigurationVariables, only: Configuration | |||
implicit none | |||
public | |||
!constants | |||
integer :: Bit_ComponentType = 0 | |||
integer :: Stabilizer_ComponentType = 1 | |||
integer :: Collar_ComponentType = 2 | |||
integer :: DrillPipe_ComponentType = 3 | |||
integer :: Heavyweight_ComponentType = 4 | |||
integer :: Cone_BitType = 0 | |||
integer :: PDC_BitType = 1 | |||
integer :: Rock_BitType = 2 | |||
! types | |||
! Pipe Items in String Array | |||
type, bind(c), public :: CStringItem | |||
integer :: ComponentType | |||
real(8) :: NumberOfJoint | |||
real(8) :: LengthPerJoint | |||
real(8) :: NominalOd | |||
real(8) :: NominalId | |||
real(8) :: WeightPerLength | |||
real(8) :: ComponentLength | |||
real(8) :: NominalToolJointOd | |||
character(1) :: Grade | |||
end type CStringItem | |||
! types | |||
! Pipe Items in String Array | |||
type, bind(c), public :: CBitInfo | |||
integer :: BitType | |||
real(8) :: BitSize | |||
integer :: BitCodeHundreds | |||
integer :: BitCodeTens | |||
integer :: BitCodeOnes | |||
real(8) :: BitNozzleSize | |||
real(8) :: BitLength | |||
real(8) :: BitWeightPerLength | |||
integer :: BitNozzleNo | |||
logical :: FloatValve | |||
end type CBitInfo | |||
Type :: StringConfigurationType | |||
integer :: StringConfigurationCount = 0 | |||
type(CStringItem), allocatable :: StringConfigurations(:) | |||
type(CBitInfo) :: BitDefinition | |||
End type StringConfigurationType | |||
contains | |||
module CStringConfigurationVariables | |||
! !@use ConfigurationVariables, only: Configuration | |||
implicit none | |||
public | |||
!constants | |||
integer :: Bit_ComponentType = 0 | |||
integer :: Stabilizer_ComponentType = 1 | |||
integer :: Collar_ComponentType = 2 | |||
integer :: DrillPipe_ComponentType = 3 | |||
integer :: Heavyweight_ComponentType = 4 | |||
integer :: Cone_BitType = 0 | |||
integer :: PDC_BitType = 1 | |||
integer :: Rock_BitType = 2 | |||
! types | |||
! Pipe Items in String Array | |||
type, bind(c), public :: CStringItem | |||
integer :: ComponentType | |||
real(8) :: NumberOfJoint | |||
real(8) :: LengthPerJoint | |||
real(8) :: NominalOd | |||
real(8) :: NominalId | |||
real(8) :: WeightPerLength | |||
real(8) :: ComponentLength | |||
real(8) :: NominalToolJointOd | |||
character(1) :: Grade | |||
end type CStringItem | |||
! types | |||
! Pipe Items in String Array | |||
type, bind(c), public :: CBitInfo | |||
integer :: BitType | |||
real(8) :: BitSize | |||
integer :: BitCodeHundreds | |||
integer :: BitCodeTens | |||
integer :: BitCodeOnes | |||
real(8) :: BitNozzleSize | |||
real(8) :: BitLength | |||
real(8) :: BitWeightPerLength | |||
integer :: BitNozzleNo | |||
logical :: FloatValve | |||
end type CBitInfo | |||
Type :: StringConfigurationType | |||
integer :: StringConfigurationCount = 0 | |||
type(CStringItem), allocatable :: StringConfigurations(:) | |||
type(CBitInfo) :: BitDefinition | |||
End type StringConfigurationType | |||
contains | |||
end module CStringConfigurationVariables |
@@ -1,82 +1,82 @@ | |||
module CMudPropertiesVariables | |||
use CIActionReference | |||
!**use CDoubleEventHandlerCollection | |||
implicit none | |||
public | |||
!constants | |||
integer, parameter :: WaterBase_MudType = 0 | |||
integer, parameter :: OilBase_MudType = 1 | |||
integer, parameter :: PowerLaw_RheologyModel = 0 | |||
integer, parameter :: Bingham_RheologyModel = 1 | |||
integer, parameter :: Newtonian_RheologyModel = 2 | |||
INTEGER, PARAMETER :: Herschel_Bulkley_RheologyModel = 3 | |||
! variables | |||
Type::MudPropertiesType | |||
integer :: ActiveMudType | |||
integer :: ActiveRheologyModel | |||
real(8) :: ActiveMudVolume | |||
real(8) :: ActiveMudVolumeGal | |||
real(8) :: ActiveDensity | |||
real(8) :: ActivePlasticViscosity | |||
real(8) :: ActiveYieldPoint | |||
real(8) :: ActiveThetaThreeHundred | |||
real(8) :: ActiveThetaSixHundred | |||
integer :: ReserveMudType | |||
real(8) :: ReserveMudVolume | |||
real(8) :: ReserveMudVolumeGal | |||
real(8) :: ReserveDensity | |||
real(8) :: ReservePlasticViscosity | |||
real(8) :: ReserveYieldPoint | |||
real(8) :: ReserveThetaThreeHundred | |||
real(8) :: ReserveThetaSixHundred | |||
real(8) :: ActiveTotalTankCapacity | |||
real(8) :: ActiveTotalTankCapacityGal | |||
real(8) :: ActiveSettledContents | |||
real(8) :: ActiveSettledContentsGal | |||
real(8) :: ActiveTotalContents | |||
real(8) :: ActiveTotalContentsGal | |||
logical :: ActiveAutoDensity | |||
real(8) :: InitialTripTankMudVolume | |||
real(8) :: InitialTripTankMudVolumeGal | |||
real(8) :: PedalFlowMeter | |||
End type MudPropertiesType | |||
! Type(MudPropertiesType)::MudProperties | |||
! subroutine SubscribeActiveMudVolume(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeActiveMudVolume | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeActiveMudVolume' :: SubscribeActiveMudVolume | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ActiveMudVolumePtr => a | |||
! end subroutine | |||
! subroutine SubscribeActiveDensity(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeActiveDensity | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeActiveDensity' :: SubscribeActiveDensity | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ActiveDensityPtr => a | |||
! end subroutine | |||
! subroutine SubscribeReserveMudVolume(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeReserveMudVolume | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeReserveMudVolume' :: SubscribeReserveMudVolume | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ReserveMudVolumePtr => a | |||
! end subroutine | |||
! subroutine SubscribeReserveDensity(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeReserveDensity | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeReserveDensity' :: SubscribeReserveDensity | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ReserveDensityPtr => a | |||
! end subroutine | |||
module CMudPropertiesVariables | |||
use CIActionReference | |||
!**use CDoubleEventHandlerCollection | |||
implicit none | |||
public | |||
!constants | |||
integer, parameter :: WaterBase_MudType = 0 | |||
integer, parameter :: OilBase_MudType = 1 | |||
integer, parameter :: PowerLaw_RheologyModel = 0 | |||
integer, parameter :: Bingham_RheologyModel = 1 | |||
integer, parameter :: Newtonian_RheologyModel = 2 | |||
INTEGER, PARAMETER :: Herschel_Bulkley_RheologyModel = 3 | |||
! variables | |||
Type::MudPropertiesType | |||
integer :: ActiveMudType | |||
integer :: ActiveRheologyModel | |||
real(8) :: ActiveMudVolume | |||
real(8) :: ActiveMudVolumeGal | |||
real(8) :: ActiveDensity | |||
real(8) :: ActivePlasticViscosity | |||
real(8) :: ActiveYieldPoint | |||
real(8) :: ActiveThetaThreeHundred | |||
real(8) :: ActiveThetaSixHundred | |||
integer :: ReserveMudType | |||
real(8) :: ReserveMudVolume | |||
real(8) :: ReserveMudVolumeGal | |||
real(8) :: ReserveDensity | |||
real(8) :: ReservePlasticViscosity | |||
real(8) :: ReserveYieldPoint | |||
real(8) :: ReserveThetaThreeHundred | |||
real(8) :: ReserveThetaSixHundred | |||
real(8) :: ActiveTotalTankCapacity | |||
real(8) :: ActiveTotalTankCapacityGal | |||
real(8) :: ActiveSettledContents | |||
real(8) :: ActiveSettledContentsGal | |||
real(8) :: ActiveTotalContents | |||
real(8) :: ActiveTotalContentsGal | |||
logical :: ActiveAutoDensity | |||
real(8) :: InitialTripTankMudVolume | |||
real(8) :: InitialTripTankMudVolumeGal | |||
real(8) :: PedalFlowMeter | |||
End type MudPropertiesType | |||
! Type(MudPropertiesType)::MudProperties | |||
! subroutine SubscribeActiveMudVolume(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeActiveMudVolume | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeActiveMudVolume' :: SubscribeActiveMudVolume | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ActiveMudVolumePtr => a | |||
! end subroutine | |||
! subroutine SubscribeActiveDensity(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeActiveDensity | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeActiveDensity' :: SubscribeActiveDensity | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ActiveDensityPtr => a | |||
! end subroutine | |||
! subroutine SubscribeReserveMudVolume(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeReserveMudVolume | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeReserveMudVolume' :: SubscribeReserveMudVolume | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ReserveMudVolumePtr => a | |||
! end subroutine | |||
! subroutine SubscribeReserveDensity(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeReserveDensity | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeReserveDensity' :: SubscribeReserveDensity | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ReserveDensityPtr => a | |||
! end subroutine | |||
end module CMudPropertiesVariables |
@@ -1,33 +1,33 @@ | |||
module CFormation | |||
use CFormationVariables | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
contains | |||
subroutine FormationToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pform | |||
integer :: i | |||
! 1. create new node | |||
call json%create_array(p,'Fromations') | |||
do i=1,data%Configuration%Formation%Count | |||
call json%create_object(pform,'') | |||
call json%add(pform,"Abrasiveness",data%Configuration%Formation%Formations(i)%Abrasiveness) | |||
call json%add(pform,"Drillablity",data%Configuration%Formation%Formations(i)%Drillablity) | |||
call json%add(pform,"PorePressureGradient",data%Configuration%Formation%Formations(i)%PorePressureGradient) | |||
call json%add(pform,"Thickness",data%Configuration%Formation%Formations(i)%Thickness) | |||
call json%add(pform,"ThresholdWeight",data%Configuration%Formation%Formations(i)%ThresholdWeight) | |||
call json%add(pform,"Top",data%Configuration%Formation%Formations(i)%Top) | |||
call json%add(p,pform) | |||
end do | |||
call json%add(parent,p) | |||
end subroutine | |||
module CFormation | |||
use CFormationVariables | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
contains | |||
subroutine FormationToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pform | |||
integer :: i | |||
! 1. create new node | |||
call json%create_array(p,'Formations') | |||
do i=1,data%Configuration%Formation%Count | |||
call json%create_object(pform,'') | |||
call json%add(pform,"Abrasiveness",data%Configuration%Formation%Formations(i)%Abrasiveness) | |||
call json%add(pform,"Drillablity",data%Configuration%Formation%Formations(i)%Drillablity) | |||
call json%add(pform,"PorePressureGradient",data%Configuration%Formation%Formations(i)%PorePressureGradient) | |||
call json%add(pform,"Thickness",data%Configuration%Formation%Formations(i)%Thickness) | |||
call json%add(pform,"ThresholdWeight",data%Configuration%Formation%Formations(i)%ThresholdWeight) | |||
call json%add(pform,"Top",data%Configuration%Formation%Formations(i)%Top) | |||
call json%add(p,pform) | |||
end do | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CFormation |
@@ -1,21 +1,21 @@ | |||
module CFormationVariables | |||
! !@use ConfigurationVariables, only: Configuration | |||
implicit none | |||
public | |||
! types | |||
! Pipe Items in String Array | |||
type, bind(c), public :: CFormationItem | |||
real(8) :: Top | |||
real(8) :: Thickness | |||
real(8) :: Drillablity | |||
real(8) :: Abrasiveness | |||
real(8) :: ThresholdWeight | |||
real(8) :: PorePressureGradient | |||
end type CFormationItem | |||
Type::FormationType | |||
integer :: Count = 0 | |||
type(CFormationItem), allocatable :: Formations(:) | |||
End type FormationType | |||
module CFormationVariables | |||
! !@use ConfigurationVariables, only: Configuration | |||
implicit none | |||
public | |||
! types | |||
! Pipe Items in String Array | |||
type, bind(c), public :: CFormationItem | |||
real(8) :: Top | |||
real(8) :: Thickness | |||
real(8) :: Drillablity | |||
real(8) :: Abrasiveness | |||
real(8) :: ThresholdWeight | |||
real(8) :: PorePressureGradient | |||
end type CFormationItem | |||
Type::FormationType | |||
integer :: Count = 0 | |||
type(CFormationItem), allocatable :: Formations(:) | |||
End type FormationType | |||
end module CFormationVariables |
@@ -1,36 +1,36 @@ | |||
module CReservoir | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
contains | |||
subroutine ReservoirToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Reservoir') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"AutoMigrationRate",data%Configuration%Reservoir%AutoMigrationRate) | |||
call json%add(p,"FluidGradient",data%Configuration%Reservoir%FluidGradient) | |||
call json%add(p,"FluidType",data%Configuration%Reservoir%FluidType) | |||
call json%add(p,"FluidViscosity",data%Configuration%Reservoir%FluidViscosity) | |||
call json%add(p,"FormationNo",data%Configuration%Reservoir%FormationNo) | |||
call json%add(p,"FormationPermeability",data%Configuration%Reservoir%FormationPermeability) | |||
call json%add(p,"FormationTop",data%Configuration%Reservoir%FormationTop) | |||
call json%add(p,"GeothermalGradient",data%Configuration%Reservoir%GeothermalGradient) | |||
call json%add(p,"InactiveInflux",data%Configuration%Reservoir%InactiveInflux) | |||
call json%add(p,"IsAutoMigrationRateSelected",data%Configuration%Reservoir%IsAutoMigrationRateSelected) | |||
call json%add(p,"MakeKickSinglePacket",data%Configuration%Reservoir%MakeKickSinglePacket) | |||
call json%add(p,"PressureGradient",data%Configuration%Reservoir%PressureGradient) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
module CReservoir | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
contains | |||
subroutine ReservoirToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Reservoir') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"AutoMigrationRate",data%Configuration%Reservoir%AutoMigrationRate) | |||
call json%add(p,"FluidGradient",data%Configuration%Reservoir%FluidGradient) | |||
call json%add(p,"FluidType",data%Configuration%Reservoir%FluidType) | |||
call json%add(p,"FluidViscosity",data%Configuration%Reservoir%FluidViscosity) | |||
call json%add(p,"FormationNo",data%Configuration%Reservoir%FormationNo) | |||
call json%add(p,"FormationPermeability",data%Configuration%Reservoir%FormationPermeability) | |||
call json%add(p,"FormationTop",data%Configuration%Reservoir%FormationTop) | |||
call json%add(p,"GeothermalGradient",data%Configuration%Reservoir%GeothermalGradient) | |||
call json%add(p,"InactiveInflux",data%Configuration%Reservoir%InactiveInflux) | |||
call json%add(p,"IsAutoMigrationRateSelected",data%Configuration%Reservoir%IsAutoMigrationRateSelected) | |||
call json%add(p,"MakeKickSinglePacket",data%Configuration%Reservoir%MakeKickSinglePacket) | |||
call json%add(p,"PressureGradient",data%Configuration%Reservoir%PressureGradient) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CReservoir |
@@ -1,25 +1,25 @@ | |||
module CReservoirVariables | |||
implicit none | |||
public | |||
!constants | |||
integer :: Gas_FluidType = 0 | |||
integer :: Oil_FluidType = 1 | |||
integer :: Water_FluidType = 2 | |||
Type :: ReservoirType | |||
! variables | |||
integer :: FormationNo | |||
real(8) :: FormationTop | |||
real(8) :: PressureGradient | |||
real(8) :: FormationPermeability | |||
real(8) :: GeothermalGradient | |||
integer :: FluidType | |||
real(8) :: FluidGradient | |||
real(8) :: FluidViscosity | |||
logical :: InactiveInflux | |||
logical :: IsAutoMigrationRateSelected | |||
real(8) :: AutoMigrationRate | |||
logical :: MakeKickSinglePacket | |||
End type ReservoirType | |||
Type(ReservoirType)::Reservoir | |||
module CReservoirVariables | |||
implicit none | |||
public | |||
!constants | |||
! integer :: Gas_FluidType = 0 | |||
! integer :: Oil_FluidType = 1 | |||
! integer :: Water_FluidType = 2 | |||
Type :: ReservoirType | |||
! variables | |||
integer :: FormationNo | |||
real(8) :: FormationTop | |||
real(8) :: PressureGradient | |||
real(8) :: FormationPermeability | |||
real(8) :: GeothermalGradient | |||
integer :: FluidType | |||
real(8) :: FluidGradient | |||
real(8) :: FluidViscosity | |||
logical :: InactiveInflux | |||
logical :: IsAutoMigrationRateSelected | |||
real(8) :: AutoMigrationRate | |||
logical :: MakeKickSinglePacket | |||
End type ReservoirType | |||
Type(ReservoirType)::Reservoir | |||
end module CReservoirVariables |
@@ -1,30 +1,30 @@ | |||
module CShoe | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine ShoeToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Shoe') | |||
! 2. add member of data type to new node | |||
call json%add(p,"Breakdown",data%Configuration%Shoe%Breakdown) | |||
call json%add(p,"FormationNo",data%Configuration%Shoe%FormationNo) | |||
call json%add(p,"FracturePropagation",data%Configuration%Shoe%FracturePropagation) | |||
call json%add(p,"InactiveFracture",data%Configuration%Shoe%InactiveFracture) | |||
call json%add(p,"LeakOff",data%Configuration%Shoe%LeakOff) | |||
call json%add(p,"ShoeDepth",data%Configuration%Shoe%ShoeDepth) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
module CShoe | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine ShoeToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Shoe') | |||
! 2. add member of data type to new node | |||
call json%add(p,"Breakdown",data%Configuration%Shoe%Breakdown) | |||
call json%add(p,"FormationNo",data%Configuration%Shoe%FormationNo) | |||
call json%add(p,"FracturePropagation",data%Configuration%Shoe%FracturePropagation) | |||
call json%add(p,"InactiveFracture",data%Configuration%Shoe%InactiveFracture) | |||
call json%add(p,"LeakOff",data%Configuration%Shoe%LeakOff) | |||
call json%add(p,"ShoeDepth",data%Configuration%Shoe%ShoeDepth) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CShoe |
@@ -1,14 +1,14 @@ | |||
module CShoeVariables | |||
implicit none | |||
public | |||
! variables | |||
Type::ShoeType | |||
integer :: FormationNo | |||
real(8) :: ShoeDepth | |||
real(8) :: LeakOff | |||
real(8) :: Breakdown | |||
real(8) :: FracturePropagation | |||
logical :: InactiveFracture | |||
End type ShoeType | |||
Type(ShoeType)::Shoe | |||
module CShoeVariables | |||
implicit none | |||
public | |||
! variables | |||
Type::ShoeType | |||
integer :: FormationNo | |||
real(8) :: ShoeDepth | |||
real(8) :: LeakOff | |||
real(8) :: Breakdown | |||
real(8) :: FracturePropagation | |||
logical :: InactiveFracture | |||
End type ShoeType | |||
Type(ShoeType)::Shoe | |||
end module CShoeVariables |
@@ -1,91 +1,91 @@ | |||
module MudPropertiesModule | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
contains | |||
subroutine MudPropertiesToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Mud') | |||
! 2. add member of data type to new node | |||
call json%add(p,"ActiveMudType",data%Configuration%Mud%ActiveMudType) | |||
call json%add(p,"ActiveRheologyModel",data%Configuration%Mud%ActiveRheologyModel) | |||
call json%add(p,"ActiveMudVolume",data%Configuration%Mud%ActiveMudVolume) | |||
call json%add(p,"ActiveMudVolumeGal",data%Configuration%Mud%ActiveMudVolumeGal) | |||
call json%add(p,"ActiveDensity",data%Configuration%Mud%ActiveDensity) | |||
call json%add(p,"ActivePlasticViscosity",data%Configuration%Mud%ActivePlasticViscosity) | |||
call json%add(p,"ActiveYieldPoint",data%Configuration%Mud%ActiveYieldPoint) | |||
call json%add(p,"ActiveThetaThreeHundred",data%Configuration%Mud%ActiveThetaThreeHundred) | |||
call json%add(p,"ActiveThetaSixHundred",data%Configuration%Mud%ActiveThetaSixHundred) | |||
call json%add(p,"ReserveMudType",data%Configuration%Mud%ReserveMudType) | |||
call json%add(p,"ReserveMudVolume",data%Configuration%Mud%ReserveMudVolume) | |||
call json%add(p,"ReserveMudVolumeGal",data%Configuration%Mud%ReserveMudVolumeGal) | |||
call json%add(p,"ReserveDensity",data%Configuration%Mud%ReserveDensity) | |||
call json%add(p,"ReservePlasticViscosity",data%Configuration%Mud%ReservePlasticViscosity) | |||
call json%add(p,"ReserveYieldPoint",data%Configuration%Mud%ReserveYieldPoint) | |||
call json%add(p,"ReserveThetaThreeHundred",data%Configuration%Mud%ReserveThetaThreeHundred) | |||
call json%add(p,"ReserveThetaSixHundred",data%Configuration%Mud%ReserveThetaSixHundred) | |||
call json%add(p,"ActiveTotalTankCapacity",data%Configuration%Mud%ActiveTotalTankCapacity) | |||
call json%add(p,"ActiveTotalTankCapacityGal",data%Configuration%Mud%ActiveTotalTankCapacityGal) | |||
call json%add(p,"ActiveSettledContents",data%Configuration%Mud%ActiveSettledContents) | |||
call json%add(p,"ActiveSettledContentsGal",data%Configuration%Mud%ActiveSettledContentsGal) | |||
call json%add(p,"ActiveTotalContents",data%Configuration%Mud%ActiveTotalContents) | |||
call json%add(p,"ActiveTotalContentsGal",data%Configuration%Mud%ActiveTotalContentsGal) | |||
call json%add(p,"ActiveAutoDensity",data%Configuration%Mud%ActiveAutoDensity) | |||
call json%add(p,"InitialTripTankMudVolume",data%Configuration%Mud%InitialTripTankMudVolume) | |||
call json%add(p,"InitialTripTankMudVolumeGal",data%Configuration%Mud%InitialTripTankMudVolumeGal) | |||
call json%add(p,"PedalFlowMeter",data%Configuration%Mud%PedalFlowMeter) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine Set_ActiveMudVolume_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ActiveMudVolume == v) return | |||
#endif | |||
data%Configuration%Mud%ActiveMudVolume = v | |||
! if(associated(ActiveMudVolumePtr)) call ActiveMudVolumePtr(data%Configuration%Mud%ActiveMudVolume) | |||
end subroutine | |||
subroutine Set_ActiveDensity_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ActiveDensity == v) return | |||
#endif | |||
data%Configuration%Mud%ActiveDensity = v | |||
! if(associated(ActiveDensityPtr)) call ActiveDensityPtr(data%Configuration%Mud%ActiveDensity) | |||
end subroutine | |||
subroutine Set_ReserveMudVolume_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ReserveMudVolume == v) return | |||
#endif | |||
data%Configuration%Mud%ReserveMudVolume = v | |||
! if(associated(ReserveMudVolumePtr)) call ReserveMudVolumePtr(data%Configuration%Mud%ReserveMudVolume) | |||
end subroutine | |||
subroutine Set_ReserveDensity_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ReserveDensity == v) return | |||
#endif | |||
data%Configuration%Mud%ReserveDensity = v | |||
! if(associated(ReserveDensityPtr)) call ReserveDensityPtr(data%Configuration%Mud%ReserveDensity) | |||
end subroutine | |||
module MudPropertiesModule | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
contains | |||
subroutine MudPropertiesToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Mud') | |||
! 2. add member of data type to new node | |||
call json%add(p,"ActiveMudType",data%Configuration%Mud%ActiveMudType) | |||
call json%add(p,"ActiveRheologyModel",data%Configuration%Mud%ActiveRheologyModel) | |||
call json%add(p,"ActiveMudVolume",data%Configuration%Mud%ActiveMudVolume) | |||
call json%add(p,"ActiveMudVolumeGal",data%Configuration%Mud%ActiveMudVolumeGal) | |||
call json%add(p,"ActiveDensity",data%Configuration%Mud%ActiveDensity) | |||
call json%add(p,"ActivePlasticViscosity",data%Configuration%Mud%ActivePlasticViscosity) | |||
call json%add(p,"ActiveYieldPoint",data%Configuration%Mud%ActiveYieldPoint) | |||
call json%add(p,"ActiveThetaThreeHundred",data%Configuration%Mud%ActiveThetaThreeHundred) | |||
call json%add(p,"ActiveThetaSixHundred",data%Configuration%Mud%ActiveThetaSixHundred) | |||
call json%add(p,"ReserveMudType",data%Configuration%Mud%ReserveMudType) | |||
call json%add(p,"ReserveMudVolume",data%Configuration%Mud%ReserveMudVolume) | |||
call json%add(p,"ReserveMudVolumeGal",data%Configuration%Mud%ReserveMudVolumeGal) | |||
call json%add(p,"ReserveDensity",data%Configuration%Mud%ReserveDensity) | |||
call json%add(p,"ReservePlasticViscosity",data%Configuration%Mud%ReservePlasticViscosity) | |||
call json%add(p,"ReserveYieldPoint",data%Configuration%Mud%ReserveYieldPoint) | |||
call json%add(p,"ReserveThetaThreeHundred",data%Configuration%Mud%ReserveThetaThreeHundred) | |||
call json%add(p,"ReserveThetaSixHundred",data%Configuration%Mud%ReserveThetaSixHundred) | |||
call json%add(p,"ActiveTotalTankCapacity",data%Configuration%Mud%ActiveTotalTankCapacity) | |||
call json%add(p,"ActiveTotalTankCapacityGal",data%Configuration%Mud%ActiveTotalTankCapacityGal) | |||
call json%add(p,"ActiveSettledContents",data%Configuration%Mud%ActiveSettledContents) | |||
call json%add(p,"ActiveSettledContentsGal",data%Configuration%Mud%ActiveSettledContentsGal) | |||
call json%add(p,"ActiveTotalContents",data%Configuration%Mud%ActiveTotalContents) | |||
call json%add(p,"ActiveTotalContentsGal",data%Configuration%Mud%ActiveTotalContentsGal) | |||
call json%add(p,"ActiveAutoDensity",data%Configuration%Mud%ActiveAutoDensity) | |||
call json%add(p,"InitialTripTankMudVolume",data%Configuration%Mud%InitialTripTankMudVolume) | |||
call json%add(p,"InitialTripTankMudVolumeGal",data%Configuration%Mud%InitialTripTankMudVolumeGal) | |||
call json%add(p,"PedalFlowMeter",data%Configuration%Mud%PedalFlowMeter) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine Set_ActiveMudVolume_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ActiveMudVolume == v) return | |||
#endif | |||
data%Configuration%Mud%ActiveMudVolume = v | |||
! if(associated(ActiveMudVolumePtr)) call ActiveMudVolumePtr(data%Configuration%Mud%ActiveMudVolume) | |||
end subroutine | |||
subroutine Set_ActiveDensity_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ActiveDensity == v) return | |||
#endif | |||
data%Configuration%Mud%ActiveDensity = v | |||
! if(associated(ActiveDensityPtr)) call ActiveDensityPtr(data%Configuration%Mud%ActiveDensity) | |||
end subroutine | |||
subroutine Set_ReserveMudVolume_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ReserveMudVolume == v) return | |||
#endif | |||
data%Configuration%Mud%ReserveMudVolume = v | |||
! if(associated(ReserveMudVolumePtr)) call ReserveMudVolumePtr(data%Configuration%Mud%ReserveMudVolume) | |||
end subroutine | |||
subroutine Set_ReserveDensity_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ReserveDensity == v) return | |||
#endif | |||
data%Configuration%Mud%ReserveDensity = v | |||
! if(associated(ReserveDensityPtr)) call ReserveDensityPtr(data%Configuration%Mud%ReserveDensity) | |||
end subroutine | |||
end module MudPropertiesModule |
@@ -1,31 +1,31 @@ | |||
module CAccumulator | |||
use SimulationVariables | |||
! use CAccumulatorVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine AccumulatorToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
call json%create_object(p,'Accumulator') | |||
call json%add(p,'AccumulatorMinimumOperatingPressure',data%Configuration%Accumulator%AccumulatorMinimumOperatingPressure) | |||
call json%add(p,'AccumulatorSystemSize',data%Configuration%Accumulator%AccumulatorSystemSize) | |||
call json%add(p,'AirPlungerPumpOutput',data%Configuration%Accumulator%AirPlungerPumpOutput) | |||
call json%add(p,'ElectricPumpOutput',data%Configuration%Accumulator%ElectricPumpOutput) | |||
call json%add(p,'NumberOfBottels',data%Configuration%Accumulator%NumberOfBottels) | |||
call json%add(p,'OilTankVolume',data%Configuration%Accumulator%OilTankVolume) | |||
call json%add(p,'PrechargePressure',data%Configuration%Accumulator%PrechargePressure) | |||
call json%add(p,'StartPressure',data%Configuration%Accumulator%StartPressure) | |||
call json%add(p,'StartPressure2',data%Configuration%Accumulator%StartPressure2) | |||
call json%add(p,'StopPressure',data%Configuration%Accumulator%StopPressure) | |||
call json%add(p,'StopPressure2',data%Configuration%Accumulator%StopPressure2) | |||
call json%add(parent,p) | |||
end subroutine | |||
module CAccumulator | |||
use SimulationVariables | |||
! use CAccumulatorVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine AccumulatorToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
call json%create_object(p,'Accumulator') | |||
call json%add(p,'AccumulatorMinimumOperatingPressure',data%Configuration%Accumulator%AccumulatorMinimumOperatingPressure) | |||
call json%add(p,'AccumulatorSystemSize',data%Configuration%Accumulator%AccumulatorSystemSize) | |||
call json%add(p,'AirPlungerPumpOutput',data%Configuration%Accumulator%AirPlungerPumpOutput) | |||
call json%add(p,'ElectricPumpOutput',data%Configuration%Accumulator%ElectricPumpOutput) | |||
call json%add(p,'NumberOfBottels',data%Configuration%Accumulator%NumberOfBottels) | |||
call json%add(p,'OilTankVolume',data%Configuration%Accumulator%OilTankVolume) | |||
call json%add(p,'PrechargePressure',data%Configuration%Accumulator%PrechargePressure) | |||
call json%add(p,'StartPressure',data%Configuration%Accumulator%StartPressure) | |||
call json%add(p,'StartPressure2',data%Configuration%Accumulator%StartPressure2) | |||
call json%add(p,'StopPressure',data%Configuration%Accumulator%StopPressure) | |||
call json%add(p,'StopPressure2',data%Configuration%Accumulator%StopPressure2) | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CAccumulator |
@@ -1,18 +1,18 @@ | |||
module CAccumulatorVariables | |||
implicit none | |||
public | |||
Type:: AccumulatorType | |||
integer :: NumberOfBottels | |||
real(8) :: AccumulatorSystemSize | |||
real(8) :: OilTankVolume | |||
real(8) :: PrechargePressure | |||
real(8) :: AccumulatorMinimumOperatingPressure | |||
real(8) :: ElectricPumpOutput | |||
real(8) :: StartPressure | |||
real(8) :: StopPressure | |||
real(8) :: AirPlungerPumpOutput | |||
real(8) :: StartPressure2 | |||
real(8) :: StopPressure2 | |||
End Type AccumulatorType | |||
! Type(AccumulatorType)::Accumulator | |||
module CAccumulatorVariables | |||
implicit none | |||
public | |||
Type:: AccumulatorType | |||
integer :: NumberOfBottels | |||
real(8) :: AccumulatorSystemSize | |||
real(8) :: OilTankVolume | |||
real(8) :: PrechargePressure | |||
real(8) :: AccumulatorMinimumOperatingPressure | |||
real(8) :: ElectricPumpOutput | |||
real(8) :: StartPressure | |||
real(8) :: StopPressure | |||
real(8) :: AirPlungerPumpOutput | |||
real(8) :: StartPressure2 | |||
real(8) :: StopPressure2 | |||
End Type AccumulatorType | |||
! Type(AccumulatorType)::Accumulator | |||
end module CAccumulatorVariables |
@@ -1,45 +1,45 @@ | |||
module CBopStack | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine BopStackToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'BopStack') | |||
! 2. add member of data type to new node | |||
call json%add(p,"AboveAnnularHeight",data%Configuration%BopStack%AboveAnnularHeight) | |||
call json%add(p,"AnnularPreventerClose",data%Configuration%BopStack%AnnularPreventerClose) | |||
call json%add(p,"AnnularPreventerHeight",data%Configuration%BopStack%AnnularPreventerHeight) | |||
call json%add(p,"AnnularPreventerOpen",data%Configuration%BopStack%AnnularPreventerOpen) | |||
call json%add(p,"AnnularStringDrag",data%Configuration%BopStack%AnnularStringDrag) | |||
call json%add(p,"BlindRamClose",data%Configuration%BopStack%BlindRamClose) | |||
call json%add(p,"BlindRamHeight",data%Configuration%BopStack%BlindRamHeight) | |||
call json%add(p,"BlindRamOpen",data%Configuration%BopStack%BlindRamOpen) | |||
call json%add(p,"ChokeClose",data%Configuration%BopStack%ChokeClose) | |||
call json%add(p,"ChokeLineId",data%Configuration%BopStack%ChokeLineId) | |||
call json%add(p,"ChokeLineLength",data%Configuration%BopStack%ChokeLineLength) | |||
call json%add(p,"ChokeOpen",data%Configuration%BopStack%ChokeOpen) | |||
call json%add(p,"GroundLevel",data%Configuration%BopStack%GroundLevel) | |||
call json%add(p,"KillClose",data%Configuration%BopStack%KillClose) | |||
call json%add(p,"KillHeight",data%Configuration%BopStack%KillHeight) | |||
call json%add(p,"KillOpen",data%Configuration%BopStack%KillOpen) | |||
call json%add(p,"LowerRamClose",data%Configuration%BopStack%LowerRamClose) | |||
call json%add(p,"LowerRamHeight",data%Configuration%BopStack%LowerRamHeight) | |||
call json%add(p,"LowerRamOpen",data%Configuration%BopStack%LowerRamOpen) | |||
call json%add(p,"RamStringDrag",data%Configuration%BopStack%RamStringDrag) | |||
call json%add(p,"UpperRamClose",data%Configuration%BopStack%UpperRamClose) | |||
call json%add(p,"UpperRamHeight",data%Configuration%BopStack%UpperRamHeight) | |||
call json%add(p,"UpperRamOpen",data%Configuration%BopStack%UpperRamOpen) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
module CBopStack | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine BopStackToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'BopStack') | |||
! 2. add member of data type to new node | |||
call json%add(p,"AboveAnnularHeight",data%Configuration%BopStack%AboveAnnularHeight) | |||
call json%add(p,"AnnularPreventerClose",data%Configuration%BopStack%AnnularPreventerClose) | |||
call json%add(p,"AnnularPreventerHeight",data%Configuration%BopStack%AnnularPreventerHeight) | |||
call json%add(p,"AnnularPreventerOpen",data%Configuration%BopStack%AnnularPreventerOpen) | |||
call json%add(p,"AnnularStringDrag",data%Configuration%BopStack%AnnularStringDrag) | |||
call json%add(p,"BlindRamClose",data%Configuration%BopStack%BlindRamClose) | |||
call json%add(p,"BlindRamHeight",data%Configuration%BopStack%BlindRamHeight) | |||
call json%add(p,"BlindRamOpen",data%Configuration%BopStack%BlindRamOpen) | |||
call json%add(p,"ChokeClose",data%Configuration%BopStack%ChokeClose) | |||
call json%add(p,"ChokeLineId",data%Configuration%BopStack%ChokeLineId) | |||
call json%add(p,"ChokeLineLength",data%Configuration%BopStack%ChokeLineLength) | |||
call json%add(p,"ChokeOpen",data%Configuration%BopStack%ChokeOpen) | |||
call json%add(p,"GroundLevel",data%Configuration%BopStack%GroundLevel) | |||
call json%add(p,"KillClose",data%Configuration%BopStack%KillClose) | |||
call json%add(p,"KillHeight",data%Configuration%BopStack%KillHeight) | |||
call json%add(p,"KillOpen",data%Configuration%BopStack%KillOpen) | |||
call json%add(p,"LowerRamClose",data%Configuration%BopStack%LowerRamClose) | |||
call json%add(p,"LowerRamHeight",data%Configuration%BopStack%LowerRamHeight) | |||
call json%add(p,"LowerRamOpen",data%Configuration%BopStack%LowerRamOpen) | |||
call json%add(p,"RamStringDrag",data%Configuration%BopStack%RamStringDrag) | |||
call json%add(p,"UpperRamClose",data%Configuration%BopStack%UpperRamClose) | |||
call json%add(p,"UpperRamHeight",data%Configuration%BopStack%UpperRamHeight) | |||
call json%add(p,"UpperRamOpen",data%Configuration%BopStack%UpperRamOpen) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CBopStack |
@@ -1,30 +1,30 @@ | |||
module CBopStackVariables | |||
implicit none | |||
public | |||
Type::BopStackSpecificationType | |||
real(8) :: AboveAnnularHeight = 10.0d0 | |||
real(8) :: AnnularPreventerHeight = 10.2d0 | |||
real(8) :: UpperRamHeight = 14.632d0 | |||
real(8) :: LowerRamHeight = 21.35d0 | |||
real(8) :: BlindRamHeight = 16.24d0 | |||
real(8) :: KillHeight = 18.8d0 | |||
real(8) :: KillOpen = 1.5d0 | |||
real(8) :: KillClose = 1.5d0 | |||
real(8) :: GroundLevel = 30.0d0 | |||
real(8) :: LowerRamOpen | |||
real(8) :: LowerRamClose | |||
real(8) :: ChokeOpen | |||
real(8) :: ChokeClose | |||
real(8) :: BlindRamOpen | |||
real(8) :: BlindRamClose | |||
real(8) :: UpperRamOpen | |||
real(8) :: UpperRamClose | |||
real(8) :: AnnularPreventerOpen | |||
real(8) :: AnnularPreventerClose | |||
real(8) :: RamStringDrag | |||
real(8) :: AnnularStringDrag | |||
real(8) :: ChokeLineLength | |||
real(8) :: ChokeLineId | |||
End Type BopStackSpecificationType | |||
module CBopStackVariables | |||
implicit none | |||
public | |||
Type::BopStackSpecificationType | |||
real(8) :: AboveAnnularHeight = 10.0d0 | |||
real(8) :: AnnularPreventerHeight = 10.2d0 | |||
real(8) :: UpperRamHeight = 14.632d0 | |||
real(8) :: LowerRamHeight = 21.35d0 | |||
real(8) :: BlindRamHeight = 16.24d0 | |||
real(8) :: KillHeight = 18.8d0 | |||
real(8) :: KillOpen = 1.5d0 | |||
real(8) :: KillClose = 1.5d0 | |||
real(8) :: GroundLevel = 30.0d0 | |||
real(8) :: LowerRamOpen | |||
real(8) :: LowerRamClose | |||
real(8) :: ChokeOpen | |||
real(8) :: ChokeClose | |||
real(8) :: BlindRamOpen | |||
real(8) :: BlindRamClose | |||
real(8) :: UpperRamOpen | |||
real(8) :: UpperRamClose | |||
real(8) :: AnnularPreventerOpen | |||
real(8) :: AnnularPreventerClose | |||
real(8) :: RamStringDrag | |||
real(8) :: AnnularStringDrag | |||
real(8) :: ChokeLineLength | |||
real(8) :: ChokeLineId | |||
End Type BopStackSpecificationType | |||
end module CBopStackVariables |
@@ -1,30 +1,30 @@ | |||
module CHoisting | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine HoistingToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Hoisting') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"DrillingLineBreakingLoadAbrasiveness",data%Configuration%Hoisting%DrillingLineBreakingLoad) | |||
call json%add(p,"DriveTypeAbrasiveness",data%Configuration%Hoisting%DriveType) | |||
call json%add(p,"KellyWeightAbrasiveness",data%Configuration%Hoisting%KellyWeight) | |||
call json%add(p,"NumberOfLineAbrasiveness",data%Configuration%Hoisting%NumberOfLine) | |||
call json%add(p,"TopDriveWeightAbrasiveness",data%Configuration%Hoisting%TopDriveWeight) | |||
call json%add(p,"TravelingBlockWeightAbrasiveness",data%Configuration%Hoisting%TravelingBlockWeight) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
module CHoisting | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine HoistingToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Hoisting') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"DrillingLineBreakingLoadAbrasiveness",data%Configuration%Hoisting%DrillingLineBreakingLoad) | |||
call json%add(p,"DriveTypeAbrasiveness",data%Configuration%Hoisting%DriveType) | |||
call json%add(p,"KellyWeightAbrasiveness",data%Configuration%Hoisting%KellyWeight) | |||
call json%add(p,"NumberOfLineAbrasiveness",data%Configuration%Hoisting%NumberOfLine) | |||
call json%add(p,"TopDriveWeightAbrasiveness",data%Configuration%Hoisting%TopDriveWeight) | |||
call json%add(p,"TravelingBlockWeightAbrasiveness",data%Configuration%Hoisting%TravelingBlockWeight) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CHoisting |
@@ -1,18 +1,18 @@ | |||
module CHoistingVariables | |||
implicit none | |||
public | |||
!constants | |||
integer :: TopDrive_DriveType = 0 | |||
integer :: Kelly_DriveType = 1 | |||
! variables | |||
Type::HoistingType | |||
integer :: DriveType | |||
real(8) :: TravelingBlockWeight | |||
real(8) :: TopDriveWeight | |||
real(8) :: KellyWeight | |||
integer :: NumberOfLine | |||
real(8) :: DrillingLineBreakingLoad | |||
End type HoistingType | |||
module CHoistingVariables | |||
implicit none | |||
public | |||
!constants | |||
integer :: TopDrive_DriveType = 0 | |||
integer :: Kelly_DriveType = 1 | |||
! variables | |||
Type::HoistingType | |||
integer :: DriveType | |||
real(8) :: TravelingBlockWeight | |||
real(8) :: TopDriveWeight | |||
real(8) :: KellyWeight | |||
integer :: NumberOfLine | |||
real(8) :: DrillingLineBreakingLoad | |||
End type HoistingType | |||
end module CHoistingVariables |
@@ -1,33 +1,33 @@ | |||
module CPower | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine PowerToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Power') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"CementPump",data%Configuration%Power%CementPump) | |||
call json%add(p,"Drawworks",data%Configuration%Power%Drawworks) | |||
call json%add(p,"GeneratorPowerRating",data%Configuration%Power%GeneratorPowerRating) | |||
call json%add(p,"MudPump1",data%Configuration%Power%MudPump1) | |||
call json%add(p,"MudPump2",data%Configuration%Power%MudPump2) | |||
call json%add(p,"NumberOfgenerators",data%Configuration%Power%NumberOfgenerators) | |||
call json%add(p,"RotaryTable",data%Configuration%Power%RotaryTable) | |||
call json%add(p,"TopDrive",data%Configuration%Power%TopDrive) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
module CPower | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine PowerToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Power') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"CementPump",data%Configuration%Power%CementPump) | |||
call json%add(p,"Drawworks",data%Configuration%Power%Drawworks) | |||
call json%add(p,"GeneratorPowerRating",data%Configuration%Power%GeneratorPowerRating) | |||
call json%add(p,"MudPump1",data%Configuration%Power%MudPump1) | |||
call json%add(p,"MudPump2",data%Configuration%Power%MudPump2) | |||
call json%add(p,"NumberOfgenerators",data%Configuration%Power%NumberOfgenerators) | |||
call json%add(p,"RotaryTable",data%Configuration%Power%RotaryTable) | |||
call json%add(p,"TopDrive",data%Configuration%Power%TopDrive) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CPower |
@@ -1,16 +1,16 @@ | |||
module CPowerVariables | |||
implicit none | |||
public | |||
! variables | |||
Type::PowerType | |||
integer :: NumberOfgenerators | |||
real(8) :: GeneratorPowerRating | |||
real(8) :: MudPump1 | |||
real(8) :: MudPump2 | |||
real(8) :: CementPump | |||
real(8) :: RotaryTable | |||
real(8) :: Drawworks | |||
real(8) :: TopDrive | |||
End type PowerType | |||
! Type(PowerType)::Power | |||
module CPowerVariables | |||
implicit none | |||
public | |||
! variables | |||
Type::PowerType | |||
integer :: NumberOfgenerators | |||
real(8) :: GeneratorPowerRating | |||
real(8) :: MudPump1 | |||
real(8) :: MudPump2 | |||
real(8) :: CementPump | |||
real(8) :: RotaryTable | |||
real(8) :: Drawworks | |||
real(8) :: TopDrive | |||
End type PowerType | |||
! Type(PowerType)::Power | |||
end module CPowerVariables |
@@ -1,199 +1,199 @@ | |||
module CPumps | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine PumpsToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Pumps') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"MudPump1LinerDiameter",data%Configuration%Pumps%MudPump1LinerDiameter) | |||
call json%add(p,"MudPump1Stroke",data%Configuration%Pumps%MudPump1Stroke) | |||
call json%add(p,"MudPump1MechanicalEfficiency",data%Configuration%Pumps%MudPump1MechanicalEfficiency) | |||
call json%add(p,"MudPump1VolumetricEfficiency",data%Configuration%Pumps%MudPump1VolumetricEfficiency) | |||
call json%add(p,"MudPump1Output",data%Configuration%Pumps%MudPump1Output) | |||
call json%add(p,"MudPump1OutputBblStroke",data%Configuration%Pumps%MudPump1OutputBblStroke) | |||
call json%add(p,"MudPump1Maximum",data%Configuration%Pumps%MudPump1Maximum) | |||
call json%add(p,"MudPump1ReliefValvePressure",data%Configuration%Pumps%MudPump1ReliefValvePressure) | |||
call json%add(p,"MudPump2LinerDiameter",data%Configuration%Pumps%MudPump2LinerDiameter) | |||
call json%add(p,"MudPump2Stroke",data%Configuration%Pumps%MudPump2Stroke) | |||
call json%add(p,"MudPump2MechanicalEfficiency",data%Configuration%Pumps%MudPump2MechanicalEfficiency) | |||
call json%add(p,"MudPump2VolumetricEfficiency",data%Configuration%Pumps%MudPump2VolumetricEfficiency) | |||
call json%add(p,"MudPump2Output",data%Configuration%Pumps%MudPump2Output) | |||
call json%add(p,"MudPump2OutputBblStroke",data%Configuration%Pumps%MudPump2OutputBblStroke) | |||
call json%add(p,"MudPump2Maximum",data%Configuration%Pumps%MudPump2Maximum) | |||
call json%add(p,"MudPump2ReliefValvePressure",data%Configuration%Pumps%MudPump2ReliefValvePressure) | |||
call json%add(p,"CementPumpLinerDiameter",data%Configuration%Pumps%CementPumpLinerDiameter) | |||
call json%add(p,"CementPumpStroke",data%Configuration%Pumps%CementPumpStroke) | |||
call json%add(p,"CementPumpMechanicalEfficiency",data%Configuration%Pumps%CementPumpMechanicalEfficiency) | |||
call json%add(p,"CementPumpVolumetricEfficiency",data%Configuration%Pumps%CementPumpVolumetricEfficiency) | |||
call json%add(p,"CementPumpOutput",data%Configuration%Pumps%CementPumpOutput) | |||
call json%add(p,"CementPumpOutputBblStroke",data%Configuration%Pumps%CementPumpOutputBblStroke) | |||
call json%add(p,"CementPumpMaximum",data%Configuration%Pumps%CementPumpMaximum) | |||
call json%add(p,"CementPumpReliefValvePressure ",data%Configuration%Pumps%CementPumpReliefValvePressure ) | |||
call json%add(p,"MudPump1ReliefValveIsSet",data%Configuration%Pumps%MudPump1ReliefValveIsSet) | |||
call json%add(p,"MudPump2ReliefValveIsSet",data%Configuration%Pumps%MudPump2ReliefValveIsSet) | |||
call json%add(p,"CementPumpReliefValveIsSet",data%Configuration%Pumps%CementPumpReliefValveIsSet) | |||
call json%add(p,"ManualPumpPower",data%Configuration%Pumps%ManualPumpPower) | |||
call json%add(p,"Valve1",data%Configuration%Pumps%Valve1) | |||
call json%add(p,"Valve2",data%Configuration%Pumps%Valve2) | |||
call json%add(p,"Valve3",data%Configuration%Pumps%Valve3) | |||
call json%add(p,"Valve4",data%Configuration%Pumps%Valve4) | |||
call json%add(p,"Valve5",data%Configuration%Pumps%Valve5) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine OpenPump1() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(16, .true.) | |||
end subroutine | |||
subroutine ClosePump1() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(16, .false.) | |||
end subroutine | |||
subroutine OpenPump2() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(17, .true.) | |||
end subroutine | |||
subroutine ClosePump2() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(17, .false.) | |||
end subroutine | |||
subroutine OpenCementPump() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(18, .true.) | |||
end subroutine | |||
subroutine CloseCementPump() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(18, .false.) | |||
end subroutine | |||
! subroutine SetMudPump1LinerDiameterN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump1LinerDiameterPtr)) call MudPump1LinerDiameterPtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump2LinerDiameterN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump2LinerDiameterPtr)) call MudPump2LinerDiameterPtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump3LinerDiameterN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump3LinerDiameterPtr)) call MudPump3LinerDiameterPtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump1OutputBblStrokeN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump1OutputBblStrokePtr)) call MudPump1OutputBblStrokePtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump2OutputBblStrokeN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump2OutputBblStrokePtr)) call MudPump2OutputBblStrokePtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump3OutputBblStrokeN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump3OutputBblStrokePtr)) call MudPump3OutputBblStrokePtr(a) | |||
! end subroutine | |||
! subroutine CalcMudPump1LinerDiameter() | |||
! use, intrinsic :: IEEE_ARITHMETIC | |||
! implicit none | |||
! real(8) :: a | |||
! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0 | |||
! a = dsqrt(data%Configuration%Pumps%MudPump1OutputBblStroke / a) | |||
! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then | |||
! data%Configuration%Pumps%MudPump1LinerDiameter = 0.0 | |||
! else | |||
! data%Configuration%Pumps%MudPump1LinerDiameter = a | |||
! endif | |||
! call SetMudPump1LinerDiameterN(data%Configuration%Pumps%MudPump1LinerDiameter) | |||
! end subroutine | |||
! subroutine CalcMudPump2LinerDiameter() | |||
! use, intrinsic :: IEEE_ARITHMETIC | |||
! implicit none | |||
! real(8) :: a | |||
! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0 | |||
! a = dsqrt(data%Configuration%Pumps%MudPump2OutputBblStroke / a) | |||
! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then | |||
! data%Configuration%Pumps%MudPump2LinerDiameter = 0.0 | |||
! else | |||
! data%Configuration%Pumps%MudPump2LinerDiameter = a | |||
! endif | |||
! call SetMudPump2LinerDiameterN(data%Configuration%Pumps%MudPump2LinerDiameter) | |||
! end subroutine | |||
! subroutine CalcMudPump3LinerDiameter() | |||
! use, intrinsic :: IEEE_ARITHMETIC | |||
! implicit none | |||
! real(8) :: a | |||
! a = (MathPI / 4.d0) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0 | |||
! a = dsqrt(data%Configuration%Pumps%CementPumpOutputBblStroke / a) | |||
! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then | |||
! data%Configuration%Pumps%CementPumpLinerDiameter = 0.0 | |||
! else | |||
! data%Configuration%Pumps%CementPumpLinerDiameter = a | |||
! endif | |||
! call SetMudPump3LinerDiameterN(data%Configuration%Pumps%CementPumpLinerDiameter) | |||
! end subroutine | |||
! subroutine CalcPump1OutputBblStroke() | |||
! implicit none | |||
! data%Configuration%Pumps%MudPump1OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump1LinerDiameter**2) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0 | |||
! call SetMudPump1OutputBblStrokeN(data%Configuration%Pumps%MudPump1OutputBblStroke) | |||
! end subroutine | |||
! subroutine CalcPump2OutputBblStroke() | |||
! implicit none | |||
! data%Configuration%Pumps%MudPump2OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump2LinerDiameter**2) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0 | |||
! call SetMudPump2OutputBblStrokeN(data%Configuration%Pumps%MudPump2OutputBblStroke) | |||
! end subroutine | |||
! subroutine CalcPump3OutputBblStroke() | |||
! implicit none | |||
! data%Configuration%Pumps%CementPumpOutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%CementPumpLinerDiameter**2) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0 | |||
! call SetMudPump3OutputBblStrokeN(data%Configuration%Pumps%CementPumpOutputBblStroke) | |||
! end subroutine | |||
module CPumps | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine PumpsToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Pumps') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"MudPump1LinerDiameter",data%Configuration%Pumps%MudPump1LinerDiameter) | |||
call json%add(p,"MudPump1Stroke",data%Configuration%Pumps%MudPump1Stroke) | |||
call json%add(p,"MudPump1MechanicalEfficiency",data%Configuration%Pumps%MudPump1MechanicalEfficiency) | |||
call json%add(p,"MudPump1VolumetricEfficiency",data%Configuration%Pumps%MudPump1VolumetricEfficiency) | |||
call json%add(p,"MudPump1Output",data%Configuration%Pumps%MudPump1Output) | |||
call json%add(p,"MudPump1OutputBblStroke",data%Configuration%Pumps%MudPump1OutputBblStroke) | |||
call json%add(p,"MudPump1Maximum",data%Configuration%Pumps%MudPump1Maximum) | |||
call json%add(p,"MudPump1ReliefValvePressure",data%Configuration%Pumps%MudPump1ReliefValvePressure) | |||
call json%add(p,"MudPump2LinerDiameter",data%Configuration%Pumps%MudPump2LinerDiameter) | |||
call json%add(p,"MudPump2Stroke",data%Configuration%Pumps%MudPump2Stroke) | |||
call json%add(p,"MudPump2MechanicalEfficiency",data%Configuration%Pumps%MudPump2MechanicalEfficiency) | |||
call json%add(p,"MudPump2VolumetricEfficiency",data%Configuration%Pumps%MudPump2VolumetricEfficiency) | |||
call json%add(p,"MudPump2Output",data%Configuration%Pumps%MudPump2Output) | |||
call json%add(p,"MudPump2OutputBblStroke",data%Configuration%Pumps%MudPump2OutputBblStroke) | |||
call json%add(p,"MudPump2Maximum",data%Configuration%Pumps%MudPump2Maximum) | |||
call json%add(p,"MudPump2ReliefValvePressure",data%Configuration%Pumps%MudPump2ReliefValvePressure) | |||
call json%add(p,"CementPumpLinerDiameter",data%Configuration%Pumps%CementPumpLinerDiameter) | |||
call json%add(p,"CementPumpStroke",data%Configuration%Pumps%CementPumpStroke) | |||
call json%add(p,"CementPumpMechanicalEfficiency",data%Configuration%Pumps%CementPumpMechanicalEfficiency) | |||
call json%add(p,"CementPumpVolumetricEfficiency",data%Configuration%Pumps%CementPumpVolumetricEfficiency) | |||
call json%add(p,"CementPumpOutput",data%Configuration%Pumps%CementPumpOutput) | |||
call json%add(p,"CementPumpOutputBblStroke",data%Configuration%Pumps%CementPumpOutputBblStroke) | |||
call json%add(p,"CementPumpMaximum",data%Configuration%Pumps%CementPumpMaximum) | |||
call json%add(p,"CementPumpReliefValvePressure ",data%Configuration%Pumps%CementPumpReliefValvePressure ) | |||
call json%add(p,"MudPump1ReliefValveIsSet",data%Configuration%Pumps%MudPump1ReliefValveIsSet) | |||
call json%add(p,"MudPump2ReliefValveIsSet",data%Configuration%Pumps%MudPump2ReliefValveIsSet) | |||
call json%add(p,"CementPumpReliefValveIsSet",data%Configuration%Pumps%CementPumpReliefValveIsSet) | |||
call json%add(p,"ManualPumpPower",data%Configuration%Pumps%ManualPumpPower) | |||
call json%add(p,"Valve1",data%Configuration%Pumps%Valve1) | |||
call json%add(p,"Valve2",data%Configuration%Pumps%Valve2) | |||
call json%add(p,"Valve3",data%Configuration%Pumps%Valve3) | |||
call json%add(p,"Valve4",data%Configuration%Pumps%Valve4) | |||
call json%add(p,"Valve5",data%Configuration%Pumps%Valve5) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine OpenPump1() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(16, .true.) | |||
end subroutine | |||
subroutine ClosePump1() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(16, .false.) | |||
end subroutine | |||
subroutine OpenPump2() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(17, .true.) | |||
end subroutine | |||
subroutine ClosePump2() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(17, .false.) | |||
end subroutine | |||
subroutine OpenCementPump() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(18, .true.) | |||
end subroutine | |||
subroutine CloseCementPump() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(18, .false.) | |||
end subroutine | |||
! subroutine SetMudPump1LinerDiameterN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump1LinerDiameterPtr)) call MudPump1LinerDiameterPtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump2LinerDiameterN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump2LinerDiameterPtr)) call MudPump2LinerDiameterPtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump3LinerDiameterN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump3LinerDiameterPtr)) call MudPump3LinerDiameterPtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump1OutputBblStrokeN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump1OutputBblStrokePtr)) call MudPump1OutputBblStrokePtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump2OutputBblStrokeN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump2OutputBblStrokePtr)) call MudPump2OutputBblStrokePtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump3OutputBblStrokeN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump3OutputBblStrokePtr)) call MudPump3OutputBblStrokePtr(a) | |||
! end subroutine | |||
! subroutine CalcMudPump1LinerDiameter() | |||
! use, intrinsic :: IEEE_ARITHMETIC | |||
! implicit none | |||
! real(8) :: a | |||
! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0 | |||
! a = dsqrt(data%Configuration%Pumps%MudPump1OutputBblStroke / a) | |||
! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then | |||
! data%Configuration%Pumps%MudPump1LinerDiameter = 0.0 | |||
! else | |||
! data%Configuration%Pumps%MudPump1LinerDiameter = a | |||
! endif | |||
! call SetMudPump1LinerDiameterN(data%Configuration%Pumps%MudPump1LinerDiameter) | |||
! end subroutine | |||
! subroutine CalcMudPump2LinerDiameter() | |||
! use, intrinsic :: IEEE_ARITHMETIC | |||
! implicit none | |||
! real(8) :: a | |||
! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0 | |||
! a = dsqrt(data%Configuration%Pumps%MudPump2OutputBblStroke / a) | |||
! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then | |||
! data%Configuration%Pumps%MudPump2LinerDiameter = 0.0 | |||
! else | |||
! data%Configuration%Pumps%MudPump2LinerDiameter = a | |||
! endif | |||
! call SetMudPump2LinerDiameterN(data%Configuration%Pumps%MudPump2LinerDiameter) | |||
! end subroutine | |||
! subroutine CalcMudPump3LinerDiameter() | |||
! use, intrinsic :: IEEE_ARITHMETIC | |||
! implicit none | |||
! real(8) :: a | |||
! a = (MathPI / 4.d0) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0 | |||
! a = dsqrt(data%Configuration%Pumps%CementPumpOutputBblStroke / a) | |||
! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then | |||
! data%Configuration%Pumps%CementPumpLinerDiameter = 0.0 | |||
! else | |||
! data%Configuration%Pumps%CementPumpLinerDiameter = a | |||
! endif | |||
! call SetMudPump3LinerDiameterN(data%Configuration%Pumps%CementPumpLinerDiameter) | |||
! end subroutine | |||
! subroutine CalcPump1OutputBblStroke() | |||
! implicit none | |||
! data%Configuration%Pumps%MudPump1OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump1LinerDiameter**2) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0 | |||
! call SetMudPump1OutputBblStrokeN(data%Configuration%Pumps%MudPump1OutputBblStroke) | |||
! end subroutine | |||
! subroutine CalcPump2OutputBblStroke() | |||
! implicit none | |||
! data%Configuration%Pumps%MudPump2OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump2LinerDiameter**2) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0 | |||
! call SetMudPump2OutputBblStrokeN(data%Configuration%Pumps%MudPump2OutputBblStroke) | |||
! end subroutine | |||
! subroutine CalcPump3OutputBblStroke() | |||
! implicit none | |||
! data%Configuration%Pumps%CementPumpOutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%CementPumpLinerDiameter**2) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0 | |||
! call SetMudPump3OutputBblStrokeN(data%Configuration%Pumps%CementPumpOutputBblStroke) | |||
! end subroutine | |||
end module CPumps |
@@ -1,60 +1,60 @@ | |||
module CPumpsVariables | |||
use CIActionReference | |||
implicit none | |||
public | |||
! Pumps Specifications | |||
Type::PumpSpecificationType | |||
real(8) :: MudPump1LinerDiameter | |||
real(8) :: MudPump1Stroke | |||
real(8) :: MudPump1MechanicalEfficiency | |||
real(8) :: MudPump1VolumetricEfficiency | |||
real(8) :: MudPump1Output | |||
real(8) :: MudPump1OutputBblStroke | |||
real(8) :: MudPump1Maximum | |||
real(8) :: MudPump1ReliefValvePressure | |||
real(8) :: MudPump2LinerDiameter | |||
real(8) :: MudPump2Stroke | |||
real(8) :: MudPump2MechanicalEfficiency | |||
real(8) :: MudPump2VolumetricEfficiency | |||
real(8) :: MudPump2Output | |||
real(8) :: MudPump2OutputBblStroke | |||
real(8) :: MudPump2Maximum | |||
real(8) :: MudPump2ReliefValvePressure | |||
real(8) :: CementPumpLinerDiameter | |||
real(8) :: CementPumpStroke | |||
real(8) :: CementPumpMechanicalEfficiency | |||
real(8) :: CementPumpVolumetricEfficiency | |||
real(8) :: CementPumpOutput | |||
real(8) :: CementPumpOutputBblStroke | |||
real(8) :: CementPumpMaximum | |||
real(8) :: CementPumpReliefValvePressure | |||
logical :: MudPump1ReliefValveIsSet | |||
logical :: MudPump2ReliefValveIsSet | |||
logical :: CementPumpReliefValveIsSet | |||
logical :: ManualPumpPower | |||
logical :: Valve1 | |||
logical :: Valve2 | |||
logical :: Valve3 | |||
logical :: Valve4 | |||
logical :: Valve5 | |||
End type PumpSpecificationType | |||
! Type(PumpSpecificationType)::PumpsSpecification | |||
! procedure (ActionDouble), pointer :: MudPump1LinerDiameterPtr | |||
! procedure (ActionDouble), pointer :: MudPump2LinerDiameterPtr | |||
! procedure (ActionDouble), pointer :: MudPump3LinerDiameterPtr | |||
! procedure (ActionDouble), pointer :: MudPump1OutputBblStrokePtr | |||
! procedure (ActionDouble), pointer :: MudPump2OutputBblStrokePtr | |||
! procedure (ActionDouble), pointer :: MudPump3OutputBblStrokePtr | |||
real(8) :: MathPI = 3.14159265358979d0 | |||
contains | |||
module CPumpsVariables | |||
use CIActionReference | |||
implicit none | |||
public | |||
! Pumps Specifications | |||
Type::PumpSpecificationType | |||
real(8) :: MudPump1LinerDiameter | |||
real(8) :: MudPump1Stroke | |||
real(8) :: MudPump1MechanicalEfficiency | |||
real(8) :: MudPump1VolumetricEfficiency | |||
real(8) :: MudPump1Output | |||
real(8) :: MudPump1OutputBblStroke | |||
real(8) :: MudPump1Maximum | |||
real(8) :: MudPump1ReliefValvePressure | |||
real(8) :: MudPump2LinerDiameter | |||
real(8) :: MudPump2Stroke | |||
real(8) :: MudPump2MechanicalEfficiency | |||
real(8) :: MudPump2VolumetricEfficiency | |||
real(8) :: MudPump2Output | |||
real(8) :: MudPump2OutputBblStroke | |||
real(8) :: MudPump2Maximum | |||
real(8) :: MudPump2ReliefValvePressure | |||
real(8) :: CementPumpLinerDiameter | |||
real(8) :: CementPumpStroke | |||
real(8) :: CementPumpMechanicalEfficiency | |||
real(8) :: CementPumpVolumetricEfficiency | |||
real(8) :: CementPumpOutput | |||
real(8) :: CementPumpOutputBblStroke | |||
real(8) :: CementPumpMaximum | |||
real(8) :: CementPumpReliefValvePressure | |||
logical :: MudPump1ReliefValveIsSet | |||
logical :: MudPump2ReliefValveIsSet | |||
logical :: CementPumpReliefValveIsSet | |||
logical :: ManualPumpPower | |||
logical :: Valve1 | |||
logical :: Valve2 | |||
logical :: Valve3 | |||
logical :: Valve4 | |||
logical :: Valve5 | |||
End type PumpSpecificationType | |||
! Type(PumpSpecificationType)::PumpsSpecification | |||
! procedure (ActionDouble), pointer :: MudPump1LinerDiameterPtr | |||
! procedure (ActionDouble), pointer :: MudPump2LinerDiameterPtr | |||
! procedure (ActionDouble), pointer :: MudPump3LinerDiameterPtr | |||
! procedure (ActionDouble), pointer :: MudPump1OutputBblStrokePtr | |||
! procedure (ActionDouble), pointer :: MudPump2OutputBblStrokePtr | |||
! procedure (ActionDouble), pointer :: MudPump3OutputBblStrokePtr | |||
real(8) :: MathPI = 3.14159265358979d0 | |||
contains | |||
end module CPumpsVariables |
@@ -1,28 +1,28 @@ | |||
module CRigSize | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine RigSizeToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'RigSize') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"RigType",data%Configuration%RigSize%RigType) | |||
call json%add(p,"CrownHeight",data%Configuration%RigSize%CrownHeight) | |||
call json%add(p,"MonkeyBoandHeight",data%Configuration%RigSize%MonkeyBoandHeight) | |||
call json%add(p,"RigFloorHeight",data%Configuration%RigSize%RigFloorHeight) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
module CRigSize | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine RigSizeToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'RigSize') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"RigType",data%Configuration%RigSize%RigType) | |||
call json%add(p,"CrownHeight",data%Configuration%RigSize%CrownHeight) | |||
call json%add(p,"MonkeyBoandHeight",data%Configuration%RigSize%MonkeyBoandHeight) | |||
call json%add(p,"RigFloorHeight",data%Configuration%RigSize%RigFloorHeight) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CRigSize |
@@ -1,15 +1,15 @@ | |||
module CRigSizeVariables | |||
implicit none | |||
public | |||
!constants | |||
integer :: Convensional_RigSize = 0 | |||
! variables | |||
Type:: RigSizeType | |||
integer :: RigType | |||
real(8) :: CrownHeight | |||
real(8) :: MonkeyBoandHeight | |||
real(8) :: RigFloorHeight | |||
End type RigSizeType | |||
Type(RigSizeType)::RigSize | |||
module CRigSizeVariables | |||
implicit none | |||
public | |||
!constants | |||
integer :: Convensional_RigSize = 0 | |||
! variables | |||
Type:: RigSizeType | |||
integer :: RigType | |||
real(8) :: CrownHeight | |||
real(8) :: MonkeyBoandHeight | |||
real(8) :: RigFloorHeight | |||
End type RigSizeType | |||
Type(RigSizeType)::RigSize | |||
end module CRigSizeVariables |
@@ -1,40 +1,40 @@ | |||
module CCasingLinerChoke | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine CasingLinerChokeToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'CasingLinerChoke') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"CasingDepth",data%Configuration%CasingLinerChoke%CasingDepth) | |||
call json%add(p,"CasingId",data%Configuration%CasingLinerChoke%CasingId) | |||
call json%add(p,"CasingOd",data%Configuration%CasingLinerChoke%CasingOd) | |||
call json%add(p,"CasingWeight",data%Configuration%CasingLinerChoke%CasingWeight) | |||
call json%add(p,"CasingCollapsePressure",data%Configuration%CasingLinerChoke%CasingCollapsePressure) | |||
call json%add(p,"CasingTensileStrength",data%Configuration%CasingLinerChoke%CasingTensileStrength) | |||
call json%add(p,"LinerTopDepth",data%Configuration%CasingLinerChoke%LinerTopDepth) | |||
call json%add(p,"LinerLength",data%Configuration%CasingLinerChoke%LinerLength) | |||
call json%add(p,"LinerId",data%Configuration%CasingLinerChoke%LinerId) | |||
call json%add(p,"LinerOd",data%Configuration%CasingLinerChoke%LinerOd) | |||
call json%add(p,"LinerWeight",data%Configuration%CasingLinerChoke%LinerWeight) | |||
call json%add(p,"LinerCollapsePressure",data%Configuration%CasingLinerChoke%LinerCollapsePressure) | |||
call json%add(p,"LinerTensileStrength",data%Configuration%CasingLinerChoke%LinerTensileStrength) | |||
call json%add(p,"OpenHoleId",data%Configuration%CasingLinerChoke%OpenHoleId) | |||
call json%add(p,"OpenHoleLength",data%Configuration%CasingLinerChoke%OpenHoleLength) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
module CCasingLinerChoke | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine CasingLinerChokeToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'CasingLinerChoke') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"CasingDepth",data%Configuration%CasingLinerChoke%CasingDepth) | |||
call json%add(p,"CasingId",data%Configuration%CasingLinerChoke%CasingId) | |||
call json%add(p,"CasingOd",data%Configuration%CasingLinerChoke%CasingOd) | |||
call json%add(p,"CasingWeight",data%Configuration%CasingLinerChoke%CasingWeight) | |||
call json%add(p,"CasingCollapsePressure",data%Configuration%CasingLinerChoke%CasingCollapsePressure) | |||
call json%add(p,"CasingTensileStrength",data%Configuration%CasingLinerChoke%CasingTensileStrength) | |||
call json%add(p,"LinerTopDepth",data%Configuration%CasingLinerChoke%LinerTopDepth) | |||
call json%add(p,"LinerLength",data%Configuration%CasingLinerChoke%LinerLength) | |||
call json%add(p,"LinerId",data%Configuration%CasingLinerChoke%LinerId) | |||
call json%add(p,"LinerOd",data%Configuration%CasingLinerChoke%LinerOd) | |||
call json%add(p,"LinerWeight",data%Configuration%CasingLinerChoke%LinerWeight) | |||
call json%add(p,"LinerCollapsePressure",data%Configuration%CasingLinerChoke%LinerCollapsePressure) | |||
call json%add(p,"LinerTensileStrength",data%Configuration%CasingLinerChoke%LinerTensileStrength) | |||
call json%add(p,"OpenHoleId",data%Configuration%CasingLinerChoke%OpenHoleId) | |||
call json%add(p,"OpenHoleLength",data%Configuration%CasingLinerChoke%OpenHoleLength) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CCasingLinerChoke |
@@ -1,26 +1,26 @@ | |||
module CCasingLinerChokeVariables | |||
implicit none | |||
public | |||
! variables | |||
Type::CasingLinerChokeType | |||
real(8) :: CasingDepth | |||
real(8) :: CasingId | |||
real(8) :: CasingOd | |||
real(8) :: CasingWeight | |||
real(8) :: CasingCollapsePressure | |||
real(8) :: CasingTensileStrength | |||
real(8) :: LinerTopDepth | |||
real(8) :: LinerLength | |||
real(8) :: LinerId | |||
real(8) :: LinerOd | |||
real(8) :: LinerWeight | |||
real(8) :: LinerCollapsePressure | |||
real(8) :: LinerTensileStrength | |||
real(8) :: OpenHoleId | |||
real(8) :: OpenHoleLength | |||
End Type CasingLinerChokeType | |||
! Type(CasingLinerChokeType)::CasingLinerChoke | |||
contains | |||
module CCasingLinerChokeVariables | |||
implicit none | |||
public | |||
! variables | |||
Type::CasingLinerChokeType | |||
real(8) :: CasingDepth | |||
real(8) :: CasingId | |||
real(8) :: CasingOd | |||
real(8) :: CasingWeight | |||
real(8) :: CasingCollapsePressure | |||
real(8) :: CasingTensileStrength | |||
real(8) :: LinerTopDepth | |||
real(8) :: LinerLength | |||
real(8) :: LinerId | |||
real(8) :: LinerOd | |||
real(8) :: LinerWeight | |||
real(8) :: LinerCollapsePressure | |||
real(8) :: LinerTensileStrength | |||
real(8) :: OpenHoleId | |||
real(8) :: OpenHoleLength | |||
End Type CasingLinerChokeType | |||
! Type(CasingLinerChokeType)::CasingLinerChoke | |||
contains | |||
end module CCasingLinerChokeVariables |
@@ -1,45 +1,45 @@ | |||
module CPathGeneration | |||
use SimulationVariables !@ | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine PathGenerationToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: ppath,pitems,pdp,p | |||
integer::i | |||
! 1. create new node | |||
call json%create_object(ppath,'Path') | |||
call json%create_array(pitems,'Items') | |||
do i=1,data%Configuration%Path%ItemCount | |||
call json%create_object(p,'') | |||
call json%add(p,"HoleType",data%Configuration%Path%items(i)%HoleType) | |||
call json%add(p,"Angle",data%Configuration%Path%items(i)%Angle) | |||
call json%add(p,"Length",data%Configuration%Path%items(i)%Length) | |||
call json%add(p,"FinalAngle",data%Configuration%Path%items(i)%FinalAngle) | |||
call json%add(p,"TotalLength",data%Configuration%Path%items(i)%TotalLength) | |||
call json%add(p,"MeasuredDepth",data%Configuration%Path%items(i)%MeasuredDepth) | |||
call json%add(p,"TotalVerticalDepth",data%Configuration%Path%items(i)%TotalVerticalDepth) | |||
call json%add(pitems,p) | |||
end do | |||
call json%create_array(pdp,'DataPoints') | |||
do i=1,data%Configuration%Path%DataPointsCount | |||
call json%create_object(p,'') | |||
call json%add(p,"X",data%Configuration%Path%DataPoints(i)%X) | |||
call json%add(p,"Y",data%Configuration%Path%DataPoints(i)%Y) | |||
call json%add(pdp,p) | |||
end do | |||
! 3. add new node to parent | |||
call json%add(ppath,pitems) | |||
call json%add(ppath,pdp) | |||
call json%add(parent,ppath) | |||
end subroutine | |||
module CPathGeneration | |||
use SimulationVariables !@ | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine PathGenerationToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: ppath,pitems,pdp,p | |||
integer::i | |||
! 1. create new node | |||
call json%create_object(ppath,'Path') | |||
call json%create_array(pitems,'Items') | |||
do i=1,data%Configuration%Path%ItemCount | |||
call json%create_object(p,'') | |||
call json%add(p,"HoleType",data%Configuration%Path%items(i)%HoleType) | |||
call json%add(p,"Angle",data%Configuration%Path%items(i)%Angle) | |||
call json%add(p,"Length",data%Configuration%Path%items(i)%Length) | |||
call json%add(p,"FinalAngle",data%Configuration%Path%items(i)%FinalAngle) | |||
call json%add(p,"TotalLength",data%Configuration%Path%items(i)%TotalLength) | |||
call json%add(p,"MeasuredDepth",data%Configuration%Path%items(i)%MeasuredDepth) | |||
call json%add(p,"TotalVerticalDepth",data%Configuration%Path%items(i)%TotalVerticalDepth) | |||
call json%add(pitems,p) | |||
end do | |||
call json%create_array(pdp,'DataPoints') | |||
do i=1,data%Configuration%Path%DataPointsCount | |||
call json%create_object(p,'') | |||
call json%add(p,"X",data%Configuration%Path%DataPoints(i)%X) | |||
call json%add(p,"Y",data%Configuration%Path%DataPoints(i)%Y) | |||
call json%add(pdp,p) | |||
end do | |||
! 3. add new node to parent | |||
call json%add(ppath,pitems) | |||
call json%add(ppath,pdp) | |||
call json%add(parent,ppath) | |||
end subroutine | |||
end module CPathGeneration |
@@ -1,30 +1,30 @@ | |||
module CPathGenerationVariables | |||
implicit none | |||
public | |||
! types | |||
type, bind(c), public :: CPathGenerationItem | |||
integer :: HoleType | |||
real(8) :: Angle | |||
real(8) :: Length | |||
real(8) :: FinalAngle | |||
real(8) :: TotalLength | |||
real(8) :: MeasuredDepth | |||
real(8) :: TotalVerticalDepth | |||
end type CPathGenerationItem | |||
type, bind(c), public :: CDataPointItem | |||
real(8) :: X | |||
real(8) :: Y | |||
end type CDataPointItem | |||
Type :: PathGenerationType | |||
integer :: ItemCount = 0 | |||
type(CPathGenerationItem), allocatable :: Items(:) | |||
integer :: DataPointsCount = 0 | |||
type(CDataPointItem), allocatable :: DataPoints(:) | |||
End type PathGenerationType | |||
! Type(PathGenerationType)::PathGeneration | |||
module CPathGenerationVariables | |||
implicit none | |||
public | |||
! types | |||
type, bind(c), public :: CPathGenerationItem | |||
integer :: HoleType | |||
real(8) :: Angle | |||
real(8) :: Length | |||
real(8) :: FinalAngle | |||
real(8) :: TotalLength | |||
real(8) :: MeasuredDepth | |||
real(8) :: TotalVerticalDepth | |||
end type CPathGenerationItem | |||
type, bind(c), public :: CDataPointItem | |||
real(8) :: X | |||
real(8) :: Y | |||
end type CDataPointItem | |||
Type :: PathGenerationType | |||
integer :: ItemCount = 0 | |||
type(CPathGenerationItem), allocatable :: Items(:) | |||
integer :: DataPointsCount = 0 | |||
type(CDataPointItem), allocatable :: DataPoints(:) | |||
End type PathGenerationType | |||
! Type(PathGenerationType)::PathGeneration | |||
end module CPathGenerationVariables |
@@ -1,34 +1,34 @@ | |||
module CWellSurveyData | |||
use CWellSurveyDataVariables | |||
implicit none | |||
public | |||
contains | |||
! integer function SetSurveyData(count, array) | |||
! !DEC$ ATTRIBUTES DLLEXPORT::SetSurveyData | |||
! !DEC$ ATTRIBUTES ALIAS: 'SetSurveyData' :: SetSurveyData | |||
! implicit none | |||
! integer, intent(in) :: count | |||
! integer :: i | |||
! type(CSurveyDataItem), intent(inout), target :: array(count) | |||
! type(CSurveyDataItem), pointer :: item | |||
! WellSurveyData%Count = count | |||
! if(size(WellSurveyData%Items) > 0) then | |||
! deallocate(WellSurveyData%Items) | |||
! end if | |||
! if(count > 0) then | |||
! allocate(WellSurveyData%Items(count)) | |||
! do i = 1, count | |||
! item => array(i) | |||
! WellSurveyData%Items(i)%MeasuredDepth = item%MeasuredDepth | |||
! WellSurveyData%Items(i)%Inclination = item%Inclination | |||
! WellSurveyData%Items(i)%Azimoth = item%Azimoth | |||
! WellSurveyData%Items(i)%TotalVerticalDepth = item%TotalVerticalDepth | |||
! WellSurveyData%Items(i)%X = item%X | |||
! WellSurveyData%Items(i)%Y = item%Y | |||
! WellSurveyData%Items(i)%Z = item%Z | |||
! end do | |||
! end if | |||
! SetSurveyData = 0 | |||
! end function SetSurveyData | |||
module CWellSurveyData | |||
use CWellSurveyDataVariables | |||
implicit none | |||
public | |||
contains | |||
! integer function SetSurveyData(count, array) | |||
! !DEC$ ATTRIBUTES DLLEXPORT::SetSurveyData | |||
! !DEC$ ATTRIBUTES ALIAS: 'SetSurveyData' :: SetSurveyData | |||
! implicit none | |||
! integer, intent(in) :: count | |||
! integer :: i | |||
! type(CSurveyDataItem), intent(inout), target :: array(count) | |||
! type(CSurveyDataItem), pointer :: item | |||
! WellSurveyData%Count = count | |||
! if(size(WellSurveyData%Items) > 0) then | |||
! deallocate(WellSurveyData%Items) | |||
! end if | |||
! if(count > 0) then | |||
! allocate(WellSurveyData%Items(count)) | |||
! do i = 1, count | |||
! item => array(i) | |||
! WellSurveyData%Items(i)%MeasuredDepth = item%MeasuredDepth | |||
! WellSurveyData%Items(i)%Inclination = item%Inclination | |||
! WellSurveyData%Items(i)%Azimoth = item%Azimoth | |||
! WellSurveyData%Items(i)%TotalVerticalDepth = item%TotalVerticalDepth | |||
! WellSurveyData%Items(i)%X = item%X | |||
! WellSurveyData%Items(i)%Y = item%Y | |||
! WellSurveyData%Items(i)%Z = item%Z | |||
! end do | |||
! end if | |||
! SetSurveyData = 0 | |||
! end function SetSurveyData | |||
end module CWellSurveyData |
@@ -1,23 +1,23 @@ | |||
module CWellSurveyDataVariables | |||
implicit none | |||
public | |||
! types | |||
type, bind(c), public :: CSurveyDataItem | |||
real(8) :: MeasuredDepth | |||
real(8) :: Inclination | |||
real(8) :: Azimoth | |||
real(8) :: TotalVerticalDepth | |||
real(8) :: X | |||
real(8) :: Y | |||
real(8) :: Z | |||
end type CSurveyDataItem | |||
Type :: WellSurveyDataType | |||
integer :: Count = 0 | |||
type(CSurveyDataItem), allocatable :: Items(:) | |||
End Type WellSurveyDataType | |||
Type(WellSurveyDataType)::WellSurveyData | |||
contains | |||
module CWellSurveyDataVariables | |||
implicit none | |||
public | |||
! types | |||
type, bind(c), public :: CSurveyDataItem | |||
real(8) :: MeasuredDepth | |||
real(8) :: Inclination | |||
real(8) :: Azimoth | |||
real(8) :: TotalVerticalDepth | |||
real(8) :: X | |||
real(8) :: Y | |||
real(8) :: Z | |||
end type CSurveyDataItem | |||
Type :: WellSurveyDataType | |||
integer :: Count = 0 | |||
type(CSurveyDataItem), allocatable :: Items(:) | |||
End Type WellSurveyDataType | |||
! Type(WellSurveyDataType)::WellSurveyData | |||
contains | |||
end module CWellSurveyDataVariables |
@@ -1,50 +1,50 @@ | |||
module CCommon | |||
use CCommonVariables | |||
implicit none | |||
public | |||
contains | |||
! Input routines | |||
subroutine SetStandRack(v) | |||
implicit none | |||
integer, intent(in) :: v | |||
if(Common%StandRack == v) return | |||
Common%StandRack = v | |||
! call Common%OnStandRackChange%Run(v) | |||
end subroutine | |||
integer function GetStandRack() | |||
implicit none | |||
GetStandRack = Common%StandRack | |||
end function | |||
! subroutine SetStandRack_WN(v) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SetStandRack_WN | |||
! !DEC$ ATTRIBUTES ALIAS: 'SetStandRack_WN' :: SetStandRack_WN | |||
! implicit none | |||
! integer, intent(in) :: v | |||
! call SetStandRack(v) | |||
! end subroutine | |||
! ! Output routines | |||
! logical function GetDrillWatchOperationMode() | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: GetDrillWatchOperationMode | |||
! !DEC$ ATTRIBUTES ALIAS: 'GetDrillWatchOperationMode' :: GetDrillWatchOperationMode | |||
! implicit none | |||
! GetDrillWatchOperationMode = Common%DrillWatchOperationMode | |||
! end function | |||
! integer function GetStandRack_WN() | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: GetStandRack_WN | |||
! !DEC$ ATTRIBUTES ALIAS: 'GetStandRack_WN' :: GetStandRack_WN | |||
! implicit none | |||
! GetStandRack_WN = Common%StandRack | |||
! end function | |||
module CCommon | |||
use CCommonVariables | |||
implicit none | |||
public | |||
contains | |||
! Input routines | |||
subroutine SetStandRack(v) | |||
implicit none | |||
integer, intent(in) :: v | |||
if(Common%StandRack == v) return | |||
Common%StandRack = v | |||
! call Common%OnStandRackChange%Run(v) | |||
end subroutine | |||
integer function GetStandRack() | |||
implicit none | |||
GetStandRack = Common%StandRack | |||
end function | |||
! subroutine SetStandRack_WN(v) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SetStandRack_WN | |||
! !DEC$ ATTRIBUTES ALIAS: 'SetStandRack_WN' :: SetStandRack_WN | |||
! implicit none | |||
! integer, intent(in) :: v | |||
! call SetStandRack(v) | |||
! end subroutine | |||
! ! Output routines | |||
! logical function GetDrillWatchOperationMode() | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: GetDrillWatchOperationMode | |||
! !DEC$ ATTRIBUTES ALIAS: 'GetDrillWatchOperationMode' :: GetDrillWatchOperationMode | |||
! implicit none | |||
! GetDrillWatchOperationMode = Common%DrillWatchOperationMode | |||
! end function | |||
! integer function GetStandRack_WN() | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: GetStandRack_WN | |||
! !DEC$ ATTRIBUTES ALIAS: 'GetStandRack_WN' :: GetStandRack_WN | |||
! implicit none | |||
! GetStandRack_WN = Common%StandRack | |||
! end function | |||
end module CCommon |
@@ -1,16 +1,16 @@ | |||
module CCommonVariables | |||
!**use CIntegerEventHandler | |||
implicit none | |||
public | |||
type :: CommonType | |||
! Input vars | |||
integer :: StandRack | |||
! type(IntegerEventHandler) :: OnStandRackChange | |||
! Output vars | |||
logical :: DrillWatchOperationMode | |||
end type | |||
type(CommonType):: Common | |||
contains | |||
module CCommonVariables | |||
!**use CIntegerEventHandler | |||
implicit none | |||
public | |||
type :: CommonType | |||
! Input vars | |||
integer :: StandRack | |||
! type(IntegerEventHandler) :: OnStandRackChange | |||
! Output vars | |||
logical :: DrillWatchOperationMode | |||
end type | |||
type(CommonType):: Common | |||
contains | |||
end module CCommonVariables |
@@ -1,55 +1,55 @@ | |||
module CIActionReference | |||
implicit none | |||
abstract interface | |||
subroutine ActionVoid() | |||
end subroutine | |||
subroutine ActionBool(i) | |||
logical, intent (in) :: i | |||
end subroutine | |||
subroutine ActionInteger(i) | |||
integer, intent (in) :: i | |||
end subroutine | |||
subroutine ActionIntegerArray(arr) | |||
integer, allocatable, intent (in) :: arr(:) | |||
end subroutine | |||
subroutine ActionReal(i) | |||
real, intent (in) :: i | |||
end subroutine | |||
subroutine ActionDouble(i) | |||
real(8), intent (in) :: i | |||
end subroutine | |||
subroutine ActionDualDouble(a, b) | |||
real(8), intent (in) :: a, b | |||
end subroutine | |||
subroutine ActionString(c) | |||
character(len=*), intent(in) :: c | |||
end subroutine | |||
subroutine ActionStringInt(c, i) | |||
character(len=*), intent(in) :: c | |||
integer, intent (in) :: i | |||
end subroutine | |||
subroutine ActionStringFloat(c, f) | |||
character(len=*), intent(in) :: c | |||
real, intent (in) :: f | |||
end subroutine | |||
subroutine ActionStringDouble(c, d) | |||
character(len=*), intent(in) :: c | |||
real(8), intent (in) :: d | |||
end subroutine | |||
subroutine ActionStringBool(c, b) | |||
character(len=*), intent(in) :: c | |||
logical, intent (in) :: b | |||
end subroutine | |||
end interface | |||
module CIActionReference | |||
implicit none | |||
abstract interface | |||
subroutine ActionVoid() | |||
end subroutine | |||
subroutine ActionBool(i) | |||
logical, intent (in) :: i | |||
end subroutine | |||
subroutine ActionInteger(i) | |||
integer, intent (in) :: i | |||
end subroutine | |||
subroutine ActionIntegerArray(arr) | |||
integer, allocatable, intent (in) :: arr(:) | |||
end subroutine | |||
subroutine ActionReal(i) | |||
real, intent (in) :: i | |||
end subroutine | |||
subroutine ActionDouble(i) | |||
real(8), intent (in) :: i | |||
end subroutine | |||
subroutine ActionDualDouble(a, b) | |||
real(8), intent (in) :: a, b | |||
end subroutine | |||
subroutine ActionString(c) | |||
character(len=*), intent(in) :: c | |||
end subroutine | |||
subroutine ActionStringInt(c, i) | |||
character(len=*), intent(in) :: c | |||
integer, intent (in) :: i | |||
end subroutine | |||
subroutine ActionStringFloat(c, f) | |||
character(len=*), intent(in) :: c | |||
real, intent (in) :: f | |||
end subroutine | |||
subroutine ActionStringDouble(c, d) | |||
character(len=*), intent(in) :: c | |||
real(8), intent (in) :: d | |||
end subroutine | |||
subroutine ActionStringBool(c, b) | |||
character(len=*), intent(in) :: c | |||
logical, intent (in) :: b | |||
end subroutine | |||
end interface | |||
end module CIActionReference |
@@ -1,17 +1,17 @@ | |||
module CQuery | |||
implicit none | |||
public GetCurrentProcessorNumber | |||
interface | |||
function GetCurrentProcessorNumber() bind(C,Name='GetCurrentProcessorNumber') | |||
use ifwinty | |||
implicit none | |||
!DEC$ ATTRIBUTES STDCALL :: GetCurrentProcessorNumber | |||
integer(DWORD) :: GetCurrentProcessorNumber | |||
end function GetCurrentProcessorNumber | |||
end interface | |||
contains | |||
module CQuery | |||
implicit none | |||
public GetCurrentProcessorNumber | |||
interface | |||
function GetCurrentProcessorNumber() bind(C,Name='GetCurrentProcessorNumber') | |||
use ifwinty | |||
implicit none | |||
!DEC$ ATTRIBUTES STDCALL :: GetCurrentProcessorNumber | |||
integer(DWORD) :: GetCurrentProcessorNumber | |||
end function GetCurrentProcessorNumber | |||
end interface | |||
contains | |||
end module CQuery |
@@ -1,16 +1,16 @@ | |||
module CScaleRange | |||
implicit none | |||
public | |||
contains | |||
real function ScaleRange(x, toMin, toMax, fromMin, fromMax) | |||
implicit none | |||
real, intent(in) :: x | |||
real, intent(in) :: toMin | |||
real, intent(in) :: toMax | |||
real, intent(in) :: fromMin | |||
real, intent(in) :: fromMax | |||
ScaleRange = ((toMax - toMin)*(x - fromMin)/(fromMax - fromMin)) + toMin | |||
end function | |||
end module CScaleRange | |||
module CScaleRange | |||
implicit none | |||
public | |||
contains | |||
real function ScaleRange(x, toMin, toMax, fromMin, fromMax) | |||
implicit none | |||
real, intent(in) :: x | |||
real, intent(in) :: toMin | |||
real, intent(in) :: toMax | |||
real, intent(in) :: fromMin | |||
real, intent(in) :: fromMax | |||
ScaleRange = ((toMax - toMin)*(x - fromMin)/(fromMax - fromMin)) + toMin | |||
end function | |||
end module CScaleRange |
@@ -1,54 +1,54 @@ | |||
module CTimer | |||
use ifwin, only: QueryPerformanceFrequency, QueryPerformanceCounter, T_LARGE_INTEGER | |||
use ISO_C_BINDING | |||
use ISO_FORTRAN_ENV | |||
implicit none | |||
public | |||
type, public :: Timer | |||
type(T_LARGE_INTEGER) :: StartTime | |||
type(T_LARGE_INTEGER) :: EndTime | |||
contains | |||
procedure :: Start => Start | |||
procedure :: Finish => Finish | |||
procedure :: ElapsedTimeMs => ElapsedTime | |||
end type Timer | |||
contains | |||
subroutine Start(this) | |||
implicit none | |||
class(Timer), intent(inout) :: this | |||
integer :: ApiResult | |||
ApiResult = QueryPerformanceCounter(this%StartTime) | |||
end subroutine | |||
subroutine Finish(this) | |||
implicit none | |||
class(Timer), intent(inout) :: this | |||
integer :: ApiResult | |||
ApiResult = QueryPerformanceCounter(this%EndTime) | |||
end subroutine | |||
integer function ElapsedTime(this) | |||
implicit none | |||
class(Timer), intent(inout) :: this | |||
real(kind=REAL128) :: time | |||
time = CalcTime(this%StartTime, this%EndTime) | |||
ElapsedTime = int(time * 1000.0) | |||
end function | |||
real(kind=REAL128) function CalcTime(start, finish) | |||
implicit none | |||
type(T_LARGE_INTEGER), intent(in) :: start | |||
type(T_LARGE_INTEGER), intent(in) :: finish | |||
type(T_LARGE_INTEGER) :: freq | |||
integer :: ApiResult | |||
integer(kind=INT64) :: freq_64 | |||
integer(kind=INT64) :: start_64 | |||
integer(kind=INT64) :: finish_64 | |||
start_64 = Make64(start) | |||
finish_64 = Make64(finish) | |||
ApiResult = QueryPerformanceFrequency(freq) | |||
freq_64 = Make64( freq) | |||
CalcTime = real(finish_64-start_64,kind=REAL128) / real(freq_64,kind=REAL128) | |||
end function | |||
integer(kind=INT64) function Make64(bit64_int) | |||
type(T_LARGE_INTEGER), intent(in) :: bit64_int | |||
Make64 = transfer(bit64_int, 0_INT64) | |||
end function | |||
module CTimer | |||
use ifwin, only: QueryPerformanceFrequency, QueryPerformanceCounter, T_LARGE_INTEGER | |||
use ISO_C_BINDING | |||
use ISO_FORTRAN_ENV | |||
implicit none | |||
public | |||
type, public :: Timer | |||
type(T_LARGE_INTEGER) :: StartTime | |||
type(T_LARGE_INTEGER) :: EndTime | |||
contains | |||
procedure :: Start => Start | |||
procedure :: Finish => Finish | |||
procedure :: ElapsedTimeMs => ElapsedTime | |||
end type Timer | |||
contains | |||
subroutine Start(this) | |||
implicit none | |||
class(Timer), intent(inout) :: this | |||
integer :: ApiResult | |||
ApiResult = QueryPerformanceCounter(this%StartTime) | |||
end subroutine | |||
subroutine Finish(this) | |||
implicit none | |||
class(Timer), intent(inout) :: this | |||
integer :: ApiResult | |||
ApiResult = QueryPerformanceCounter(this%EndTime) | |||
end subroutine | |||
integer function ElapsedTime(this) | |||
implicit none | |||
class(Timer), intent(inout) :: this | |||
real(kind=REAL128) :: time | |||
time = CalcTime(this%StartTime, this%EndTime) | |||
ElapsedTime = int(time * 1000.0) | |||
end function | |||
real(kind=REAL128) function CalcTime(start, finish) | |||
implicit none | |||
type(T_LARGE_INTEGER), intent(in) :: start | |||
type(T_LARGE_INTEGER), intent(in) :: finish | |||
type(T_LARGE_INTEGER) :: freq | |||
integer :: ApiResult | |||
integer(kind=INT64) :: freq_64 | |||
integer(kind=INT64) :: start_64 | |||
integer(kind=INT64) :: finish_64 | |||
start_64 = Make64(start) | |||
finish_64 = Make64(finish) | |||
ApiResult = QueryPerformanceFrequency(freq) | |||
freq_64 = Make64( freq) | |||
CalcTime = real(finish_64-start_64,kind=REAL128) / real(freq_64,kind=REAL128) | |||
end function | |||
integer(kind=INT64) function Make64(bit64_int) | |||
type(T_LARGE_INTEGER), intent(in) :: bit64_int | |||
Make64 = transfer(bit64_int, 0_INT64) | |||
end function | |||
end module CTimer |
@@ -1,28 +1,28 @@ | |||
module CTimerLegacy | |||
implicit none | |||
public | |||
type, public :: TimerLegacy | |||
integer, dimension(8) :: StartTime | |||
integer, dimension(8) :: EndTime | |||
contains | |||
procedure :: Start => Start | |||
procedure :: Finish => Finish | |||
procedure :: ElapsedTimeMs => ElapsedTime | |||
end type TimerLegacy | |||
contains | |||
subroutine Start(this) | |||
implicit none | |||
class(TimerLegacy), intent(inout) :: this | |||
call date_and_time(values=this%StartTime) | |||
end subroutine | |||
subroutine Finish(this) | |||
implicit none | |||
class(TimerLegacy), intent(inout) :: this | |||
call date_and_time(values=this%EndTime) | |||
end subroutine | |||
integer function ElapsedTime(this) | |||
implicit none | |||
class(TimerLegacy), intent(inout) :: this | |||
ElapsedTime = (this%EndTime(6)*60000+this%EndTime(7)*1000+this%EndTime(8)) - (this%StartTime(6)*60000+this%StartTime(7)*1000+this%StartTime(8)) | |||
end function | |||
module CTimerLegacy | |||
implicit none | |||
public | |||
type, public :: TimerLegacy | |||
integer, dimension(8) :: StartTime | |||
integer, dimension(8) :: EndTime | |||
contains | |||
procedure :: Start => Start | |||
procedure :: Finish => Finish | |||
procedure :: ElapsedTimeMs => ElapsedTime | |||
end type TimerLegacy | |||
contains | |||
subroutine Start(this) | |||
implicit none | |||
class(TimerLegacy), intent(inout) :: this | |||
call date_and_time(values=this%StartTime) | |||
end subroutine | |||
subroutine Finish(this) | |||
implicit none | |||
class(TimerLegacy), intent(inout) :: this | |||
call date_and_time(values=this%EndTime) | |||
end subroutine | |||
integer function ElapsedTime(this) | |||
implicit none | |||
class(TimerLegacy), intent(inout) :: this | |||
ElapsedTime = (this%EndTime(6)*60000+this%EndTime(7)*1000+this%EndTime(8)) - (this%StartTime(6)*60000+this%StartTime(7)*1000+this%StartTime(8)) | |||
end function | |||
end module CTimerLegacy |
@@ -1,105 +1,105 @@ | |||
module CDownHoleActions | |||
use CIActionReference | |||
implicit none | |||
public | |||
abstract interface | |||
subroutine ActionFluid(array) | |||
use CDownHoleTypes | |||
type(CFluid), allocatable, intent(in), target :: array(:) | |||
end subroutine | |||
subroutine ActionComponent(array) | |||
use CDownHoleTypes | |||
type(CStringComponent), allocatable, intent(in), target :: array(:) | |||
end subroutine | |||
subroutine ActionBopElement(array) | |||
use CDownHoleTypes | |||
type(CBopElement), allocatable, intent(in), target :: array(:) | |||
end subroutine | |||
end interface | |||
procedure (ActionInteger), pointer :: AnnalusMudCountPtr | |||
procedure (ActionFluid), pointer :: AnnalusMudArrayPtr | |||
procedure (ActionInteger), pointer :: StringMudCountPtr | |||
procedure (ActionFluid), pointer :: StringMudArrayPtr | |||
procedure (ActionInteger), pointer :: StringComponentCountPtr | |||
procedure (ActionComponent), pointer :: StringComponentArrayPtr | |||
procedure (ActionBopElement), pointer :: BopElementsPtr | |||
contains | |||
subroutine SubscribeAnnalusMudCount(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeAnnalusMudCount | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeAnnalusMudCount' :: SubscribeAnnalusMudCount | |||
implicit none | |||
procedure (ActionInteger) :: a | |||
AnnalusMudCountPtr => a | |||
end subroutine | |||
subroutine SubscribeAnnalusMudArray(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeAnnalusMudArray | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeAnnalusMudArray' :: SubscribeAnnalusMudArray | |||
implicit none | |||
procedure (ActionFluid) :: a | |||
AnnalusMudArrayPtr => a | |||
end subroutine | |||
subroutine SubscribeStringMudCount(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringMudCount | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringMudCount' :: SubscribeStringMudCount | |||
implicit none | |||
procedure (ActionInteger) :: a | |||
StringMudCountPtr => a | |||
end subroutine | |||
subroutine SubscribeStringMudArray(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringMudArray | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringMudArray' :: SubscribeStringMudArray | |||
implicit none | |||
procedure (ActionFluid) :: a | |||
StringMudArrayPtr => a | |||
end subroutine | |||
subroutine SubscribeStringComponentCount(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringComponentCount | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringComponentCount' :: SubscribeStringComponentCount | |||
implicit none | |||
procedure (ActionInteger) :: a | |||
StringComponentCountPtr => a | |||
end subroutine | |||
subroutine SubscribeStringComponentArray(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringComponentArray | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringComponentArray' :: SubscribeStringComponentArray | |||
implicit none | |||
procedure (ActionComponent) :: a | |||
StringComponentArrayPtr => a | |||
end subroutine | |||
subroutine SubscribeBopElements(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeBopElements | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeBopElements' :: SubscribeBopElements | |||
implicit none | |||
procedure (ActionBopElement) :: a | |||
BopElementsPtr => a | |||
end subroutine | |||
module CDownHoleActions | |||
use CIActionReference | |||
implicit none | |||
public | |||
abstract interface | |||
subroutine ActionFluid(array) | |||
use CDownHoleTypes | |||
type(CFluid), allocatable, intent(in), target :: array(:) | |||
end subroutine | |||
subroutine ActionComponent(array) | |||
use CDownHoleTypes | |||
type(CStringComponent), allocatable, intent(in), target :: array(:) | |||
end subroutine | |||
subroutine ActionBopElement(array) | |||
use CDownHoleTypes | |||
type(CBopElement), allocatable, intent(in), target :: array(:) | |||
end subroutine | |||
end interface | |||
procedure (ActionInteger), pointer :: AnnalusMudCountPtr | |||
procedure (ActionFluid), pointer :: AnnalusMudArrayPtr | |||
procedure (ActionInteger), pointer :: StringMudCountPtr | |||
procedure (ActionFluid), pointer :: StringMudArrayPtr | |||
procedure (ActionInteger), pointer :: StringComponentCountPtr | |||
procedure (ActionComponent), pointer :: StringComponentArrayPtr | |||
procedure (ActionBopElement), pointer :: BopElementsPtr | |||
contains | |||
subroutine SubscribeAnnalusMudCount(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeAnnalusMudCount | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeAnnalusMudCount' :: SubscribeAnnalusMudCount | |||
implicit none | |||
procedure (ActionInteger) :: a | |||
AnnalusMudCountPtr => a | |||
end subroutine | |||
subroutine SubscribeAnnalusMudArray(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeAnnalusMudArray | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeAnnalusMudArray' :: SubscribeAnnalusMudArray | |||
implicit none | |||
procedure (ActionFluid) :: a | |||
AnnalusMudArrayPtr => a | |||
end subroutine | |||
subroutine SubscribeStringMudCount(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringMudCount | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringMudCount' :: SubscribeStringMudCount | |||
implicit none | |||
procedure (ActionInteger) :: a | |||
StringMudCountPtr => a | |||
end subroutine | |||
subroutine SubscribeStringMudArray(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringMudArray | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringMudArray' :: SubscribeStringMudArray | |||
implicit none | |||
procedure (ActionFluid) :: a | |||
StringMudArrayPtr => a | |||
end subroutine | |||
subroutine SubscribeStringComponentCount(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringComponentCount | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringComponentCount' :: SubscribeStringComponentCount | |||
implicit none | |||
procedure (ActionInteger) :: a | |||
StringComponentCountPtr => a | |||
end subroutine | |||
subroutine SubscribeStringComponentArray(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringComponentArray | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringComponentArray' :: SubscribeStringComponentArray | |||
implicit none | |||
procedure (ActionComponent) :: a | |||
StringComponentArrayPtr => a | |||
end subroutine | |||
subroutine SubscribeBopElements(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeBopElements | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeBopElements' :: SubscribeBopElements | |||
implicit none | |||
procedure (ActionBopElement) :: a | |||
BopElementsPtr => a | |||
end subroutine | |||
end module CDownHoleActions |
@@ -1,52 +1,52 @@ | |||
module CDownHoleTypes | |||
implicit none | |||
public | |||
!enums | |||
enum, bind(c) | |||
enumerator STRING_BIT !0 | |||
enumerator STRING_STABILIZER !1 | |||
enumerator STRING_COLLAR !2 | |||
enumerator STRING_DRILLPIPE !3 | |||
enumerator STRING_HEAVYWEIGHT !4 | |||
end enum | |||
enum, bind(c) | |||
enumerator FLUID_NORMAL_MUD !0 | |||
enumerator FLUID_GAS_KICK !1 | |||
enumerator FLUID_WATER_KICK !2 | |||
enumerator FLUID_OIL_KICK !3 | |||
enumerator FLUID_NO_MUD !4 | |||
end enum | |||
! new types | |||
type, bind(c), public :: CFluid | |||
real(8) :: StartMd | |||
real(8) :: EndMd | |||
real(8) :: Density | |||
integer :: MudType | |||
end type CFluid | |||
type, bind(c), public :: CStringComponents | |||
real(8) :: Length | |||
real(8) :: TopDepth | |||
real(8) :: DownDepth | |||
real(8) :: Od | |||
real(8) :: Id | |||
integer :: ComponentType | |||
end type CStringComponents | |||
type, bind(c), public :: CStringComponent | |||
real(8) :: StartMd | |||
real(8) :: EndMd | |||
integer :: ComponentType | |||
end type CStringComponent | |||
type, bind(c), public :: CBopElement | |||
integer :: ElementType | |||
real :: ElementStart | |||
real :: ElementEnd | |||
end type CBopElement | |||
contains | |||
module CDownHoleTypes | |||
implicit none | |||
public | |||
!enums | |||
enum, bind(c) | |||
enumerator STRING_BIT !0 | |||
enumerator STRING_STABILIZER !1 | |||
enumerator STRING_COLLAR !2 | |||
enumerator STRING_DRILLPIPE !3 | |||
enumerator STRING_HEAVYWEIGHT !4 | |||
end enum | |||
enum, bind(c) | |||
enumerator FLUID_NORMAL_MUD !0 | |||
enumerator FLUID_GAS_KICK !1 | |||
enumerator FLUID_WATER_KICK !2 | |||
enumerator FLUID_OIL_KICK !3 | |||
enumerator FLUID_NO_MUD !4 | |||
end enum | |||
! new types | |||
type, bind(c), public :: CFluid | |||
real(8) :: StartMd | |||
real(8) :: EndMd | |||
real(8) :: Density | |||
integer :: MudType | |||
end type CFluid | |||
type, bind(c), public :: CStringComponents | |||
real(8) :: Length | |||
real(8) :: TopDepth | |||
real(8) :: DownDepth | |||
real(8) :: Od | |||
real(8) :: Id | |||
integer :: ComponentType | |||
end type CStringComponents | |||
type, bind(c), public :: CStringComponent | |||
real(8) :: StartMd | |||
real(8) :: EndMd | |||
integer :: ComponentType | |||
end type CStringComponent | |||
type, bind(c), public :: CBopElement | |||
integer :: ElementType | |||
real :: ElementStart | |||
real :: ElementEnd | |||
end type CBopElement | |||
contains | |||
end module CDownHoleTypes |
@@ -1,43 +1,43 @@ | |||
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 | |||
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 |
@@ -1,204 +1,204 @@ | |||
module DownHoleModule | |||
use SimulationVariables | |||
contains | |||
subroutine SetAnnalusFluids(count, array) | |||
implicit none | |||
integer, intent(in) :: count | |||
integer :: i, offset | |||
type(CFluid), intent(inout), target :: array(count) | |||
type(CFluid), pointer :: item | |||
DownHole%AnnalusFluidsCount = count | |||
print*, 'AnnalusFluidsCount = ', count | |||
if(size(DownHole%AnnalusFluids) > 0) then | |||
deallocate(DownHole%AnnalusFluids) | |||
end if | |||
if(count > 0) then | |||
offset = 0; | |||
item => array(1) | |||
if(item%StartMd > 0) then | |||
DownHole%AnnalusFluidsCount = DownHole%AnnalusFluidsCount + 1 | |||
offset = 1; | |||
allocate(DownHole%AnnalusFluids(DownHole%AnnalusFluidsCount)) | |||
DownHole%AnnalusFluids(1)%StartMd = 0 | |||
DownHole%AnnalusFluids(1)%EndMd = item%StartMd | |||
DownHole%AnnalusFluids(1)%Density = 0 | |||
DownHole%AnnalusFluids(1)%MudType = FLUID_NO_MUD | |||
endif | |||
!if(associated(AnnalusMudCountPtr)) then | |||
! call AnnalusMudCountPtr(AnnalusFluidsCount) | |||
!end if | |||
if(.not.allocated(DownHole%AnnalusFluids))allocate(DownHole%AnnalusFluids(DownHole%AnnalusFluidsCount)) | |||
!print*, '============START-AN============' | |||
if(item%StartMd < 0) DownHole%AnnalusFluids(1)%StartMd = 0 | |||
do i = 1, count | |||
item => array(i) | |||
DownHole%AnnalusFluids(i + offset)%StartMd = item%StartMd | |||
if(i==1) DownHole%AnnalusFluids(i)%StartMd = 0 | |||
!print*, 'AnnalusFluids(',i,')%StartMd=', AnnalusFluids(i)%StartMd | |||
DownHole%AnnalusFluids(i + offset)%EndMd = item%EndMd | |||
!print*, 'AnnalusFluids(',i,')%EndMd=', AnnalusFluids(i)%EndMd | |||
DownHole%AnnalusFluids(i + offset)%Density = item%Density | |||
!print*, 'AnnalusFluids(',i,')%Density=', AnnalusFluids(i)%Density | |||
DownHole%AnnalusFluids(i + offset)%MudType = item%MudType | |||
!print*, 'AnnalusFluids(',i,')%MudType=', AnnalusFluids(i)%MudType | |||
!print*, '----------------------------' | |||
end do | |||
!print*, '============END-AN============' | |||
!if(associated(AnnalusMudArrayPtr)) then | |||
! !AnnalusFluidsPtr => AnnalusFluids | |||
! call AnnalusMudArrayPtr(AnnalusFluids) | |||
!end if | |||
end if | |||
end subroutine SetAnnalusFluids | |||
subroutine SetStringFluids(count, array) | |||
implicit none | |||
integer, intent(in) :: count | |||
integer :: i, offset !, startArr | |||
type(CFluid), intent(inout), target :: array(count) | |||
type(CFluid), pointer :: item | |||
DownHole%StringFluidsCount = count | |||
print*, 'StringFluidsCount = ', count | |||
if(size(DownHole%StringFluids) > 0) then | |||
deallocate(DownHole%StringFluids) | |||
end if | |||
!startArr = 1 | |||
if(count > 0) then | |||
offset = 0; | |||
item => array(1) | |||
! | |||
!if(item%StartMd <= 0 .and. item%EndMd <= 0) then | |||
! StringFluidsCount = StringFluidsCount - 1 | |||
! count = count - 1 | |||
! offset = offset + 1 | |||
! startArr = startArr + 1 | |||
!endif | |||
! | |||
!if(count <= 0) return | |||
if(item%StartMd > 0) then | |||
DownHole%StringFluidsCount = DownHole%StringFluidsCount + 1 | |||
offset = offset + 1 | |||
allocate(DownHole%StringFluids(DownHole%StringFluidsCount)) | |||
DownHole%StringFluids(1)%StartMd = 0 | |||
DownHole%StringFluids(1)%EndMd = item%StartMd | |||
DownHole%StringFluids(1)%Density = 0 | |||
DownHole%StringFluids(1)%MudType = FLUID_NO_MUD | |||
endif | |||
!if(associated(StringMudCountPtr)) then | |||
! call StringMudCountPtr(count) | |||
!end if | |||
if(.not.allocated(DownHole%StringFluids))allocate(DownHole%StringFluids(DownHole%StringFluidsCount)) | |||
!print*, '============START-ST============' | |||
!print*, 'count=', count | |||
do i = 1, count | |||
item => array(i) | |||
DownHole%StringFluids(i + offset)%StartMd = item%StartMd | |||
if(i==1) DownHole%StringFluids(i)%StartMd = 0 | |||
!print*, 'StringFluids(i)%StartMd=', StringFluids(i)%StartMd | |||
DownHole%StringFluids(i + offset)%EndMd = item%EndMd | |||
!print*, 'StringFluids(i)%EndMd=', StringFluids(i)%EndMd | |||
DownHole%StringFluids(i + offset)%Density = item%Density | |||
DownHole%StringFluids(i + offset)%MudType = item%MudType | |||
!print*, '----------------------------' | |||
end do | |||
!!if(item%StartMd < 0) StringFluids(1)%StartMd = 0 | |||
!!print*, '============END-ST============' | |||
!if(associated(StringMudArrayPtr)) then | |||
! call StringMudArrayPtr(StringFluids) | |||
!end if | |||
end if | |||
end subroutine SetStringFluids | |||
subroutine SetString(count, array) | |||
use CLog3 | |||
implicit none | |||
integer, intent(in) :: count | |||
integer :: i !, j | |||
type(CStringComponents), intent(inout), target :: array(count) | |||
type(CStringComponents), pointer :: item | |||
DownHole%StringCount = count | |||
if(size(DownHole%String) > 0) then | |||
deallocate(DownHole%String) | |||
end if | |||
if(count > 0) then | |||
!if(associated(StringComponentCountPtr)) then | |||
! call StringComponentCountPtr(count) | |||
!end if | |||
allocate(DownHole%String(count)) | |||
!j = 0 | |||
!print*, '============CMP-ST============' | |||
!call Log_3( '============CMP-ST============') | |||
!do i = count, 1, -1 | |||
do i = 1, count | |||
item => array(i) | |||
!String(i)%Length = item%Length | |||
!String(i)%TopDepth = item%TopDepth | |||
!String(i)%DownDepth = item%DownDepth | |||
!String(i)%Od = item%Od | |||
!String(i)%Id = item%Id | |||
DownHole%String(i)%ComponentType= item%ComponentType | |||
!j = j + 1 | |||
DownHole%String(i)%StartMd = item%TopDepth | |||
DownHole%String(i)%EndMd = item%DownDepth | |||
DownHole%String(i)%ComponentType=0 | |||
!if(item%ComponentType > 4 ) then | |||
! String(i)%ComponentType=0 | |||
! String(i)%StartMd = 0 | |||
!endif | |||
if(item%ComponentType == 3) DownHole%String(i)%ComponentType=0 | |||
if(item%ComponentType == 4) DownHole%String(i)%ComponentType=1 | |||
if(item%ComponentType == 2) DownHole%String(i)%ComponentType=2 | |||
if(item%ComponentType == 1) DownHole%String(i)%ComponentType=3 | |||
!print*, 'item%ComponentType=', item%ComponentType | |||
!print*, 'String(i)%ComponentType=', String(i)%ComponentType | |||
!print*, 'String(i)%StartMd=', String(i)%StartMd | |||
!print*, 'String(i)%EndMd=', String(i)%EndMd | |||
!print*, '----------------------------' | |||
!call Log_3( 'item%ComponentType=', item%ComponentType) | |||
!call Log_3( 'String(i)%ComponentType=', String(i)%ComponentType) | |||
!call Log_3( 'String(i)%StartMd=', String(i)%StartMd) | |||
!call Log_3( 'String(i)%EndMd=', String(i)%EndMd) | |||
!call Log_3( '----------------------------') | |||
end do | |||
!!print*, '============CMP-ST============' | |||
!!call Log_3( '============CMP-ST============') | |||
!if(associated(StringComponentArrayPtr)) then | |||
! call StringComponentArrayPtr(String) | |||
!end if | |||
end if | |||
end subroutine SetString | |||
subroutine SetBopElements(array) | |||
use CLog4 | |||
implicit none | |||
integer, parameter :: count = 4 | |||
integer :: i = 1 !, j | |||
type(CBopElement), intent(inout), target :: array(count) | |||
type(CBopElement), pointer :: item | |||
if(size(DownHole%BopElements) > 0) deallocate(DownHole%BopElements) | |||
allocate(DownHole%BopElements(count)) | |||
do i = 1, count | |||
item => array(i) | |||
!call Log_4('item%ElementStart', item%ElementStart) | |||
!call Log_4('item%ElementEnd', item%ElementEnd) | |||
!call Log_4('item%ElementType', item%ElementType) | |||
!call Log_4('=====================================================') | |||
DownHole%BopElements(i)%ElementStart = item%ElementStart | |||
DownHole%BopElements(i)%ElementEnd = item%ElementEnd | |||
DownHole%BopElements(i)%ElementType = item%ElementType | |||
end do | |||
!if(associated(BopElementsPtr)) call BopElementsPtr(BopElements) | |||
end subroutine SetBopElements | |||
module DownHoleModule | |||
use SimulationVariables | |||
contains | |||
subroutine SetAnnalusFluids(count, array) | |||
implicit none | |||
integer, intent(in) :: count | |||
integer :: i, offset | |||
type(CFluid), intent(inout), target :: array(count) | |||
type(CFluid), pointer :: item | |||
DownHole%AnnalusFluidsCount = count | |||
print*, 'AnnalusFluidsCount = ', count | |||
if(size(DownHole%AnnalusFluids) > 0) then | |||
deallocate(DownHole%AnnalusFluids) | |||
end if | |||
if(count > 0) then | |||
offset = 0; | |||
item => array(1) | |||
if(item%StartMd > 0) then | |||
DownHole%AnnalusFluidsCount = DownHole%AnnalusFluidsCount + 1 | |||
offset = 1; | |||
allocate(DownHole%AnnalusFluids(DownHole%AnnalusFluidsCount)) | |||
DownHole%AnnalusFluids(1)%StartMd = 0 | |||
DownHole%AnnalusFluids(1)%EndMd = item%StartMd | |||
DownHole%AnnalusFluids(1)%Density = 0 | |||
DownHole%AnnalusFluids(1)%MudType = FLUID_NO_MUD | |||
endif | |||
!if(associated(AnnalusMudCountPtr)) then | |||
! call AnnalusMudCountPtr(AnnalusFluidsCount) | |||
!end if | |||
if(.not.allocated(DownHole%AnnalusFluids))allocate(DownHole%AnnalusFluids(DownHole%AnnalusFluidsCount)) | |||
!print*, '============START-AN============' | |||
if(item%StartMd < 0) DownHole%AnnalusFluids(1)%StartMd = 0 | |||
do i = 1, count | |||
item => array(i) | |||
DownHole%AnnalusFluids(i + offset)%StartMd = item%StartMd | |||
if(i==1) DownHole%AnnalusFluids(i)%StartMd = 0 | |||
!print*, 'AnnalusFluids(',i,')%StartMd=', AnnalusFluids(i)%StartMd | |||
DownHole%AnnalusFluids(i + offset)%EndMd = item%EndMd | |||
!print*, 'AnnalusFluids(',i,')%EndMd=', AnnalusFluids(i)%EndMd | |||
DownHole%AnnalusFluids(i + offset)%Density = item%Density | |||
!print*, 'AnnalusFluids(',i,')%Density=', AnnalusFluids(i)%Density | |||
DownHole%AnnalusFluids(i + offset)%MudType = item%MudType | |||
!print*, 'AnnalusFluids(',i,')%MudType=', AnnalusFluids(i)%MudType | |||
!print*, '----------------------------' | |||
end do | |||
!print*, '============END-AN============' | |||
!if(associated(AnnalusMudArrayPtr)) then | |||
! !AnnalusFluidsPtr => AnnalusFluids | |||
! call AnnalusMudArrayPtr(AnnalusFluids) | |||
!end if | |||
end if | |||
end subroutine SetAnnalusFluids | |||
subroutine SetStringFluids(count, array) | |||
implicit none | |||
integer, intent(in) :: count | |||
integer :: i, offset !, startArr | |||
type(CFluid), intent(inout), target :: array(count) | |||
type(CFluid), pointer :: item | |||
DownHole%StringFluidsCount = count | |||
print*, 'StringFluidsCount = ', count | |||
if(size(DownHole%StringFluids) > 0) then | |||
deallocate(DownHole%StringFluids) | |||
end if | |||
!startArr = 1 | |||
if(count > 0) then | |||
offset = 0; | |||
item => array(1) | |||
! | |||
!if(item%StartMd <= 0 .and. item%EndMd <= 0) then | |||
! StringFluidsCount = StringFluidsCount - 1 | |||
! count = count - 1 | |||
! offset = offset + 1 | |||
! startArr = startArr + 1 | |||
!endif | |||
! | |||
!if(count <= 0) return | |||
if(item%StartMd > 0) then | |||
DownHole%StringFluidsCount = DownHole%StringFluidsCount + 1 | |||
offset = offset + 1 | |||
allocate(DownHole%StringFluids(DownHole%StringFluidsCount)) | |||
DownHole%StringFluids(1)%StartMd = 0 | |||
DownHole%StringFluids(1)%EndMd = item%StartMd | |||
DownHole%StringFluids(1)%Density = 0 | |||
DownHole%StringFluids(1)%MudType = FLUID_NO_MUD | |||
endif | |||
!if(associated(StringMudCountPtr)) then | |||
! call StringMudCountPtr(count) | |||
!end if | |||
if(.not.allocated(DownHole%StringFluids))allocate(DownHole%StringFluids(DownHole%StringFluidsCount)) | |||
!print*, '============START-ST============' | |||
!print*, 'count=', count | |||
do i = 1, count | |||
item => array(i) | |||
DownHole%StringFluids(i + offset)%StartMd = item%StartMd | |||
if(i==1) DownHole%StringFluids(i)%StartMd = 0 | |||
!print*, 'StringFluids(i)%StartMd=', StringFluids(i)%StartMd | |||
DownHole%StringFluids(i + offset)%EndMd = item%EndMd | |||
!print*, 'StringFluids(i)%EndMd=', StringFluids(i)%EndMd | |||
DownHole%StringFluids(i + offset)%Density = item%Density | |||
DownHole%StringFluids(i + offset)%MudType = item%MudType | |||
!print*, '----------------------------' | |||
end do | |||
!!if(item%StartMd < 0) StringFluids(1)%StartMd = 0 | |||
!!print*, '============END-ST============' | |||
!if(associated(StringMudArrayPtr)) then | |||
! call StringMudArrayPtr(StringFluids) | |||
!end if | |||
end if | |||
end subroutine SetStringFluids | |||
subroutine SetString(count, array) | |||
use CLog3 | |||
implicit none | |||
integer, intent(in) :: count | |||
integer :: i !, j | |||
type(CStringComponents), intent(inout), target :: array(count) | |||
type(CStringComponents), pointer :: item | |||
DownHole%StringCount = count | |||
if(size(DownHole%String) > 0) then | |||
deallocate(DownHole%String) | |||
end if | |||
if(count > 0) then | |||
!if(associated(StringComponentCountPtr)) then | |||
! call StringComponentCountPtr(count) | |||
!end if | |||
allocate(DownHole%String(count)) | |||
!j = 0 | |||
!print*, '============CMP-ST============' | |||
!call Log_3( '============CMP-ST============') | |||
!do i = count, 1, -1 | |||
do i = 1, count | |||
item => array(i) | |||
!String(i)%Length = item%Length | |||
!String(i)%TopDepth = item%TopDepth | |||
!String(i)%DownDepth = item%DownDepth | |||
!String(i)%Od = item%Od | |||
!String(i)%Id = item%Id | |||
DownHole%String(i)%ComponentType= item%ComponentType | |||
!j = j + 1 | |||
DownHole%String(i)%StartMd = item%TopDepth | |||
DownHole%String(i)%EndMd = item%DownDepth | |||
DownHole%String(i)%ComponentType=0 | |||
!if(item%ComponentType > 4 ) then | |||
! String(i)%ComponentType=0 | |||
! String(i)%StartMd = 0 | |||
!endif | |||
if(item%ComponentType == 3) DownHole%String(i)%ComponentType=0 | |||
if(item%ComponentType == 4) DownHole%String(i)%ComponentType=1 | |||
if(item%ComponentType == 2) DownHole%String(i)%ComponentType=2 | |||
if(item%ComponentType == 1) DownHole%String(i)%ComponentType=3 | |||
!print*, 'item%ComponentType=', item%ComponentType | |||
!print*, 'String(i)%ComponentType=', String(i)%ComponentType | |||
!print*, 'String(i)%StartMd=', String(i)%StartMd | |||
!print*, 'String(i)%EndMd=', String(i)%EndMd | |||
!print*, '----------------------------' | |||
!call Log_3( 'item%ComponentType=', item%ComponentType) | |||
!call Log_3( 'String(i)%ComponentType=', String(i)%ComponentType) | |||
!call Log_3( 'String(i)%StartMd=', String(i)%StartMd) | |||
!call Log_3( 'String(i)%EndMd=', String(i)%EndMd) | |||
!call Log_3( '----------------------------') | |||
end do | |||
!!print*, '============CMP-ST============' | |||
!!call Log_3( '============CMP-ST============') | |||
!if(associated(StringComponentArrayPtr)) then | |||
! call StringComponentArrayPtr(String) | |||
!end if | |||
end if | |||
end subroutine SetString | |||
subroutine SetBopElements(array) | |||
use CLog4 | |||
implicit none | |||
integer, parameter :: count = 4 | |||
integer :: i = 1 !, j | |||
type(CBopElement), intent(inout), target :: array(count) | |||
type(CBopElement), pointer :: item | |||
if(size(DownHole%BopElements) > 0) deallocate(DownHole%BopElements) | |||
allocate(DownHole%BopElements(count)) | |||
do i = 1, count | |||
item => array(i) | |||
!call Log_4('item%ElementStart', item%ElementStart) | |||
!call Log_4('item%ElementEnd', item%ElementEnd) | |||
!call Log_4('item%ElementType', item%ElementType) | |||
!call Log_4('=====================================================') | |||
DownHole%BopElements(i)%ElementStart = item%ElementStart | |||
DownHole%BopElements(i)%ElementEnd = item%ElementEnd | |||
DownHole%BopElements(i)%ElementType = item%ElementType | |||
end do | |||
!if(associated(BopElementsPtr)) call BopElementsPtr(BopElements) | |||
end subroutine SetBopElements | |||
end module DownHoleModule |
@@ -1,83 +1,87 @@ | |||
module CBopControlPanel | |||
! use CBopControlPanel | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
subroutine OpenAnnular() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(52, .true.) | |||
end subroutine | |||
subroutine CloseAnnular() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(52, .false.) | |||
end subroutine | |||
subroutine OpenUpperRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(51, .true.) | |||
end subroutine | |||
subroutine CloseUpperRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(51, .false.) | |||
end subroutine | |||
subroutine OpenMiddleRams() | |||
use CManifolds | |||
implicit none | |||
call ToggleMiddleRams(.true.) | |||
end subroutine | |||
subroutine CloseMiddleRams() | |||
use CManifolds | |||
implicit none | |||
call ToggleMiddleRams(.false.) | |||
end subroutine | |||
subroutine OpenKillLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(46, .true.) | |||
end subroutine | |||
subroutine CloseKillLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(46, .false.) | |||
end subroutine | |||
subroutine OpenChokeLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(47, .true.) | |||
!WRITE (*,*) ' valve 47 true ' | |||
end subroutine | |||
subroutine CloseChokeLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(47, .false.) | |||
!WRITE (*,*) ' valve 47 false ' | |||
end subroutine | |||
subroutine OpenLowerRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(49, .true.) | |||
!WRITE (*,*) ' valve 49 true ' | |||
end subroutine | |||
subroutine CloseLowerRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(49, .false.) | |||
!WRITE (*,*) ' valve 49 false ' | |||
end subroutine | |||
end module CBopControlPanel | |||
module CBopControlPanel | |||
! use CBopControlPanel | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
! subroutine BopControlPanelToJson(parent) | |||
! end subroutine | |||
subroutine OpenAnnular() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(52, .true.) | |||
end subroutine | |||
subroutine CloseAnnular() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(52, .false.) | |||
end subroutine | |||
subroutine OpenUpperRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(51, .true.) | |||
end subroutine | |||
subroutine CloseUpperRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(51, .false.) | |||
end subroutine | |||
subroutine OpenMiddleRams() | |||
use CManifolds | |||
implicit none | |||
call ToggleMiddleRams(.true.) | |||
end subroutine | |||
subroutine CloseMiddleRams() | |||
use CManifolds | |||
implicit none | |||
call ToggleMiddleRams(.false.) | |||
end subroutine | |||
subroutine OpenKillLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(46, .true.) | |||
end subroutine | |||
subroutine CloseKillLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(46, .false.) | |||
end subroutine | |||
subroutine OpenChokeLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(47, .true.) | |||
!WRITE (*,*) ' valve 47 true ' | |||
end subroutine | |||
subroutine CloseChokeLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(47, .false.) | |||
!WRITE (*,*) ' valve 47 false ' | |||
end subroutine | |||
subroutine OpenLowerRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(49, .true.) | |||
!WRITE (*,*) ' valve 49 true ' | |||
end subroutine | |||
subroutine CloseLowerRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(49, .false.) | |||
!WRITE (*,*) ' valve 49 false ' | |||
end subroutine | |||
end module CBopControlPanel |
@@ -1,40 +1,40 @@ | |||
module CBopControlPanelVariables | |||
implicit none | |||
public | |||
Type, Public:: BopControlPanelType | |||
! Input vars | |||
real(8) :: AnnularRegulatorSetControl | |||
real(8) :: AirMasterValve | |||
real(8) :: ByePassValve | |||
real(8) :: AnnularValve | |||
real(8) :: UpperRamsValve | |||
real(8) :: MiddleRamsValve | |||
real(8) :: KillLineValve | |||
real(8) :: ChokeLineValve | |||
real(8) :: LowerRamsValve | |||
! Output vars | |||
real(8) :: ManifoldPressureGauge | |||
real(8) :: AirSupplyPressureGauge | |||
real(8) :: AccumulatorPressureGauge | |||
real(8) :: AnnularPressureGauge | |||
integer :: AnnularOpenLED | |||
integer :: AnnularCloseLED | |||
integer :: UpperRamsOpenLED | |||
integer :: UpperRamsCloseLED | |||
integer :: MiddleRamsOpenLED | |||
integer :: MiddleRamsCloseLED | |||
integer :: KillLineOpenLED | |||
integer :: KillLineCloseLED | |||
integer :: ChokeLineOpenLED | |||
integer :: ChokeLineCloseLED | |||
integer :: LowerRamsOpenLED | |||
integer :: LowerRamsCloseLED | |||
real(8) :: AnnularStatus | |||
real(8) :: UpperRamsStatus | |||
real(8) :: MiddleRamsStatus | |||
real(8) :: LowerRamsStatus | |||
end type | |||
contains | |||
end module CBopControlPanelVariables | |||
module CBopControlPanelVariables | |||
implicit none | |||
public | |||
Type, Public:: BopControlPanelType | |||
! Input vars | |||
real(8) :: AnnularRegulatorSetControl | |||
real(8) :: AirMasterValve | |||
real(8) :: ByePassValve | |||
real(8) :: AnnularValve | |||
real(8) :: UpperRamsValve | |||
real(8) :: MiddleRamsValve | |||
real(8) :: KillLineValve | |||
real(8) :: ChokeLineValve | |||
real(8) :: LowerRamsValve | |||
! Output vars | |||
real(8) :: ManifoldPressureGauge | |||
real(8) :: AirSupplyPressureGauge | |||
real(8) :: AccumulatorPressureGauge | |||
real(8) :: AnnularPressureGauge | |||
integer :: AnnularOpenLED | |||
integer :: AnnularCloseLED | |||
integer :: UpperRamsOpenLED | |||
integer :: UpperRamsCloseLED | |||
integer :: MiddleRamsOpenLED | |||
integer :: MiddleRamsCloseLED | |||
integer :: KillLineOpenLED | |||
integer :: KillLineCloseLED | |||
integer :: ChokeLineOpenLED | |||
integer :: ChokeLineCloseLED | |||
integer :: LowerRamsOpenLED | |||
integer :: LowerRamsCloseLED | |||
real(8) :: AnnularStatus | |||
real(8) :: UpperRamsStatus | |||
real(8) :: MiddleRamsStatus | |||
real(8) :: LowerRamsStatus | |||
end type | |||
contains | |||
end module CBopControlPanelVariables |
@@ -1,162 +1,162 @@ | |||
module CChokeControlPanel | |||
use CChokeControlPanelVariables | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
! Input routines | |||
subroutine SetChokePanelPumpSelectorSwitch(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokePanelPumpSelectorSwitch | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokePanelPumpSelectorSwitch' :: SetChokePanelPumpSelectorSwitch | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%ChokePanelPumpSelectorSwitch = v | |||
#ifdef deb | |||
print*, 'ChokePanelPumpSelectorSwitch=', data%EquipmentControl%ChokeControlPanel%ChokePanelPumpSelectorSwitch | |||
#endif | |||
end subroutine | |||
subroutine SetChokePanelStrokeResetSwitch(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokePanelStrokeResetSwitch | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokePanelStrokeResetSwitch' :: SetChokePanelStrokeResetSwitch | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%ChokePanelStrokeResetSwitch = v | |||
#ifdef deb | |||
print*, 'ChokePanelStrokeResetSwitch=', data%EquipmentControl%ChokeControlPanel%ChokePanelStrokeResetSwitch | |||
#endif | |||
end subroutine | |||
subroutine SetChokeSelectorSwitch(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokeSelectorSwitch | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokeSelectorSwitch' :: SetChokeSelectorSwitch | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%ChokeSelectorSwitch = v | |||
#ifdef deb | |||
print*, 'ChokeSelectorSwitch=', data%EquipmentControl%ChokeControlPanel%ChokeSelectorSwitch | |||
#endif | |||
end subroutine | |||
subroutine SetChokeRateControlKnob(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokeRateControlKnob | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokeRateControlKnob' :: SetChokeRateControlKnob | |||
implicit none | |||
real*8, intent(in) :: v | |||
!character(8) :: date | |||
!character(10) :: time | |||
!character(5) :: zone | |||
!integer,dimension(8) :: values | |||
data%EquipmentControl%ChokeControlPanel%ChokeRateControlKnob = v | |||
#ifdef deb | |||
!call date_and_time(date,time,zone,values) | |||
!!print '(a,2x,a,2x,a)', date, time, zone | |||
!print '(8i5)', values | |||
print*, 'ChokeRateControlKnob=', data%EquipmentControl%ChokeControlPanel%ChokeRateControlKnob | |||
#endif | |||
end subroutine | |||
subroutine SetChokeControlLever(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokeControlLever | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokeControlLever' :: SetChokeControlLever | |||
implicit none | |||
real*8, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%ChokeControlLever = v | |||
#ifdef deb | |||
print*, 'ChokeControlLever=', data%EquipmentControl%ChokeControlPanel%ChokeControlLever | |||
#endif | |||
end subroutine | |||
subroutine SetChokePanelRigAirSwitch(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokePanelRigAirSwitch | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokePanelRigAirSwitch' :: SetChokePanelRigAirSwitch | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%ChokePanelRigAirSwitch = v | |||
#ifdef deb | |||
print*, 'ChokePanelRigAirSwitch=', data%EquipmentControl%ChokeControlPanel%ChokePanelRigAirSwitch | |||
#endif | |||
end subroutine | |||
subroutine SetEnableAutoChoke(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetEnableAutoChoke | |||
!DEC$ ATTRIBUTES ALIAS: 'SetEnableAutoChoke' :: SetEnableAutoChoke | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%EnableAutoChoke = v | |||
#ifdef deb | |||
print*, 'EnableAutoChoke=', data%EquipmentControl%ChokeControlPanel%EnableAutoChoke | |||
#endif | |||
end subroutine | |||
! Output routines | |||
real(8) function GetStandPipePressure() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipePressure | |||
!DEC$ ATTRIBUTES ALIAS: 'GetStandPipePressure' :: GetStandPipePressure | |||
implicit none | |||
GetStandPipePressure = data%EquipmentControl%ChokeControlPanel%StandPipePressure | |||
end function | |||
real(8) function GetCasingPressure() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetCasingPressure | |||
!DEC$ ATTRIBUTES ALIAS: 'GetCasingPressure' :: GetCasingPressure | |||
implicit none | |||
GetCasingPressure = data%EquipmentControl%ChokeControlPanel%CasingPressure | |||
end function | |||
real(8) function GetChokePosition() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetChokePosition | |||
!DEC$ ATTRIBUTES ALIAS: 'GetChokePosition' :: GetChokePosition | |||
implicit none | |||
GetChokePosition = data%EquipmentControl%ChokeControlPanel%ChokePosition | |||
end function | |||
real(8) function GetChokePanelSPMCounter() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetChokePanelSPMCounter | |||
!DEC$ ATTRIBUTES ALIAS: 'GetChokePanelSPMCounter' :: GetChokePanelSPMCounter | |||
implicit none | |||
!GetChokePanelSPMCounter = 0 | |||
GetChokePanelSPMCounter = data%EquipmentControl%ChokeControlPanel%ChokePanelSPMCounter | |||
end function | |||
real(8) function GetChokePanelTotalStrokeCounter() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetChokePanelTotalStrokeCounter | |||
!DEC$ ATTRIBUTES ALIAS: 'GetChokePanelTotalStrokeCounter' :: GetChokePanelTotalStrokeCounter | |||
implicit none | |||
!GetChokePanelTotalStrokeCounter = 0 | |||
GetChokePanelTotalStrokeCounter = data%EquipmentControl%ChokeControlPanel%ChokePanelTotalStrokeCounter | |||
end function | |||
integer function GetChoke1LED() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetChoke1LED | |||
!DEC$ ATTRIBUTES ALIAS: 'GetChoke1LED' :: GetChoke1LED | |||
implicit none | |||
GetChoke1LED = data%EquipmentControl%ChokeControlPanel%Choke1LED | |||
end function | |||
integer function GetChoke2LED() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetChoke2LED | |||
!DEC$ ATTRIBUTES ALIAS: 'GetChoke2LED' :: GetChoke2LED | |||
implicit none | |||
GetChoke2LED = data%EquipmentControl%ChokeControlPanel%Choke2LED | |||
end function | |||
module CChokeControlPanel | |||
use CChokeControlPanelVariables | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
! Input routines | |||
subroutine SetChokePanelPumpSelectorSwitch(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokePanelPumpSelectorSwitch | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokePanelPumpSelectorSwitch' :: SetChokePanelPumpSelectorSwitch | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%ChokePanelPumpSelectorSwitch = v | |||
#ifdef deb | |||
print*, 'ChokePanelPumpSelectorSwitch=', data%EquipmentControl%ChokeControlPanel%ChokePanelPumpSelectorSwitch | |||
#endif | |||
end subroutine | |||
subroutine SetChokePanelStrokeResetSwitch(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokePanelStrokeResetSwitch | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokePanelStrokeResetSwitch' :: SetChokePanelStrokeResetSwitch | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%ChokePanelStrokeResetSwitch = v | |||
#ifdef deb | |||
print*, 'ChokePanelStrokeResetSwitch=', data%EquipmentControl%ChokeControlPanel%ChokePanelStrokeResetSwitch | |||
#endif | |||
end subroutine | |||
subroutine SetChokeSelectorSwitch(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokeSelectorSwitch | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokeSelectorSwitch' :: SetChokeSelectorSwitch | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%ChokeSelectorSwitch = v | |||
#ifdef deb | |||
print*, 'ChokeSelectorSwitch=', data%EquipmentControl%ChokeControlPanel%ChokeSelectorSwitch | |||
#endif | |||
end subroutine | |||
subroutine SetChokeRateControlKnob(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokeRateControlKnob | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokeRateControlKnob' :: SetChokeRateControlKnob | |||
implicit none | |||
real*8, intent(in) :: v | |||
!character(8) :: date | |||
!character(10) :: time | |||
!character(5) :: zone | |||
!integer,dimension(8) :: values | |||
data%EquipmentControl%ChokeControlPanel%ChokeRateControlKnob = v | |||
#ifdef deb | |||
!call date_and_time(date,time,zone,values) | |||
!!print '(a,2x,a,2x,a)', date, time, zone | |||
!print '(8i5)', values | |||
print*, 'ChokeRateControlKnob=', data%EquipmentControl%ChokeControlPanel%ChokeRateControlKnob | |||
#endif | |||
end subroutine | |||
subroutine SetChokeControlLever(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokeControlLever | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokeControlLever' :: SetChokeControlLever | |||
implicit none | |||
real*8, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%ChokeControlLever = v | |||
#ifdef deb | |||
print*, 'ChokeControlLever=', data%EquipmentControl%ChokeControlPanel%ChokeControlLever | |||
#endif | |||
end subroutine | |||
subroutine SetChokePanelRigAirSwitch(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetChokePanelRigAirSwitch | |||
!DEC$ ATTRIBUTES ALIAS: 'SetChokePanelRigAirSwitch' :: SetChokePanelRigAirSwitch | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%ChokePanelRigAirSwitch = v | |||
#ifdef deb | |||
print*, 'ChokePanelRigAirSwitch=', data%EquipmentControl%ChokeControlPanel%ChokePanelRigAirSwitch | |||
#endif | |||
end subroutine | |||
subroutine SetEnableAutoChoke(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetEnableAutoChoke | |||
!DEC$ ATTRIBUTES ALIAS: 'SetEnableAutoChoke' :: SetEnableAutoChoke | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%ChokeControlPanel%EnableAutoChoke = v | |||
#ifdef deb | |||
print*, 'EnableAutoChoke=', data%EquipmentControl%ChokeControlPanel%EnableAutoChoke | |||
#endif | |||
end subroutine | |||
! Output routines | |||
real(8) function GetStandPipePressure() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipePressure | |||
!DEC$ ATTRIBUTES ALIAS: 'GetStandPipePressure' :: GetStandPipePressure | |||
implicit none | |||
GetStandPipePressure = data%EquipmentControl%ChokeControlPanel%StandPipePressure | |||
end function | |||
real(8) function GetCasingPressure() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetCasingPressure | |||
!DEC$ ATTRIBUTES ALIAS: 'GetCasingPressure' :: GetCasingPressure | |||
implicit none | |||
GetCasingPressure = data%EquipmentControl%ChokeControlPanel%CasingPressure | |||
end function | |||
real(8) function GetChokePosition() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetChokePosition | |||
!DEC$ ATTRIBUTES ALIAS: 'GetChokePosition' :: GetChokePosition | |||
implicit none | |||
GetChokePosition = data%EquipmentControl%ChokeControlPanel%ChokePosition | |||
end function | |||
real(8) function GetChokePanelSPMCounter() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetChokePanelSPMCounter | |||
!DEC$ ATTRIBUTES ALIAS: 'GetChokePanelSPMCounter' :: GetChokePanelSPMCounter | |||
implicit none | |||
!GetChokePanelSPMCounter = 0 | |||
GetChokePanelSPMCounter = data%EquipmentControl%ChokeControlPanel%ChokePanelSPMCounter | |||
end function | |||
real(8) function GetChokePanelTotalStrokeCounter() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetChokePanelTotalStrokeCounter | |||
!DEC$ ATTRIBUTES ALIAS: 'GetChokePanelTotalStrokeCounter' :: GetChokePanelTotalStrokeCounter | |||
implicit none | |||
!GetChokePanelTotalStrokeCounter = 0 | |||
GetChokePanelTotalStrokeCounter = data%EquipmentControl%ChokeControlPanel%ChokePanelTotalStrokeCounter | |||
end function | |||
integer function GetChoke1LED() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetChoke1LED | |||
!DEC$ ATTRIBUTES ALIAS: 'GetChoke1LED' :: GetChoke1LED | |||
implicit none | |||
GetChoke1LED = data%EquipmentControl%ChokeControlPanel%Choke1LED | |||
end function | |||
integer function GetChoke2LED() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetChoke2LED | |||
!DEC$ ATTRIBUTES ALIAS: 'GetChoke2LED' :: GetChoke2LED | |||
implicit none | |||
GetChoke2LED = data%EquipmentControl%ChokeControlPanel%Choke2LED | |||
end function | |||
end module CChokeControlPanel |
@@ -1,23 +1,23 @@ | |||
module CChokeControlPanelVariables | |||
implicit none | |||
type, public :: ChokeControlPanelType | |||
! Input vars | |||
integer :: ChokePanelPumpSelectorSwitch | |||
logical :: ChokePanelStrokeResetSwitch | |||
logical :: ChokeSelectorSwitch | |||
real(8) :: ChokeRateControlKnob | |||
real(8) :: ChokeControlLever | |||
logical :: ChokePanelRigAirSwitch | |||
logical :: EnableAutoChoke | |||
! Output vars | |||
real(8) :: StandPipePressure | |||
real(8) :: CasingPressure | |||
real(8) :: ChokePosition | |||
real(8) :: ChokePanelSPMCounter | |||
real(8) :: ChokePanelTotalStrokeCounter | |||
integer :: Choke1LED | |||
integer :: Choke2LED | |||
End Type ChokeControlPanelType | |||
module CChokeControlPanelVariables | |||
implicit none | |||
type, public :: ChokeControlPanelType | |||
! Input vars | |||
integer :: ChokePanelPumpSelectorSwitch | |||
logical :: ChokePanelStrokeResetSwitch | |||
logical :: ChokeSelectorSwitch | |||
real(8) :: ChokeRateControlKnob | |||
real(8) :: ChokeControlLever | |||
logical :: ChokePanelRigAirSwitch | |||
logical :: EnableAutoChoke | |||
! Output vars | |||
real(8) :: StandPipePressure | |||
real(8) :: CasingPressure | |||
real(8) :: ChokePosition | |||
real(8) :: ChokePanelSPMCounter | |||
real(8) :: ChokePanelTotalStrokeCounter | |||
integer :: Choke1LED | |||
integer :: Choke2LED | |||
End Type ChokeControlPanelType | |||
end module CChokeControlPanelVariables |
@@ -1,41 +1,41 @@ | |||
module CChokeManifold | |||
! use CChokeManifoldVariables | |||
use SimulationVariables | |||
use CManifolds | |||
use CLog2 | |||
implicit none | |||
public | |||
contains | |||
subroutine SetHydraulicChock1(v) | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%ChokeManifold%HydraulicChock1 = v | |||
if(data%EquipmentControl%ChokeManifold%HyChock1OnProblem) then | |||
call ChangeValve(33, .true.) | |||
else | |||
if(v == 100) then | |||
if(Manifold%Valve(33)%Status) call ChangeValve(33, .false.) | |||
else | |||
if(.not.Manifold%Valve(33)%Status) call ChangeValve(33, .true.) | |||
endif | |||
endif | |||
!WRITE (*,*) ' valve 33 ', Valve(33)%Status, ' arg ', v | |||
end subroutine | |||
subroutine SetHydraulicChock2(v) | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%ChokeManifold%HydraulicChock2 = v | |||
if(data%EquipmentControl%ChokeManifold%HyChock2OnProblem) then | |||
call ChangeValve(34, .true.) | |||
else | |||
if(v==100) then | |||
if(Manifold%Valve(34)%Status) call ChangeValve(34, .false.) | |||
else | |||
if(.not.Manifold%Valve(34)%Status) call ChangeValve(34, .true.) | |||
endif | |||
endif | |||
!WRITE (*,*) ' valve 34 ', Valve(34)%Status, ' arg ', v | |||
end subroutine | |||
module CChokeManifold | |||
! use CChokeManifoldVariables | |||
use SimulationVariables | |||
use CManifolds | |||
use CLog2 | |||
implicit none | |||
public | |||
contains | |||
subroutine SetHydraulicChock1(v) | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%ChokeManifold%HydraulicChock1 = v | |||
if(data%EquipmentControl%ChokeManifold%HyChock1OnProblem) then | |||
call ChangeValve(33, .true.) | |||
else | |||
if(v == 100) then | |||
if(Manifold%Valve(33)%Status) call ChangeValve(33, .false.) | |||
else | |||
if(.not.Manifold%Valve(33)%Status) call ChangeValve(33, .true.) | |||
endif | |||
endif | |||
!WRITE (*,*) ' valve 33 ', Valve(33)%Status, ' arg ', v | |||
end subroutine | |||
subroutine SetHydraulicChock2(v) | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%ChokeManifold%HydraulicChock2 = v | |||
if(data%EquipmentControl%ChokeManifold%HyChock2OnProblem) then | |||
call ChangeValve(34, .true.) | |||
else | |||
if(v==100) then | |||
if(Manifold%Valve(34)%Status) call ChangeValve(34, .false.) | |||
else | |||
if(.not.Manifold%Valve(34)%Status) call ChangeValve(34, .true.) | |||
endif | |||
endif | |||
!WRITE (*,*) ' valve 34 ', Valve(34)%Status, ' arg ', v | |||
end subroutine | |||
end module CChokeManifold |
@@ -1,36 +1,36 @@ | |||
module CChokeManifoldVariables | |||
implicit none | |||
public | |||
Type :: ChokeManifoldType | |||
! Input vars | |||
logical :: ChokeManifoldValve1 | |||
logical :: ChokeManifoldValve2 | |||
real(8) :: LeftManualChoke | |||
logical :: ChokeManifoldValve4 | |||
logical :: ChokeManifoldValve5 | |||
real(8) :: RightManualChoke | |||
logical :: ChokeManifoldValve7 | |||
logical :: ChokeManifoldValve8 | |||
logical :: ChokeManifoldValve9 | |||
logical :: ChokeManifoldValve10 | |||
logical :: ChokeManifoldValve11 | |||
logical :: ChokeManifoldValve12 | |||
logical :: ChokeManifoldValve13 | |||
! Output vars | |||
integer :: HydraulicChock1 | |||
integer :: HydraulicChock2 | |||
! Control vars | |||
logical :: HyChock1OnProblem = .false. | |||
logical :: HyChock2OnProblem = .false. | |||
logical :: LeftManChokeOnProblem = .false. | |||
logical :: RightManChokeOnProblem = .false. | |||
End Type ChokeManifoldType | |||
contains | |||
module CChokeManifoldVariables | |||
implicit none | |||
public | |||
Type :: ChokeManifoldType | |||
! Input vars | |||
logical :: ChokeManifoldValve1 | |||
logical :: ChokeManifoldValve2 | |||
real(8) :: LeftManualChoke | |||
logical :: ChokeManifoldValve4 | |||
logical :: ChokeManifoldValve5 | |||
real(8) :: RightManualChoke | |||
logical :: ChokeManifoldValve7 | |||
logical :: ChokeManifoldValve8 | |||
logical :: ChokeManifoldValve9 | |||
logical :: ChokeManifoldValve10 | |||
logical :: ChokeManifoldValve11 | |||
logical :: ChokeManifoldValve12 | |||
logical :: ChokeManifoldValve13 | |||
! Output vars | |||
integer :: HydraulicChock1 | |||
integer :: HydraulicChock2 | |||
! Control vars | |||
logical :: HyChock1OnProblem = .false. | |||
logical :: HyChock2OnProblem = .false. | |||
logical :: LeftManChokeOnProblem = .false. | |||
logical :: RightManChokeOnProblem = .false. | |||
End Type ChokeManifoldType | |||
contains | |||
endmodule CChokeManifoldVariables |
@@ -1,153 +1,153 @@ | |||
module CDataDisplayConsole | |||
! use CDataDisplayConsole | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
subroutine Set_TotalDepth(v) | |||
use SimulationVariables !@!!, only: data%EquipmentControl%DrillingWatch%Depth | |||
! use CSimulationVariables, only: SetDistanceDrilled | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%TotalWellDepth = v | |||
data%EquipmentControl%DrillingWatch%Depth = v | |||
! call SetDistanceDrilled(v) | |||
end subroutine | |||
subroutine Set_BitPosition(v) | |||
use SimulationVariables !@!!, only: data%EquipmentControl%DrillingWatch%BitPosition | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%BitDepth = v | |||
data%EquipmentControl%DrillingWatch%BitPosition = v | |||
end subroutine | |||
subroutine Set_RotaryTorque(v) | |||
use SimulationVariables !@!!, only: data%EquipmentControl%DrillingWatch%Torque | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%RotaryTorqueGauge = v | |||
data%EquipmentControl%DrillingWatch%Torque = v | |||
data%EquipmentControl%DataDisplayConsole%RTTorque = v | |||
end subroutine | |||
subroutine Set_MudWeightIn(v) | |||
use SimulationVariables !@!, only: MudWeightInDw => data%EquipmentControl%DataDisplayConsole%MudWeightIn | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MudWeightIn = v | |||
data%EquipmentControl%DrillingWatch%MudWeightIn = v | |||
end subroutine | |||
subroutine Set_MudWeightOut(v) | |||
use SimulationVariables !@!, only: MudWeightOutDw => data%EquipmentControl%DataDisplayConsole%MudWeightOut | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MudWeightOut = v | |||
data%EquipmentControl%DrillingWatch%MudWeightOut = v | |||
end subroutine | |||
subroutine Set_TripTankVolume(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%TripTankVolume | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DrillingWatch%TripTankVolume = v | |||
end subroutine | |||
subroutine Set_FillVolume(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%FillVolume | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DrillingWatch%FillVolume = v | |||
end subroutine | |||
subroutine Set_HookLoad(v) | |||
use SimulationVariables !@!, only: HookLoadDw => data%EquipmentControl%DataDisplayConsole%HookLoad | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%HookLoadPointer = v | |||
data%EquipmentControl%DrillingWatch%HookLoad = v * 1000 | |||
data%EquipmentControl%DataDisplayConsole%HookLoad = v | |||
end subroutine | |||
subroutine Set_WeightOnBit(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%WeightOnBit | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%WOBPointer = v | |||
data%EquipmentControl%DrillingWatch%WeightOnBit = v | |||
data%EquipmentControl%DataDisplayConsole%WOP = v | |||
end subroutine | |||
subroutine Set_ROP(v) | |||
use SimulationVariables !@!, only: ROPDw => data%EquipmentControl%DataDisplayConsole%ROP | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%ROP = v | |||
data%EquipmentControl%DrillingWatch%ROP = v | |||
end subroutine | |||
subroutine Set_CasingPressure(v) | |||
use SimulationVariables !@!, only: CasingPressureDw => CasingPressure | |||
use CChokeControlPanelVariables | |||
use SimulationVariables!, only: CasingPressureChoke => CasingPressure | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%CasingPressureGauge = v | |||
data%EquipmentControl%DrillingWatch%CasingPressure = v | |||
data%EquipmentControl%ChokeControlPanel%CasingPressure = v | |||
data%EquipmentControl%DataDisplayConsole%CasingPressure = v | |||
end subroutine | |||
subroutine Set_StandPipePressure(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%PumpPressure | |||
use CChokeControlPanelVariables | |||
use SimulationVariables!, only: StandPipePressureChoke => data%EquipmentControl%DataDisplayConsole%StandPipePressure | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%StandPipePressureGauge = v | |||
data%EquipmentControl%DrillingWatch%PumpPressure = v | |||
data%EquipmentControl%ChokeControlPanel%StandPipePressure = v | |||
data%EquipmentControl%DataDisplayConsole%StandPipePressure = v | |||
end subroutine | |||
subroutine Set_RotaryRPMGauge(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%RPM | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%RotaryRPMGauge = v | |||
data%EquipmentControl%DrillingWatch%RPM = v | |||
data%EquipmentControl%DataDisplayConsole%RTRPM = v | |||
! call data%EquipmentControl%DataDisplayConsole%OnRotaryRpmChange%RunAll(v) | |||
end subroutine | |||
subroutine Set_MP1SPMGauge(v) | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MP1SPMGauge = v | |||
data%EquipmentControl%DataDisplayConsole%MP1SPM = v | |||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%EquipmentControl%DataDisplayConsole%MP1SPMGauge, data%EquipmentControl%DataDisplayConsole%MP2SPMGauge) | |||
#ifdef deb | |||
print*, 'MP1SPMGauge=', data%EquipmentControl%DataDisplayConsole%MP1SPMGauge | |||
#endif | |||
end subroutine | |||
subroutine Set_MP2SPMGauge(v) | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MP2SPMGauge = v | |||
data%EquipmentControl%DataDisplayConsole%MP2SPM = v | |||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%EquipmentControl%DataDisplayConsole%MP1SPMGauge, data%EquipmentControl%DataDisplayConsole%MP2SPMGauge) | |||
#ifdef deb | |||
print*, 'MP2SPMGauge=', data%EquipmentControl%DataDisplayConsole%MP2SPMGauge | |||
#endif | |||
end subroutine | |||
module CDataDisplayConsole | |||
! use CDataDisplayConsole | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
subroutine Set_TotalDepth(v) | |||
use SimulationVariables !@!!, only: data%EquipmentControl%DrillingWatch%Depth | |||
! use CSimulationVariables, only: SetDistanceDrilled | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%TotalWellDepth = v | |||
data%EquipmentControl%DrillingWatch%Depth = v | |||
! call SetDistanceDrilled(v) | |||
end subroutine | |||
subroutine Set_BitPosition(v) | |||
use SimulationVariables !@!!, only: data%EquipmentControl%DrillingWatch%BitPosition | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%BitDepth = v | |||
data%EquipmentControl%DrillingWatch%BitPosition = v | |||
end subroutine | |||
subroutine Set_RotaryTorque(v) | |||
use SimulationVariables !@!!, only: data%EquipmentControl%DrillingWatch%Torque | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%RotaryTorqueGauge = v | |||
data%EquipmentControl%DrillingWatch%Torque = v | |||
data%EquipmentControl%DataDisplayConsole%RTTorque = v | |||
end subroutine | |||
subroutine Set_MudWeightIn(v) | |||
use SimulationVariables !@!, only: MudWeightInDw => data%EquipmentControl%DataDisplayConsole%MudWeightIn | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MudWeightIn = v | |||
data%EquipmentControl%DrillingWatch%MudWeightIn = v | |||
end subroutine | |||
subroutine Set_MudWeightOut(v) | |||
use SimulationVariables !@!, only: MudWeightOutDw => data%EquipmentControl%DataDisplayConsole%MudWeightOut | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MudWeightOut = v | |||
data%EquipmentControl%DrillingWatch%MudWeightOut = v | |||
end subroutine | |||
subroutine Set_TripTankVolume(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%TripTankVolume | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DrillingWatch%TripTankVolume = v | |||
end subroutine | |||
subroutine Set_FillVolume(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%FillVolume | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DrillingWatch%FillVolume = v | |||
end subroutine | |||
subroutine Set_HookLoad(v) | |||
use SimulationVariables !@!, only: HookLoadDw => data%EquipmentControl%DataDisplayConsole%HookLoad | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%HookLoadPointer = v | |||
data%EquipmentControl%DrillingWatch%HookLoad = v * 1000 | |||
data%EquipmentControl%DataDisplayConsole%HookLoad = v | |||
end subroutine | |||
subroutine Set_WeightOnBit(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%WeightOnBit | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%WOBPointer = v | |||
data%EquipmentControl%DrillingWatch%WeightOnBit = v | |||
data%EquipmentControl%DataDisplayConsole%WOP = v | |||
end subroutine | |||
subroutine Set_ROP(v) | |||
use SimulationVariables !@!, only: ROPDw => data%EquipmentControl%DataDisplayConsole%ROP | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%ROP = v | |||
data%EquipmentControl%DrillingWatch%ROP = v | |||
end subroutine | |||
subroutine Set_CasingPressure(v) | |||
use SimulationVariables !@!, only: CasingPressureDw => CasingPressure | |||
use CChokeControlPanelVariables | |||
use SimulationVariables!, only: CasingPressureChoke => CasingPressure | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%CasingPressureGauge = v | |||
data%EquipmentControl%DrillingWatch%CasingPressure = v | |||
data%EquipmentControl%ChokeControlPanel%CasingPressure = v | |||
data%EquipmentControl%DataDisplayConsole%CasingPressure = v | |||
end subroutine | |||
subroutine Set_StandPipePressure(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%PumpPressure | |||
use CChokeControlPanelVariables | |||
use SimulationVariables!, only: StandPipePressureChoke => data%EquipmentControl%DataDisplayConsole%StandPipePressure | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%StandPipePressureGauge = v | |||
data%EquipmentControl%DrillingWatch%PumpPressure = v | |||
data%EquipmentControl%ChokeControlPanel%StandPipePressure = v | |||
data%EquipmentControl%DataDisplayConsole%StandPipePressure = v | |||
end subroutine | |||
subroutine Set_RotaryRPMGauge(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%RPM | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%RotaryRPMGauge = v | |||
data%EquipmentControl%DrillingWatch%RPM = v | |||
data%EquipmentControl%DataDisplayConsole%RTRPM = v | |||
! call data%EquipmentControl%DataDisplayConsole%OnRotaryRpmChange%RunAll(v) | |||
end subroutine | |||
subroutine Set_MP1SPMGauge(v) | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MP1SPMGauge = v | |||
data%EquipmentControl%DataDisplayConsole%MP1SPM = v | |||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%EquipmentControl%DataDisplayConsole%MP1SPMGauge, data%EquipmentControl%DataDisplayConsole%MP2SPMGauge) | |||
#ifdef deb | |||
print*, 'MP1SPMGauge=', data%EquipmentControl%DataDisplayConsole%MP1SPMGauge | |||
#endif | |||
end subroutine | |||
subroutine Set_MP2SPMGauge(v) | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MP2SPMGauge = v | |||
data%EquipmentControl%DataDisplayConsole%MP2SPM = v | |||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%EquipmentControl%DataDisplayConsole%MP1SPMGauge, data%EquipmentControl%DataDisplayConsole%MP2SPMGauge) | |||
#ifdef deb | |||
print*, 'MP2SPMGauge=', data%EquipmentControl%DataDisplayConsole%MP2SPMGauge | |||
#endif | |||
end subroutine | |||
end module CDataDisplayConsole |
@@ -1,106 +1,106 @@ | |||
module CDataDisplayConsoleVariables | |||
use CIActionReference | |||
! !**use CDoubleEventHandlerCollection | |||
implicit none | |||
public | |||
Type :: DataDisplayConsoleType | |||
!portable | |||
real(8) :: TripAlarmLow | |||
real(8) :: TripAlarmHigh | |||
real(8) :: RetFlowAlarmLow | |||
real(8) :: RetFlowAlarmHigh | |||
real(8) :: PitAlarmLow | |||
real(8) :: PitAlarmHigh | |||
real(8) :: PortWeightOnBit | |||
real(8) :: PortHookLoad | |||
real(8) :: PortCasingPressure | |||
real(8) :: PortPumpPressure | |||
! Input vars | |||
real(8) :: TripTankSetAlarmLow | |||
real(8) :: TripTankSetAlarmHigh | |||
integer :: TripTankSetAlarmSwitch | |||
logical :: TripTankPowerSwitch | |||
logical :: TripTankPumpSwitch | |||
logical :: TripTankHornSwitch | |||
logical :: AcidGasDetectionHornSwitch | |||
logical :: TotalStrokeCounterResetSwitch | |||
logical :: DrillingTrippingSelectorSwitch | |||
real(8) :: MVTSetAlarmLowKnob | |||
real(8) :: MVTSetAlarmHighKnob | |||
integer :: MVTSetAlarmSwitch | |||
logical :: MudTank1Switch | |||
logical :: MudTank2Switch | |||
logical :: MudTank3Switch | |||
logical :: MudTank4Switch | |||
real(8) :: MVTFineKnob | |||
real(8) :: MVTCoarseKnob | |||
logical :: MVTHornSwitch | |||
logical :: MVTDeviationTripSelectionSwitch | |||
logical :: MVTPowerSwitch | |||
logical :: MFFIResetTotalStrokes | |||
logical :: MFFIResetFillCounter | |||
integer :: MFFIPumpSelectorSwitch | |||
logical :: MFFIFillSPMSelectorSwitch | |||
real(8) :: MFFISetAlarmLowKnob | |||
real(8) :: MFFISetAlarmHighKnob | |||
integer :: MFFISetAlarmSwitch | |||
logical :: MFFIPowerSwitch | |||
logical :: MFFIHornSwitch | |||
logical :: ResetWob | |||
logical :: Clutch | |||
! Output vars | |||
real(8) :: WOBPointer | |||
real(8) :: HookLoadPointer | |||
real(8) :: TripTankGauge | |||
integer :: TripTankAlarmLED | |||
integer :: TripTankPumpLED | |||
real(8) :: StandPipePressureGauge | |||
real(8) :: CasingPressureGauge | |||
real(8) :: MP1SPMGauge | |||
real(8) :: MP2SPMGauge | |||
real(8) :: ReturnLineTempGauge | |||
real(8) :: RotaryTorqueGauge | |||
real(8) :: RotaryRPMGauge | |||
! !**type(DoubleEventHandlerCollection) :: OnRotaryRpmChange | |||
integer :: AcidGasDetectionLED | |||
real(8) :: TotalStrokeCounter | |||
!real(8) :: TotalStrokeCounter_temp | |||
real(8) :: PitGainLossGauge | |||
real(8) :: MudTanksVolumeGauge | |||
integer :: MVTAlarmLED | |||
real(8) :: ReturnMudFlowGauge | |||
real(8) :: FillStrokeCounter | |||
real(8) :: MFFITotalStrokeCounter | |||
integer :: MFFIAlarmLED | |||
integer :: MFFIPumpLED | |||
real(8) :: TotalWellDepth | |||
real(8) :: BitDepth | |||
real(8) :: HookLoad | |||
real(8) :: StandPipePressure | |||
real(8) :: CasingPressure | |||
real(8) :: MP1SPM | |||
real(8) :: MP2SPM | |||
real(8) :: RTTorque | |||
real(8) :: RTRPM | |||
real(8) :: WOP | |||
real(8) :: ROP | |||
real(8) :: MudWeightIn | |||
real(8) :: MudWeightOut | |||
logical :: Buzzer1 | |||
logical :: Buzzer2 | |||
logical :: Buzzer3 | |||
logical :: Buzzer4 | |||
End Type DataDisplayConsoleType | |||
! events | |||
! procedure (ActionDualDouble), pointer :: PumpsSpmChanges => null() | |||
contains | |||
module CDataDisplayConsoleVariables | |||
use CIActionReference | |||
! !**use CDoubleEventHandlerCollection | |||
implicit none | |||
public | |||
Type :: DataDisplayConsoleType | |||
!portable | |||
real(8) :: TripAlarmLow | |||
real(8) :: TripAlarmHigh | |||
real(8) :: RetFlowAlarmLow | |||
real(8) :: RetFlowAlarmHigh | |||
real(8) :: PitAlarmLow | |||
real(8) :: PitAlarmHigh | |||
real(8) :: PortWeightOnBit | |||
real(8) :: PortHookLoad | |||
real(8) :: PortCasingPressure | |||
real(8) :: PortPumpPressure | |||
! Input vars | |||
real(8) :: TripTankSetAlarmLow | |||
real(8) :: TripTankSetAlarmHigh | |||
integer :: TripTankSetAlarmSwitch | |||
logical :: TripTankPowerSwitch | |||
logical :: TripTankPumpSwitch | |||
logical :: TripTankHornSwitch | |||
logical :: AcidGasDetectionHornSwitch | |||
logical :: TotalStrokeCounterResetSwitch | |||
logical :: DrillingTrippingSelectorSwitch | |||
real(8) :: MVTSetAlarmLowKnob | |||
real(8) :: MVTSetAlarmHighKnob | |||
integer :: MVTSetAlarmSwitch | |||
logical :: MudTank1Switch | |||
logical :: MudTank2Switch | |||
logical :: MudTank3Switch | |||
logical :: MudTank4Switch | |||
real(8) :: MVTFineKnob | |||
real(8) :: MVTCoarseKnob | |||
logical :: MVTHornSwitch | |||
logical :: MVTDeviationTripSelectionSwitch | |||
logical :: MVTPowerSwitch | |||
logical :: MFFIResetTotalStrokes | |||
logical :: MFFIResetFillCounter | |||
integer :: MFFIPumpSelectorSwitch | |||
logical :: MFFIFillSPMSelectorSwitch | |||
real(8) :: MFFISetAlarmLowKnob | |||
real(8) :: MFFISetAlarmHighKnob | |||
integer :: MFFISetAlarmSwitch | |||
logical :: MFFIPowerSwitch | |||
logical :: MFFIHornSwitch | |||
logical :: ResetWob | |||
logical :: Clutch | |||
! Output vars | |||
real(8) :: WOBPointer | |||
real(8) :: HookLoadPointer | |||
real(8) :: TripTankGauge | |||
integer :: TripTankAlarmLED | |||
integer :: TripTankPumpLED | |||
real(8) :: StandPipePressureGauge | |||
real(8) :: CasingPressureGauge | |||
real(8) :: MP1SPMGauge | |||
real(8) :: MP2SPMGauge | |||
real(8) :: ReturnLineTempGauge | |||
real(8) :: RotaryTorqueGauge | |||
real(8) :: RotaryRPMGauge | |||
! !**type(DoubleEventHandlerCollection) :: OnRotaryRpmChange | |||
integer :: AcidGasDetectionLED | |||
real(8) :: TotalStrokeCounter | |||
!real(8) :: TotalStrokeCounter_temp | |||
real(8) :: PitGainLossGauge | |||
real(8) :: MudTanksVolumeGauge | |||
integer :: MVTAlarmLED | |||
real(8) :: ReturnMudFlowGauge | |||
real(8) :: FillStrokeCounter | |||
real(8) :: MFFITotalStrokeCounter | |||
integer :: MFFIAlarmLED | |||
integer :: MFFIPumpLED | |||
real(8) :: TotalWellDepth | |||
real(8) :: BitDepth | |||
real(8) :: HookLoad | |||
real(8) :: StandPipePressure | |||
real(8) :: CasingPressure | |||
real(8) :: MP1SPM | |||
real(8) :: MP2SPM | |||
real(8) :: RTTorque | |||
real(8) :: RTRPM | |||
real(8) :: WOP | |||
real(8) :: ROP | |||
real(8) :: MudWeightIn | |||
real(8) :: MudWeightOut | |||
logical :: Buzzer1 | |||
logical :: Buzzer2 | |||
logical :: Buzzer3 | |||
logical :: Buzzer4 | |||
End Type DataDisplayConsoleType | |||
! events | |||
! procedure (ActionDualDouble), pointer :: PumpsSpmChanges => null() | |||
contains | |||
end module CDataDisplayConsoleVariables |
@@ -1,133 +1,133 @@ | |||
module CDrillingConsoleVariables | |||
! use CVoidEventHandlerCollection | |||
implicit none | |||
public | |||
TYPE, PUBLIC :: DrillingConsoleType | |||
! Input vars | |||
integer :: AssignmentSwitch | |||
logical :: EmergencySwitch | |||
real(8) :: RTTorqueLimitKnob | |||
integer :: MP1CPSwitchI = 0 !for not turning on pump1 on simulation start | |||
integer :: MP1CPSwitchT !for not turning on pump1 on simulation start | |||
integer :: MP1CPSwitch | |||
logical :: MP1ThrottleUpdate = .false. | |||
real(8) :: MP1Throttle = -1.0 | |||
integer :: MP2SwitchI = 0 !for not turning on pump2 on simulation start | |||
logical :: MP2SwitchT !for not turning on pump2 on simulation start | |||
logical :: MP2Switch | |||
logical :: MP2ThrottleUpdate = .false. | |||
real(8) :: MP2Throttle = -1.0 | |||
integer :: DWSwitch | |||
real(8) :: DWThrottle | |||
integer :: RTSwitch | |||
real(8) :: RTThrottle | |||
real(8) :: DWBreak | |||
real(8) :: PreviousDWBreak | |||
logical :: ForceBreak = .false. | |||
real(8) :: DWAcceleretor | |||
real(8) :: DWTransmisionLever | |||
real(8) :: DWPowerLever | |||
real(8) :: TongLever | |||
! ! type(VoidEventHandlerCollection) :: OnBreakoutLeverPress | |||
! ! type(VoidEventHandlerCollection) :: OnMakeupLeverPress | |||
! ! type(VoidEventHandlerCollection) :: OnTongNeutralPress | |||
real(8) :: RTTransmissionLever | |||
real(8) :: DWClutchLever | |||
real(8) :: EddyBreakLever | |||
logical :: AutoDW | |||
logical :: GEN1 | |||
logical :: GEN2 | |||
logical :: GEN3 | |||
logical :: GEN4 | |||
logical :: Permission_OpenKellyCock = .false. | |||
logical :: OpenKellyCock | |||
! ! type(VoidEventHandlerCollection) :: OnOpenKellyCockPress | |||
logical :: Permission_CloseKellyCock = .false. | |||
logical :: CloseKellyCock | |||
! ! type(VoidEventHandlerCollection) :: OnCloseKellyCockPress | |||
logical :: Permission_OpenSafetyValve = .false. | |||
logical :: OpenSafetyValve | |||
! typeVoidEventHandlerCollection) :: OnOpenSafetyValvePress | |||
logical :: Permission_CloseSafetyValve = .false. | |||
logical :: CloseSafetyValve | |||
! typeVoidEventHandlerCollection) :: OnCloseSafetyValvePress | |||
logical :: Permission_IRSafetyValve = .false. | |||
logical :: IRSafetyValve | |||
! typeVoidEventHandlerCollection) :: OnIRSafetyValvePress | |||
logical :: Permission_IRIBop = .false. | |||
logical :: IRIBop | |||
! typeVoidEventHandlerCollection) :: OnIRIBopPress | |||
logical :: LatchPipe | |||
! typeVoidEventHandlerCollection) :: OnLatchPipePress | |||
logical :: UnlatchPipe | |||
! typeVoidEventHandlerCollection) :: OnUnlatchPipePress | |||
logical :: Swing | |||
! typeVoidEventHandlerCollection) :: OnSwingPress | |||
logical :: FillMouseHole | |||
! typeVoidEventHandlerCollection) :: OnFillMouseHolePress | |||
logical :: Slips | |||
! typeVoidEventHandlerCollection) :: OnSlipsPress | |||
!logical :: TopDriveIBop | |||
! | |||
!logical :: TopDriveDrillTorque | |||
!integer :: TopDriveRevOffFwd | |||
!integer :: TopDriveDrillOffTilt | |||
real :: BrakeLeverCoefficient | |||
logical :: HideDrillingBrake | |||
logical :: ParkingBrakeBtn | |||
! Output vars | |||
logical :: ParkingBrakeLed | |||
integer :: GEN1LED | |||
integer :: GEN2LED | |||
integer :: GEN3LED | |||
integer :: GEN4LED | |||
integer :: SCR1LED | |||
integer :: SCR2LED | |||
integer :: SCR3LED | |||
integer :: SCR4LED | |||
integer :: MP1BLWR | |||
integer :: MP2BLWR | |||
integer :: DWBLWR | |||
integer :: RTBLWR | |||
integer :: PWRLIM | |||
real(8) :: PWRLIMMTR | |||
real(8) :: RTTorqueLimitGauge | |||
integer :: AutoDWLED | |||
integer :: GEN1BTNLED | |||
integer :: GEN2BTNLED | |||
integer :: GEN3BTNLED | |||
integer :: GEN4BTNLED | |||
integer :: OpenKellyCockLed | |||
integer :: CloseKellyCockLed | |||
integer :: OpenSafetyValveLed | |||
integer :: CloseSafetyValveLed | |||
integer :: IRSafetyValveLed | |||
integer :: IRIBopLed | |||
integer :: LatchPipeLED | |||
integer :: UnlatchPipeLED | |||
integer :: SwingLed | |||
integer :: FillMouseHoleLed | |||
END TYPE DrillingConsoleType | |||
module CDrillingConsoleVariables | |||
! use CVoidEventHandlerCollection | |||
implicit none | |||
public | |||
TYPE, PUBLIC :: DrillingConsoleType | |||
! Input vars | |||
integer :: AssignmentSwitch | |||
logical :: EmergencySwitch | |||
real(8) :: RTTorqueLimitKnob | |||
integer :: MP1CPSwitchI = 0 !for not turning on pump1 on simulation start | |||
integer :: MP1CPSwitchT !for not turning on pump1 on simulation start | |||
integer :: MP1CPSwitch | |||
logical :: MP1ThrottleUpdate = .false. | |||
real(8) :: MP1Throttle = -1.0 | |||
integer :: MP2SwitchI = 0 !for not turning on pump2 on simulation start | |||
logical :: MP2SwitchT !for not turning on pump2 on simulation start | |||
logical :: MP2Switch | |||
logical :: MP2ThrottleUpdate = .false. | |||
real(8) :: MP2Throttle = -1.0 | |||
integer :: DWSwitch | |||
real(8) :: DWThrottle | |||
integer :: RTSwitch | |||
real(8) :: RTThrottle | |||
real(8) :: DWBreak | |||
real(8) :: PreviousDWBreak | |||
logical :: ForceBreak = .false. | |||
real(8) :: DWAcceleretor | |||
real(8) :: DWTransmisionLever | |||
real(8) :: DWPowerLever | |||
real(8) :: TongLever | |||
! ! type(VoidEventHandlerCollection) :: OnBreakoutLeverPress | |||
! ! type(VoidEventHandlerCollection) :: OnMakeupLeverPress | |||
! ! type(VoidEventHandlerCollection) :: OnTongNeutralPress | |||
real(8) :: RTTransmissionLever | |||
real(8) :: DWClutchLever | |||
real(8) :: EddyBreakLever | |||
logical :: AutoDW | |||
logical :: GEN1 | |||
logical :: GEN2 | |||
logical :: GEN3 | |||
logical :: GEN4 | |||
logical :: Permission_OpenKellyCock = .false. | |||
logical :: OpenKellyCock | |||
! ! type(VoidEventHandlerCollection) :: OnOpenKellyCockPress | |||
logical :: Permission_CloseKellyCock = .false. | |||
logical :: CloseKellyCock | |||
! ! type(VoidEventHandlerCollection) :: OnCloseKellyCockPress | |||
logical :: Permission_OpenSafetyValve = .false. | |||
logical :: OpenSafetyValve | |||
! typeVoidEventHandlerCollection) :: OnOpenSafetyValvePress | |||
logical :: Permission_CloseSafetyValve = .false. | |||
logical :: CloseSafetyValve | |||
! typeVoidEventHandlerCollection) :: OnCloseSafetyValvePress | |||
logical :: Permission_IRSafetyValve = .false. | |||
logical :: IRSafetyValve | |||
! typeVoidEventHandlerCollection) :: OnIRSafetyValvePress | |||
logical :: Permission_IRIBop = .false. | |||
logical :: IRIBop | |||
! typeVoidEventHandlerCollection) :: OnIRIBopPress | |||
logical :: LatchPipe | |||
! typeVoidEventHandlerCollection) :: OnLatchPipePress | |||
logical :: UnlatchPipe | |||
! typeVoidEventHandlerCollection) :: OnUnlatchPipePress | |||
logical :: Swing | |||
! typeVoidEventHandlerCollection) :: OnSwingPress | |||
logical :: FillMouseHole | |||
! typeVoidEventHandlerCollection) :: OnFillMouseHolePress | |||
logical :: Slips | |||
! typeVoidEventHandlerCollection) :: OnSlipsPress | |||
!logical :: TopDriveIBop | |||
! | |||
!logical :: TopDriveDrillTorque | |||
!integer :: TopDriveRevOffFwd | |||
!integer :: TopDriveDrillOffTilt | |||
real :: BrakeLeverCoefficient | |||
logical :: HideDrillingBrake | |||
logical :: ParkingBrakeBtn | |||
! Output vars | |||
logical :: ParkingBrakeLed | |||
integer :: GEN1LED | |||
integer :: GEN2LED | |||
integer :: GEN3LED | |||
integer :: GEN4LED | |||
integer :: SCR1LED | |||
integer :: SCR2LED | |||
integer :: SCR3LED | |||
integer :: SCR4LED | |||
integer :: MP1BLWR | |||
integer :: MP2BLWR | |||
integer :: DWBLWR | |||
integer :: RTBLWR | |||
integer :: PWRLIM | |||
real(8) :: PWRLIMMTR | |||
real(8) :: RTTorqueLimitGauge | |||
integer :: AutoDWLED | |||
integer :: GEN1BTNLED | |||
integer :: GEN2BTNLED | |||
integer :: GEN3BTNLED | |||
integer :: GEN4BTNLED | |||
integer :: OpenKellyCockLed | |||
integer :: CloseKellyCockLed | |||
integer :: OpenSafetyValveLed | |||
integer :: CloseSafetyValveLed | |||
integer :: IRSafetyValveLed | |||
integer :: IRIBopLed | |||
integer :: LatchPipeLED | |||
integer :: UnlatchPipeLED | |||
integer :: SwingLed | |||
integer :: FillMouseHoleLed | |||
END TYPE DrillingConsoleType | |||
end module CDrillingConsoleVariables |
@@ -1,11 +1,11 @@ | |||
module CEquipmentsConstants | |||
implicit none | |||
public | |||
! LED State Types | |||
integer :: LedOff = 0 | |||
integer :: LedOn = 1 | |||
integer :: LedBlinking = 2 | |||
contains | |||
module CEquipmentsConstants | |||
implicit none | |||
public | |||
! LED State Types | |||
integer :: LedOff = 0 | |||
integer :: LedOn = 1 | |||
integer :: LedBlinking = 2 | |||
contains | |||
end module CEquipmentsConstants |
@@ -1,64 +1,64 @@ | |||
module CHook | |||
use CHookVariables | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
subroutine Set_HookHeight(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables | |||
implicit none | |||
real , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%EquipmentControl%Hook%HookHeight == v) return | |||
#endif | |||
data%EquipmentControl%Hook%HookHeight = v | |||
! if(associated(HookHeightPtr)) then | |||
! call HookHeightPtr(data%EquipmentControl%Hook%HookHeight) | |||
! end if | |||
#ifdef deb | |||
print*, 'HookHeight=', data%EquipmentControl%Hook%HookHeight | |||
#endif | |||
!**call data%EquipmentControl%Hook%OnHookHeightChange%RunAll(data%EquipmentControl%Hook%HookHeight) | |||
end subroutine | |||
subroutine Set_HookHeight_S(v) | |||
implicit none | |||
real , intent(in) :: v | |||
if(v == data%EquipmentControl%Hook%HookHeight) then | |||
return | |||
elseif (v > data%EquipmentControl%Hook%HookHeight) then | |||
loop1: do | |||
call Set_HookHeight(data%EquipmentControl%Hook%HookHeight + 0.2) | |||
if(abs(v - data%EquipmentControl%Hook%HookHeight) <= 0.1) then | |||
call Set_HookHeight(v) | |||
exit loop1 | |||
endif | |||
call sleepqq(100) | |||
enddo loop1 | |||
else ! v < HookHeight | |||
loop2: do | |||
call Set_HookHeight(data%EquipmentControl%Hook%HookHeight - 0.2) | |||
if(abs(data%EquipmentControl%Hook%HookHeight - v) <= 0.1) then | |||
call Set_HookHeight(v) | |||
exit loop2 | |||
endif | |||
call sleepqq(100) | |||
enddo loop2 | |||
endif | |||
end subroutine | |||
subroutine Update_HookHeight_From_Snapshot() | |||
implicit none | |||
call Set_HookHeight_S(data%EquipmentControl%Hook%HookHeight_S) | |||
end subroutine | |||
end module CHook | |||
module CHook | |||
use CHookVariables | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
subroutine Set_HookHeight(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables | |||
implicit none | |||
real , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%EquipmentControl%Hook%HookHeight == v) return | |||
#endif | |||
data%EquipmentControl%Hook%HookHeight = v | |||
! if(associated(HookHeightPtr)) then | |||
! call HookHeightPtr(data%EquipmentControl%Hook%HookHeight) | |||
! end if | |||
#ifdef deb | |||
print*, 'HookHeight=', data%EquipmentControl%Hook%HookHeight | |||
#endif | |||
!**call data%EquipmentControl%Hook%OnHookHeightChange%RunAll(data%EquipmentControl%Hook%HookHeight) | |||
end subroutine | |||
subroutine Set_HookHeight_S(v) | |||
implicit none | |||
real , intent(in) :: v | |||
if(v == data%EquipmentControl%Hook%HookHeight) then | |||
return | |||
elseif (v > data%EquipmentControl%Hook%HookHeight) then | |||
loop1: do | |||
call Set_HookHeight(data%EquipmentControl%Hook%HookHeight + 0.2) | |||
if(abs(v - data%EquipmentControl%Hook%HookHeight) <= 0.1) then | |||
call Set_HookHeight(v) | |||
exit loop1 | |||
endif | |||
call sleepqq(100) | |||
enddo loop1 | |||
else ! v < HookHeight | |||
loop2: do | |||
call Set_HookHeight(data%EquipmentControl%Hook%HookHeight - 0.2) | |||
if(abs(data%EquipmentControl%Hook%HookHeight - v) <= 0.1) then | |||
call Set_HookHeight(v) | |||
exit loop2 | |||
endif | |||
call sleepqq(100) | |||
enddo loop2 | |||
endif | |||
end subroutine | |||
subroutine Update_HookHeight_From_Snapshot() | |||
implicit none | |||
call Set_HookHeight_S(data%EquipmentControl%Hook%HookHeight_S) | |||
end subroutine | |||
end module CHook |
@@ -1,16 +1,16 @@ | |||
module CHookActions | |||
use CIActionReference | |||
implicit none | |||
public | |||
procedure (ActionReal), pointer :: HookHeightPtr | |||
contains | |||
subroutine SubscribeHookHeight(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeHookHeight | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeHookHeight' :: SubscribeHookHeight | |||
implicit none | |||
procedure (ActionReal) :: a | |||
HookHeightPtr => a | |||
end subroutine | |||
module CHookActions | |||
use CIActionReference | |||
implicit none | |||
public | |||
procedure (ActionReal), pointer :: HookHeightPtr | |||
contains | |||
subroutine SubscribeHookHeight(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeHookHeight | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeHookHeight' :: SubscribeHookHeight | |||
implicit none | |||
procedure (ActionReal) :: a | |||
HookHeightPtr => a | |||
end subroutine | |||
end module CHookActions |
@@ -1,16 +1,16 @@ | |||
module CHookVariables | |||
!**use CRealEventHandlerCollection | |||
! use CHookActions | |||
implicit none | |||
Type :: HookType | |||
real :: HookHeight_S = 0.0 | |||
real :: HookHeight | |||
!**type(RealEventHandlerCollection) :: OnHookHeightChange | |||
end type HookType | |||
contains | |||
module CHookVariables | |||
!**use CRealEventHandlerCollection | |||
! use CHookActions | |||
implicit none | |||
Type :: HookType | |||
real :: HookHeight_S = 0.0 | |||
real :: HookHeight | |||
!**type(RealEventHandlerCollection) :: OnHookHeightChange | |||
end type HookType | |||
contains | |||
end module CHookVariables |
@@ -1,207 +1,207 @@ | |||
module CStandPipeManifold | |||
use CStandPipeManifoldVariables | |||
use SimulationVariables | |||
use CManifolds | |||
implicit none | |||
public | |||
contains | |||
! Input routines | |||
subroutine SetStandPipeManifoldValve1(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve1 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve1' :: SetStandPipeManifoldValve1 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve1 = v | |||
call ChangeValve(13, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve1=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve1 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve2(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve2 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve2' :: SetStandPipeManifoldValve2 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve2 = v | |||
call ChangeValve(14, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve2=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve2 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve3(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve3 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve3' :: SetStandPipeManifoldValve3 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve3 = v | |||
call ChangeValve(15, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve3=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve3 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve4(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve4 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve4' :: SetStandPipeManifoldValve4 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve4 = v | |||
call ChangeValve(11, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve4=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve4 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve5(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve5 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve5' :: SetStandPipeManifoldValve5 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve5 = v | |||
call ChangeValve(12, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve5=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve5 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve6(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve6 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve6' :: SetStandPipeManifoldValve6 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve6 = v | |||
call ChangeValve(9, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve6=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve6 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve7(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve7 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve7' :: SetStandPipeManifoldValve7 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve7 = v | |||
call ChangeValve(10, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve7=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve7 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve8(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve8 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve8' :: SetStandPipeManifoldValve8 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve8 = v | |||
call ChangeValve(6, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve8=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve8 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve9(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve9 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve9' :: SetStandPipeManifoldValve9 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve9 = v | |||
call ChangeValve(7, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve9=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve9 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve10(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve10 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve10' :: SetStandPipeManifoldValve10 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve10 = v | |||
call ChangeValve(8, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve10=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve10 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve11(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve11 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve11' :: SetStandPipeManifoldValve11 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve11 = v | |||
call ChangeValve(1, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve11=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve11 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve12(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve12 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve12' :: SetStandPipeManifoldValve12 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve12 = v | |||
call ChangeValve(2, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve12=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve12 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve13(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve13 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve13' :: SetStandPipeManifoldValve13 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve13 = v | |||
call ChangeValve(3, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve13=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve13 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve14(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve14 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve14' :: SetStandPipeManifoldValve14 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve14 = v | |||
call ChangeValve(4, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve14=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve14 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve15(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve15 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve15' :: SetStandPipeManifoldValve15 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve15 = v | |||
call ChangeValve(5, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve15=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve15 | |||
#endif | |||
end subroutine | |||
! Output routines | |||
real(8) function GetStandPipeGauge1() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipeGauge1 | |||
!DEC$ ATTRIBUTES ALIAS: 'GetStandPipeGauge1' :: GetStandPipeGauge1 | |||
implicit none | |||
GetStandPipeGauge1 = data%EquipmentControl%StandPipeManifold%StandPipeGauge1 | |||
!GetStandPipeGauge1 = 567.4 | |||
end function | |||
real(8) function GetStandPipeGauge2() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipeGauge2 | |||
!DEC$ ATTRIBUTES ALIAS: 'GetStandPipeGauge2' :: GetStandPipeGauge2 | |||
implicit none | |||
GetStandPipeGauge2 = data%EquipmentControl%StandPipeManifold%StandPipeGauge2 | |||
!GetStandPipeGauge2 = 1564.0 | |||
end function | |||
module CStandPipeManifold | |||
use CStandPipeManifoldVariables | |||
use SimulationVariables | |||
use CManifolds | |||
implicit none | |||
public | |||
contains | |||
! Input routines | |||
subroutine SetStandPipeManifoldValve1(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve1 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve1' :: SetStandPipeManifoldValve1 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve1 = v | |||
call ChangeValve(13, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve1=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve1 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve2(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve2 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve2' :: SetStandPipeManifoldValve2 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve2 = v | |||
call ChangeValve(14, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve2=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve2 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve3(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve3 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve3' :: SetStandPipeManifoldValve3 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve3 = v | |||
call ChangeValve(15, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve3=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve3 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve4(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve4 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve4' :: SetStandPipeManifoldValve4 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve4 = v | |||
call ChangeValve(11, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve4=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve4 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve5(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve5 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve5' :: SetStandPipeManifoldValve5 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve5 = v | |||
call ChangeValve(12, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve5=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve5 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve6(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve6 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve6' :: SetStandPipeManifoldValve6 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve6 = v | |||
call ChangeValve(9, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve6=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve6 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve7(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve7 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve7' :: SetStandPipeManifoldValve7 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve7 = v | |||
call ChangeValve(10, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve7=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve7 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve8(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve8 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve8' :: SetStandPipeManifoldValve8 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve8 = v | |||
call ChangeValve(6, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve8=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve8 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve9(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve9 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve9' :: SetStandPipeManifoldValve9 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve9 = v | |||
call ChangeValve(7, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve9=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve9 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve10(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve10 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve10' :: SetStandPipeManifoldValve10 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve10 = v | |||
call ChangeValve(8, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve10=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve10 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve11(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve11 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve11' :: SetStandPipeManifoldValve11 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve11 = v | |||
call ChangeValve(1, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve11=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve11 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve12(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve12 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve12' :: SetStandPipeManifoldValve12 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve12 = v | |||
call ChangeValve(2, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve12=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve12 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve13(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve13 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve13' :: SetStandPipeManifoldValve13 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve13 = v | |||
call ChangeValve(3, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve13=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve13 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve14(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve14 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve14' :: SetStandPipeManifoldValve14 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve14 = v | |||
call ChangeValve(4, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve14=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve14 | |||
#endif | |||
end subroutine | |||
subroutine SetStandPipeManifoldValve15(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetStandPipeManifoldValve15 | |||
!DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve15' :: SetStandPipeManifoldValve15 | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve15 = v | |||
call ChangeValve(5, v) | |||
#ifdef deb | |||
print*, 'StandPipeManifoldValve15=', data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve15 | |||
#endif | |||
end subroutine | |||
! Output routines | |||
real(8) function GetStandPipeGauge1() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipeGauge1 | |||
!DEC$ ATTRIBUTES ALIAS: 'GetStandPipeGauge1' :: GetStandPipeGauge1 | |||
implicit none | |||
GetStandPipeGauge1 = data%EquipmentControl%StandPipeManifold%StandPipeGauge1 | |||
!GetStandPipeGauge1 = 567.4 | |||
end function | |||
real(8) function GetStandPipeGauge2() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipeGauge2 | |||
!DEC$ ATTRIBUTES ALIAS: 'GetStandPipeGauge2' :: GetStandPipeGauge2 | |||
implicit none | |||
GetStandPipeGauge2 = data%EquipmentControl%StandPipeManifold%StandPipeGauge2 | |||
!GetStandPipeGauge2 = 1564.0 | |||
end function | |||
end module CStandPipeManifold |
@@ -1,28 +1,28 @@ | |||
module CStandPipeManifoldVariables | |||
implicit none | |||
public | |||
Type::StandPipeManifoldType | |||
! Input vars | |||
logical :: StandPipeManifoldValve1 | |||
logical :: StandPipeManifoldValve2 | |||
logical :: StandPipeManifoldValve3 | |||
logical :: StandPipeManifoldValve4 | |||
logical :: StandPipeManifoldValve5 | |||
logical :: StandPipeManifoldValve6 | |||
logical :: StandPipeManifoldValve7 | |||
logical :: StandPipeManifoldValve8 | |||
logical :: StandPipeManifoldValve9 | |||
logical :: StandPipeManifoldValve10 | |||
logical :: StandPipeManifoldValve11 | |||
logical :: StandPipeManifoldValve12 | |||
logical :: StandPipeManifoldValve13 | |||
logical :: StandPipeManifoldValve14 | |||
logical :: StandPipeManifoldValve15 | |||
! Output vars | |||
real(8) :: StandPipeGauge1 | |||
real(8) :: StandPipeGauge2 | |||
End type StandPipeManifoldType | |||
module CStandPipeManifoldVariables | |||
implicit none | |||
public | |||
Type::StandPipeManifoldType | |||
! Input vars | |||
logical :: StandPipeManifoldValve1 | |||
logical :: StandPipeManifoldValve2 | |||
logical :: StandPipeManifoldValve3 | |||
logical :: StandPipeManifoldValve4 | |||
logical :: StandPipeManifoldValve5 | |||
logical :: StandPipeManifoldValve6 | |||
logical :: StandPipeManifoldValve7 | |||
logical :: StandPipeManifoldValve8 | |||
logical :: StandPipeManifoldValve9 | |||
logical :: StandPipeManifoldValve10 | |||
logical :: StandPipeManifoldValve11 | |||
logical :: StandPipeManifoldValve12 | |||
logical :: StandPipeManifoldValve13 | |||
logical :: StandPipeManifoldValve14 | |||
logical :: StandPipeManifoldValve15 | |||
! Output vars | |||
real(8) :: StandPipeGauge1 | |||
real(8) :: StandPipeGauge2 | |||
End type StandPipeManifoldType | |||
end module CStandPipeManifoldVariables |
@@ -1,216 +1,216 @@ | |||
module CTopDrivePanel | |||
use CTopDrivePanelVariables | |||
use SimulationVariables | |||
use CLog3 | |||
implicit none | |||
public | |||
contains | |||
! Input routines | |||
subroutine SetTopDriveTdsPowerState(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveTdsPowerState | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTdsPowerState' :: SetTopDriveTdsPowerState | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveTdsPowerState=', data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState) | |||
#endif | |||
end subroutine | |||
subroutine SetTopDriveTorqueWrench(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveTorqueWrench | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTorqueWrench' :: SetTopDriveTorqueWrench | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrench = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveTorqueWrench=', data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrench) | |||
#endif | |||
end subroutine | |||
subroutine SetTopDriveDrillTorqueState(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveDrillTorqueState | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveDrillTorqueState' :: SetTopDriveDrillTorqueState | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%TopDrivePanel%TopDriveDrillTorqueState = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveDrillTorqueState=', data%EquipmentControl%TopDrivePanel%TopDriveDrillTorqueState) | |||
#endif | |||
end subroutine | |||
subroutine SetTopDriveLinkTiltState(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveLinkTiltState | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveLinkTiltState' :: SetTopDriveLinkTiltState | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveLinkTiltState=', data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState) | |||
#endif | |||
end subroutine | |||
subroutine SetTopDriveIbop(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveIbop | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveIbop' :: SetTopDriveIbop | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbop = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveIbop=', data%EquipmentControl%TopDrivePanel%TopDriveIbop) | |||
#endif | |||
end subroutine | |||
subroutine SetTopDriveTorqueLimitKnob(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveTorqueLimitKnob | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTorqueLimitKnob' :: SetTopDriveTorqueLimitKnob | |||
! use CSimulationVariables, only: IsPortable | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%EquipmentControl%DrillingConsole%RTSwitch, data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob | |||
use CWarnings, only: Activate_TopdriveRotaryTableConfilict | |||
use CScaleRange | |||
implicit none | |||
real, intent(in) :: v | |||
if (IsPortable) then | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch == 0) then | |||
data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob = 0 | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob = v | |||
#ifdef deb | |||
call Log_3( 'RTTorqueLimitKnob=', data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob ) | |||
call Log_3( 'TopDriveTorqueLimitKnob=', data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob ) | |||
#endif | |||
endif | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch /= 0) then | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob = 0 | |||
data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob = real(ScaleRange(v, 0.0, 10.0, 0.0, 6000.0), 8) | |||
#ifdef deb | |||
call Log_3( 'RTTorqueLimitKnob=', data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob ) | |||
call Log_3( 'TopDriveTorqueLimitKnob=', data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob ) | |||
#endif | |||
endif | |||
else | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveTorqueLimitKnob=', data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob) | |||
#endif | |||
endif | |||
end subroutine | |||
subroutine SetRpmKnob(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetRpmKnob | |||
!DEC$ ATTRIBUTES ALIAS: 'SetRpmKnob' :: SetRpmKnob | |||
! use CSimulationVariables, only: IsPortable | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%EquipmentControl%DrillingConsole%RTSwitch, data%EquipmentControl%DrillingConsole%RTThrottle | |||
use CWarnings, only: Activate_TopdriveRotaryTableConfilict | |||
use CScaleRange | |||
implicit none | |||
real, intent(in) :: v | |||
if (IsPortable) then | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch == 0) then | |||
data%EquipmentControl%DrillingConsole%RTThrottle = 0 | |||
data%EquipmentControl%TopDrivePanel%RpmKnob = v | |||
#ifdef deb | |||
call Log_3( 'RTThrottle=', data%EquipmentControl%DrillingConsole%RTThrottle ) | |||
call Log_3( 'RpmKnob=', data%EquipmentControl%TopDrivePanel%RpmKnob ) | |||
#endif | |||
endif | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch /= 0) then | |||
data%EquipmentControl%TopDrivePanel%RpmKnob = 0 | |||
data%EquipmentControl%DrillingConsole%RTThrottle = real(ScaleRange(v, 0.0, 965.0, 0.0, 250.0), 8) | |||
#ifdef deb | |||
call Log_3( 'RpmKnob=', data%EquipmentControl%TopDrivePanel%RpmKnob ) | |||
call Log_3( 'RTThrottle=', data%EquipmentControl%DrillingConsole%RTThrottle ) | |||
#endif | |||
endif | |||
else | |||
data%EquipmentControl%TopDrivePanel%RpmKnob = v | |||
endif | |||
if (IsPortable) then | |||
! | |||
else | |||
data%EquipmentControl%TopDrivePanel%RpmKnob = v | |||
#ifdef deb | |||
call Log_3( 'RpmKnob=', data%EquipmentControl%TopDrivePanel%RpmKnob ) | |||
#endif | |||
endif | |||
end subroutine | |||
! Output routines | |||
integer function GetTopDriveOperationFaultLed() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveOperationFaultLed | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveOperationFaultLed' :: GetTopDriveOperationFaultLed | |||
implicit none | |||
GetTopDriveOperationFaultLed = data%EquipmentControl%TopDrivePanel%TopDriveOperationFaultLed | |||
!GetTopDriveOperationFaultLed = 1 | |||
end function | |||
integer function GetTopDriveTdsPowerLed() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTdsPowerLed | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTdsPowerLed' :: GetTopDriveTdsPowerLed | |||
implicit none | |||
GetTopDriveTdsPowerLed = data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed | |||
!GetTopDriveTdsPowerLed = 1 | |||
end function | |||
integer function GetTopDriveTorqueWrenchLed() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueWrenchLed | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueWrenchLed' :: GetTopDriveTorqueWrenchLed | |||
implicit none | |||
GetTopDriveTorqueWrenchLed = data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrenchLed | |||
!GetTopDriveTorqueWrenchLed = 1 | |||
end function | |||
integer function GetTopDriveLinkTiltLed() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveLinkTiltLed | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveLinkTiltLed' :: GetTopDriveLinkTiltLed | |||
implicit none | |||
GetTopDriveLinkTiltLed = data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed | |||
!GetTopDriveLinkTiltLed = 1 | |||
end function | |||
integer function GetTopDriveIbopLed() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveIbopLed | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveIbopLed' :: GetTopDriveIbopLed | |||
implicit none | |||
GetTopDriveIbopLed = data%EquipmentControl%TopDrivePanel%TopDriveIbopLed | |||
!GetTopDriveIbopLed = 1 | |||
end function | |||
real function GetTopDriveTorqueGauge() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueGauge | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueGauge' :: GetTopDriveTorqueGauge | |||
implicit none | |||
GetTopDriveTorqueGauge = data%EquipmentControl%TopDrivePanel%TopDriveTorqueGauge | |||
!GetTopDriveTorqueGauge = 340 | |||
end function | |||
real function GetTopDriveTorqueLimitGauge() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueLimitGauge | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueLimitGauge' :: GetTopDriveTorqueLimitGauge | |||
implicit none | |||
GetTopDriveTorqueLimitGauge = data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitGauge | |||
!GetTopDriveTorqueLimitGauge = 442 | |||
end function | |||
real function GetTopDriveRpmGauge() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveRpmGauge | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveRpmGauge' :: GetTopDriveRpmGauge | |||
implicit none | |||
GetTopDriveRpmGauge = data%EquipmentControl%TopDrivePanel%TopDriveRpmGauge | |||
!GetTopDriveRpmGauge = 67 | |||
end function | |||
end module CTopDrivePanel | |||
module CTopDrivePanel | |||
use CTopDrivePanelVariables | |||
use SimulationVariables | |||
use CLog3 | |||
implicit none | |||
public | |||
contains | |||
! Input routines | |||
subroutine SetTopDriveTdsPowerState(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveTdsPowerState | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTdsPowerState' :: SetTopDriveTdsPowerState | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveTdsPowerState=', data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState) | |||
#endif | |||
end subroutine | |||
subroutine SetTopDriveTorqueWrench(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveTorqueWrench | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTorqueWrench' :: SetTopDriveTorqueWrench | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrench = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveTorqueWrench=', data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrench) | |||
#endif | |||
end subroutine | |||
subroutine SetTopDriveDrillTorqueState(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveDrillTorqueState | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveDrillTorqueState' :: SetTopDriveDrillTorqueState | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%TopDrivePanel%TopDriveDrillTorqueState = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveDrillTorqueState=', data%EquipmentControl%TopDrivePanel%TopDriveDrillTorqueState) | |||
#endif | |||
end subroutine | |||
subroutine SetTopDriveLinkTiltState(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveLinkTiltState | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveLinkTiltState' :: SetTopDriveLinkTiltState | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveLinkTiltState=', data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState) | |||
#endif | |||
end subroutine | |||
subroutine SetTopDriveIbop(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveIbop | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveIbop' :: SetTopDriveIbop | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbop = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveIbop=', data%EquipmentControl%TopDrivePanel%TopDriveIbop) | |||
#endif | |||
end subroutine | |||
subroutine SetTopDriveTorqueLimitKnob(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveTorqueLimitKnob | |||
!DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTorqueLimitKnob' :: SetTopDriveTorqueLimitKnob | |||
! use CSimulationVariables, only: IsPortable | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%EquipmentControl%DrillingConsole%RTSwitch, data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob | |||
use CWarnings, only: Activate_TopdriveRotaryTableConfilict | |||
use CScaleRange | |||
implicit none | |||
real, intent(in) :: v | |||
if (IsPortable) then | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch == 0) then | |||
data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob = 0 | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob = v | |||
#ifdef deb | |||
call Log_3( 'RTTorqueLimitKnob=', data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob ) | |||
call Log_3( 'TopDriveTorqueLimitKnob=', data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob ) | |||
#endif | |||
endif | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch /= 0) then | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob = 0 | |||
data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob = real(ScaleRange(v, 0.0, 10.0, 0.0, 6000.0), 8) | |||
#ifdef deb | |||
call Log_3( 'RTTorqueLimitKnob=', data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob ) | |||
call Log_3( 'TopDriveTorqueLimitKnob=', data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob ) | |||
#endif | |||
endif | |||
else | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob = v | |||
#ifdef deb | |||
call Log_3( 'TopDriveTorqueLimitKnob=', data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob) | |||
#endif | |||
endif | |||
end subroutine | |||
subroutine SetRpmKnob(v) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetRpmKnob | |||
!DEC$ ATTRIBUTES ALIAS: 'SetRpmKnob' :: SetRpmKnob | |||
! use CSimulationVariables, only: IsPortable | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%EquipmentControl%DrillingConsole%RTSwitch, data%EquipmentControl%DrillingConsole%RTThrottle | |||
use CWarnings, only: Activate_TopdriveRotaryTableConfilict | |||
use CScaleRange | |||
implicit none | |||
real, intent(in) :: v | |||
if (IsPortable) then | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch == 0) then | |||
data%EquipmentControl%DrillingConsole%RTThrottle = 0 | |||
data%EquipmentControl%TopDrivePanel%RpmKnob = v | |||
#ifdef deb | |||
call Log_3( 'RTThrottle=', data%EquipmentControl%DrillingConsole%RTThrottle ) | |||
call Log_3( 'RpmKnob=', data%EquipmentControl%TopDrivePanel%RpmKnob ) | |||
#endif | |||
endif | |||
if(data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == 0 .and. data%EquipmentControl%DrillingConsole%RTSwitch /= 0) then | |||
data%EquipmentControl%TopDrivePanel%RpmKnob = 0 | |||
data%EquipmentControl%DrillingConsole%RTThrottle = real(ScaleRange(v, 0.0, 965.0, 0.0, 250.0), 8) | |||
#ifdef deb | |||
call Log_3( 'RpmKnob=', data%EquipmentControl%TopDrivePanel%RpmKnob ) | |||
call Log_3( 'RTThrottle=', data%EquipmentControl%DrillingConsole%RTThrottle ) | |||
#endif | |||
endif | |||
else | |||
data%EquipmentControl%TopDrivePanel%RpmKnob = v | |||
endif | |||
if (IsPortable) then | |||
! | |||
else | |||
data%EquipmentControl%TopDrivePanel%RpmKnob = v | |||
#ifdef deb | |||
call Log_3( 'RpmKnob=', data%EquipmentControl%TopDrivePanel%RpmKnob ) | |||
#endif | |||
endif | |||
end subroutine | |||
! Output routines | |||
integer function GetTopDriveOperationFaultLed() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveOperationFaultLed | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveOperationFaultLed' :: GetTopDriveOperationFaultLed | |||
implicit none | |||
GetTopDriveOperationFaultLed = data%EquipmentControl%TopDrivePanel%TopDriveOperationFaultLed | |||
!GetTopDriveOperationFaultLed = 1 | |||
end function | |||
integer function GetTopDriveTdsPowerLed() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTdsPowerLed | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTdsPowerLed' :: GetTopDriveTdsPowerLed | |||
implicit none | |||
GetTopDriveTdsPowerLed = data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed | |||
!GetTopDriveTdsPowerLed = 1 | |||
end function | |||
integer function GetTopDriveTorqueWrenchLed() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueWrenchLed | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueWrenchLed' :: GetTopDriveTorqueWrenchLed | |||
implicit none | |||
GetTopDriveTorqueWrenchLed = data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrenchLed | |||
!GetTopDriveTorqueWrenchLed = 1 | |||
end function | |||
integer function GetTopDriveLinkTiltLed() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveLinkTiltLed | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveLinkTiltLed' :: GetTopDriveLinkTiltLed | |||
implicit none | |||
GetTopDriveLinkTiltLed = data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed | |||
!GetTopDriveLinkTiltLed = 1 | |||
end function | |||
integer function GetTopDriveIbopLed() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveIbopLed | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveIbopLed' :: GetTopDriveIbopLed | |||
implicit none | |||
GetTopDriveIbopLed = data%EquipmentControl%TopDrivePanel%TopDriveIbopLed | |||
!GetTopDriveIbopLed = 1 | |||
end function | |||
real function GetTopDriveTorqueGauge() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueGauge | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueGauge' :: GetTopDriveTorqueGauge | |||
implicit none | |||
GetTopDriveTorqueGauge = data%EquipmentControl%TopDrivePanel%TopDriveTorqueGauge | |||
!GetTopDriveTorqueGauge = 340 | |||
end function | |||
real function GetTopDriveTorqueLimitGauge() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueLimitGauge | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueLimitGauge' :: GetTopDriveTorqueLimitGauge | |||
implicit none | |||
GetTopDriveTorqueLimitGauge = data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitGauge | |||
!GetTopDriveTorqueLimitGauge = 442 | |||
end function | |||
real function GetTopDriveRpmGauge() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveRpmGauge | |||
!DEC$ ATTRIBUTES ALIAS: 'GetTopDriveRpmGauge' :: GetTopDriveRpmGauge | |||
implicit none | |||
GetTopDriveRpmGauge = data%EquipmentControl%TopDrivePanel%TopDriveRpmGauge | |||
!GetTopDriveRpmGauge = 67 | |||
end function | |||
end module CTopDrivePanel |
@@ -1,44 +1,44 @@ | |||
module CTopDrivePanelVariables | |||
implicit none | |||
public | |||
! const | |||
integer :: TdsPower_REV = 1 | |||
integer :: TdsPower_OFF = 0 | |||
integer :: TdsPower_FWD = -1 | |||
integer :: TdsMu_TORQ = 1 | |||
integer :: TdsMu_SPINE = 0 | |||
integer :: TdsMu_DRILL = -1 | |||
integer :: TdsLinkTilt_TILT = 1 | |||
integer :: TdsLinkTilt_OFF = 0 | |||
integer :: TdsLinkTilt_DRILL = -1 | |||
integer :: LED_OFF = 0 | |||
integer :: LED_ON = 1 | |||
integer :: LED_BLINK = 2 | |||
! Input vars | |||
Type::TopDrivePanelType | |||
integer :: TopDriveTdsPowerState | |||
logical :: TopDriveTorqueWrench | |||
integer :: TopDriveDrillTorqueState | |||
integer :: TopDriveLinkTiltState | |||
logical :: TopDriveIbop | |||
real :: TopDriveTorqueLimitKnob | |||
real :: RpmKnob | |||
! Output vars | |||
integer :: TopDriveOperationFaultLed | |||
integer :: TopDriveTdsPowerLed | |||
integer :: TopDriveTorqueWrenchLed | |||
integer :: TopDriveLinkTiltLed | |||
integer :: TopDriveIbopLed | |||
real :: TopDriveTorqueLimitGauge | |||
real :: TopDriveTorqueGauge | |||
real :: TopDriveRpmGauge | |||
end type TopDrivePanelType | |||
contains | |||
module CTopDrivePanelVariables | |||
implicit none | |||
public | |||
! const | |||
integer :: TdsPower_REV = 1 | |||
integer :: TdsPower_OFF = 0 | |||
integer :: TdsPower_FWD = -1 | |||
integer :: TdsMu_TORQ = 1 | |||
integer :: TdsMu_SPINE = 0 | |||
integer :: TdsMu_DRILL = -1 | |||
integer :: TdsLinkTilt_TILT = 1 | |||
integer :: TdsLinkTilt_OFF = 0 | |||
integer :: TdsLinkTilt_DRILL = -1 | |||
integer :: LED_OFF = 0 | |||
integer :: LED_ON = 1 | |||
integer :: LED_BLINK = 2 | |||
! Input vars | |||
Type::TopDrivePanelType | |||
integer :: TopDriveTdsPowerState | |||
logical :: TopDriveTorqueWrench | |||
integer :: TopDriveDrillTorqueState | |||
integer :: TopDriveLinkTiltState | |||
logical :: TopDriveIbop | |||
real :: TopDriveTorqueLimitKnob | |||
real :: RpmKnob | |||
! Output vars | |||
integer :: TopDriveOperationFaultLed | |||
integer :: TopDriveTdsPowerLed | |||
integer :: TopDriveTorqueWrenchLed | |||
integer :: TopDriveLinkTiltLed | |||
integer :: TopDriveIbopLed | |||
real :: TopDriveTorqueLimitGauge | |||
real :: TopDriveTorqueGauge | |||
real :: TopDriveRpmGauge | |||
end type TopDrivePanelType | |||
contains | |||
end module CTopDrivePanelVariables |
@@ -1,34 +1,34 @@ | |||
module CDrillWatchVariables | |||
implicit none | |||
public | |||
! Input vars | |||
Type, Public::DrillingWatchType | |||
! Output vars | |||
real(8) :: Depth | |||
real(8) :: BitPosition | |||
real(8) :: HookLoad | |||
real(8) :: WeightOnBit | |||
real(8) :: RPM | |||
real(8) :: ROP | |||
real(8) :: Torque | |||
real(8) :: PumpPressure | |||
real(8) :: SPM1 | |||
real(8) :: SPM2 | |||
!real(8) :: SPM3 | |||
real(8) :: CasingPressure | |||
real(8) :: PercentFlow | |||
real(8) :: PitGainLose | |||
real(8) :: PitVolume | |||
real(8) :: KillMudVolume | |||
real(8) :: TripTankVolume | |||
real(8) :: MudWeightIn | |||
real(8) :: FillVolume | |||
real(8) :: MudWeightOut | |||
End Type DrillingWatchType | |||
module CDrillWatchVariables | |||
implicit none | |||
public | |||
! Input vars | |||
Type, Public::DrillingWatchType | |||
! Output vars | |||
real(8) :: Depth | |||
real(8) :: BitPosition | |||
real(8) :: HookLoad | |||
real(8) :: WeightOnBit | |||
real(8) :: RPM | |||
real(8) :: ROP | |||
real(8) :: Torque | |||
real(8) :: PumpPressure | |||
real(8) :: SPM1 | |||
real(8) :: SPM2 | |||
!real(8) :: SPM3 | |||
real(8) :: CasingPressure | |||
real(8) :: PercentFlow | |||
real(8) :: PitGainLose | |||
real(8) :: PitVolume | |||
real(8) :: KillMudVolume | |||
real(8) :: TripTankVolume | |||
real(8) :: MudWeightIn | |||
real(8) :: FillVolume | |||
real(8) :: MudWeightOut | |||
End Type DrillingWatchType | |||
end module CDrillWatchVariables |
@@ -1,137 +1,137 @@ | |||
module CArrangement | |||
implicit none | |||
public | |||
integer, parameter :: Normal = 0 | |||
integer, parameter :: Relation = 1 | |||
integer, parameter :: Input = 2 | |||
integer, parameter :: Output = 3 | |||
integer, parameter :: InputOutput = 4 | |||
type, public :: Arrangement | |||
integer, allocatable :: Adjacent(:) !adjacent valves that is connected to this valve | |||
logical :: Status !valve status ... open/close ... true/false | |||
integer :: ValveType ! Normal/Input/Output/InputOutput | |||
integer :: Number | |||
logical :: IsTraversed | |||
contains | |||
procedure :: Init => Init | |||
procedure :: IsConnectedTo => IsConnectedTo | |||
procedure :: IsSource => IsSource | |||
procedure :: Length => Length | |||
procedure :: AdjacentTo => AdjacentTo | |||
procedure :: RemoveAdjacent => RemoveAdjacent | |||
end type Arrangement | |||
contains | |||
subroutine Init(this, value) | |||
implicit none | |||
class(Arrangement), intent(inout) :: this | |||
integer, intent(in) :: value | |||
if(allocated(this%Adjacent)) deallocate(this%Adjacent) | |||
this%Status = .false. | |||
this%IsTraversed = .false. | |||
this%ValveType = Normal | |||
this%Number = value | |||
end subroutine | |||
integer function Length(this) | |||
implicit none | |||
class(Arrangement), intent(in) :: this | |||
if(allocated(this%Adjacent)) then | |||
Length = size(this%Adjacent) | |||
return | |||
end if | |||
Length = 0 | |||
end function | |||
subroutine AdjacentTo(this, value) | |||
implicit none | |||
class(Arrangement), intent(inout) :: this | |||
integer, intent(in) :: value | |||
integer, allocatable :: tempArr(:) | |||
integer :: i, isize | |||
if(allocated(this%Adjacent)) then | |||
isize = size(this%Adjacent) | |||
! check to see if already AdjacentTo that valve# | |||
do i=1,isize | |||
if(this%Adjacent(i)==value) return | |||
end do | |||
! if value is a new entry then add it to the collection | |||
allocate(tempArr(isize+1)) | |||
do i=1,isize | |||
tempArr(i) = this%Adjacent(i) | |||
end do | |||
tempArr(isize+1) = value | |||
deallocate(this%Adjacent) | |||
call move_alloc(tempArr, this%Adjacent) | |||
else | |||
allocate(this%Adjacent(1)) | |||
this%Adjacent(1) = value | |||
end if | |||
end subroutine | |||
logical function IsConnectedTo(this, value) | |||
implicit none | |||
class(Arrangement), intent(in) :: this | |||
integer, intent(in) :: value | |||
if(.not.allocated(this%Adjacent)) then | |||
IsConnectedTo = .false. | |||
return | |||
endif | |||
IsConnectedTo = any(this%Adjacent == value) | |||
return | |||
end function | |||
logical function IsSource(this) | |||
implicit none | |||
class(Arrangement), intent(in) :: this | |||
IsSource = this%ValveType > Relation | |||
end function | |||
subroutine RemoveAdjacent(this, value) | |||
implicit none | |||
class(Arrangement), intent(inout) :: this | |||
integer, intent(in) :: value | |||
integer, allocatable :: tempArr(:) | |||
integer :: i, index, isize | |||
logical :: found | |||
if(.not.allocated(this%Adjacent))return | |||
index = -1 | |||
do i=1, size(this%Adjacent) | |||
if(this%Adjacent(i)==value) then | |||
index = i | |||
exit | |||
end if | |||
end do | |||
if(index <= 0 .or. index > size(this%Adjacent)) return | |||
allocate(tempArr(size(this%Adjacent)-1)) | |||
found = .false. | |||
do i=1, size(this%Adjacent) | |||
if(i==index) then | |||
found = .true. | |||
cycle | |||
end if | |||
if(found) then | |||
tempArr(i-1) = this%Adjacent(i) | |||
else | |||
tempArr(i) = this%Adjacent(i) | |||
endif | |||
end do | |||
deallocate(this%Adjacent) | |||
call move_alloc(tempArr, this%Adjacent) | |||
end subroutine | |||
module CArrangement | |||
implicit none | |||
public | |||
integer, parameter :: Normal = 0 | |||
integer, parameter :: Relation = 1 | |||
integer, parameter :: Input = 2 | |||
integer, parameter :: Output = 3 | |||
integer, parameter :: InputOutput = 4 | |||
type, public :: Arrangement | |||
integer, allocatable :: Adjacent(:) !adjacent valves that is connected to this valve | |||
logical :: Status !valve status ... open/close ... true/false | |||
integer :: ValveType ! Normal/Input/Output/InputOutput | |||
integer :: Number | |||
logical :: IsTraversed | |||
contains | |||
procedure :: Init => Init | |||
procedure :: IsConnectedTo => IsConnectedTo | |||
procedure :: IsSource => IsSource | |||
procedure :: Length => Length | |||
procedure :: AdjacentTo => AdjacentTo | |||
procedure :: RemoveAdjacent => RemoveAdjacent | |||
end type Arrangement | |||
contains | |||
subroutine Init(this, value) | |||
implicit none | |||
class(Arrangement), intent(inout) :: this | |||
integer, intent(in) :: value | |||
if(allocated(this%Adjacent)) deallocate(this%Adjacent) | |||
this%Status = .false. | |||
this%IsTraversed = .false. | |||
this%ValveType = Normal | |||
this%Number = value | |||
end subroutine | |||
integer function Length(this) | |||
implicit none | |||
class(Arrangement), intent(in) :: this | |||
if(allocated(this%Adjacent)) then | |||
Length = size(this%Adjacent) | |||
return | |||
end if | |||
Length = 0 | |||
end function | |||
subroutine AdjacentTo(this, value) | |||
implicit none | |||
class(Arrangement), intent(inout) :: this | |||
integer, intent(in) :: value | |||
integer, allocatable :: tempArr(:) | |||
integer :: i, isize | |||
if(allocated(this%Adjacent)) then | |||
isize = size(this%Adjacent) | |||
! check to see if already AdjacentTo that valve# | |||
do i=1,isize | |||
if(this%Adjacent(i)==value) return | |||
end do | |||
! if value is a new entry then add it to the collection | |||
allocate(tempArr(isize+1)) | |||
do i=1,isize | |||
tempArr(i) = this%Adjacent(i) | |||
end do | |||
tempArr(isize+1) = value | |||
deallocate(this%Adjacent) | |||
call move_alloc(tempArr, this%Adjacent) | |||
else | |||
allocate(this%Adjacent(1)) | |||
this%Adjacent(1) = value | |||
end if | |||
end subroutine | |||
logical function IsConnectedTo(this, value) | |||
implicit none | |||
class(Arrangement), intent(in) :: this | |||
integer, intent(in) :: value | |||
if(.not.allocated(this%Adjacent)) then | |||
IsConnectedTo = .false. | |||
return | |||
endif | |||
IsConnectedTo = any(this%Adjacent == value) | |||
return | |||
end function | |||
logical function IsSource(this) | |||
implicit none | |||
class(Arrangement), intent(in) :: this | |||
IsSource = this%ValveType > Relation | |||
end function | |||
subroutine RemoveAdjacent(this, value) | |||
implicit none | |||
class(Arrangement), intent(inout) :: this | |||
integer, intent(in) :: value | |||
integer, allocatable :: tempArr(:) | |||
integer :: i, index, isize | |||
logical :: found | |||
if(.not.allocated(this%Adjacent))return | |||
index = -1 | |||
do i=1, size(this%Adjacent) | |||
if(this%Adjacent(i)==value) then | |||
index = i | |||
exit | |||
end if | |||
end do | |||
if(index <= 0 .or. index > size(this%Adjacent)) return | |||
allocate(tempArr(size(this%Adjacent)-1)) | |||
found = .false. | |||
do i=1, size(this%Adjacent) | |||
if(i==index) then | |||
found = .true. | |||
cycle | |||
end if | |||
if(found) then | |||
tempArr(i-1) = this%Adjacent(i) | |||
else | |||
tempArr(i) = this%Adjacent(i) | |||
endif | |||
end do | |||
deallocate(this%Adjacent) | |||
call move_alloc(tempArr, this%Adjacent) | |||
end subroutine | |||
end module CArrangement |
@@ -1,231 +1,231 @@ | |||
module CPath | |||
use CLog5 | |||
implicit none | |||
public | |||
type, public :: Path | |||
integer, allocatable :: Valves(:) | |||
logical :: IsClosed | |||
contains | |||
procedure :: Display => Display | |||
procedure :: DisplayWrite => DisplayWrite | |||
procedure :: First => First | |||
procedure :: Last => Last | |||
procedure :: Length => Length | |||
procedure :: Get => Get | |||
procedure :: Add => Add | |||
procedure :: Remove => Remove | |||
procedure :: Purge => Purge | |||
procedure :: Copy => Copy | |||
procedure :: MakeNull => MakeNull | |||
procedure :: IsNull => IsNull | |||
procedure :: Equal => Equal | |||
procedure :: Find => Find | |||
end type Path | |||
contains | |||
subroutine DisplayWrite(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
character(len=512) :: temp | |||
integer :: i | |||
if(allocated(this%valves)) then | |||
write(temp, '(a1,i0,a3,i0,a4,9999(g0))') '(', this%First(), '<=>', this%Last(), ') : ', (this%Valves(i), ", ",i=1,size(this%Valves)) | |||
write(*,*) temp | |||
end if | |||
end subroutine | |||
subroutine Display(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
character(len=512) :: temp | |||
integer :: i | |||
if(allocated(this%valves)) then | |||
write(temp, '(a1,i0,a3,i0,a4,9999(g0))') '(', this%First(), '<=>', this%Last(), ') : ', (this%Valves(i), ", ",i=1,size(this%Valves)) | |||
call Log_5(temp) | |||
end if | |||
end subroutine | |||
integer function First(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
if(allocated(this%Valves) .and. size(this%Valves) > 0) then | |||
First = this%Valves(1) | |||
return | |||
end if | |||
First = 0 | |||
end function | |||
integer function Last(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
if(allocated(this%Valves) .and. size(this%Valves) > 0) then | |||
Last = this%Valves(size(this%Valves)) | |||
return | |||
end if | |||
Last = 0 | |||
end function | |||
integer function Length(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
if(allocated(this%Valves)) then | |||
Length = size(this%Valves) | |||
return | |||
end if | |||
Length = 0 | |||
end function | |||
integer function Get(this, index) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
integer, intent(in) :: index | |||
if(allocated(this%Valves)) then | |||
if(index < 1 .or. index > size(this%Valves)) then | |||
Get = -1 | |||
return | |||
endif | |||
Get = this%Valves(index) | |||
return | |||
end if | |||
get = -1 | |||
end function | |||
subroutine Add(this, value) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
integer, allocatable :: tempArr(:) | |||
integer, intent(in) :: value | |||
integer :: i, isize | |||
if(allocated(this%Valves)) then | |||
isize = size(this%Valves) | |||
allocate(tempArr(isize+1)) | |||
do i=1,isize | |||
tempArr(i) = this%Valves(i) | |||
end do | |||
tempArr(isize+1) = value | |||
deallocate(this%Valves) | |||
call move_alloc(tempArr, this%Valves) | |||
else | |||
allocate(this%Valves(1)) | |||
this%Valves(1) = value | |||
end if | |||
end subroutine | |||
subroutine Remove(this, index) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
integer, intent(in) :: index | |||
integer, allocatable :: tempArr(:) | |||
integer :: i | |||
logical :: found | |||
if(index <= 0 .or. index > size(this%Valves)) return | |||
if(.not.allocated(this%Valves))return | |||
allocate(tempArr(size(this%Valves)-1)) | |||
found = .false. | |||
do i=1, size(this%Valves) | |||
if(i==index) then | |||
found = .true. | |||
cycle | |||
end if | |||
if(found) then | |||
tempArr(i-1) = this%Valves(i) | |||
else | |||
tempArr(i) = this%Valves(i) | |||
endif | |||
end do | |||
deallocate(this%valves) | |||
call move_alloc(tempArr, this%valves) | |||
end subroutine | |||
subroutine Purge(this, min, max) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
integer, intent(in) :: min | |||
integer, intent(in) :: max | |||
integer :: i | |||
i = 1 | |||
do | |||
! | |||
if(this%Valves(i) >= min .and. this%Valves(i) <= max) then | |||
call this%Remove(i) | |||
else | |||
i = i + 1 | |||
endif | |||
if(i > this%Length()) exit | |||
enddo | |||
end subroutine | |||
subroutine Copy(this, from) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
class(Path), intent(in) :: from | |||
if(allocated(from%Valves)) then | |||
if(allocated(this%Valves)) deallocate(this%Valves) | |||
allocate(this%Valves(size(from%Valves))) | |||
this%Valves(:) = from%Valves(:) | |||
end if | |||
end subroutine | |||
subroutine MakeNull(this) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
if(allocated(this%Valves)) deallocate(this%Valves) | |||
end subroutine | |||
logical function IsNull(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
IsNull = .not.allocated(this%Valves) | |||
return | |||
end function | |||
logical function Equal(this, otherPath) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
class(Path), intent(in) :: otherPath | |||
integer :: i, sizeThis, sizeOtherPath | |||
sizeThis = size(this%Valves) | |||
sizeOtherPath = size(otherPath%Valves) | |||
if(sizeThis /= sizeOtherPath) then | |||
Equal = .false. | |||
return | |||
end if | |||
do i = 1, sizeThis | |||
if(this%Valves(i) /= otherPath%Valves(i)) then | |||
Equal = .false. | |||
return | |||
end if | |||
end do | |||
Equal = .true. | |||
return | |||
end function | |||
logical function Find(this, value) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
integer, intent(in) :: value | |||
if(allocated(this%Valves)) then | |||
Find = any(this%Valves == value) | |||
return | |||
end if | |||
Find = .false. | |||
end function | |||
module CPath | |||
use CLog5 | |||
implicit none | |||
public | |||
type, public :: Path | |||
integer, allocatable :: Valves(:) | |||
logical :: IsClosed | |||
contains | |||
procedure :: Display => Display | |||
procedure :: DisplayWrite => DisplayWrite | |||
procedure :: First => First | |||
procedure :: Last => Last | |||
procedure :: Length => Length | |||
procedure :: Get => Get | |||
procedure :: Add => Add | |||
procedure :: Remove => Remove | |||
procedure :: Purge => Purge | |||
procedure :: Copy => Copy | |||
procedure :: MakeNull => MakeNull | |||
procedure :: IsNull => IsNull | |||
procedure :: Equal => Equal | |||
procedure :: Find => Find | |||
end type Path | |||
contains | |||
subroutine DisplayWrite(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
character(len=512) :: temp | |||
integer :: i | |||
if(allocated(this%valves)) then | |||
write(temp, '(a1,i0,a3,i0,a4,9999(g0))') '(', this%First(), '<=>', this%Last(), ') : ', (this%Valves(i), ", ",i=1,size(this%Valves)) | |||
write(*,*) temp | |||
end if | |||
end subroutine | |||
subroutine Display(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
character(len=512) :: temp | |||
integer :: i | |||
if(allocated(this%valves)) then | |||
write(temp, '(a1,i0,a3,i0,a4,9999(g0))') '(', this%First(), '<=>', this%Last(), ') : ', (this%Valves(i), ", ",i=1,size(this%Valves)) | |||
call Log_5(temp) | |||
end if | |||
end subroutine | |||
integer function First(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
if(allocated(this%Valves) .and. size(this%Valves) > 0) then | |||
First = this%Valves(1) | |||
return | |||
end if | |||
First = 0 | |||
end function | |||
integer function Last(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
if(allocated(this%Valves) .and. size(this%Valves) > 0) then | |||
Last = this%Valves(size(this%Valves)) | |||
return | |||
end if | |||
Last = 0 | |||
end function | |||
integer function Length(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
if(allocated(this%Valves)) then | |||
Length = size(this%Valves) | |||
return | |||
end if | |||
Length = 0 | |||
end function | |||
integer function Get(this, index) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
integer, intent(in) :: index | |||
if(allocated(this%Valves)) then | |||
if(index < 1 .or. index > size(this%Valves)) then | |||
Get = -1 | |||
return | |||
endif | |||
Get = this%Valves(index) | |||
return | |||
end if | |||
get = -1 | |||
end function | |||
subroutine Add(this, value) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
integer, allocatable :: tempArr(:) | |||
integer, intent(in) :: value | |||
integer :: i, isize | |||
if(allocated(this%Valves)) then | |||
isize = size(this%Valves) | |||
allocate(tempArr(isize+1)) | |||
do i=1,isize | |||
tempArr(i) = this%Valves(i) | |||
end do | |||
tempArr(isize+1) = value | |||
deallocate(this%Valves) | |||
call move_alloc(tempArr, this%Valves) | |||
else | |||
allocate(this%Valves(1)) | |||
this%Valves(1) = value | |||
end if | |||
end subroutine | |||
subroutine Remove(this, index) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
integer, intent(in) :: index | |||
integer, allocatable :: tempArr(:) | |||
integer :: i | |||
logical :: found | |||
if(index <= 0 .or. index > size(this%Valves)) return | |||
if(.not.allocated(this%Valves))return | |||
allocate(tempArr(size(this%Valves)-1)) | |||
found = .false. | |||
do i=1, size(this%Valves) | |||
if(i==index) then | |||
found = .true. | |||
cycle | |||
end if | |||
if(found) then | |||
tempArr(i-1) = this%Valves(i) | |||
else | |||
tempArr(i) = this%Valves(i) | |||
endif | |||
end do | |||
deallocate(this%valves) | |||
call move_alloc(tempArr, this%valves) | |||
end subroutine | |||
subroutine Purge(this, min, max) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
integer, intent(in) :: min | |||
integer, intent(in) :: max | |||
integer :: i | |||
i = 1 | |||
do | |||
! | |||
if(this%Valves(i) >= min .and. this%Valves(i) <= max) then | |||
call this%Remove(i) | |||
else | |||
i = i + 1 | |||
endif | |||
if(i > this%Length()) exit | |||
enddo | |||
end subroutine | |||
subroutine Copy(this, from) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
class(Path), intent(in) :: from | |||
if(allocated(from%Valves)) then | |||
if(allocated(this%Valves)) deallocate(this%Valves) | |||
allocate(this%Valves(size(from%Valves))) | |||
this%Valves(:) = from%Valves(:) | |||
end if | |||
end subroutine | |||
subroutine MakeNull(this) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
if(allocated(this%Valves)) deallocate(this%Valves) | |||
end subroutine | |||
logical function IsNull(this) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
IsNull = .not.allocated(this%Valves) | |||
return | |||
end function | |||
logical function Equal(this, otherPath) | |||
implicit none | |||
class(Path), intent(inout) :: this | |||
class(Path), intent(in) :: otherPath | |||
integer :: i, sizeThis, sizeOtherPath | |||
sizeThis = size(this%Valves) | |||
sizeOtherPath = size(otherPath%Valves) | |||
if(sizeThis /= sizeOtherPath) then | |||
Equal = .false. | |||
return | |||
end if | |||
do i = 1, sizeThis | |||
if(this%Valves(i) /= otherPath%Valves(i)) then | |||
Equal = .false. | |||
return | |||
end if | |||
end do | |||
Equal = .true. | |||
return | |||
end function | |||
logical function Find(this, value) | |||
implicit none | |||
class(Path), intent(in) :: this | |||
integer, intent(in) :: value | |||
if(allocated(this%Valves)) then | |||
Find = any(this%Valves == value) | |||
return | |||
end if | |||
Find = .false. | |||
end function | |||
end module CPath |
@@ -1,12 +1,12 @@ | |||
module CPathChangeEvents | |||
! use CIntegerArrayEventHandlerCollection | |||
! use CVoidEventHandlerCollection | |||
implicit none | |||
public | |||
! type(VoidEventHandlerCollection) :: BeforeTraverse | |||
! type(VoidEventHandlerCollection) :: AfterTraverse | |||
! type(IntegerArrayEventHandlerCollection) :: OnPathOpen | |||
contains | |||
module CPathChangeEvents | |||
! use CIntegerArrayEventHandlerCollection | |||
! use CVoidEventHandlerCollection | |||
implicit none | |||
public | |||
! type(VoidEventHandlerCollection) :: BeforeTraverse | |||
! type(VoidEventHandlerCollection) :: AfterTraverse | |||
! type(IntegerArrayEventHandlerCollection) :: OnPathOpen | |||
contains | |||
end module CPathChangeEvents |
@@ -1,42 +1,42 @@ | |||
module CStack | |||
use CPath,Only:Path | |||
implicit none | |||
public | |||
type, public :: Stack | |||
type(Path) :: List | |||
contains | |||
procedure :: Clear => Clear | |||
procedure :: Push => Push | |||
procedure :: Pop => Pop | |||
procedure :: DoesHave => DoesHave | |||
end type Stack | |||
contains | |||
subroutine Clear(this) | |||
implicit none | |||
class(Stack), intent(inout) :: this | |||
call this%List%MakeNull() | |||
end subroutine | |||
subroutine Push(this, value) | |||
implicit none | |||
class(Stack), intent(inout) :: this | |||
integer, intent(in) :: value | |||
call this%List%Add(value) | |||
end subroutine | |||
subroutine Pop(this) | |||
implicit none | |||
class(Stack), intent(inout) :: this | |||
call this%List%Remove(this%List%Length()) | |||
end subroutine | |||
logical function DoesHave(this, value) | |||
implicit none | |||
class(Stack), intent(in) :: this | |||
integer, intent(in) :: value | |||
DoesHave = this%List%Find(value) | |||
end function | |||
module CStack | |||
use CPath,Only:Path | |||
implicit none | |||
public | |||
type, public :: Stack | |||
type(Path) :: List | |||
contains | |||
procedure :: Clear => Clear | |||
procedure :: Push => Push | |||
procedure :: Pop => Pop | |||
procedure :: DoesHave => DoesHave | |||
end type Stack | |||
contains | |||
subroutine Clear(this) | |||
implicit none | |||
class(Stack), intent(inout) :: this | |||
call this%List%MakeNull() | |||
end subroutine | |||
subroutine Push(this, value) | |||
implicit none | |||
class(Stack), intent(inout) :: this | |||
integer, intent(in) :: value | |||
call this%List%Add(value) | |||
end subroutine | |||
subroutine Pop(this) | |||
implicit none | |||
class(Stack), intent(inout) :: this | |||
call this%List%Remove(this%List%Length()) | |||
end subroutine | |||
logical function DoesHave(this, value) | |||
implicit none | |||
class(Stack), intent(in) :: this | |||
integer, intent(in) :: value | |||
DoesHave = this%List%Find(value) | |||
end function | |||
end module CStack |
@@ -1,20 +1,20 @@ | |||
module CTanks | |||
use SimulationVariables | |||
use CManifolds | |||
implicit none | |||
public | |||
contains | |||
subroutine Set_ManualPumpPower(v) | |||
use CManifolds, only:ChangeValve | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%Tank%ManualPumpPower = v | |||
call ChangeValve(43, v) | |||
#ifdef deb | |||
print*, 'ManualPumpPower=', data%EquipmentControl%Tank%ManualPumpPower | |||
#endif | |||
end subroutine | |||
module CTanks | |||
use SimulationVariables | |||
use CManifolds | |||
implicit none | |||
public | |||
contains | |||
subroutine Set_ManualPumpPower(v) | |||
use CManifolds, only:ChangeValve | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%Tank%ManualPumpPower = v | |||
call ChangeValve(43, v) | |||
#ifdef deb | |||
print*, 'ManualPumpPower=', data%EquipmentControl%Tank%ManualPumpPower | |||
#endif | |||
end subroutine | |||
end module CTanks |
@@ -1,29 +1,29 @@ | |||
module CTanksVariables | |||
implicit none | |||
public | |||
Type :: TankType | |||
! Input vars | |||
real(8) :: WaterRate | |||
real(8) :: CementTankVolume | |||
real(8) :: CementTankDensity | |||
real(8) :: TripTankVolume | |||
real(8) :: TripTankDensity | |||
logical :: ManualPumpPower | |||
logical :: Valve1 | |||
logical :: Valve2 | |||
logical :: Valve3 | |||
logical :: Valve4 | |||
logical :: Valve5 | |||
logical :: Valve6 | |||
logical :: Valve7 | |||
logical :: Valve8 | |||
logical :: Valve9 | |||
logical :: Valve10 | |||
logical :: Valve11 | |||
End Type TankType | |||
contains | |||
module CTanksVariables | |||
implicit none | |||
public | |||
Type :: TankType | |||
! Input vars | |||
real(8) :: WaterRate | |||
real(8) :: CementTankVolume | |||
real(8) :: CementTankDensity | |||
real(8) :: TripTankVolume | |||
real(8) :: TripTankDensity | |||
logical :: ManualPumpPower | |||
logical :: Valve1 | |||
logical :: Valve2 | |||
logical :: Valve3 | |||
logical :: Valve4 | |||
logical :: Valve5 | |||
logical :: Valve6 | |||
logical :: Valve7 | |||
logical :: Valve8 | |||
logical :: Valve9 | |||
logical :: Valve10 | |||
logical :: Valve11 | |||
End Type TankType | |||
contains | |||
end module CTanksVariables |
@@ -1,303 +1,303 @@ | |||
module CError | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Error | |||
module procedure :: Error1, Error2, Error3, Error4, Error5 | |||
end interface | |||
interface ErrorStop | |||
module procedure :: ErrorStop1, ErrorStop2, ErrorStop3, ErrorStop4, ErrorStop5 | |||
end interface | |||
procedure (ActionString), pointer :: ErrorMessagePtr | |||
procedure (ActionStringInt), pointer :: ErrorMessageIntPtr | |||
procedure (ActionStringFloat), pointer :: ErrorMessageFloatPtr | |||
procedure (ActionStringDouble), pointer :: ErrorMessageDoublePtr | |||
procedure (ActionStringBool), pointer :: ErrorMessageBoolPtr | |||
procedure (ActionString), pointer :: ErrorStopPtr | |||
procedure (ActionStringInt), pointer :: ErrorStopIntPtr | |||
procedure (ActionStringFloat), pointer :: ErrorStopFloatPtr | |||
procedure (ActionStringDouble), pointer :: ErrorStopDoublePtr | |||
procedure (ActionStringBool), pointer :: ErrorStopBoolPtr | |||
contains | |||
subroutine Error1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
if(associated(ErrorMessagePtr)) call ErrorMessagePtr(message) | |||
end subroutine | |||
subroutine Error2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorMessagePtr)) call ErrorMessagePtr(trim(message//' '//adjustl(temp))) | |||
if(associated(ErrorMessageIntPtr)) call ErrorMessageIntPtr(message, value) | |||
end subroutine | |||
subroutine Error3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorMessagePtr)) call ErrorMessagePtr(trim(message//' '//adjustl(temp))) | |||
if(associated(ErrorMessageFloatPtr)) call ErrorMessageFloatPtr(message, value) | |||
end subroutine | |||
subroutine Error4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorMessagePtr)) call ErrorMessagePtr(trim(message//' '//adjustl(temp))) | |||
if(associated(ErrorMessageDoublePtr)) call ErrorMessageDoublePtr(message, value) | |||
end subroutine | |||
subroutine Error5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
!if(value) then | |||
! if(associated(ErrorMessagePtr)) call ErrorMessagePtr(message//' '//'TRUE') | |||
!else | |||
! if(associated(ErrorMessagePtr)) call ErrorMessagePtr(message//' '//'FALSE') | |||
!endif | |||
if(associated(ErrorMessageBoolPtr)) call ErrorMessageBoolPtr(message, value) | |||
end subroutine | |||
subroutine ErrorStop1(message) | |||
!use ifmt | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
if(associated(ErrorStopPtr)) then | |||
call ErrorStopPtr(message) | |||
! call ExitThread(0) | |||
end if | |||
end subroutine | |||
subroutine ErrorStop2(message, value) | |||
!use ifmt | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorStopPtr)) then | |||
! call ErrorStopPtr(trim(message//' '//adjustl(temp))) | |||
! ! call ExitThread(0) | |||
!end if | |||
if(associated(ErrorStopIntPtr)) then | |||
call ErrorStopIntPtr(message, value) | |||
! call ExitThread(0) | |||
end if | |||
end subroutine | |||
subroutine ErrorStop3(message, value) | |||
!use ifmt | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorStopPtr)) then | |||
! call ErrorStopPtr(trim(message//' '//adjustl(temp))) | |||
! ! call ExitThread(0) | |||
!end if | |||
if(associated(ErrorStopFloatPtr)) then | |||
call ErrorStopFloatPtr(message, value) | |||
! ! call ExitThread(0) | |||
end if | |||
end subroutine | |||
subroutine ErrorStop4(message, value) | |||
! use ifmt | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorStopPtr)) then | |||
! call ErrorStopPtr(trim(message//' '//adjustl(temp))) | |||
! ! call ExitThread(0) | |||
!end if | |||
if(associated(ErrorStopDoublePtr)) then | |||
call ErrorStopDoublePtr(message, value) | |||
! ! call ExitThread(0) | |||
end if | |||
end subroutine | |||
subroutine ErrorStop5(message, value) | |||
!use ifmt | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
!if(value) then | |||
! if(associated(ErrorStopPtr)) then | |||
! call ErrorStopPtr(message//' '//'TRUE') | |||
! ! ! call ExitThread(0) | |||
! end if | |||
!else | |||
! if(associated(ErrorStopPtr)) then | |||
! call ErrorStopPtr(message//' '//'FALSE') | |||
! ! ! call ExitThread(0) | |||
! end if | |||
!endif | |||
if(associated(ErrorStopBoolPtr)) then | |||
call ErrorStopBoolPtr(message, value) | |||
! call ExitThread(0) | |||
end if | |||
end subroutine | |||
subroutine SubscribeErrorMessage(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorMessage | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorMessage' :: SubscribeErrorMessage | |||
implicit none | |||
procedure (ActionString) :: a | |||
ErrorMessagePtr => a | |||
end subroutine | |||
subroutine SubscribeErrorMessageInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorMessageInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorMessageInt' :: SubscribeErrorMessageInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
ErrorMessageIntPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorMessageFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorMessageFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorMessageFloat' :: SubscribeErrorMessageFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
ErrorMessageFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorMessageDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorMessageDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorMessageDouble' :: SubscribeErrorMessageDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
ErrorMessageDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeErrorMessageBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorMessageBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorMessageBool' :: SubscribeErrorMessageBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
ErrorMessageBoolPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorStop(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorStop | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorStop' :: SubscribeErrorStop | |||
implicit none | |||
procedure (ActionString) :: a | |||
ErrorStopPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorStopInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorStopInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorStopInt' :: SubscribeErrorStopInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
ErrorStopIntPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorStopFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorStopFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorStopFloat' :: SubscribeErrorStopFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
ErrorStopFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorStopDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorStopDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorStopDouble' :: SubscribeErrorStopDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
ErrorStopDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeErrorStopBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorStopBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorStopBool' :: SubscribeErrorStopBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
ErrorStopBoolPtr => a | |||
end subroutine | |||
module CError | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Error | |||
module procedure :: Error1, Error2, Error3, Error4, Error5 | |||
end interface | |||
interface ErrorStop | |||
module procedure :: ErrorStop1, ErrorStop2, ErrorStop3, ErrorStop4, ErrorStop5 | |||
end interface | |||
procedure (ActionString), pointer :: ErrorMessagePtr | |||
procedure (ActionStringInt), pointer :: ErrorMessageIntPtr | |||
procedure (ActionStringFloat), pointer :: ErrorMessageFloatPtr | |||
procedure (ActionStringDouble), pointer :: ErrorMessageDoublePtr | |||
procedure (ActionStringBool), pointer :: ErrorMessageBoolPtr | |||
procedure (ActionString), pointer :: ErrorStopPtr | |||
procedure (ActionStringInt), pointer :: ErrorStopIntPtr | |||
procedure (ActionStringFloat), pointer :: ErrorStopFloatPtr | |||
procedure (ActionStringDouble), pointer :: ErrorStopDoublePtr | |||
procedure (ActionStringBool), pointer :: ErrorStopBoolPtr | |||
contains | |||
subroutine Error1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
if(associated(ErrorMessagePtr)) call ErrorMessagePtr(message) | |||
end subroutine | |||
subroutine Error2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorMessagePtr)) call ErrorMessagePtr(trim(message//' '//adjustl(temp))) | |||
if(associated(ErrorMessageIntPtr)) call ErrorMessageIntPtr(message, value) | |||
end subroutine | |||
subroutine Error3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorMessagePtr)) call ErrorMessagePtr(trim(message//' '//adjustl(temp))) | |||
if(associated(ErrorMessageFloatPtr)) call ErrorMessageFloatPtr(message, value) | |||
end subroutine | |||
subroutine Error4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorMessagePtr)) call ErrorMessagePtr(trim(message//' '//adjustl(temp))) | |||
if(associated(ErrorMessageDoublePtr)) call ErrorMessageDoublePtr(message, value) | |||
end subroutine | |||
subroutine Error5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
!if(value) then | |||
! if(associated(ErrorMessagePtr)) call ErrorMessagePtr(message//' '//'TRUE') | |||
!else | |||
! if(associated(ErrorMessagePtr)) call ErrorMessagePtr(message//' '//'FALSE') | |||
!endif | |||
if(associated(ErrorMessageBoolPtr)) call ErrorMessageBoolPtr(message, value) | |||
end subroutine | |||
subroutine ErrorStop1(message) | |||
!use ifmt | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
if(associated(ErrorStopPtr)) then | |||
call ErrorStopPtr(message) | |||
! call ExitThread(0) | |||
end if | |||
end subroutine | |||
subroutine ErrorStop2(message, value) | |||
!use ifmt | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorStopPtr)) then | |||
! call ErrorStopPtr(trim(message//' '//adjustl(temp))) | |||
! ! call ExitThread(0) | |||
!end if | |||
if(associated(ErrorStopIntPtr)) then | |||
call ErrorStopIntPtr(message, value) | |||
! call ExitThread(0) | |||
end if | |||
end subroutine | |||
subroutine ErrorStop3(message, value) | |||
!use ifmt | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorStopPtr)) then | |||
! call ErrorStopPtr(trim(message//' '//adjustl(temp))) | |||
! ! call ExitThread(0) | |||
!end if | |||
if(associated(ErrorStopFloatPtr)) then | |||
call ErrorStopFloatPtr(message, value) | |||
! ! call ExitThread(0) | |||
end if | |||
end subroutine | |||
subroutine ErrorStop4(message, value) | |||
! use ifmt | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
!character(len=256) :: temp | |||
!temp(:)=' ' | |||
!write(temp,*) value | |||
!if(associated(ErrorStopPtr)) then | |||
! call ErrorStopPtr(trim(message//' '//adjustl(temp))) | |||
! ! call ExitThread(0) | |||
!end if | |||
if(associated(ErrorStopDoublePtr)) then | |||
call ErrorStopDoublePtr(message, value) | |||
! ! call ExitThread(0) | |||
end if | |||
end subroutine | |||
subroutine ErrorStop5(message, value) | |||
!use ifmt | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
!if(value) then | |||
! if(associated(ErrorStopPtr)) then | |||
! call ErrorStopPtr(message//' '//'TRUE') | |||
! ! ! call ExitThread(0) | |||
! end if | |||
!else | |||
! if(associated(ErrorStopPtr)) then | |||
! call ErrorStopPtr(message//' '//'FALSE') | |||
! ! ! call ExitThread(0) | |||
! end if | |||
!endif | |||
if(associated(ErrorStopBoolPtr)) then | |||
call ErrorStopBoolPtr(message, value) | |||
! call ExitThread(0) | |||
end if | |||
end subroutine | |||
subroutine SubscribeErrorMessage(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorMessage | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorMessage' :: SubscribeErrorMessage | |||
implicit none | |||
procedure (ActionString) :: a | |||
ErrorMessagePtr => a | |||
end subroutine | |||
subroutine SubscribeErrorMessageInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorMessageInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorMessageInt' :: SubscribeErrorMessageInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
ErrorMessageIntPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorMessageFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorMessageFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorMessageFloat' :: SubscribeErrorMessageFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
ErrorMessageFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorMessageDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorMessageDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorMessageDouble' :: SubscribeErrorMessageDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
ErrorMessageDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeErrorMessageBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorMessageBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorMessageBool' :: SubscribeErrorMessageBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
ErrorMessageBoolPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorStop(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorStop | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorStop' :: SubscribeErrorStop | |||
implicit none | |||
procedure (ActionString) :: a | |||
ErrorStopPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorStopInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorStopInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorStopInt' :: SubscribeErrorStopInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
ErrorStopIntPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorStopFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorStopFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorStopFloat' :: SubscribeErrorStopFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
ErrorStopFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeErrorStopDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorStopDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorStopDouble' :: SubscribeErrorStopDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
ErrorStopDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeErrorStopBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeErrorStopBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeErrorStopBool' :: SubscribeErrorStopBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
ErrorStopBoolPtr => a | |||
end subroutine | |||
end module CError |
@@ -1,113 +1,113 @@ | |||
module CLog1 | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Log_1 | |||
module procedure :: Log1Log1, Log1Log2, Log1Log3, Log1Log4, Log1Log5 | |||
end interface | |||
procedure (ActionString), pointer :: Log1MsgPtr | |||
procedure (ActionStringInt), pointer :: Log1MsgIntPtr | |||
procedure (ActionStringFloat), pointer :: Log1MsgFloatPtr | |||
procedure (ActionStringDouble), pointer :: Log1MsgDoublePtr | |||
procedure (ActionStringBool), pointer :: Log1MsgBoolPtr | |||
contains | |||
subroutine Log1Log1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
#ifdef Log1 | |||
if(associated(Log1MsgPtr)) call Log1MsgPtr(message) | |||
#endif | |||
end subroutine | |||
subroutine Log1Log2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
#ifdef Log1 | |||
if(associated(Log1MsgIntPtr)) call Log1MsgIntPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log1Log3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
#ifdef Log1 | |||
if(associated(Log1MsgFloatPtr)) call Log1MsgFloatPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log1Log4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
#ifdef Log1 | |||
if(associated(Log1MsgDoublePtr)) call Log1MsgDoublePtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log1Log5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
#ifdef Log1 | |||
if(associated(Log1MsgBoolPtr)) call Log1MsgBoolPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine SubscribeLog1Message(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog1Message | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog1Message' :: SubscribeLog1Message | |||
implicit none | |||
procedure (ActionString) :: a | |||
Log1MsgPtr => a | |||
end subroutine | |||
subroutine SubscribeLog1MsgInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog1MsgInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog1MsgInt' :: SubscribeLog1MsgInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
Log1MsgIntPtr => a | |||
end subroutine | |||
subroutine SubscribeLog1MsgFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog1MsgFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog1MsgFloat' :: SubscribeLog1MsgFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
Log1MsgFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeLog1MsgDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog1MsgDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog1MsgDouble' :: SubscribeLog1MsgDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
Log1MsgDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeLog1MsgBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog1MsgBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog1MsgBool' :: SubscribeLog1MsgBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
Log1MsgBoolPtr => a | |||
end subroutine | |||
module CLog1 | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Log_1 | |||
module procedure :: Log1Log1, Log1Log2, Log1Log3, Log1Log4, Log1Log5 | |||
end interface | |||
procedure (ActionString), pointer :: Log1MsgPtr | |||
procedure (ActionStringInt), pointer :: Log1MsgIntPtr | |||
procedure (ActionStringFloat), pointer :: Log1MsgFloatPtr | |||
procedure (ActionStringDouble), pointer :: Log1MsgDoublePtr | |||
procedure (ActionStringBool), pointer :: Log1MsgBoolPtr | |||
contains | |||
subroutine Log1Log1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
#ifdef Log1 | |||
if(associated(Log1MsgPtr)) call Log1MsgPtr(message) | |||
#endif | |||
end subroutine | |||
subroutine Log1Log2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
#ifdef Log1 | |||
if(associated(Log1MsgIntPtr)) call Log1MsgIntPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log1Log3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
#ifdef Log1 | |||
if(associated(Log1MsgFloatPtr)) call Log1MsgFloatPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log1Log4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
#ifdef Log1 | |||
if(associated(Log1MsgDoublePtr)) call Log1MsgDoublePtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log1Log5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
#ifdef Log1 | |||
if(associated(Log1MsgBoolPtr)) call Log1MsgBoolPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine SubscribeLog1Message(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog1Message | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog1Message' :: SubscribeLog1Message | |||
implicit none | |||
procedure (ActionString) :: a | |||
Log1MsgPtr => a | |||
end subroutine | |||
subroutine SubscribeLog1MsgInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog1MsgInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog1MsgInt' :: SubscribeLog1MsgInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
Log1MsgIntPtr => a | |||
end subroutine | |||
subroutine SubscribeLog1MsgFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog1MsgFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog1MsgFloat' :: SubscribeLog1MsgFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
Log1MsgFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeLog1MsgDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog1MsgDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog1MsgDouble' :: SubscribeLog1MsgDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
Log1MsgDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeLog1MsgBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog1MsgBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog1MsgBool' :: SubscribeLog1MsgBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
Log1MsgBoolPtr => a | |||
end subroutine | |||
end module CLog1 |
@@ -1,113 +1,113 @@ | |||
module CLog2 | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Log_2 | |||
module procedure :: Log2Log1, Log2Log2, Log2Log3, Log2Log4, Log2Log5 | |||
end interface | |||
procedure (ActionString), pointer :: Log2MsgPtr | |||
procedure (ActionStringInt), pointer :: Log2MsgIntPtr | |||
procedure (ActionStringFloat), pointer :: Log2MsgFloatPtr | |||
procedure (ActionStringDouble), pointer :: Log2MsgDoublePtr | |||
procedure (ActionStringBool), pointer :: Log2MsgBoolPtr | |||
contains | |||
subroutine Log2Log1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
#ifdef Log2 | |||
if(associated(Log2MsgPtr)) call Log2MsgPtr(message) | |||
#endif | |||
end subroutine | |||
subroutine Log2Log2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
#ifdef Log2 | |||
if(associated(Log2MsgIntPtr)) call Log2MsgIntPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log2Log3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
#ifdef Log2 | |||
if(associated(Log2MsgFloatPtr)) call Log2MsgFloatPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log2Log4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
#ifdef Log2 | |||
if(associated(Log2MsgDoublePtr)) call Log2MsgDoublePtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log2Log5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
#ifdef Log2 | |||
if(associated(Log2MsgBoolPtr)) call Log2MsgBoolPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine SubscribeLog2Message(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2Message | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2Message' :: SubscribeLog2Message | |||
implicit none | |||
procedure (ActionString) :: a | |||
Log2MsgPtr => a | |||
end subroutine | |||
subroutine SubscribeLog2MsgInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgInt' :: SubscribeLog2MsgInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
Log2MsgIntPtr => a | |||
end subroutine | |||
subroutine SubscribeLog2MsgFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgFloat' :: SubscribeLog2MsgFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
Log2MsgFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeLog2MsgDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgDouble' :: SubscribeLog2MsgDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
Log2MsgDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeLog2MsgBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgBool' :: SubscribeLog2MsgBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
Log2MsgBoolPtr => a | |||
end subroutine | |||
module CLog2 | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Log_2 | |||
module procedure :: Log2Log1, Log2Log2, Log2Log3, Log2Log4, Log2Log5 | |||
end interface | |||
procedure (ActionString), pointer :: Log2MsgPtr | |||
procedure (ActionStringInt), pointer :: Log2MsgIntPtr | |||
procedure (ActionStringFloat), pointer :: Log2MsgFloatPtr | |||
procedure (ActionStringDouble), pointer :: Log2MsgDoublePtr | |||
procedure (ActionStringBool), pointer :: Log2MsgBoolPtr | |||
contains | |||
subroutine Log2Log1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
#ifdef Log2 | |||
if(associated(Log2MsgPtr)) call Log2MsgPtr(message) | |||
#endif | |||
end subroutine | |||
subroutine Log2Log2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
#ifdef Log2 | |||
if(associated(Log2MsgIntPtr)) call Log2MsgIntPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log2Log3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
#ifdef Log2 | |||
if(associated(Log2MsgFloatPtr)) call Log2MsgFloatPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log2Log4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
#ifdef Log2 | |||
if(associated(Log2MsgDoublePtr)) call Log2MsgDoublePtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log2Log5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
#ifdef Log2 | |||
if(associated(Log2MsgBoolPtr)) call Log2MsgBoolPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine SubscribeLog2Message(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2Message | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2Message' :: SubscribeLog2Message | |||
implicit none | |||
procedure (ActionString) :: a | |||
Log2MsgPtr => a | |||
end subroutine | |||
subroutine SubscribeLog2MsgInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgInt' :: SubscribeLog2MsgInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
Log2MsgIntPtr => a | |||
end subroutine | |||
subroutine SubscribeLog2MsgFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgFloat' :: SubscribeLog2MsgFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
Log2MsgFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeLog2MsgDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgDouble' :: SubscribeLog2MsgDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
Log2MsgDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeLog2MsgBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog2MsgBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog2MsgBool' :: SubscribeLog2MsgBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
Log2MsgBoolPtr => a | |||
end subroutine | |||
end module CLog2 |
@@ -1,113 +1,113 @@ | |||
module CLog3 | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Log_3 | |||
module procedure :: Log3Log1, Log3Log2, Log3Log3, Log3Log4, Log3Log5 | |||
end interface | |||
procedure (ActionString), pointer :: Log3MsgPtr | |||
procedure (ActionStringInt), pointer :: Log3MsgIntPtr | |||
procedure (ActionStringFloat), pointer :: Log3MsgFloatPtr | |||
procedure (ActionStringDouble), pointer :: Log3MsgDoublePtr | |||
procedure (ActionStringBool), pointer :: Log3MsgBoolPtr | |||
contains | |||
subroutine Log3Log1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
#ifdef Log3 | |||
if(associated(Log3MsgPtr)) call Log3MsgPtr(message) | |||
#endif | |||
end subroutine | |||
subroutine Log3Log2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
#ifdef Log3 | |||
if(associated(Log3MsgIntPtr)) call Log3MsgIntPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log3Log3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
#ifdef Log3 | |||
if(associated(Log3MsgFloatPtr)) call Log3MsgFloatPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log3Log4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
#ifdef Log3 | |||
if(associated(Log3MsgDoublePtr)) call Log3MsgDoublePtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log3Log5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
#ifdef Log3 | |||
if(associated(Log3MsgBoolPtr)) call Log3MsgBoolPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine SubscribeLog3Message(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog3Message | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog3Message' :: SubscribeLog3Message | |||
implicit none | |||
procedure (ActionString) :: a | |||
Log3MsgPtr => a | |||
end subroutine | |||
subroutine SubscribeLog3MsgInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog3MsgInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog3MsgInt' :: SubscribeLog3MsgInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
Log3MsgIntPtr => a | |||
end subroutine | |||
subroutine SubscribeLog3MsgFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog3MsgFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog3MsgFloat' :: SubscribeLog3MsgFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
Log3MsgFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeLog3MsgDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog3MsgDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog3MsgDouble' :: SubscribeLog3MsgDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
Log3MsgDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeLog3MsgBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog3MsgBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog3MsgBool' :: SubscribeLog3MsgBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
Log3MsgBoolPtr => a | |||
end subroutine | |||
module CLog3 | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Log_3 | |||
module procedure :: Log3Log1, Log3Log2, Log3Log3, Log3Log4, Log3Log5 | |||
end interface | |||
procedure (ActionString), pointer :: Log3MsgPtr | |||
procedure (ActionStringInt), pointer :: Log3MsgIntPtr | |||
procedure (ActionStringFloat), pointer :: Log3MsgFloatPtr | |||
procedure (ActionStringDouble), pointer :: Log3MsgDoublePtr | |||
procedure (ActionStringBool), pointer :: Log3MsgBoolPtr | |||
contains | |||
subroutine Log3Log1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
#ifdef Log3 | |||
if(associated(Log3MsgPtr)) call Log3MsgPtr(message) | |||
#endif | |||
end subroutine | |||
subroutine Log3Log2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
#ifdef Log3 | |||
if(associated(Log3MsgIntPtr)) call Log3MsgIntPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log3Log3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
#ifdef Log3 | |||
if(associated(Log3MsgFloatPtr)) call Log3MsgFloatPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log3Log4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
#ifdef Log3 | |||
if(associated(Log3MsgDoublePtr)) call Log3MsgDoublePtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log3Log5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
#ifdef Log3 | |||
if(associated(Log3MsgBoolPtr)) call Log3MsgBoolPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine SubscribeLog3Message(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog3Message | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog3Message' :: SubscribeLog3Message | |||
implicit none | |||
procedure (ActionString) :: a | |||
Log3MsgPtr => a | |||
end subroutine | |||
subroutine SubscribeLog3MsgInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog3MsgInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog3MsgInt' :: SubscribeLog3MsgInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
Log3MsgIntPtr => a | |||
end subroutine | |||
subroutine SubscribeLog3MsgFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog3MsgFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog3MsgFloat' :: SubscribeLog3MsgFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
Log3MsgFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeLog3MsgDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog3MsgDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog3MsgDouble' :: SubscribeLog3MsgDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
Log3MsgDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeLog3MsgBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog3MsgBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog3MsgBool' :: SubscribeLog3MsgBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
Log3MsgBoolPtr => a | |||
end subroutine | |||
end module CLog3 |
@@ -1,113 +1,113 @@ | |||
module CLog4 | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Log_4 | |||
module procedure :: Log4Log1, Log4Log2, Log4Log3, Log4Log4, Log4Log5 | |||
end interface | |||
procedure (ActionString), pointer :: Log4MsgPtr | |||
procedure (ActionStringInt), pointer :: Log4MsgIntPtr | |||
procedure (ActionStringFloat), pointer :: Log4MsgFloatPtr | |||
procedure (ActionStringDouble), pointer :: Log4MsgDoublePtr | |||
procedure (ActionStringBool), pointer :: Log4MsgBoolPtr | |||
contains | |||
subroutine Log4Log1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
#ifdef Log4 | |||
if(associated(Log4MsgPtr)) call Log4MsgPtr(message) | |||
#endif | |||
end subroutine | |||
subroutine Log4Log2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
#ifdef Log4 | |||
if(associated(Log4MsgIntPtr)) call Log4MsgIntPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log4Log3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
#ifdef Log4 | |||
if(associated(Log4MsgFloatPtr)) call Log4MsgFloatPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log4Log4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
#ifdef Log4 | |||
if(associated(Log4MsgDoublePtr)) call Log4MsgDoublePtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log4Log5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
#ifdef Log4 | |||
if(associated(Log4MsgBoolPtr)) call Log4MsgBoolPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine SubscribeLog4Message(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog4Message | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog4Message' :: SubscribeLog4Message | |||
implicit none | |||
procedure (ActionString) :: a | |||
Log4MsgPtr => a | |||
end subroutine | |||
subroutine SubscribeLog4MsgInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog4MsgInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog4MsgInt' :: SubscribeLog4MsgInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
Log4MsgIntPtr => a | |||
end subroutine | |||
subroutine SubscribeLog4MsgFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog4MsgFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog4MsgFloat' :: SubscribeLog4MsgFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
Log4MsgFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeLog4MsgDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog4MsgDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog4MsgDouble' :: SubscribeLog4MsgDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
Log4MsgDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeLog4MsgBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog4MsgBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog4MsgBool' :: SubscribeLog4MsgBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
Log4MsgBoolPtr => a | |||
end subroutine | |||
module CLog4 | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Log_4 | |||
module procedure :: Log4Log1, Log4Log2, Log4Log3, Log4Log4, Log4Log5 | |||
end interface | |||
procedure (ActionString), pointer :: Log4MsgPtr | |||
procedure (ActionStringInt), pointer :: Log4MsgIntPtr | |||
procedure (ActionStringFloat), pointer :: Log4MsgFloatPtr | |||
procedure (ActionStringDouble), pointer :: Log4MsgDoublePtr | |||
procedure (ActionStringBool), pointer :: Log4MsgBoolPtr | |||
contains | |||
subroutine Log4Log1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
#ifdef Log4 | |||
if(associated(Log4MsgPtr)) call Log4MsgPtr(message) | |||
#endif | |||
end subroutine | |||
subroutine Log4Log2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
#ifdef Log4 | |||
if(associated(Log4MsgIntPtr)) call Log4MsgIntPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log4Log3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
#ifdef Log4 | |||
if(associated(Log4MsgFloatPtr)) call Log4MsgFloatPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log4Log4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
#ifdef Log4 | |||
if(associated(Log4MsgDoublePtr)) call Log4MsgDoublePtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log4Log5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
#ifdef Log4 | |||
if(associated(Log4MsgBoolPtr)) call Log4MsgBoolPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine SubscribeLog4Message(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog4Message | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog4Message' :: SubscribeLog4Message | |||
implicit none | |||
procedure (ActionString) :: a | |||
Log4MsgPtr => a | |||
end subroutine | |||
subroutine SubscribeLog4MsgInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog4MsgInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog4MsgInt' :: SubscribeLog4MsgInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
Log4MsgIntPtr => a | |||
end subroutine | |||
subroutine SubscribeLog4MsgFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog4MsgFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog4MsgFloat' :: SubscribeLog4MsgFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
Log4MsgFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeLog4MsgDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog4MsgDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog4MsgDouble' :: SubscribeLog4MsgDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
Log4MsgDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeLog4MsgBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog4MsgBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog4MsgBool' :: SubscribeLog4MsgBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
Log4MsgBoolPtr => a | |||
end subroutine | |||
end module CLog4 |
@@ -1,113 +1,113 @@ | |||
module CLog5 | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Log_5 | |||
module procedure :: Log5Log1, Log5Log2, Log5Log3, Log5Log4, Log5Log5 | |||
end interface | |||
procedure (ActionString), pointer :: Log5MsgPtr | |||
procedure (ActionStringInt), pointer :: Log5MsgIntPtr | |||
procedure (ActionStringFloat), pointer :: Log5MsgFloatPtr | |||
procedure (ActionStringDouble), pointer :: Log5MsgDoublePtr | |||
procedure (ActionStringBool), pointer :: Log5MsgBoolPtr | |||
contains | |||
subroutine Log5Log1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
#ifdef Log5 | |||
if(associated(Log5MsgPtr)) call Log5MsgPtr(message) | |||
#endif | |||
end subroutine | |||
subroutine Log5Log2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
#ifdef Log5 | |||
if(associated(Log5MsgIntPtr)) call Log5MsgIntPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log5Log3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
#ifdef Log5 | |||
if(associated(Log5MsgFloatPtr)) call Log5MsgFloatPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log5Log4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
#ifdef Log5 | |||
if(associated(Log5MsgDoublePtr)) call Log5MsgDoublePtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log5Log5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
#ifdef Log5 | |||
if(associated(Log5MsgBoolPtr)) call Log5MsgBoolPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine SubscribeLog5Message(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog5Message | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog5Message' :: SubscribeLog5Message | |||
implicit none | |||
procedure (ActionString) :: a | |||
Log5MsgPtr => a | |||
end subroutine | |||
subroutine SubscribeLog5MsgInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog5MsgInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog5MsgInt' :: SubscribeLog5MsgInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
Log5MsgIntPtr => a | |||
end subroutine | |||
subroutine SubscribeLog5MsgFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog5MsgFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog5MsgFloat' :: SubscribeLog5MsgFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
Log5MsgFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeLog5MsgDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog5MsgDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog5MsgDouble' :: SubscribeLog5MsgDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
Log5MsgDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeLog5MsgBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog5MsgBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog5MsgBool' :: SubscribeLog5MsgBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
Log5MsgBoolPtr => a | |||
end subroutine | |||
module CLog5 | |||
use CIActionReference | |||
implicit none | |||
public | |||
interface Log_5 | |||
module procedure :: Log5Log1, Log5Log2, Log5Log3, Log5Log4, Log5Log5 | |||
end interface | |||
procedure (ActionString), pointer :: Log5MsgPtr | |||
procedure (ActionStringInt), pointer :: Log5MsgIntPtr | |||
procedure (ActionStringFloat), pointer :: Log5MsgFloatPtr | |||
procedure (ActionStringDouble), pointer :: Log5MsgDoublePtr | |||
procedure (ActionStringBool), pointer :: Log5MsgBoolPtr | |||
contains | |||
subroutine Log5Log1(message) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
#ifdef Log5 | |||
if(associated(Log5MsgPtr)) call Log5MsgPtr(message) | |||
#endif | |||
end subroutine | |||
subroutine Log5Log2(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
integer, intent(in) :: value | |||
#ifdef Log5 | |||
if(associated(Log5MsgIntPtr)) call Log5MsgIntPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log5Log3(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real, intent(in) :: value | |||
#ifdef Log5 | |||
if(associated(Log5MsgFloatPtr)) call Log5MsgFloatPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log5Log4(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
real(8), intent(in) :: value | |||
#ifdef Log5 | |||
if(associated(Log5MsgDoublePtr)) call Log5MsgDoublePtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine Log5Log5(message, value) | |||
implicit none | |||
character(len=*), intent(in) :: message | |||
logical, intent(in) :: value | |||
#ifdef Log5 | |||
if(associated(Log5MsgBoolPtr)) call Log5MsgBoolPtr(message, value) | |||
#endif | |||
end subroutine | |||
subroutine SubscribeLog5Message(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog5Message | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog5Message' :: SubscribeLog5Message | |||
implicit none | |||
procedure (ActionString) :: a | |||
Log5MsgPtr => a | |||
end subroutine | |||
subroutine SubscribeLog5MsgInt(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog5MsgInt | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog5MsgInt' :: SubscribeLog5MsgInt | |||
implicit none | |||
procedure (ActionStringInt) :: a | |||
Log5MsgIntPtr => a | |||
end subroutine | |||
subroutine SubscribeLog5MsgFloat(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog5MsgFloat | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog5MsgFloat' :: SubscribeLog5MsgFloat | |||
implicit none | |||
procedure (ActionStringFloat) :: a | |||
Log5MsgFloatPtr => a | |||
end subroutine | |||
subroutine SubscribeLog5MsgDouble(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog5MsgDouble | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog5MsgDouble' :: SubscribeLog5MsgDouble | |||
implicit none | |||
procedure (ActionStringDouble) :: a | |||
Log5MsgDoublePtr => a | |||
end subroutine | |||
subroutine SubscribeLog5MsgBool(a) | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeLog5MsgBool | |||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeLog5MsgBool' :: SubscribeLog5MsgBool | |||
implicit none | |||
procedure (ActionStringBool) :: a | |||
Log5MsgBoolPtr => a | |||
end subroutine | |||
end module CLog5 |
@@ -1,462 +1,462 @@ | |||
module COperationScenariosMain | |||
use CIActionReference | |||
implicit none | |||
public | |||
! procedure (ActionVoid), pointer :: UpdateUnityPtr | |||
contains | |||
subroutine OperationScenarios_Step | |||
! use CSimulationVariables | |||
use OperationScenariosModule | |||
use CElevatorConnectionEnum | |||
use CCloseKellyCockLedNotification | |||
use CCloseSafetyValveLedNotification | |||
use CFillMouseHoleLedNotification | |||
use CIrIBopLedNotification | |||
use CIrSafetyValveLedNotification | |||
use CLatchLedNotification | |||
use COpenKellyCockLedNotification | |||
use COpenSafetyValveLedNotification | |||
use CSlipsNotification | |||
use CSwingLedNotification | |||
use CTongNotification | |||
use CUnlatchLedNotification | |||
use CInstallFillupHeadPermission | |||
use CInstallMudBucketPermission | |||
use CIrIbopPermission | |||
use CIrSafetyValvePermission | |||
use CRemoveFillupHeadPermission | |||
use CRemoveMudBucketPermission | |||
use SoftwareInputsVariables | |||
! use CHookHeight | |||
! use CIbopHeight | |||
! use CNearFloorConnection | |||
! use CSafetyValveHeight | |||
! use CSlackOff | |||
! use CStandRack | |||
! use CStringPressure | |||
! use CZeroStringSpeed | |||
use CUnityInputs, only: & | |||
Get_ElevatorConnectionPossible, & | |||
Get_JointConnectionPossible, & | |||
Get_ElevatorPickup, & | |||
Get_NearFloorPosition, & | |||
Get_SingleSetInMouseHole | |||
! use CBucketEnum | |||
! use UnitySignalsModule | |||
use CElevatorEnum | |||
! use CHeadEnum | |||
use CIbopEnum | |||
use CKellyEnum | |||
use CMouseHoleEnum | |||
use UnitySignalsModule | |||
use CSafetyValveEnum | |||
use CSlipsEnum | |||
use CSwingEnum | |||
use CTongEnum | |||
! use CStringUpdate | |||
use CFlowPipeDisconnectEnum | |||
use CFlowKellyDisconnectEnum | |||
use CFillupHeadPermission | |||
use CSwingDrillPermission | |||
use CSwingOffPermission | |||
use CSwingTiltPermission | |||
! use CTdsStemJointHeight | |||
! use UnitySignalsModule !for CTdsConnectionModesEnum | |||
use CTdsElevatorModesEnum | |||
use CTdsSpineEnum | |||
use CTdsSwingEnum | |||
use CTdsTongEnum | |||
use CTdsBackupClamp | |||
use CTdsIbopLedNotification | |||
use CTdsPowerLedNotification | |||
use CTdsTorqueWrenchLedNotification | |||
implicit none | |||
call Evaluate_KellyConnection() | |||
call Evaluate_ElevatorConnection() | |||
call Evaluate_CloseKellyCockLed() | |||
call Evaluate_CloseSafetyValveLed() | |||
call Evaluate_FillMouseHoleLed() | |||
call Evaluate_IrIBopLed() | |||
call Evaluate_IrSafetyValveLed() | |||
call Evaluate_LatchLed() | |||
call Evaluate_OpenKellyCockLed() | |||
call Evaluate_OpenSafetyValveLed() | |||
call Evaluate_SlipsNotification() | |||
call Evaluate_SwingLed() | |||
call Evaluate_TongNotification() | |||
call Evaluate_UnlatchLed() | |||
call Evaluate_InstallFillupHeadPermission() | |||
call Evaluate_InstallMudBucketPermission() | |||
call Evaluate_IrIbopPermission() | |||
call Evaluate_IrSafetyValvePermission() | |||
call Evaluate_RemoveFillupHeadPermission() | |||
call Evaluate_RemoveMudBucketPermission() | |||
call Evaluate_MudBucket() | |||
call Evaluate_Elevator() | |||
call Evaluate_FillupHead() | |||
call Evaluate_Ibop() | |||
call Evaluate_Kelly() | |||
call Evaluate_MouseHole() | |||
call Evaluate_MouseHole() | |||
call Evaluate_OperationCondition() | |||
call Evaluate_SafetyValve() | |||
call Evaluate_Slips() | |||
call Evaluate_Swing() | |||
call Evaluate_Tong() | |||
! call Evaluate_StringUpdate() | |||
call Evaluate_FlowKellyDisconnect() | |||
call Evaluate_FlowPipeDisconnect() | |||
!if(Get_FillMouseHoleLed()) then | |||
! call Set_MouseHole(MOUSE_HOLE_FILL) | |||
!else | |||
! if((Get_KellyConnection() == KELLY_CONNECTION_SINGLE .or.& | |||
! Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE) .and.& | |||
! Get_HookHeight() >= 95.0 ) then | |||
! call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
! else | |||
! call Set_MouseHole(MOUSE_HOLE_EMPTY) | |||
! endif | |||
!endif | |||
!topdrive | |||
call Evaluate_TdsElevatorModes() | |||
call Evaluate_TdsConnectionModes() | |||
call Evaluate_SwingTiltPermission() | |||
call Evaluate_SwingOffPermission() | |||
call Evaluate_SwingDrillPermission() | |||
call Evaluate_FillupHeadPermission() | |||
call Evaluate_TdsTong() | |||
call Evaluate_TdsBackupClamp() | |||
call Evaluate_TdsSwing() | |||
call Evaluate_TdsSpine() | |||
call Evaluate_PowerLed() | |||
call Evaluate_IbopLed() | |||
call Evaluate_TorqueWrenchLed() | |||
end subroutine OperationScenarios_Step | |||
! subroutine UpdateUnity() | |||
! implicit none | |||
! if(associated(UpdateUnityPtr)) call UpdateUnityPtr() | |||
! end subroutine | |||
subroutine Kelly_ConnectionNothing | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
!TODO: possibly goto a position to activate swing | |||
! goto preferred swing position | |||
if(data%State%unitySignals%Swing_S == SWING_MOUSE_HOLE_END) then | |||
call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop2: do | |||
if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2 | |||
call sleepqq(100) | |||
enddo loop2 | |||
elseif (data%State%unitySignals%Swing_S == SWING_RAT_HOLE_END) then | |||
call Set_Swing(SWING_RAT_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop3: do | |||
if(Get_Swing() == SWING_RAT_HOLE_END) exit loop3 | |||
call sleepqq(100) | |||
enddo loop3 | |||
!elseif (Swing_S == SWING_WELL_END) then | |||
! call Set_Swing(SWING_WELL_BEGIN) | |||
! !@call UpdateUnity() | |||
! loop4: do | |||
! if(Get_Swing() == SWING_WELL_END) exit loop4 | |||
! call sleepqq(100) | |||
! enddo loop4 | |||
endif | |||
call sleep(3) | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
end subroutine Kelly_ConnectionNothing | |||
subroutine Kelly_ConnectionString | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
! use CTongEnumVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
! goto connection to string position | |||
call Set_HookHeight_S(66.7) | |||
call sleep(1) | |||
! start tong makeup | |||
call Set_Tong(TONG_MAKEUP_BEGIN) | |||
!@call UpdateUnity() | |||
loop2: do | |||
if(Get_Tong() == TONG_MAKEUP_END) exit loop2 | |||
call sleepqq(100) | |||
enddo loop2 | |||
call sleepqq(100) | |||
! release slips | |||
call Set_Slips(SLIPS_UNSET_BEGIN) | |||
!@call UpdateUnity() | |||
loop3: do | |||
if(Get_Slips() == SLIPS_UNSET_END) exit loop3 | |||
call sleepqq(100) | |||
enddo loop3 | |||
call sleepqq(100) | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
! put slips to saved position | |||
if(data%State%unitySignals%Slips_S == SLIPS_SET_END) then | |||
call Set_Slips(SLIPS_SET_BEGIN) | |||
!@call UpdateUnity() | |||
loop4: do | |||
if(Get_Slips() == SLIPS_SET_END) exit loop4 | |||
call sleepqq(100) | |||
enddo loop4 | |||
call sleep(1) | |||
endif | |||
end subroutine Kelly_ConnectionString | |||
subroutine Kelly_ConnectionSingle | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
! use CTongEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
! goto swing mouse hole position | |||
call Set_HookHeight_S(70.0) | |||
call sleep(1) | |||
! swing mouse hole | |||
call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop2: do | |||
if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2 | |||
call sleepqq(100) | |||
enddo loop2 | |||
call sleepqq(100) | |||
! goto makeup pipe location | |||
call Set_HookHeight_S(65.0) | |||
call sleep(1) | |||
! start tong makeup | |||
call Set_Tong(TONG_MAKEUP_BEGIN) | |||
!@call UpdateUnity() | |||
loop3: do | |||
if(Get_Tong() == TONG_MAKEUP_END) exit loop3 | |||
call sleepqq(100) | |||
enddo loop3 | |||
call sleepqq(100) | |||
if (data%State%unitySignals%Swing_S == SWING_WELL_END) then ! already in mouse hole | |||
! goto swing location | |||
call Set_HookHeight_S(98.0) | |||
call sleep(1) | |||
! goto preferred swing position | |||
call Set_Swing(SWING_WELL_BEGIN) | |||
!@call UpdateUnity() | |||
loop4: do | |||
if(Get_Swing() == SWING_WELL_END) exit loop4 | |||
call sleepqq(100) | |||
enddo loop4 | |||
call sleep(2) | |||
endif | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
end subroutine Kelly_ConnectionSingle | |||
subroutine Elevator_ConnectionNothing | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
! use CKellyEnumVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
!TODO: possibly goto a position to activate swing | |||
!! first goto mouse hole | |||
!call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!!@call UpdateUnity() | |||
!loop2: do | |||
! if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2 | |||
! call sleepqq(100) | |||
!enddo loop2 | |||
!call sleep(1) | |||
! | |||
!! then goto rat hole | |||
!call Set_Swing(SWING_RAT_HOLE_BEGIN) | |||
!!@call UpdateUnity() | |||
!loop3: do | |||
! if(Get_Swing() == SWING_RAT_HOLE_END) exit loop3 | |||
! call sleepqq(100) | |||
!enddo loop3 | |||
!call sleep(1) | |||
! kelly back | |||
call Set_Kelly(KELLY_REMOVE) | |||
call sleepqq(100) | |||
! goto preferred swing position | |||
if(data%State%unitySignals%Swing_S == SWING_MOUSE_HOLE_END) then | |||
call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop4: do | |||
if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop4 | |||
call sleepqq(100) | |||
enddo loop4 | |||
elseif (data%State%unitySignals%Swing_S == SWING_RAT_HOLE_END) then | |||
call Set_Swing(SWING_RAT_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop5: do | |||
if(Get_Swing() == SWING_RAT_HOLE_END) exit loop5 | |||
call sleepqq(100) | |||
enddo loop5 | |||
elseif (data%State%unitySignals%Swing_S == SWING_WELL_END) then | |||
call Set_Swing(SWING_WELL_BEGIN) | |||
!@call UpdateUnity() | |||
loop6: do | |||
if(Get_Swing() == SWING_WELL_END) exit loop6 | |||
call sleepqq(100) | |||
enddo loop6 | |||
endif | |||
call sleepqq(100) | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
end subroutine Elevator_ConnectionNothing | |||
subroutine Elevator_ConnectionString | |||
implicit none | |||
end subroutine Elevator_ConnectionString | |||
subroutine Elevator_ConnectionStand | |||
implicit none | |||
end subroutine Elevator_ConnectionStand | |||
subroutine Elevator_ConnectionSingle | |||
implicit none | |||
end subroutine Elevator_ConnectionSingle | |||
module COperationScenariosMain | |||
use CIActionReference | |||
implicit none | |||
public | |||
! procedure (ActionVoid), pointer :: UpdateUnityPtr | |||
contains | |||
subroutine OperationScenarios_Step | |||
! use CSimulationVariables | |||
use OperationScenariosModule | |||
use CElevatorConnectionEnum | |||
use CCloseKellyCockLedNotification | |||
use CCloseSafetyValveLedNotification | |||
use CFillMouseHoleLedNotification | |||
use CIrIBopLedNotification | |||
use CIrSafetyValveLedNotification | |||
use CLatchLedNotification | |||
use COpenKellyCockLedNotification | |||
use COpenSafetyValveLedNotification | |||
use CSlipsNotification | |||
use CSwingLedNotification | |||
use CTongNotification | |||
use CUnlatchLedNotification | |||
use CInstallFillupHeadPermission | |||
use CInstallMudBucketPermission | |||
use CIrIbopPermission | |||
use CIrSafetyValvePermission | |||
use CRemoveFillupHeadPermission | |||
use CRemoveMudBucketPermission | |||
use SoftwareInputsVariables | |||
! use CHookHeight | |||
! use CIbopHeight | |||
! use CNearFloorConnection | |||
! use CSafetyValveHeight | |||
! use CSlackOff | |||
! use CStandRack | |||
! use CStringPressure | |||
! use CZeroStringSpeed | |||
use CUnityInputs, only: & | |||
Get_ElevatorConnectionPossible, & | |||
Get_JointConnectionPossible, & | |||
Get_ElevatorPickup, & | |||
Get_NearFloorPosition, & | |||
Get_SingleSetInMouseHole | |||
! use CBucketEnum | |||
! use UnitySignalsModule | |||
use CElevatorEnum | |||
! use CHeadEnum | |||
use CIbopEnum | |||
use CKellyEnum | |||
use CMouseHoleEnum | |||
use UnitySignalsModule | |||
use CSafetyValveEnum | |||
use CSlipsEnum | |||
use CSwingEnum | |||
use CTongEnum | |||
! use CStringUpdate | |||
use CFlowPipeDisconnectEnum | |||
use CFlowKellyDisconnectEnum | |||
use CFillupHeadPermission | |||
use CSwingDrillPermission | |||
use CSwingOffPermission | |||
use CSwingTiltPermission | |||
! use CTdsStemJointHeight | |||
! use UnitySignalsModule !for CTdsConnectionModesEnum | |||
use CTdsElevatorModesEnum | |||
use CTdsSpineEnum | |||
use CTdsSwingEnum | |||
use CTdsTongEnum | |||
use CTdsBackupClamp | |||
use CTdsIbopLedNotification | |||
use CTdsPowerLedNotification | |||
use CTdsTorqueWrenchLedNotification | |||
implicit none | |||
call Evaluate_KellyConnection() | |||
call Evaluate_ElevatorConnection() | |||
call Evaluate_CloseKellyCockLed() | |||
call Evaluate_CloseSafetyValveLed() | |||
call Evaluate_FillMouseHoleLed() | |||
call Evaluate_IrIBopLed() | |||
call Evaluate_IrSafetyValveLed() | |||
call Evaluate_LatchLed() | |||
call Evaluate_OpenKellyCockLed() | |||
call Evaluate_OpenSafetyValveLed() | |||
call Evaluate_SlipsNotification() | |||
call Evaluate_SwingLed() | |||
call Evaluate_TongNotification() | |||
call Evaluate_UnlatchLed() | |||
call Evaluate_InstallFillupHeadPermission() | |||
call Evaluate_InstallMudBucketPermission() | |||
call Evaluate_IrIbopPermission() | |||
call Evaluate_IrSafetyValvePermission() | |||
call Evaluate_RemoveFillupHeadPermission() | |||
call Evaluate_RemoveMudBucketPermission() | |||
call Evaluate_MudBucket() | |||
call Evaluate_Elevator() | |||
call Evaluate_FillupHead() | |||
call Evaluate_Ibop() | |||
call Evaluate_Kelly() | |||
call Evaluate_MouseHole() | |||
call Evaluate_MouseHole() | |||
call Evaluate_OperationCondition() | |||
call Evaluate_SafetyValve() | |||
call Evaluate_Slips() | |||
call Evaluate_Swing() | |||
call Evaluate_Tong() | |||
! call Evaluate_StringUpdate() | |||
call Evaluate_FlowKellyDisconnect() | |||
call Evaluate_FlowPipeDisconnect() | |||
!if(Get_FillMouseHoleLed()) then | |||
! call Set_MouseHole(MOUSE_HOLE_FILL) | |||
!else | |||
! if((Get_KellyConnection() == KELLY_CONNECTION_SINGLE .or.& | |||
! Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE) .and.& | |||
! Get_HookHeight() >= 95.0 ) then | |||
! call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
! else | |||
! call Set_MouseHole(MOUSE_HOLE_EMPTY) | |||
! endif | |||
!endif | |||
!topdrive | |||
call Evaluate_TdsElevatorModes() | |||
call Evaluate_TdsConnectionModes() | |||
call Evaluate_SwingTiltPermission() | |||
call Evaluate_SwingOffPermission() | |||
call Evaluate_SwingDrillPermission() | |||
call Evaluate_FillupHeadPermission() | |||
call Evaluate_TdsTong() | |||
call Evaluate_TdsBackupClamp() | |||
call Evaluate_TdsSwing() | |||
call Evaluate_TdsSpine() | |||
call Evaluate_PowerLed() | |||
call Evaluate_IbopLed() | |||
call Evaluate_TorqueWrenchLed() | |||
end subroutine OperationScenarios_Step | |||
! subroutine UpdateUnity() | |||
! implicit none | |||
! if(associated(UpdateUnityPtr)) call UpdateUnityPtr() | |||
! end subroutine | |||
subroutine Kelly_ConnectionNothing | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
!TODO: possibly goto a position to activate swing | |||
! goto preferred swing position | |||
if(data%State%unitySignals%Swing_S == SWING_MOUSE_HOLE_END) then | |||
call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop2: do | |||
if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2 | |||
call sleepqq(100) | |||
enddo loop2 | |||
elseif (data%State%unitySignals%Swing_S == SWING_RAT_HOLE_END) then | |||
call Set_Swing(SWING_RAT_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop3: do | |||
if(Get_Swing() == SWING_RAT_HOLE_END) exit loop3 | |||
call sleepqq(100) | |||
enddo loop3 | |||
!elseif (Swing_S == SWING_WELL_END) then | |||
! call Set_Swing(SWING_WELL_BEGIN) | |||
! !@call UpdateUnity() | |||
! loop4: do | |||
! if(Get_Swing() == SWING_WELL_END) exit loop4 | |||
! call sleepqq(100) | |||
! enddo loop4 | |||
endif | |||
call sleep(3) | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
end subroutine Kelly_ConnectionNothing | |||
subroutine Kelly_ConnectionString | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
! use CTongEnumVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
! goto connection to string position | |||
call Set_HookHeight_S(66.7) | |||
call sleep(1) | |||
! start tong makeup | |||
call Set_Tong(TONG_MAKEUP_BEGIN) | |||
!@call UpdateUnity() | |||
loop2: do | |||
if(Get_Tong() == TONG_MAKEUP_END) exit loop2 | |||
call sleepqq(100) | |||
enddo loop2 | |||
call sleepqq(100) | |||
! release slips | |||
call Set_Slips(SLIPS_UNSET_BEGIN) | |||
!@call UpdateUnity() | |||
loop3: do | |||
if(Get_Slips() == SLIPS_UNSET_END) exit loop3 | |||
call sleepqq(100) | |||
enddo loop3 | |||
call sleepqq(100) | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
! put slips to saved position | |||
if(data%State%unitySignals%Slips_S == SLIPS_SET_END) then | |||
call Set_Slips(SLIPS_SET_BEGIN) | |||
!@call UpdateUnity() | |||
loop4: do | |||
if(Get_Slips() == SLIPS_SET_END) exit loop4 | |||
call sleepqq(100) | |||
enddo loop4 | |||
call sleep(1) | |||
endif | |||
end subroutine Kelly_ConnectionString | |||
subroutine Kelly_ConnectionSingle | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
! use CTongEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
! goto swing mouse hole position | |||
call Set_HookHeight_S(70.0) | |||
call sleep(1) | |||
! swing mouse hole | |||
call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop2: do | |||
if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2 | |||
call sleepqq(100) | |||
enddo loop2 | |||
call sleepqq(100) | |||
! goto makeup pipe location | |||
call Set_HookHeight_S(65.0) | |||
call sleep(1) | |||
! start tong makeup | |||
call Set_Tong(TONG_MAKEUP_BEGIN) | |||
!@call UpdateUnity() | |||
loop3: do | |||
if(Get_Tong() == TONG_MAKEUP_END) exit loop3 | |||
call sleepqq(100) | |||
enddo loop3 | |||
call sleepqq(100) | |||
if (data%State%unitySignals%Swing_S == SWING_WELL_END) then ! already in mouse hole | |||
! goto swing location | |||
call Set_HookHeight_S(98.0) | |||
call sleep(1) | |||
! goto preferred swing position | |||
call Set_Swing(SWING_WELL_BEGIN) | |||
!@call UpdateUnity() | |||
loop4: do | |||
if(Get_Swing() == SWING_WELL_END) exit loop4 | |||
call sleepqq(100) | |||
enddo loop4 | |||
call sleep(2) | |||
endif | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
end subroutine Kelly_ConnectionSingle | |||
subroutine Elevator_ConnectionNothing | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
! use CKellyEnumVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
!TODO: possibly goto a position to activate swing | |||
!! first goto mouse hole | |||
!call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!!@call UpdateUnity() | |||
!loop2: do | |||
! if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2 | |||
! call sleepqq(100) | |||
!enddo loop2 | |||
!call sleep(1) | |||
! | |||
!! then goto rat hole | |||
!call Set_Swing(SWING_RAT_HOLE_BEGIN) | |||
!!@call UpdateUnity() | |||
!loop3: do | |||
! if(Get_Swing() == SWING_RAT_HOLE_END) exit loop3 | |||
! call sleepqq(100) | |||
!enddo loop3 | |||
!call sleep(1) | |||
! kelly back | |||
call Set_Kelly(KELLY_REMOVE) | |||
call sleepqq(100) | |||
! goto preferred swing position | |||
if(data%State%unitySignals%Swing_S == SWING_MOUSE_HOLE_END) then | |||
call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop4: do | |||
if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop4 | |||
call sleepqq(100) | |||
enddo loop4 | |||
elseif (data%State%unitySignals%Swing_S == SWING_RAT_HOLE_END) then | |||
call Set_Swing(SWING_RAT_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop5: do | |||
if(Get_Swing() == SWING_RAT_HOLE_END) exit loop5 | |||
call sleepqq(100) | |||
enddo loop5 | |||
elseif (data%State%unitySignals%Swing_S == SWING_WELL_END) then | |||
call Set_Swing(SWING_WELL_BEGIN) | |||
!@call UpdateUnity() | |||
loop6: do | |||
if(Get_Swing() == SWING_WELL_END) exit loop6 | |||
call sleepqq(100) | |||
enddo loop6 | |||
endif | |||
call sleepqq(100) | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
end subroutine Elevator_ConnectionNothing | |||
subroutine Elevator_ConnectionString | |||
implicit none | |||
end subroutine Elevator_ConnectionString | |||
subroutine Elevator_ConnectionStand | |||
implicit none | |||
end subroutine Elevator_ConnectionStand | |||
subroutine Elevator_ConnectionSingle | |||
implicit none | |||
end subroutine Elevator_ConnectionSingle | |||
end module COperationScenariosMain |
@@ -1,489 +1,489 @@ | |||
module COperationScenariosSettings | |||
implicit none | |||
public | |||
contains | |||
!subroutine Initialization() | |||
! ! use CSimulationVariables | |||
! use CUnityOutputs, only: SetupUnityOutputs => Setup | |||
! | |||
! use CBucketEnum | |||
! use CTongEnum | |||
! use CSwingEnum | |||
! use CSlipsEnum | |||
! use CSafetyValveEnum | |||
! use UnitySignalsModule | |||
! use CMouseHoleEnum | |||
! use CKellyEnum | |||
! use OperationScenariosModule | |||
! use CIbopEnum | |||
! use CHeadEnum | |||
! use CElevatorEnum | |||
! use CElevatorConnectionEnum | |||
! | |||
! use CInstallFillupHeadPermission | |||
! use CInstallMudBucketPermission | |||
! use CIrIbopPermission | |||
! use CIrSafetyValvePermission | |||
! use CRemoveFillupHeadPermission | |||
! use CRemoveMudBucketPermission | |||
! | |||
! use CCloseKellyCockLedNotification | |||
! use CCloseSafetyValveLedNotification | |||
! use CFillMouseHoleLedNotification | |||
! use CIrIBopLedNotification | |||
! use CIrSafetyValveLedNotification | |||
! use CLatchLedNotification | |||
! use COpenKellyCockLedNotification | |||
! use COpenSafetyValveLedNotification | |||
! use CSlipsNotification | |||
! use CSwingLedNotification | |||
! use CTongNotification | |||
! use CUnlatchLedNotification | |||
! | |||
! use CHookHeight | |||
! use CIbopHeight | |||
! use CNearFloorConnection | |||
! use CSafetyValveHeight | |||
! use CSlackOff | |||
! use CStandRack | |||
! use CStringPressure | |||
! use CZeroStringSpeed | |||
! | |||
! use CStringUpdate | |||
! | |||
! use CFlowPipeDisconnectEnum | |||
! use CFlowKellyDisconnectEnum | |||
! | |||
! use CFillupHeadPermission | |||
! use CSwingDrillPermission | |||
! use CSwingOffPermission | |||
! use CSwingTiltPermission | |||
! use CTdsStemJointHeight | |||
! use UnitySignalsModule !for CTdsConnectionModesEnum | |||
! use CTdsElevatorModesEnum | |||
! use CTdsSpineEnum | |||
! use CTdsSwingEnum | |||
! use CTdsTongEnum | |||
! use CTdsBackupClamp | |||
! | |||
! use CTdsIbopLedNotification | |||
! use CTdsPowerLedNotification | |||
! | |||
! use CTdsTorqueWrenchLedNotification | |||
! | |||
! implicit none | |||
! | |||
! call SetupUnityOutputs() | |||
! | |||
! call Subscribe_Tong() | |||
! call Subscribe_MudBucket() | |||
! call Subscribe_ElevatorConnection() | |||
! call Subscribe_Elevator() | |||
! call Subscribe_FillupHead() | |||
! call Subscribe_Ibop() | |||
! call Subscribe_KellyConnection() | |||
! call Subscribe_Kelly() | |||
! call Subscribe_MouseHole() | |||
! call Subscribe_OperationCondition() | |||
! call Subscribe_SafetyValve() | |||
! call Subscribe_Slips() | |||
! call Subscribe_Swing() | |||
! | |||
! | |||
! call Subscribe_InstallFillupHeadPermission() | |||
! call Subscribe_InstallMudBucketPermission() | |||
! call Subscribe_IrIbopPermission() | |||
! call Subscribe_IrSafetyValvePermission() | |||
! call Subscribe_RemoveFillupHeadPermission() | |||
! call Subscribe_RemoveMudBucketPermission() | |||
! | |||
! call Subscribe_CloseKellyCockLed() | |||
! call Subscribe_CloseSafetyValveLed() | |||
! call Subscribe_FillMouseHoleLed() | |||
! call Subscribe_IrIBopLed() | |||
! call Subscribe_IrSafetyValveLed() | |||
! call Subscribe_LatchLed() | |||
! call Subscribe_OpenKellyCockLed() | |||
! call Subscribe_OpenSafetyValveLed() | |||
! call Subscribe_SlipsNotification() | |||
! call Subscribe_SwingLed() | |||
! call Subscribe_UnlatchLed() | |||
! | |||
! call Subscribe_HookHeight() | |||
! call Subscribe_IbopHeight() | |||
! call Subscribe_NearFloorConnection() | |||
! call Subscribe_SafetyValveHeight() | |||
! call Subscribe_SlackOff() | |||
! call Subscribe_StringPressure() | |||
! call Subscribe_ZeroStringSpeed() | |||
! call Subscribe_StandRack() | |||
! | |||
! call Subscribe_StringUpdate() | |||
! | |||
! call Subscribe_TongNotification() | |||
! | |||
! call Subscribe_FlowKellyDisconnect() | |||
! call Subscribe_FlowPipeDisconnect() | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! !top drive | |||
! call Subscribe_TdsConnectionModes() | |||
! call Subscribe_TdsElevatorModes() | |||
! call Subscribe_FillupHeadPermission() | |||
! call Subscribe_SwingDrillPermission() | |||
! call Subscribe_SwingOffPermission() | |||
! call Subscribe_SwingTiltPermission() | |||
! call Subscribe_TdsStemJointHeight() | |||
! call Subscribe_TdsTong() | |||
! call Subscribe_TdsBackupClamp() | |||
! call Subscribe_TdsSwing() | |||
! call Subscribe_TdsSpine() | |||
! call Subscribe_PowerLed() | |||
! call Subscribe_IbopLed() | |||
! | |||
! call Subscribe_TorqueWrenchLed() | |||
! | |||
! | |||
! call OnSimulationStart%Add(SetDefaultValues) | |||
! | |||
!end subroutine | |||
subroutine SetDefaultValues() | |||
use OperationScenariosModule | |||
use CHoistingVariables | |||
use SimulationVariables!, only: data%State%Hoisting%DriveType, TopDrive_DriveType | |||
use CManifolds, only: RemoveSafetyValve_TripMode, RemoveSafetyValve_KellyMode | |||
implicit none | |||
call Set_KellyConnection(KELLY_CONNECTION_NOTHING) | |||
!Get_KellyConnection() | |||
!KELLY_CONNECTION_NOTHING | |||
!KELLY_CONNECTION_STRING | |||
!KELLY_CONNECTION_SINGLE | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING) | |||
!Get_ElevatorConnection() | |||
!ELEVATOR_CONNECTION_NOTHING | |||
!ELEVATOR_CONNECTION_STRING | |||
!ELEVATOR_CONNECTION_STAND | |||
!ELEVATOR_CONNECTION_SINGLE | |||
!ELEVATOR_LATCH_STRING | |||
!ELEVATOR_LATCH_SINGLE | |||
!ELEVATOR_LATCH_STAND | |||
call Set_CloseKellyCockLed(.false.) !Get_CloseKellyCockLed() | |||
call Set_CloseSafetyValveLed(.false.) !Get_CloseSafetyValveLed() | |||
call Set_FillMouseHoleLed(.true.) !Get_FillMouseHoleLed() | |||
call Set_IrIBopLed(.false.) !Get_IrIBopLed() | |||
!call Set_IrSafetyValveLed(.true.) !Get_IrSafetyValveLed() | |||
if(data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
call RemoveSafetyValve_TripMode() | |||
call RemoveSafetyValve_KellyMode() | |||
call Set_IrSafetyValveLed(.false.) | |||
else | |||
call Set_IrSafetyValveLed(.true.) | |||
endif | |||
call Set_LatchLed(.false.) !Get_LatchLed() | |||
call Set_OpenKellyCockLed(.true.) !Get_OpenKellyCockLed() | |||
call Set_OpenSafetyValveLed(.true.) !Get_OpenSafetyValveLed() | |||
call Set_SlipsNotification(.false.) !Get_SlipsNotification() | |||
call Set_SwingLed(.false.) !Get_SwingLed() | |||
call Set_TongNotification(.false.) !Get_TongNotification() | |||
call Set_UnlatchLed(.false.) !Get_UnlatchLed() | |||
call Set_InstallFillupHeadPermission(.false.) !Get_InstallFillupHeadPermission() | |||
call Set_InstallMudBucketPermission(.false.) !Get_InstallMudBucketPermission() | |||
call Set_IrIbopPermission(.false.) !Get_IrIbopPermission() | |||
call Set_IrSafetyValvePermission(.false.) !Get_IrSafetyValvePermission() | |||
call Set_RemoveFillupHeadPermission(.false.) !Get_RemoveFillupHeadPermission() | |||
call Set_RemoveMudBucketPermission(.false.) !Get_RemoveMudBucketPermission() | |||
!call Set_HookHeight(REAL(70.0, 8)) !Get_HookHeight() | |||
call Set_IbopHeight(3.0) !Get_IbopHeight() | |||
!call Set_NearFloorConnection(3.0) !Get_NearFloorConnection() | |||
call Set_SafetyValveHeight(3.0) !Get_SafetyValveHeight() | |||
call Set_SlackOff(.true.) !Get_SlackOff() | |||
!call Set_StandRack(0.0) !Get_StandRack() | |||
!call Set_StringPressure(0.0) !Get_StringPressure() | |||
!call Set_ZeroStringSpeed(.true.) !Get_ZeroStringSpeed() | |||
!Get_ElevatorConnected() | |||
!Get_JointConnection() | |||
!Get_NearMonkeyBoardPosition() | |||
!Get_NearFloorPosition() | |||
!Get_SingleSetInMouseHole() | |||
!Get_SwingCenter() | |||
call Set_MudBucket(MUD_BUCKET_REMOVE) | |||
!Get_MudBucket() | |||
!MUD_BUCKET_INSTALL | |||
!MUD_BUCKET_REMOVE | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
! Get_Elevator() | |||
!ELEVATOR_NEUTRAL | |||
!ELEVATOR_LATCH_STRING_BEGIN | |||
!ELEVATOR_LATCH_STRING_END | |||
!ELEVATOR_UNLATCH_STRING_BEGIN | |||
!ELEVATOR_UNLATCH_STRING_END | |||
!ELEVATOR_LATCH_STAND_BEGIN | |||
!ELEVATOR_LATCH_STAND_END | |||
!ELEVATOR_UNLATCH_STAND_BEGIN | |||
!ELEVATOR_UNLATCH_STAND_END | |||
!ELEVATOR_LATCH_SINGLE_BEGIN | |||
!ELEVATOR_LATCH_SINGLE_END | |||
!ELEVATOR_UNLATCH_SINGLE_BEGIN | |||
!ELEVATOR_UNLATCH_SINGLE_END | |||
call Set_FillupHead(FILLUP_HEAD_REMOVE) | |||
!Get_FillupHead() | |||
!FILLUP_HEAD_INSTALL | |||
!FILLUP_HEAD_REMOVE | |||
call Set_Ibop(IBOP_REMOVE) | |||
!Get_Ibop() | |||
!IBOP_INSTALL | |||
!IBOP_REMOVE | |||
call Set_Kelly(KELLY_INSTALL) | |||
!Get_Kelly() | |||
!KELLY_NEUTRAL | |||
!KELLY_INSTALL | |||
!KELLY_REMOVE | |||
call Set_MouseHole(MOUSE_HOLE_FILL) | |||
!Get_MouseHole() | |||
!MOUSE_HOLE_NEUTRAL | |||
!MOUSE_HOLE_FILL | |||
!MOUSE_HOLE_EMPTY | |||
call Set_OperationCondition(OPERATION_DRILL) | |||
!Get_OperationCondition() | |||
!OPERATION_DRILL | |||
!OPERATION_TRIP | |||
call Set_SafetyValve(SAFETY_VALVE_INSTALL) | |||
!Get_SafetyValve() | |||
!SAFETY_VALVE_INSTALL | |||
!SAFETY_VALVE_REMOVE | |||
if(data%State%Hoisting%DriveType == TopDrive_DriveType) call Set_SafetyValve(SAFETY_VALVE_REMOVE) | |||
call Set_Slips(SLIPS_SET_BEGIN) | |||
!Get_Slips() | |||
!SLIPS_NEUTRAL | |||
!SLIPS_SET_BEGIN | |||
!SLIPS_SET_END | |||
!SLIPS_UNSET_BEGIN | |||
!SLIPS_UNSET_END | |||
call Set_Swing(SWING_WELL_BEGIN) | |||
!Get_Swing() | |||
!SWING_NEUTRAL | |||
!SWING_MOUSE_HOLE_BEGIN | |||
!SWING_MOUSE_HOLE_END | |||
!SWING_RAT_HOLE_BEGIN | |||
!SWING_RAT_HOLE_END | |||
!SWING_WELL_BEGIN | |||
!SWING_WELL_END | |||
call Set_Tong(TONG_NEUTRAL) | |||
!Get_Tong() | |||
!TONG_NEUTRAL | |||
!TONG_BREAKOUT_BEGIN | |||
!TONG_BREAKOUT_END | |||
!TONG_MAKEUP_BEGIN | |||
!TONG_MAKEUP_END | |||
call Set_StringUpdate(STRING_UPDATE_NEUTRAL) | |||
!Get_StringUpdate() | |||
!STRING_UPDATE_NEUTRAL | |||
!STRING_UPDATE_ADD_SINGLE | |||
!STRING_UPDATE_ADD_STAND | |||
!STRING_UPDATE_REMOVE_SINGLE | |||
!STRING_UPDATE_REMOVE_STAND | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING) | |||
!Get_TdsElevatorModes() | |||
!TDS_ELEVATOR_CONNECTION_NOTHING | |||
!TDS_ELEVATOR_CONNECTION_STRING | |||
!TDS_ELEVATOR_CONNECTION_SINGLE | |||
!TDS_ELEVATOR_CONNECTION_STAND | |||
!TDS_ELEVATOR_LATCH_STRING | |||
!TDS_ELEVATOR_LATCH_SINGLE | |||
!TDS_ELEVATOR_LATCH_STAND | |||
call Set_TdsConnectionModes(TDS_CONNECTION_NOTHING) | |||
!Get_TdsConnectionModes() | |||
!TDS_CONNECTION_NOTHING | |||
!TDS_CONNECTION_STRING | |||
!TDS_CONNECTION_SPINE | |||
call Set_SwingTiltPermission(.false.) !Get_SwingTiltPermission() | |||
call Set_SwingOffPermission(.false.) !Get_SwingOffPermission() | |||
call Set_SwingDrillPermission(.false.) !Get_SwingDrillPermission() | |||
call Set_FillupHeadPermission(.false.) !Get_FillupHeadPermission() | |||
call Set_PowerLed(.false.) | |||
call Set_IbopLed(.false.) | |||
call Set_TorqueWrenchLed(0) !Get_TorqueWrenchLed() | |||
!TdsPower_REV = 1 | |||
!TdsPower_OFF = 0 | |||
!TdsPower_FWD = -1 | |||
! | |||
!TdsMu_TORQ = 1 | |||
!TdsMu_SPINE = 0 | |||
!TdsMu_DRILL = -1 | |||
! | |||
!TdsLinkTilt_TILT = 1 | |||
!TdsLinkTilt_OFF = 0 | |||
!TdsLinkTilt_DRILL = -1 | |||
!TDS IBOP TopDriveIbop | |||
!TDS LinkTilt TopDriveLinkTiltState | |||
!TDS MU TopDriveDrillTorqueState | |||
!TDS Power TopDriveTdsPowerState | |||
!TopDriveTorqueWrench PRESSED=True or UNPRESSED=Falses | |||
!Get_TdsConnectionPossible() | |||
!Get_TdsStemIn() | |||
!call Set_TdsStemJointHeight(v) !Get_TdsStemJointHeight() | |||
!Get_SwingDrillPermission() | |||
!Get_SwingOffPermission() | |||
!Get_SwingTiltPermission() | |||
!Get_FillupHeadPermission() | |||
call Set_TdsTong(TDS_TONG_BREAKOUT_END) | |||
!Get_TdsTong() | |||
!TDS_TONG_BREAKOUT_BEGIN | |||
!TDS_TONG_BREAKOUT_END | |||
!TDS_TONG_MAKEUP_BEGIN | |||
!TDS_TONG_MAKEUP_END | |||
call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_END) | |||
!Get_TdsBackupClamp() | |||
!BACKUP_CLAMP_OFF_END | |||
!BACKUP_CLAMP_OFF_BEGIN | |||
!BACKUP_CLAMP_FW_BEGIN | |||
!BACKUP_CLAMP_FW_END | |||
call Set_TdsSwing(TDS_SWING_OFF_END) | |||
!Get_TdsSwing() | |||
!TDS_SWING_NEUTRAL | |||
!TDS_SWING_OFF_BEGIN | |||
!TDS_SWING_OFF_END | |||
!TDS_SWING_DRILL_BEGIN | |||
!TDS_SWING_DRILL_END | |||
!TDS_SWING_TILT_BEGIN | |||
!TDS_SWING_TILT_END | |||
call Set_TdsSpine(TDS_SPINE_NEUTRAL) !TDS_SPINE_DISCONNECT_END | |||
!Get_TdsSpine() | |||
!TDS_SPINE_NEUTRAL | |||
!TDS_SPINE_CONNECT_BEGIN | |||
!TDS_SPINE_CONNECT_END | |||
!TDS_SPINE_DISCONNECT_BEGIN | |||
!TDS_SPINE_DISCONNECT_END | |||
end subroutine | |||
subroutine SetDefaults_WN() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetDefaults_WN | |||
!DEC$ ATTRIBUTES ALIAS: 'SetDefaults_WN' :: SetDefaults_WN | |||
implicit none | |||
call SetDefaultValues() | |||
end subroutine | |||
module COperationScenariosSettings | |||
implicit none | |||
public | |||
contains | |||
!subroutine Initialization() | |||
! ! use CSimulationVariables | |||
! use CUnityOutputs, only: SetupUnityOutputs => Setup | |||
! | |||
! use CBucketEnum | |||
! use CTongEnum | |||
! use CSwingEnum | |||
! use CSlipsEnum | |||
! use CSafetyValveEnum | |||
! use UnitySignalsModule | |||
! use CMouseHoleEnum | |||
! use CKellyEnum | |||
! use OperationScenariosModule | |||
! use CIbopEnum | |||
! use CHeadEnum | |||
! use CElevatorEnum | |||
! use CElevatorConnectionEnum | |||
! | |||
! use CInstallFillupHeadPermission | |||
! use CInstallMudBucketPermission | |||
! use CIrIbopPermission | |||
! use CIrSafetyValvePermission | |||
! use CRemoveFillupHeadPermission | |||
! use CRemoveMudBucketPermission | |||
! | |||
! use CCloseKellyCockLedNotification | |||
! use CCloseSafetyValveLedNotification | |||
! use CFillMouseHoleLedNotification | |||
! use CIrIBopLedNotification | |||
! use CIrSafetyValveLedNotification | |||
! use CLatchLedNotification | |||
! use COpenKellyCockLedNotification | |||
! use COpenSafetyValveLedNotification | |||
! use CSlipsNotification | |||
! use CSwingLedNotification | |||
! use CTongNotification | |||
! use CUnlatchLedNotification | |||
! | |||
! use CHookHeight | |||
! use CIbopHeight | |||
! use CNearFloorConnection | |||
! use CSafetyValveHeight | |||
! use CSlackOff | |||
! use CStandRack | |||
! use CStringPressure | |||
! use CZeroStringSpeed | |||
! | |||
! use CStringUpdate | |||
! | |||
! use CFlowPipeDisconnectEnum | |||
! use CFlowKellyDisconnectEnum | |||
! | |||
! use CFillupHeadPermission | |||
! use CSwingDrillPermission | |||
! use CSwingOffPermission | |||
! use CSwingTiltPermission | |||
! use CTdsStemJointHeight | |||
! use UnitySignalsModule !for CTdsConnectionModesEnum | |||
! use CTdsElevatorModesEnum | |||
! use CTdsSpineEnum | |||
! use CTdsSwingEnum | |||
! use CTdsTongEnum | |||
! use CTdsBackupClamp | |||
! | |||
! use CTdsIbopLedNotification | |||
! use CTdsPowerLedNotification | |||
! | |||
! use CTdsTorqueWrenchLedNotification | |||
! | |||
! implicit none | |||
! | |||
! call SetupUnityOutputs() | |||
! | |||
! call Subscribe_Tong() | |||
! call Subscribe_MudBucket() | |||
! call Subscribe_ElevatorConnection() | |||
! call Subscribe_Elevator() | |||
! call Subscribe_FillupHead() | |||
! call Subscribe_Ibop() | |||
! call Subscribe_KellyConnection() | |||
! call Subscribe_Kelly() | |||
! call Subscribe_MouseHole() | |||
! call Subscribe_OperationCondition() | |||
! call Subscribe_SafetyValve() | |||
! call Subscribe_Slips() | |||
! call Subscribe_Swing() | |||
! | |||
! | |||
! call Subscribe_InstallFillupHeadPermission() | |||
! call Subscribe_InstallMudBucketPermission() | |||
! call Subscribe_IrIbopPermission() | |||
! call Subscribe_IrSafetyValvePermission() | |||
! call Subscribe_RemoveFillupHeadPermission() | |||
! call Subscribe_RemoveMudBucketPermission() | |||
! | |||
! call Subscribe_CloseKellyCockLed() | |||
! call Subscribe_CloseSafetyValveLed() | |||
! call Subscribe_FillMouseHoleLed() | |||
! call Subscribe_IrIBopLed() | |||
! call Subscribe_IrSafetyValveLed() | |||
! call Subscribe_LatchLed() | |||
! call Subscribe_OpenKellyCockLed() | |||
! call Subscribe_OpenSafetyValveLed() | |||
! call Subscribe_SlipsNotification() | |||
! call Subscribe_SwingLed() | |||
! call Subscribe_UnlatchLed() | |||
! | |||
! call Subscribe_HookHeight() | |||
! call Subscribe_IbopHeight() | |||
! call Subscribe_NearFloorConnection() | |||
! call Subscribe_SafetyValveHeight() | |||
! call Subscribe_SlackOff() | |||
! call Subscribe_StringPressure() | |||
! call Subscribe_ZeroStringSpeed() | |||
! call Subscribe_StandRack() | |||
! | |||
! call Subscribe_StringUpdate() | |||
! | |||
! call Subscribe_TongNotification() | |||
! | |||
! call Subscribe_FlowKellyDisconnect() | |||
! call Subscribe_FlowPipeDisconnect() | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! !top drive | |||
! call Subscribe_TdsConnectionModes() | |||
! call Subscribe_TdsElevatorModes() | |||
! call Subscribe_FillupHeadPermission() | |||
! call Subscribe_SwingDrillPermission() | |||
! call Subscribe_SwingOffPermission() | |||
! call Subscribe_SwingTiltPermission() | |||
! call Subscribe_TdsStemJointHeight() | |||
! call Subscribe_TdsTong() | |||
! call Subscribe_TdsBackupClamp() | |||
! call Subscribe_TdsSwing() | |||
! call Subscribe_TdsSpine() | |||
! call Subscribe_PowerLed() | |||
! call Subscribe_IbopLed() | |||
! | |||
! call Subscribe_TorqueWrenchLed() | |||
! | |||
! | |||
! call OnSimulationStart%Add(SetDefaultValues) | |||
! | |||
!end subroutine | |||
subroutine SetDefaultValues() | |||
use OperationScenariosModule | |||
use CHoistingVariables | |||
use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType | |||
use CManifolds, only: RemoveSafetyValve_TripMode, RemoveSafetyValve_KellyMode | |||
implicit none | |||
call Set_KellyConnection(KELLY_CONNECTION_NOTHING) | |||
!Get_KellyConnection() | |||
!KELLY_CONNECTION_NOTHING | |||
!KELLY_CONNECTION_STRING | |||
!KELLY_CONNECTION_SINGLE | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING) | |||
!Get_ElevatorConnection() | |||
!ELEVATOR_CONNECTION_NOTHING | |||
!ELEVATOR_CONNECTION_STRING | |||
!ELEVATOR_CONNECTION_STAND | |||
!ELEVATOR_CONNECTION_SINGLE | |||
!ELEVATOR_LATCH_STRING | |||
!ELEVATOR_LATCH_SINGLE | |||
!ELEVATOR_LATCH_STAND | |||
call Set_CloseKellyCockLed(.false.) !Get_CloseKellyCockLed() | |||
call Set_CloseSafetyValveLed(.false.) !Get_CloseSafetyValveLed() | |||
call Set_FillMouseHoleLed(.true.) !Get_FillMouseHoleLed() | |||
call Set_IrIBopLed(.false.) !Get_IrIBopLed() | |||
!call Set_IrSafetyValveLed(.true.) !Get_IrSafetyValveLed() | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
call RemoveSafetyValve_TripMode() | |||
call RemoveSafetyValve_KellyMode() | |||
call Set_IrSafetyValveLed(.false.) | |||
else | |||
call Set_IrSafetyValveLed(.true.) | |||
endif | |||
call Set_LatchLed(.false.) !Get_LatchLed() | |||
call Set_OpenKellyCockLed(.true.) !Get_OpenKellyCockLed() | |||
call Set_OpenSafetyValveLed(.true.) !Get_OpenSafetyValveLed() | |||
call Set_SlipsNotification(.false.) !Get_SlipsNotification() | |||
call Set_SwingLed(.false.) !Get_SwingLed() | |||
call Set_TongNotification(.false.) !Get_TongNotification() | |||
call Set_UnlatchLed(.false.) !Get_UnlatchLed() | |||
call Set_InstallFillupHeadPermission(.false.) !Get_InstallFillupHeadPermission() | |||
call Set_InstallMudBucketPermission(.false.) !Get_InstallMudBucketPermission() | |||
call Set_IrIbopPermission(.false.) !Get_IrIbopPermission() | |||
call Set_IrSafetyValvePermission(.false.) !Get_IrSafetyValvePermission() | |||
call Set_RemoveFillupHeadPermission(.false.) !Get_RemoveFillupHeadPermission() | |||
call Set_RemoveMudBucketPermission(.false.) !Get_RemoveMudBucketPermission() | |||
!call Set_HookHeight(REAL(70.0, 8)) !Get_HookHeight() | |||
call Set_IbopHeight(3.0) !Get_IbopHeight() | |||
!call Set_NearFloorConnection(3.0) !Get_NearFloorConnection() | |||
call Set_SafetyValveHeight(3.0) !Get_SafetyValveHeight() | |||
call Set_SlackOff(.true.) !Get_SlackOff() | |||
!call Set_StandRack(0.0) !Get_StandRack() | |||
!call Set_StringPressure(0.0) !Get_StringPressure() | |||
!call Set_ZeroStringSpeed(.true.) !Get_ZeroStringSpeed() | |||
!Get_ElevatorConnected() | |||
!Get_JointConnection() | |||
!Get_NearMonkeyBoardPosition() | |||
!Get_NearFloorPosition() | |||
!Get_SingleSetInMouseHole() | |||
!Get_SwingCenter() | |||
call Set_MudBucket(MUD_BUCKET_REMOVE) | |||
!Get_MudBucket() | |||
!MUD_BUCKET_INSTALL | |||
!MUD_BUCKET_REMOVE | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
! Get_Elevator() | |||
!ELEVATOR_NEUTRAL | |||
!ELEVATOR_LATCH_STRING_BEGIN | |||
!ELEVATOR_LATCH_STRING_END | |||
!ELEVATOR_UNLATCH_STRING_BEGIN | |||
!ELEVATOR_UNLATCH_STRING_END | |||
!ELEVATOR_LATCH_STAND_BEGIN | |||
!ELEVATOR_LATCH_STAND_END | |||
!ELEVATOR_UNLATCH_STAND_BEGIN | |||
!ELEVATOR_UNLATCH_STAND_END | |||
!ELEVATOR_LATCH_SINGLE_BEGIN | |||
!ELEVATOR_LATCH_SINGLE_END | |||
!ELEVATOR_UNLATCH_SINGLE_BEGIN | |||
!ELEVATOR_UNLATCH_SINGLE_END | |||
call Set_FillupHead(FILLUP_HEAD_REMOVE) | |||
!Get_FillupHead() | |||
!FILLUP_HEAD_INSTALL | |||
!FILLUP_HEAD_REMOVE | |||
call Set_Ibop(IBOP_REMOVE) | |||
!Get_Ibop() | |||
!IBOP_INSTALL | |||
!IBOP_REMOVE | |||
call Set_Kelly(KELLY_INSTALL) | |||
!Get_Kelly() | |||
!KELLY_NEUTRAL | |||
!KELLY_INSTALL | |||
!KELLY_REMOVE | |||
call Set_MouseHole(MOUSE_HOLE_FILL) | |||
!Get_MouseHole() | |||
!MOUSE_HOLE_NEUTRAL | |||
!MOUSE_HOLE_FILL | |||
!MOUSE_HOLE_EMPTY | |||
call Set_OperationCondition(OPERATION_DRILL) | |||
!Get_OperationCondition() | |||
!OPERATION_DRILL | |||
!OPERATION_TRIP | |||
call Set_SafetyValve(SAFETY_VALVE_INSTALL) | |||
!Get_SafetyValve() | |||
!SAFETY_VALVE_INSTALL | |||
!SAFETY_VALVE_REMOVE | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call Set_SafetyValve(SAFETY_VALVE_REMOVE) | |||
call Set_Slips(SLIPS_SET_BEGIN) | |||
!Get_Slips() | |||
!SLIPS_NEUTRAL | |||
!SLIPS_SET_BEGIN | |||
!SLIPS_SET_END | |||
!SLIPS_UNSET_BEGIN | |||
!SLIPS_UNSET_END | |||
call Set_Swing(SWING_WELL_BEGIN) | |||
!Get_Swing() | |||
!SWING_NEUTRAL | |||
!SWING_MOUSE_HOLE_BEGIN | |||
!SWING_MOUSE_HOLE_END | |||
!SWING_RAT_HOLE_BEGIN | |||
!SWING_RAT_HOLE_END | |||
!SWING_WELL_BEGIN | |||
!SWING_WELL_END | |||
call Set_Tong(TONG_NEUTRAL) | |||
!Get_Tong() | |||
!TONG_NEUTRAL | |||
!TONG_BREAKOUT_BEGIN | |||
!TONG_BREAKOUT_END | |||
!TONG_MAKEUP_BEGIN | |||
!TONG_MAKEUP_END | |||
call Set_StringUpdate(STRING_UPDATE_NEUTRAL) | |||
!Get_StringUpdate() | |||
!STRING_UPDATE_NEUTRAL | |||
!STRING_UPDATE_ADD_SINGLE | |||
!STRING_UPDATE_ADD_STAND | |||
!STRING_UPDATE_REMOVE_SINGLE | |||
!STRING_UPDATE_REMOVE_STAND | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING) | |||
!Get_TdsElevatorModes() | |||
!TDS_ELEVATOR_CONNECTION_NOTHING | |||
!TDS_ELEVATOR_CONNECTION_STRING | |||
!TDS_ELEVATOR_CONNECTION_SINGLE | |||
!TDS_ELEVATOR_CONNECTION_STAND | |||
!TDS_ELEVATOR_LATCH_STRING | |||
!TDS_ELEVATOR_LATCH_SINGLE | |||
!TDS_ELEVATOR_LATCH_STAND | |||
call Set_TdsConnectionModes(TDS_CONNECTION_NOTHING) | |||
!Get_TdsConnectionModes() | |||
!TDS_CONNECTION_NOTHING | |||
!TDS_CONNECTION_STRING | |||
!TDS_CONNECTION_SPINE | |||
call Set_SwingTiltPermission(.false.) !Get_SwingTiltPermission() | |||
call Set_SwingOffPermission(.false.) !Get_SwingOffPermission() | |||
call Set_SwingDrillPermission(.false.) !Get_SwingDrillPermission() | |||
call Set_FillupHeadPermission(.false.) !Get_FillupHeadPermission() | |||
call Set_PowerLed(.false.) | |||
call Set_IbopLed(.false.) | |||
call Set_TorqueWrenchLed(0) !Get_TorqueWrenchLed() | |||
!TdsPower_REV = 1 | |||
!TdsPower_OFF = 0 | |||
!TdsPower_FWD = -1 | |||
! | |||
!TdsMu_TORQ = 1 | |||
!TdsMu_SPINE = 0 | |||
!TdsMu_DRILL = -1 | |||
! | |||
!TdsLinkTilt_TILT = 1 | |||
!TdsLinkTilt_OFF = 0 | |||
!TdsLinkTilt_DRILL = -1 | |||
!TDS IBOP TopDriveIbop | |||
!TDS LinkTilt TopDriveLinkTiltState | |||
!TDS MU TopDriveDrillTorqueState | |||
!TDS Power TopDriveTdsPowerState | |||
!TopDriveTorqueWrench PRESSED=True or UNPRESSED=Falses | |||
!Get_TdsConnectionPossible() | |||
!Get_TdsStemIn() | |||
!call Set_TdsStemJointHeight(v) !Get_TdsStemJointHeight() | |||
!Get_SwingDrillPermission() | |||
!Get_SwingOffPermission() | |||
!Get_SwingTiltPermission() | |||
!Get_FillupHeadPermission() | |||
call Set_TdsTong(TDS_TONG_BREAKOUT_END) | |||
!Get_TdsTong() | |||
!TDS_TONG_BREAKOUT_BEGIN | |||
!TDS_TONG_BREAKOUT_END | |||
!TDS_TONG_MAKEUP_BEGIN | |||
!TDS_TONG_MAKEUP_END | |||
call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_END) | |||
!Get_TdsBackupClamp() | |||
!BACKUP_CLAMP_OFF_END | |||
!BACKUP_CLAMP_OFF_BEGIN | |||
!BACKUP_CLAMP_FW_BEGIN | |||
!BACKUP_CLAMP_FW_END | |||
call Set_TdsSwing(TDS_SWING_OFF_END) | |||
!Get_TdsSwing() | |||
!TDS_SWING_NEUTRAL | |||
!TDS_SWING_OFF_BEGIN | |||
!TDS_SWING_OFF_END | |||
!TDS_SWING_DRILL_BEGIN | |||
!TDS_SWING_DRILL_END | |||
!TDS_SWING_TILT_BEGIN | |||
!TDS_SWING_TILT_END | |||
call Set_TdsSpine(TDS_SPINE_NEUTRAL) !TDS_SPINE_DISCONNECT_END | |||
!Get_TdsSpine() | |||
!TDS_SPINE_NEUTRAL | |||
!TDS_SPINE_CONNECT_BEGIN | |||
!TDS_SPINE_CONNECT_END | |||
!TDS_SPINE_DISCONNECT_BEGIN | |||
!TDS_SPINE_DISCONNECT_END | |||
end subroutine | |||
subroutine SetDefaults_WN() | |||
!DEC$ ATTRIBUTES DLLEXPORT :: SetDefaults_WN | |||
!DEC$ ATTRIBUTES ALIAS: 'SetDefaults_WN' :: SetDefaults_WN | |||
implicit none | |||
call SetDefaultValues() | |||
end subroutine | |||
end module COperationScenariosSettings |
@@ -1,48 +1,43 @@ | |||
module COperationScenariosVariables | |||
implicit none | |||
public | |||
type::OperationScenarioType | |||
real :: HKL = 63.76 ! Hook And Kelly Length | |||
real :: HL = 17.81 ! Hook Length | |||
real :: PL = 30.0 ! Pipe Length | |||
real :: SL = 90.0 ! Stand Length | |||
real :: LG = 8.0 ! Limit Gap | |||
real :: SG = 3.0 ! Slips Gap | |||
real :: TG = 4.0 ! Tong Gap | |||
real :: RE = 3.0 ! Release | |||
real :: ECG = 2.3 ! Elevator Connection Gap | |||
!moved from enum/CElevatorConnectionEnum | |||
integer :: ElevatorConnection = 0 | |||
!moved from SoftwareOutputs/CStringUpdateVariables | |||
integer :: StringUpdate = 0 | |||
integer :: KellyConnection = 0 | |||
end type OperationScenarioType | |||
enum, bind(c) | |||
enumerator STRING_UPDATE_NEUTRAL | |||
enumerator STRING_UPDATE_ADD_SINGLE | |||
enumerator STRING_UPDATE_ADD_STAND | |||
enumerator STRING_UPDATE_REMOVE_SINGLE | |||
enumerator STRING_UPDATE_REMOVE_STAND | |||
enumerator KELLY_CONNECTION_NOTHING | |||
enumerator KELLY_CONNECTION_STRING | |||
enumerator KELLY_CONNECTION_SINGLE | |||
enumerator ELEVATOR_CONNECTION_NOTHING | |||
enumerator ELEVATOR_CONNECTION_STRING | |||
enumerator ELEVATOR_CONNECTION_STAND | |||
enumerator ELEVATOR_CONNECTION_SINGLE | |||
enumerator ELEVATOR_LATCH_STRING | |||
enumerator ELEVATOR_LATCH_SINGLE | |||
enumerator ELEVATOR_LATCH_STAND | |||
end enum | |||
contains | |||
module COperationScenariosVariables | |||
implicit none | |||
public | |||
type::OperationScenarioType | |||
! Apparently Constants | |||
real :: HKL = 63.76 ! Hook And Kelly Length | |||
real :: HL = 17.81 ! Hook Length | |||
real :: PL = 30.0 ! Pipe Length | |||
real :: SL = 90.0 ! Stand Length | |||
real :: LG = 8.0 ! Limit Gap | |||
real :: SG = 3.0 ! Slips Gap | |||
real :: TG = 4.0 ! Tong Gap | |||
real :: RE = 3.0 ! Release | |||
real :: ECG = 2.3 ! Elevator Connection Gap | |||
!Apparently Variables | |||
integer :: ElevatorConnection = 0 | |||
integer :: StringUpdate = 0 | |||
integer :: KellyConnection = 0 | |||
end type OperationScenarioType | |||
enum, bind(c) | |||
enumerator STRING_UPDATE_NEUTRAL | |||
enumerator STRING_UPDATE_ADD_SINGLE | |||
enumerator STRING_UPDATE_ADD_STAND | |||
enumerator STRING_UPDATE_REMOVE_SINGLE | |||
enumerator STRING_UPDATE_REMOVE_STAND | |||
enumerator KELLY_CONNECTION_NOTHING | |||
enumerator KELLY_CONNECTION_STRING | |||
enumerator KELLY_CONNECTION_SINGLE | |||
enumerator ELEVATOR_CONNECTION_NOTHING | |||
enumerator ELEVATOR_CONNECTION_STRING | |||
enumerator ELEVATOR_CONNECTION_STAND | |||
enumerator ELEVATOR_CONNECTION_SINGLE | |||
enumerator ELEVATOR_LATCH_STRING | |||
enumerator ELEVATOR_LATCH_SINGLE | |||
enumerator ELEVATOR_LATCH_STAND | |||
end enum | |||
contains | |||
end module COperationScenariosVariables |
@@ -1,247 +1,263 @@ | |||
module OperationScenariosModule | |||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |||
!! Paseted From ....Variables.f90 | |||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |||
! use OperationScenariosModule ! | |||
! use OperationScenariosModule !!CElevator... | |||
! use COperationScenariosVariables | |||
use SimulationVariables | |||
use PermissionsModule | |||
use SoftwareInputsVariables | |||
use CUnityInputs | |||
use CUnityOutputs, only: GetRotaryRpm | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use PermissionsModule | |||
! use CTdsElevatorModesEnumVariables ! | |||
use CHoistingVariables | |||
use SimulationVariables | |||
use CTopDrivePanelVariables | |||
use SimulationVariables | |||
use NotificationModule | |||
use UnitySignalsModule !for CTdsConnectionModesEnum!!!! | |||
! use CTdsTorqueWrenchLedNotificationVariables ! | |||
contains | |||
! moved from kellyConnectionEnum | |||
subroutine Set_KellyConnection(v) | |||
use CManifolds, Only: KellyConnected, KellyDisconnected | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%OperationScenario%KellyConnection == v) return | |||
#endif | |||
data%State%OperationScenario%KellyConnection = v | |||
if(data%State%OperationScenario%KellyConnection /= KELLY_CONNECTION_STRING) then | |||
call KellyDisconnected() | |||
else | |||
call KellyConnected() | |||
endif | |||
#ifdef deb | |||
print*, 'data%State%OperationScenario%KellyConnection=', data%State%OperationScenario%KellyConnection | |||
#endif | |||
!**call data%State%OperationScenario%OnKellyConnectionChange%RunAll() | |||
end subroutine | |||
integer function Get_KellyConnection() | |||
implicit none | |||
Get_KellyConnection = data%State%OperationScenario%KellyConnection | |||
end function | |||
subroutine Evaluate_KellyConnection() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_KellyConnection=TopDrive' | |||
#endif | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_KellyConnection=Kelly' | |||
#endif | |||
!!OPERATION-CODE=4 | |||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
! Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
! Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
! Get_TongNotification() .and.& | |||
! Get_FillMouseHoleLed() == .false. .and.& | |||
! Get_Tong() == TONG_BREAKOUT_END) then | |||
! | |||
! call Set_FillMouseHoleLed(.true.) | |||
! return | |||
!end if | |||
!OPERATION-CODE=1 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
!Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_Tong() == TONG_MAKEUP_END) then | |||
!call Log_4('KELLY_CONNECTION_STRING') | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_STRING) | |||
return | |||
end if | |||
!OPERATION-CODE=2 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_StringPressure() == 0 .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HKL + Get_NearFloorConnection()) .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_Tong() == TONG_BREAKOUT_END) then | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_NOTHING) | |||
call Set_SwingLed(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=3 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
!Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_FillMouseHoleLed() .and.& | |||
Get_Tong() == TONG_MAKEUP_END) then | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_SINGLE) | |||
call Set_SwingLed(.false.) | |||
call Set_FillMouseHoleLed(.false.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
return | |||
end if | |||
!OPERATION-CODE=4 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_FillMouseHoleLed() == .false. .and.& | |||
Get_Tong() == TONG_BREAKOUT_END) then | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_NOTHING) | |||
call Set_FillMouseHoleLed(.true.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
return | |||
end if | |||
!OPERATION-CODE=5 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
!Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_Tong() == TONG_MAKEUP_END) then | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_STRING) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE) | |||
call Set_SwingLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=6 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_StringPressure() == 0 .and.& | |||
Get_HookHeight() > 70.0 .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& | |||
!Get_TongNotification() .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Tong() == TONG_BREAKOUT_END) then | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_SINGLE) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_KellyConnection() | |||
! use CDrillingConsoleVariables | |||
! use ConfigurationVariables | |||
! use ConfigurationVariables | |||
! implicit none | |||
! call OnBreakoutLeverPress%Add(ButtonPress_Breakout) | |||
! call OnMakeupLeverPress%Add(ButtonPress_Makeup) | |||
! end subroutine | |||
subroutine ButtonPress_Breakout() | |||
implicit none | |||
#ifdef deb | |||
print*, 'ButtonPress_Breakout on ======> CKellyConnectionEnum' | |||
#endif | |||
end subroutine | |||
subroutine ButtonPress_Makeup() | |||
implicit none | |||
#ifdef deb | |||
print*, 'ButtonPress_Makeup on ======> CKellyConnectionEnum' | |||
#endif | |||
end subroutine | |||
subroutine Set_StringUpdate(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%OperationScenario%StringUpdate == v) return | |||
#endif | |||
data%State%OperationScenario%StringUpdate = v | |||
!**call data%State%OperationScenario%OnStringUpdateChange%RunAll(v) | |||
end subroutine | |||
integer function Get_StringUpdate() | |||
implicit none | |||
Get_StringUpdate = data%State%OperationScenario%StringUpdate | |||
end function | |||
real(8) function TJH() | |||
use TD_DrillStemComponents | |||
implicit none | |||
TJH = data%State%TD_String%TopJointHeight | |||
end function | |||
real function TL() | |||
implicit none | |||
TL = 26.97 | |||
end function | |||
real function NFC() | |||
implicit none | |||
NFC = Get_NearFloorConnection() | |||
end function | |||
subroutine Set_ElevatorConnection(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%OperationScenario%ElevatorConnection == v) return | |||
#endif | |||
data%State%OperationScenario%ElevatorConnection = v | |||
#ifdef deb | |||
print*, 'data%State%OperationScenario%ElevatorConnection=', data%State%OperationScenario%ElevatorConnection | |||
#endif | |||
!**call data%State%OperationScenario%OnElevatorConnectionChange%RunAll() | |||
end subroutine | |||
integer function Get_ElevatorConnection() | |||
implicit none | |||
Get_ElevatorConnection = data%State%OperationScenario%ElevatorConnection | |||
end function | |||
module OperationScenariosModule | |||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |||
!! Paseted From ....Variables.f90 | |||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |||
! use OperationScenariosModule ! | |||
! use OperationScenariosModule !!CElevator... | |||
! use COperationScenariosVariables | |||
use SimulationVariables | |||
use PermissionsModule | |||
! use SoftwareInputsVariables | |||
use CUnityInputs | |||
use CUnityOutputs, only: GetRotaryRpm | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use PermissionsModule | |||
! use CTdsElevatorModesEnumVariables ! | |||
use CHoistingVariables | |||
use CTopDrivePanelVariables | |||
use NotificationModule | |||
use SoftwareInputsModule | |||
contains | |||
subroutine OperationScenariosToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'OperationScenarios') | |||
! 2. add member of data type to new node | |||
call json%add(p,"ElevatorConnection",data%State%OperationScenario%ElevatorConnection) | |||
call json%add(p,"StringUpdate",data%State%OperationScenario%StringUpdate) | |||
call json%add(p,"KellyConnection",data%State%OperationScenario%KellyConnection) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
! moved from kellyConnectionEnum | |||
subroutine Set_KellyConnection(v) | |||
use CManifolds, Only: KellyConnected, KellyDisconnected | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%OperationScenario%KellyConnection == v) return | |||
#endif | |||
data%State%OperationScenario%KellyConnection = v | |||
if(data%State%OperationScenario%KellyConnection /= KELLY_CONNECTION_STRING) then | |||
call KellyDisconnected() | |||
else | |||
call KellyConnected() | |||
endif | |||
#ifdef deb | |||
print*, 'data%State%OperationScenario%KellyConnection=', data%State%OperationScenario%KellyConnection | |||
#endif | |||
!**call data%State%OperationScenario%OnKellyConnectionChange%RunAll() | |||
end subroutine | |||
integer function Get_KellyConnection() | |||
implicit none | |||
Get_KellyConnection = data%State%OperationScenario%KellyConnection | |||
end function | |||
subroutine Evaluate_KellyConnection() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_KellyConnection=TopDrive' | |||
#endif | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_KellyConnection=Kelly' | |||
#endif | |||
!!OPERATION-CODE=4 | |||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
! Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
! Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
! Get_TongNotification() .and.& | |||
! Get_FillMouseHoleLed() == .false. .and.& | |||
! Get_Tong() == TONG_BREAKOUT_END) then | |||
! | |||
! call Set_FillMouseHoleLed(.true.) | |||
! return | |||
!end if | |||
!OPERATION-CODE=1 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
!Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_Tong() == TONG_MAKEUP_END) then | |||
!call Log_4('KELLY_CONNECTION_STRING') | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_STRING) | |||
return | |||
end if | |||
!OPERATION-CODE=2 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_StringPressure() == 0 .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HKL + Get_NearFloorConnection()) .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_Tong() == TONG_BREAKOUT_END) then | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_NOTHING) | |||
call Set_SwingLed(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=3 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
!Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_FillMouseHoleLed() .and.& | |||
Get_Tong() == TONG_MAKEUP_END) then | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_SINGLE) | |||
call Set_SwingLed(.false.) | |||
call Set_FillMouseHoleLed(.false.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
return | |||
end if | |||
!OPERATION-CODE=4 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_FillMouseHoleLed() == .false. .and.& | |||
Get_Tong() == TONG_BREAKOUT_END) then | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_NOTHING) | |||
call Set_FillMouseHoleLed(.true.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
return | |||
end if | |||
!OPERATION-CODE=5 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
!Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_Tong() == TONG_MAKEUP_END) then | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_STRING) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE) | |||
call Set_SwingLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=6 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_StringPressure() == 0 .and.& | |||
Get_HookHeight() > 70.0 .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& | |||
!Get_TongNotification() .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Tong() == TONG_BREAKOUT_END) then | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_KellyConnection(KELLY_CONNECTION_SINGLE) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_KellyConnection() | |||
! use CDrillingConsoleVariables | |||
! use ConfigurationVariables | |||
! use ConfigurationVariables | |||
! implicit none | |||
! call OnBreakoutLeverPress%Add(ButtonPress_Breakout) | |||
! call OnMakeupLeverPress%Add(ButtonPress_Makeup) | |||
! end subroutine | |||
subroutine ButtonPress_Breakout() | |||
implicit none | |||
#ifdef deb | |||
print*, 'ButtonPress_Breakout on ======> CKellyConnectionEnum' | |||
#endif | |||
end subroutine | |||
subroutine ButtonPress_Makeup() | |||
implicit none | |||
#ifdef deb | |||
print*, 'ButtonPress_Makeup on ======> CKellyConnectionEnum' | |||
#endif | |||
end subroutine | |||
subroutine Set_StringUpdate(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%OperationScenario%StringUpdate == v) return | |||
#endif | |||
data%State%OperationScenario%StringUpdate = v | |||
!**call data%State%OperationScenario%OnStringUpdateChange%RunAll(v) | |||
end subroutine | |||
integer function Get_StringUpdate() | |||
implicit none | |||
Get_StringUpdate = data%State%OperationScenario%StringUpdate | |||
end function | |||
real(8) function TJH() | |||
use TD_DrillStemComponents | |||
implicit none | |||
TJH = data%State%TD_String%TopJointHeight | |||
end function | |||
real function TL() | |||
implicit none | |||
TL = 26.97 | |||
end function | |||
real function NFC() | |||
implicit none | |||
NFC = Get_NearFloorConnection() | |||
end function | |||
subroutine Set_ElevatorConnection(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%OperationScenario%ElevatorConnection == v) return | |||
#endif | |||
data%State%OperationScenario%ElevatorConnection = v | |||
#ifdef deb | |||
print*, 'data%State%OperationScenario%ElevatorConnection=', data%State%OperationScenario%ElevatorConnection | |||
#endif | |||
!**call data%State%OperationScenario%OnElevatorConnectionChange%RunAll() | |||
end subroutine | |||
integer function Get_ElevatorConnection() | |||
implicit none | |||
Get_ElevatorConnection = data%State%OperationScenario%ElevatorConnection | |||
end function | |||
end module OperationScenariosModule |
@@ -1,332 +1,332 @@ | |||
module CTdsElevatorModesEnum | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_TdsElevatorModes() | |||
use CCommon, only: SetStandRack | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_TdsElevatorModes=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=7 | |||
if (Get_Elevator() == ELEVATOR_LATCH_STRING_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END ) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=8 | |||
if (Get_HookHeight() <= (TL() + TJH() - data%State%OperationScenario%ECG) .and.& | |||
Get_ElevatorPickup() == .false. .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=9 | |||
if (Get_ElevatorPickup() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=10 | |||
if (Get_Elevator() == ELEVATOR_UNLATCH_STRING_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=11 | |||
if (Get_Elevator() == ELEVATOR_UNLATCH_STRING_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_STRING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=12 | |||
if (Get_Elevator() == ELEVATOR_LATCH_STAND_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
call SetStandRack(Get_StandRack() - 1) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=13 | |||
if (Get_Elevator() == ELEVATOR_UNLATCH_STAND_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
call SetStandRack(Get_StandRack() + 1) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=14 | |||
if (Get_Elevator() == ELEVATOR_LATCH_SINGLE_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_FillMouseHoleLed()) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
call Set_UnlatchLed(.true.) | |||
call Set_FillMouseHoleLed(.false.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=15 | |||
if (Get_Elevator() == ELEVATOR_UNLATCH_SINGLE_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_FillMouseHoleLed() == .false.) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
call Set_UnlatchLed(.false.) | |||
call Set_FillMouseHoleLed(.true.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=16 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.& | |||
Get_Tong() == TONG_BREAKOUT_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_SINGLE) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=17 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.& | |||
Get_Tong() == TONG_BREAKOUT_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=18 | |||
if (Get_ElevatorPickup() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=19 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.& | |||
Get_ElevatorPickup() == .false. .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=20 | |||
if (Get_Tong() == TONG_MAKEUP_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=21 | |||
if (Get_Tong() == TONG_MAKEUP_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=22 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.& | |||
Get_Tong() == TONG_BREAKOUT_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STAND) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_STAND) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=23 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.& | |||
Get_Tong() == TONG_BREAKOUT_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_STAND) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=24 | |||
if (Get_ElevatorPickup() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=25 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.& | |||
Get_ElevatorPickup() == .false. .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STAND) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=26 | |||
if (Get_Tong() == TONG_MAKEUP_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_STAND) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=27 | |||
if (Get_Tong() == TONG_MAKEUP_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_STAND) | |||
return | |||
end if | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_TdsElevatorModes=Kelly' | |||
#endif | |||
endif | |||
end subroutine | |||
subroutine Subscribe_TdsElevatorModes() | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables | |||
implicit none | |||
end subroutine | |||
module CTdsElevatorModesEnum | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_TdsElevatorModes() | |||
use CCommon, only: SetStandRack | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_TdsElevatorModes=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=7 | |||
if (Get_Elevator() == ELEVATOR_LATCH_STRING_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END ) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=8 | |||
if (Get_HookHeight() <= (TL() + TJH() - data%State%OperationScenario%ECG) .and.& | |||
Get_ElevatorPickup() == .false. .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=9 | |||
if (Get_ElevatorPickup() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=10 | |||
if (Get_Elevator() == ELEVATOR_UNLATCH_STRING_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=11 | |||
if (Get_Elevator() == ELEVATOR_UNLATCH_STRING_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_STRING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=12 | |||
if (Get_Elevator() == ELEVATOR_LATCH_STAND_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
call SetStandRack(Get_StandRack() - 1) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=13 | |||
if (Get_Elevator() == ELEVATOR_UNLATCH_STAND_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
call SetStandRack(Get_StandRack() + 1) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=14 | |||
if (Get_Elevator() == ELEVATOR_LATCH_SINGLE_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_FillMouseHoleLed()) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
call Set_UnlatchLed(.true.) | |||
call Set_FillMouseHoleLed(.false.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=15 | |||
if (Get_Elevator() == ELEVATOR_UNLATCH_SINGLE_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_FillMouseHoleLed() == .false.) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
call Set_UnlatchLed(.false.) | |||
call Set_FillMouseHoleLed(.true.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=16 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.& | |||
Get_Tong() == TONG_BREAKOUT_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_SINGLE) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=17 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.& | |||
Get_Tong() == TONG_BREAKOUT_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=18 | |||
if (Get_ElevatorPickup() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=19 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.& | |||
Get_ElevatorPickup() == .false. .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=20 | |||
if (Get_Tong() == TONG_MAKEUP_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=21 | |||
if (Get_Tong() == TONG_MAKEUP_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=22 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.& | |||
Get_Tong() == TONG_BREAKOUT_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STAND) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_STAND) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=23 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.& | |||
Get_Tong() == TONG_BREAKOUT_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_STAND) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=24 | |||
if (Get_ElevatorPickup() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=25 | |||
if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.& | |||
Get_ElevatorPickup() == .false. .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STAND) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=26 | |||
if (Get_Tong() == TONG_MAKEUP_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_STAND) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=27 | |||
if (Get_Tong() == TONG_MAKEUP_END .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND) then | |||
call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING) | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_STAND) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_TdsElevatorModes=Kelly' | |||
#endif | |||
endif | |||
end subroutine | |||
subroutine Subscribe_TdsElevatorModes() | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables | |||
implicit none | |||
end subroutine | |||
end module CTdsElevatorModesEnum |
@@ -1,76 +1,76 @@ | |||
module CCloseKellyCockLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_CloseKellyCockLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_CloseKellyCockLed=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_CloseKellyCockLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_CloseKellyCockLed() | |||
! use CDrillingConsoleVariables | |||
! use ConfigurationVariables | |||
! use ConfigurationVariables | |||
! implicit none | |||
! call OnCloseKellyCockPress%Add(ButtonPress_CloseKellyCock) | |||
! end subroutine | |||
subroutine ButtonPress_CloseKellyCock() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_CloseKellyCockLed=TopDrive' | |||
#endif | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_CloseKellyCockLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=66 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_CloseKellyCockLed() == .false. .and.& | |||
Get_OpenKellyCockLed()) then | |||
call Set_OpenKellyCockLed(.false.) | |||
call Set_CloseKellyCockLed(.true.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
module CCloseKellyCockLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_CloseKellyCockLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_CloseKellyCockLed=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_CloseKellyCockLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_CloseKellyCockLed() | |||
! use CDrillingConsoleVariables | |||
! use ConfigurationVariables | |||
! use ConfigurationVariables | |||
! implicit none | |||
! call OnCloseKellyCockPress%Add(ButtonPress_CloseKellyCock) | |||
! end subroutine | |||
subroutine ButtonPress_CloseKellyCock() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_CloseKellyCockLed=TopDrive' | |||
#endif | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_CloseKellyCockLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=66 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_CloseKellyCockLed() == .false. .and.& | |||
Get_OpenKellyCockLed()) then | |||
call Set_OpenKellyCockLed(.false.) | |||
call Set_CloseKellyCockLed(.true.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
end module CCloseKellyCockLedNotification |
@@ -1,111 +1,111 @@ | |||
module CCloseSafetyValveLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_CloseSafetyValveLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_CloseSafetyValveLed=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_CloseSafetyValveLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_CloseSafetyValveLed() | |||
! use CDrillingConsoleVariables | |||
!@ use ConfigurationVariables | |||
!@ use ConfigurationVariables | |||
! implicit none | |||
! call OnCloseSafetyValvePress%Add(ButtonPress_CloseSafetyValve) | |||
! call OnOperationConditionChangeInt%Add(Set_Operation_CloseSafetyValveLed) | |||
! end subroutine | |||
subroutine Set_Operation_CloseSafetyValveLed(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%operation_CloseSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%operation_CloseSafetyValveLed = v | |||
#ifdef deb | |||
print*, 'operation_CloseSafetyValveLed=', data%State%notifications%operation_CloseSafetyValveLed | |||
#endif | |||
end subroutine | |||
subroutine ButtonPress_CloseSafetyValve() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_CloseSafetyValveLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=57 | |||
if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.& | |||
Get_CloseSafetyValveLed() == .false. .and.& | |||
Get_OpenSafetyValveLed()) then | |||
call Set_OpenSafetyValveLed(.false.) | |||
call Set_CloseSafetyValveLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_CloseSafetyValveLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=59 | |||
if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.& | |||
Get_CloseSafetyValveLed() == .false. .and.& | |||
Get_OpenSafetyValveLed()) then | |||
call Set_OpenSafetyValveLed(.false.) | |||
call Set_CloseSafetyValveLed(.true.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
module CCloseSafetyValveLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_CloseSafetyValveLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_CloseSafetyValveLed=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_CloseSafetyValveLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_CloseSafetyValveLed() | |||
! use CDrillingConsoleVariables | |||
!@ use ConfigurationVariables | |||
!@ use ConfigurationVariables | |||
! implicit none | |||
! call OnCloseSafetyValvePress%Add(ButtonPress_CloseSafetyValve) | |||
! call OnOperationConditionChangeInt%Add(Set_Operation_CloseSafetyValveLed) | |||
! end subroutine | |||
subroutine Set_Operation_CloseSafetyValveLed(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%operation_CloseSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%operation_CloseSafetyValveLed = v | |||
#ifdef deb | |||
print*, 'operation_CloseSafetyValveLed=', data%State%notifications%operation_CloseSafetyValveLed | |||
#endif | |||
end subroutine | |||
subroutine ButtonPress_CloseSafetyValve() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_CloseSafetyValveLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=57 | |||
if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.& | |||
Get_CloseSafetyValveLed() == .false. .and.& | |||
Get_OpenSafetyValveLed()) then | |||
call Set_OpenSafetyValveLed(.false.) | |||
call Set_CloseSafetyValveLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_CloseSafetyValveLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=59 | |||
if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.& | |||
Get_CloseSafetyValveLed() == .false. .and.& | |||
Get_OpenSafetyValveLed()) then | |||
call Set_OpenSafetyValveLed(.false.) | |||
call Set_CloseSafetyValveLed(.true.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
end module CCloseSafetyValveLedNotification |
@@ -1,61 +1,61 @@ | |||
module CFillMouseHoleLedNotification | |||
use OperationScenariosModule | |||
use NotificationModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_FillMouseHoleLed() | |||
implicit none | |||
end subroutine | |||
subroutine ButtonPress_FillMouseHole() | |||
! use OperationScenariosModule | |||
use UnitySignalsModule | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
!TOPDRIVE-CODE=71 | |||
if (Get_FillMouseHoleLed()) then | |||
call Set_FillMouseHoleLed(.false.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=72 | |||
if (Get_TdsElevatorModes() /= TDS_ELEVATOR_CONNECTION_STRING .and.& | |||
Get_FillMouseHoleLed() == .false.) then | |||
call Set_FillMouseHoleLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
!OPERATION-CODE=81 | |||
if (Get_FillMouseHoleLed()) then | |||
call Set_FillMouseHoleLed(.false.) | |||
call Set_MouseHole(MOUSE_HOLE_EMPTY) | |||
return | |||
end if | |||
!OPERATION-CODE=82 | |||
if (Get_KellyConnection() /= KELLY_CONNECTION_SINGLE .and.& | |||
Get_ElevatorConnection() /= ELEVATOR_CONNECTION_SINGLE .and.& | |||
Get_FillMouseHoleLed() == .false.) then | |||
call Set_FillMouseHoleLed(.true.) | |||
call Set_MouseHole(MOUSE_HOLE_FILL) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
module CFillMouseHoleLedNotification | |||
use OperationScenariosModule | |||
use NotificationModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_FillMouseHoleLed() | |||
implicit none | |||
end subroutine | |||
subroutine ButtonPress_FillMouseHole() | |||
! use OperationScenariosModule | |||
use UnitySignalsModule | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
!TOPDRIVE-CODE=71 | |||
if (Get_FillMouseHoleLed()) then | |||
call Set_FillMouseHoleLed(.false.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=72 | |||
if (Get_TdsElevatorModes() /= TDS_ELEVATOR_CONNECTION_STRING .and.& | |||
Get_FillMouseHoleLed() == .false.) then | |||
call Set_FillMouseHoleLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
!OPERATION-CODE=81 | |||
if (Get_FillMouseHoleLed()) then | |||
call Set_FillMouseHoleLed(.false.) | |||
call Set_MouseHole(MOUSE_HOLE_EMPTY) | |||
return | |||
end if | |||
!OPERATION-CODE=82 | |||
if (Get_KellyConnection() /= KELLY_CONNECTION_SINGLE .and.& | |||
Get_ElevatorConnection() /= ELEVATOR_CONNECTION_SINGLE .and.& | |||
Get_FillMouseHoleLed() == .false.) then | |||
call Set_FillMouseHoleLed(.true.) | |||
call Set_MouseHole(MOUSE_HOLE_FILL) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
end module CFillMouseHoleLedNotification |
@@ -1,120 +1,120 @@ | |||
module CIrIBopLedNotification | |||
use OperationScenariosModule | |||
! use CTopDrivePanelVariables | |||
use SimulationVariables | |||
implicit none | |||
contains | |||
subroutine Evaluate_IrIBopLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_IrIBopLed=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_IrIBopLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_IrIBopLed() | |||
! use CDrillingConsoleVariables | |||
!@ use ConfigurationVariables | |||
!@ use ConfigurationVariables | |||
! implicit none | |||
! call OnIRIBopPress%Add(ButtonPress_IrIBop) | |||
! end subroutine | |||
subroutine ButtonPress_IrIBop() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrIBopLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=59 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed() == .false.) then | |||
call Set_IrIBopLed(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=60 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed() == .true. .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then | |||
call Set_IrIBopLed(.false.) | |||
return | |||
end if | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrIBopLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=63 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed() == .false.) then | |||
call Set_IrIBopLed(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=64 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed()) then | |||
call Set_IrIBopLed(.false.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
module CIrIBopLedNotification | |||
use OperationScenariosModule | |||
! use CTopDrivePanelVariables | |||
use SimulationVariables | |||
implicit none | |||
contains | |||
subroutine Evaluate_IrIBopLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_IrIBopLed=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_IrIBopLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_IrIBopLed() | |||
! use CDrillingConsoleVariables | |||
!@ use ConfigurationVariables | |||
!@ use ConfigurationVariables | |||
! implicit none | |||
! call OnIRIBopPress%Add(ButtonPress_IrIBop) | |||
! end subroutine | |||
subroutine ButtonPress_IrIBop() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrIBopLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=59 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed() == .false.) then | |||
call Set_IrIBopLed(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=60 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed() == .true. .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then | |||
call Set_IrIBopLed(.false.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrIBopLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=63 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed() == .false.) then | |||
call Set_IrIBopLed(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=64 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed()) then | |||
call Set_IrIBopLed(.false.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
end module CIrIBopLedNotification |
@@ -1,164 +1,164 @@ | |||
module CIrSafetyValveLedNotification | |||
use OperationScenariosModule | |||
!use UnitySignalsModuleVariables | |||
implicit none | |||
contains | |||
subroutine Evaluate_IrSafetyValveLed() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrSafetyValveLed=TopDrive' | |||
#endif | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrSafetyValveLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=56 | |||
if (Get_OperationCondition() == OPERATION_DRILL) then | |||
call Set_IrSafetyValveLed(.true.) | |||
return | |||
end if | |||
!call Set_IrSafetyValveLed(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_IrSafetyValveLed() | |||
! use CDrillingConsoleVariables | |||
!@ use ConfigurationVariables | |||
!@ use ConfigurationVariables | |||
! implicit none | |||
! call OnIRSafetyValvePress%Add(ButtonPress_IrSafetyValve) | |||
! call OnOperationConditionChangeInt%Add(Set_Operation_IrSafetyValveLed) | |||
! end subroutine | |||
subroutine Set_Operation_IrSafetyValveLed(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%operation_IrSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%operation_IrSafetyValveLed = v | |||
#ifdef deb | |||
print*, 'operation_IrSafetyValveLed=', data%State%notifications%operation_IrSafetyValveLed | |||
#endif | |||
end subroutine | |||
subroutine ButtonPress_IrSafetyValve() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrSafetyValveLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=53 | |||
if (Get_IrSafetyValvePermission() .and.& | |||
Get_IrSafetyValveLed()) then | |||
call Set_IrSafetyValveLed(.false.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=54 | |||
if (Get_IrSafetyValvePermission() .and.& | |||
Get_IrSafetyValveLed() == .false.) then | |||
call Set_IrSafetyValveLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrSafetyValveLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=54 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_IrSafetyValvePermission() .and.& | |||
Get_IrSafetyValveLed()) then | |||
call Set_IrSafetyValveLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=55 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_IrSafetyValvePermission() .and.& | |||
Get_IrSafetyValveLed() == .false. ) then | |||
call Set_IrSafetyValveLed(.true.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
module CIrSafetyValveLedNotification | |||
use OperationScenariosModule | |||
!use UnitySignalsModuleVariables | |||
implicit none | |||
contains | |||
subroutine Evaluate_IrSafetyValveLed() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrSafetyValveLed=TopDrive' | |||
#endif | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrSafetyValveLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=56 | |||
if (Get_OperationCondition() == OPERATION_DRILL) then | |||
call Set_IrSafetyValveLed(.true.) | |||
return | |||
end if | |||
!call Set_IrSafetyValveLed(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_IrSafetyValveLed() | |||
! use CDrillingConsoleVariables | |||
!@ use ConfigurationVariables | |||
!@ use ConfigurationVariables | |||
! implicit none | |||
! call OnIRSafetyValvePress%Add(ButtonPress_IrSafetyValve) | |||
! call OnOperationConditionChangeInt%Add(Set_Operation_IrSafetyValveLed) | |||
! end subroutine | |||
subroutine Set_Operation_IrSafetyValveLed(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%operation_IrSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%operation_IrSafetyValveLed = v | |||
#ifdef deb | |||
print*, 'operation_IrSafetyValveLed=', data%State%notifications%operation_IrSafetyValveLed | |||
#endif | |||
end subroutine | |||
subroutine ButtonPress_IrSafetyValve() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrSafetyValveLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=53 | |||
if (Get_IrSafetyValvePermission() .and.& | |||
Get_IrSafetyValveLed()) then | |||
call Set_IrSafetyValveLed(.false.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=54 | |||
if (Get_IrSafetyValvePermission() .and.& | |||
Get_IrSafetyValveLed() == .false.) then | |||
call Set_IrSafetyValveLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrSafetyValveLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=54 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_IrSafetyValvePermission() .and.& | |||
Get_IrSafetyValveLed()) then | |||
call Set_IrSafetyValveLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=55 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_IrSafetyValvePermission() .and.& | |||
Get_IrSafetyValveLed() == .false. ) then | |||
call Set_IrSafetyValveLed(.true.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
end module CIrSafetyValveLedNotification |
@@ -1,251 +1,251 @@ | |||
module CLatchLedNotification | |||
use OperationScenariosModule | |||
use CLog4 | |||
implicit none | |||
contains | |||
subroutine Evaluate_LatchLed() | |||
use CCommon | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_LatchLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=44 | |||
if (Get_HookHeight() <= (TL() + NFC() - data%State%OperationScenario%ECG) .and.& | |||
Get_ElevatorConnectionPossible() .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_LatchLed(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=45 | |||
if ((Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC()) .and. Get_HookHeight() <= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() + data%State%OperationScenario%TG)) .and.& | |||
GetStandRack() > 0 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_LatchLed(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=46 | |||
if ((Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC()) .and. Get_HookHeight() <= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() + data%State%OperationScenario%TG)) .and.& | |||
Get_ElevatorConnectionPossible() .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_FillMouseHoleLed()) then | |||
call Set_LatchLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_LatchLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=36 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() - data%State%OperationScenario%ECG) .and.& | |||
Get_ElevatorConnectionPossible() .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_Elevator() == ELEVATOR_UNLATCH_STRING_END .and.& | |||
!Get_UnlatchLed() .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
!call Log_4("OPERATION-CODE=36") | |||
call Set_LatchLed(.true.) | |||
!call Set_UnlatchLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=37 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_StandRack() > 0 .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection()) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection() + data%State%OperationScenario%LG) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_Elevator() == ELEVATOR_UNLATCH_STAND_END .and.& | |||
Get_ElevatorConnectionPossible() == .false. .and.& | |||
!Get_UnlatchLed() .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
!call Log_4("OPERATION-CODE=37") | |||
call Set_LatchLed(.true.) | |||
!call Set_UnlatchLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=38 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_ElevatorConnectionPossible() .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_Elevator() == ELEVATOR_UNLATCH_SINGLE_END .and.& | |||
!Get_UnlatchLed() .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
Get_FillMouseHoleLed()) then | |||
!call Log_4("OPERATION-CODE=38") | |||
call Set_LatchLed(.true.) | |||
!call Set_UnlatchLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=39 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= 27.41 .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_UnlatchLed() .and.& | |||
Get_Swing() == SWING_RAT_HOLE_END) then | |||
!call Log_4("OPERATION-CODE=39") | |||
call Set_LatchLed(.true.) | |||
!call Set_UnlatchLed(.false.) | |||
return | |||
end if | |||
call Set_LatchLed(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_LatchLed() | |||
! use UnitySignalsModuleVariables | |||
! use CStandRack | |||
! use CUnityInputs, OnElevatorConnectionChangePosibility => OnElevatorConnectionPossibleChange | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
! use CFillMouseHoleLedNotificationVariables | |||
! implicit none | |||
! call OnOperationConditionChange%Add(Evaluate_LatchLed) | |||
! call OnStandRackChanged%Add(Evaluate_LatchLed) | |||
! call OnElevatorConnectionChangePosibility%Add(Evaluate_LatchLed) | |||
! call OnElevatorPickupChange%Add(Evaluate_LatchLed) | |||
! call OnNearFloorPositionChange%Add(Evaluate_LatchLed) | |||
! call OnSwingChange%Add(Evaluate_LatchLed) | |||
! call OnSlipsChange%Add(Evaluate_LatchLed) | |||
! call OnFillMouseHoleLedChange%Add(Evaluate_LatchLed) | |||
! end subroutine | |||
module CLatchLedNotification | |||
use OperationScenariosModule | |||
use CLog4 | |||
implicit none | |||
contains | |||
subroutine Evaluate_LatchLed() | |||
use CCommon | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_LatchLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=44 | |||
if (Get_HookHeight() <= (TL() + NFC() - data%State%OperationScenario%ECG) .and.& | |||
Get_ElevatorConnectionPossible() .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_LatchLed(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=45 | |||
if ((Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC()) .and. Get_HookHeight() <= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() + data%State%OperationScenario%TG)) .and.& | |||
GetStandRack() > 0 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_LatchLed(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=46 | |||
if ((Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC()) .and. Get_HookHeight() <= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() + data%State%OperationScenario%TG)) .and.& | |||
Get_ElevatorConnectionPossible() .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_FillMouseHoleLed()) then | |||
call Set_LatchLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_LatchLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=36 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() - data%State%OperationScenario%ECG) .and.& | |||
Get_ElevatorConnectionPossible() .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_Elevator() == ELEVATOR_UNLATCH_STRING_END .and.& | |||
!Get_UnlatchLed() .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
!call Log_4("OPERATION-CODE=36") | |||
call Set_LatchLed(.true.) | |||
!call Set_UnlatchLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=37 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_StandRack() > 0 .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection()) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection() + data%State%OperationScenario%LG) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_Elevator() == ELEVATOR_UNLATCH_STAND_END .and.& | |||
Get_ElevatorConnectionPossible() == .false. .and.& | |||
!Get_UnlatchLed() .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
!call Log_4("OPERATION-CODE=37") | |||
call Set_LatchLed(.true.) | |||
!call Set_UnlatchLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=38 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_ElevatorConnectionPossible() .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_Elevator() == ELEVATOR_UNLATCH_SINGLE_END .and.& | |||
!Get_UnlatchLed() .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
Get_FillMouseHoleLed()) then | |||
!call Log_4("OPERATION-CODE=38") | |||
call Set_LatchLed(.true.) | |||
!call Set_UnlatchLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=39 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= 27.41 .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_UnlatchLed() .and.& | |||
Get_Swing() == SWING_RAT_HOLE_END) then | |||
!call Log_4("OPERATION-CODE=39") | |||
call Set_LatchLed(.true.) | |||
!call Set_UnlatchLed(.false.) | |||
return | |||
end if | |||
call Set_LatchLed(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_LatchLed() | |||
! use UnitySignalsModuleVariables | |||
! use CStandRack | |||
! use CUnityInputs, OnElevatorConnectionChangePosibility => OnElevatorConnectionPossibleChange | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
! use CFillMouseHoleLedNotificationVariables | |||
! implicit none | |||
! call OnOperationConditionChange%Add(Evaluate_LatchLed) | |||
! call OnStandRackChanged%Add(Evaluate_LatchLed) | |||
! call OnElevatorConnectionChangePosibility%Add(Evaluate_LatchLed) | |||
! call OnElevatorPickupChange%Add(Evaluate_LatchLed) | |||
! call OnNearFloorPositionChange%Add(Evaluate_LatchLed) | |||
! call OnSwingChange%Add(Evaluate_LatchLed) | |||
! call OnSlipsChange%Add(Evaluate_LatchLed) | |||
! call OnFillMouseHoleLedChange%Add(Evaluate_LatchLed) | |||
! end subroutine | |||
end module CLatchLedNotification |
@@ -1,64 +1,64 @@ | |||
module COpenKellyCockLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_OpenKellyCockLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_OpenKellyCockLed=TopDrive' | |||
!#endif | |||
! endif | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_OpenKellyCockLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_OpenKellyCockLed() | |||
! use CDrillingConsoleVariables | |||
!@ use ConfigurationVariables | |||
!@ use ConfigurationVariables | |||
! implicit none | |||
! call OnOpenKellyCockPress%Add(ButtonPress_OpenKellyCock) | |||
! end subroutine | |||
subroutine ButtonPress_OpenKellyCock() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'ButtonPress_OpenKellyCock=TopDrive' | |||
#endif | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'ButtonPress_OpenKellyCock=Kelly' | |||
#endif | |||
!OPERATION-CODE=65 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_OpenKellyCockLed() == .false. .and.& | |||
Get_CloseKellyCockLed()) then | |||
call Set_OpenKellyCockLed(.true.) | |||
call Set_CloseKellyCockLed(.false.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
module COpenKellyCockLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_OpenKellyCockLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_OpenKellyCockLed=TopDrive' | |||
!#endif | |||
! endif | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_OpenKellyCockLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_OpenKellyCockLed() | |||
! use CDrillingConsoleVariables | |||
!@ use ConfigurationVariables | |||
!@ use ConfigurationVariables | |||
! implicit none | |||
! call OnOpenKellyCockPress%Add(ButtonPress_OpenKellyCock) | |||
! end subroutine | |||
subroutine ButtonPress_OpenKellyCock() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'ButtonPress_OpenKellyCock=TopDrive' | |||
#endif | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'ButtonPress_OpenKellyCock=Kelly' | |||
#endif | |||
!OPERATION-CODE=65 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_OpenKellyCockLed() == .false. .and.& | |||
Get_CloseKellyCockLed()) then | |||
call Set_OpenKellyCockLed(.true.) | |||
call Set_CloseKellyCockLed(.false.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
end module COpenKellyCockLedNotification |
@@ -1,108 +1,108 @@ | |||
module COpenSafetyValveLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_OpenSafetyValveLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_OpenSafetyValveLed=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_OpenSafetyValveLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_OpenSafetyValveLed() | |||
! use CDrillingConsoleVariables | |||
! use ConfigurationVariables | |||
! use ConfigurationVariables | |||
! implicit none | |||
! call OnOpenSafetyValvePress%Add(ButtonPress_OpenSafetyValve) | |||
! call OnOperationConditionChangeInt%Add(Set_Operation_OpenSafetyValveLed) | |||
! end subroutine | |||
subroutine Set_Operation_OpenSafetyValveLed(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%operation_OpenSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%operation_OpenSafetyValveLed = v | |||
#ifdef deb | |||
print*, 'data%State%notifications%operation_OpenSafetyValveLed=', data%State%notifications%operation_OpenSafetyValveLed | |||
#endif | |||
end subroutine | |||
subroutine ButtonPress_OpenSafetyValve() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'ButtonPress_OpenSafetyValve=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=56 | |||
if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.& | |||
Get_OpenSafetyValveLed() == .false. .and.& | |||
Get_CloseSafetyValveLed()) then | |||
call Set_CloseSafetyValveLed(.false.) | |||
call Set_OpenSafetyValveLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'ButtonPress_OpenSafetyValve=Kelly' | |||
#endif | |||
!OPERATION-CODE=58 | |||
if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.& | |||
Get_OpenSafetyValveLed() == .false. .and.& | |||
Get_CloseSafetyValveLed()) then | |||
call Set_OpenSafetyValveLed(.true.) | |||
call Set_CloseSafetyValveLed(.false.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
module COpenSafetyValveLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_OpenSafetyValveLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_OpenSafetyValveLed=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_OpenSafetyValveLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_OpenSafetyValveLed() | |||
! use CDrillingConsoleVariables | |||
! use ConfigurationVariables | |||
! use ConfigurationVariables | |||
! implicit none | |||
! call OnOpenSafetyValvePress%Add(ButtonPress_OpenSafetyValve) | |||
! call OnOperationConditionChangeInt%Add(Set_Operation_OpenSafetyValveLed) | |||
! end subroutine | |||
subroutine Set_Operation_OpenSafetyValveLed(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%operation_OpenSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%operation_OpenSafetyValveLed = v | |||
#ifdef deb | |||
print*, 'data%State%notifications%operation_OpenSafetyValveLed=', data%State%notifications%operation_OpenSafetyValveLed | |||
#endif | |||
end subroutine | |||
subroutine ButtonPress_OpenSafetyValve() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'ButtonPress_OpenSafetyValve=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=56 | |||
if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.& | |||
Get_OpenSafetyValveLed() == .false. .and.& | |||
Get_CloseSafetyValveLed()) then | |||
call Set_CloseSafetyValveLed(.false.) | |||
call Set_OpenSafetyValveLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'ButtonPress_OpenSafetyValve=Kelly' | |||
#endif | |||
!OPERATION-CODE=58 | |||
if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.& | |||
Get_OpenSafetyValveLed() == .false. .and.& | |||
Get_CloseSafetyValveLed()) then | |||
call Set_OpenSafetyValveLed(.true.) | |||
call Set_CloseSafetyValveLed(.false.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
end module COpenSafetyValveLedNotification |
@@ -1,134 +1,134 @@ | |||
module CSlipsNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_SlipsNotification() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_SlipsNotification=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=28 | |||
if (Get_ZeroStringSpeed() .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_Slips() == SLIPS_UNSET_END .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then | |||
call Set_SlipsNotification(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=29 | |||
if (Get_ZeroStringSpeed() .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .or.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_STRING) .and.& | |||
Get_Slips() == SLIPS_SET_END .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then | |||
call Set_SlipsNotification(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_SlipsNotification=Kelly' | |||
#endif | |||
!OPERATION-CODE=53 | |||
if (Get_ZeroStringSpeed() .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
!Get_KellyConnection() == KELLY_CONNECTION_STRING | |||
Get_Slips() == SLIPS_UNSET_END .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then | |||
call Set_SlipsNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=77 | |||
if (Get_ZeroStringSpeed() .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_Slips() == SLIPS_SET_END .and.& | |||
Get_IsKellyBushingSetInTable() == .false. .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
(Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_KellyConnection() == KELLY_CONNECTION_STRING)) then | |||
call Set_SlipsNotification(.true.) | |||
return | |||
end if | |||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
! Get_ZeroStringSpeed() .and.& | |||
! Get_SlackOff() .and.& | |||
! Get_KellyConnection() == KELLY_CONNECTION_STRING) then | |||
! call Set_SlipsNotification(.true.) | |||
! return | |||
!end if | |||
! | |||
! | |||
!if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
! Get_ZeroStringSpeed() .and.& | |||
! Get_NearFloorConnection() >= 21 .and. Get_NearFloorConnection() <= 25 .and.& | |||
! Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING) then | |||
! call Set_SlipsNotification(.true.) | |||
! return | |||
!end if | |||
call Set_SlipsNotification(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_SlipsNotification() | |||
! implicit none | |||
! call OnOperationConditionChange%Add(Evaluate_SlipsNotification) | |||
! call OnSlackOffChange%Add(Evaluate_SlipsNotification) | |||
! call OnZeroStringSpeedChange%Add(Evaluate_SlipsNotification) | |||
! call OnNearFloorConnectionChange%Add(Evaluate_SlipsNotification) | |||
! call data%State%OperationScenario%OnElevatorConnectionChange%Add(Evaluate_SlipsNotification) | |||
! call OnKellyConnectionChange%Add(Evaluate_SlipsNotification) | |||
! call OnSlipsChange%Add(Evaluate_SlipsNotification) | |||
! end subroutine | |||
module CSlipsNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_SlipsNotification() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_SlipsNotification=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=28 | |||
if (Get_ZeroStringSpeed() .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_Slips() == SLIPS_UNSET_END .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then | |||
call Set_SlipsNotification(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=29 | |||
if (Get_ZeroStringSpeed() .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .or.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_STRING) .and.& | |||
Get_Slips() == SLIPS_SET_END .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then | |||
call Set_SlipsNotification(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_SlipsNotification=Kelly' | |||
#endif | |||
!OPERATION-CODE=53 | |||
if (Get_ZeroStringSpeed() .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
!Get_KellyConnection() == KELLY_CONNECTION_STRING | |||
Get_Slips() == SLIPS_UNSET_END .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then | |||
call Set_SlipsNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=77 | |||
if (Get_ZeroStringSpeed() .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_Slips() == SLIPS_SET_END .and.& | |||
Get_IsKellyBushingSetInTable() == .false. .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
(Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_KellyConnection() == KELLY_CONNECTION_STRING)) then | |||
call Set_SlipsNotification(.true.) | |||
return | |||
end if | |||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
! Get_ZeroStringSpeed() .and.& | |||
! Get_SlackOff() .and.& | |||
! Get_KellyConnection() == KELLY_CONNECTION_STRING) then | |||
! call Set_SlipsNotification(.true.) | |||
! return | |||
!end if | |||
! | |||
! | |||
!if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
! Get_ZeroStringSpeed() .and.& | |||
! Get_NearFloorConnection() >= 21 .and. Get_NearFloorConnection() <= 25 .and.& | |||
! Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING) then | |||
! call Set_SlipsNotification(.true.) | |||
! return | |||
!end if | |||
call Set_SlipsNotification(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_SlipsNotification() | |||
! implicit none | |||
! call OnOperationConditionChange%Add(Evaluate_SlipsNotification) | |||
! call OnSlackOffChange%Add(Evaluate_SlipsNotification) | |||
! call OnZeroStringSpeedChange%Add(Evaluate_SlipsNotification) | |||
! call OnNearFloorConnectionChange%Add(Evaluate_SlipsNotification) | |||
! call data%State%OperationScenario%OnElevatorConnectionChange%Add(Evaluate_SlipsNotification) | |||
! call OnKellyConnectionChange%Add(Evaluate_SlipsNotification) | |||
! call OnSlipsChange%Add(Evaluate_SlipsNotification) | |||
! end subroutine | |||
end module CSlipsNotification |
@@ -1,122 +1,122 @@ | |||
module CSwingLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_SwingLed() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_SwingLed=TopDrive' | |||
#endif | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_SwingLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=22 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + Get_NearFloorConnection()) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%LG) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
(Get_Swing() /= SWING_WELL_BEGIN .and.& | |||
Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& | |||
Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_SwingLed(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=23 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%PL) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%LG + data%State%OperationScenario%PL) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
(Get_Swing() /= SWING_WELL_BEGIN .and.& | |||
Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& | |||
Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_SwingLed(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=24 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HKL + Get_NearFloorConnection()) .and. Get_HookHeight() <= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%LG) .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& | |||
(Get_Swing() /= SWING_WELL_BEGIN .and.& | |||
Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& | |||
Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_SwingLed(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=25 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%PL) .and. Get_HookHeight() <= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%LG + data%State%OperationScenario%PL) .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
(Get_Swing() /= SWING_WELL_BEGIN .and.& | |||
Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& | |||
Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_SwingLed(.true.) | |||
return | |||
end if | |||
call Set_SwingLed(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_SwingLed() | |||
! implicit none | |||
! call OnOperationConditionChange%Add(Evaluate_SwingLed) | |||
! call OnHookHeightChange%Add(Evaluate_SwingLed) | |||
! call OnElevatorConnectionChange%Add(Evaluate_SwingLed) | |||
! call OnKellyConnectionChange%Add(Evaluate_SwingLed) | |||
! call OnSwingChange%Add(Evaluate_SwingLed) | |||
! call OnSlipsChange%Add(Evaluate_SwingLed) | |||
! call OnFillMouseHoleLedChange%Add(Evaluate_SwingLed) | |||
! end subroutine | |||
module CSwingLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_SwingLed() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_SwingLed=TopDrive' | |||
#endif | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_SwingLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=22 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + Get_NearFloorConnection()) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%LG) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
(Get_Swing() /= SWING_WELL_BEGIN .and.& | |||
Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& | |||
Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_SwingLed(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=23 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%PL) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%LG + data%State%OperationScenario%PL) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
(Get_Swing() /= SWING_WELL_BEGIN .and.& | |||
Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& | |||
Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_SwingLed(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=24 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HKL + Get_NearFloorConnection()) .and. Get_HookHeight() <= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%LG) .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& | |||
(Get_Swing() /= SWING_WELL_BEGIN .and.& | |||
Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& | |||
Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_SwingLed(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=25 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%PL) .and. Get_HookHeight() <= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%LG + data%State%OperationScenario%PL) .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
(Get_Swing() /= SWING_WELL_BEGIN .and.& | |||
Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& | |||
Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_SwingLed(.true.) | |||
return | |||
end if | |||
call Set_SwingLed(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_SwingLed() | |||
! implicit none | |||
! call OnOperationConditionChange%Add(Evaluate_SwingLed) | |||
! call OnHookHeightChange%Add(Evaluate_SwingLed) | |||
! call OnElevatorConnectionChange%Add(Evaluate_SwingLed) | |||
! call OnKellyConnectionChange%Add(Evaluate_SwingLed) | |||
! call OnSwingChange%Add(Evaluate_SwingLed) | |||
! call OnSlipsChange%Add(Evaluate_SwingLed) | |||
! call OnFillMouseHoleLedChange%Add(Evaluate_SwingLed) | |||
! end subroutine | |||
end module CSwingLedNotification |
@@ -1,72 +1,72 @@ | |||
module CTdsIbopLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_IbopLed() | |||
use CCommon | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IbopLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=61 | |||
if (Get_IbopLed() == .false. .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbop == .false.) then | |||
call Set_IbopLed(.true.) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_OFF | |||
return | |||
end if | |||
!TOPDRIVE-CODE=62 | |||
if (Get_IbopLed() .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbop) then | |||
call Set_IbopLed(.false.) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
return | |||
end if | |||
endif | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_IbopLed=Kelly' | |||
!#endif | |||
! | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_IbopLed() | |||
! implicit none | |||
! end subroutine | |||
module CTdsIbopLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_IbopLed() | |||
use CCommon | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IbopLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=61 | |||
if (Get_IbopLed() == .false. .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbop == .false.) then | |||
call Set_IbopLed(.true.) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_OFF | |||
return | |||
end if | |||
!TOPDRIVE-CODE=62 | |||
if (Get_IbopLed() .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbop) then | |||
call Set_IbopLed(.false.) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
return | |||
end if | |||
endif | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_IbopLed=Kelly' | |||
!#endif | |||
! | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_IbopLed() | |||
! implicit none | |||
! end subroutine | |||
end module CTdsIbopLedNotification |
@@ -1,49 +1,49 @@ | |||
module CTdsPowerLedNotification | |||
use OperationScenariosModule | |||
use SimulationVariables | |||
implicit none | |||
contains | |||
subroutine Evaluate_PowerLed() | |||
use CCommon | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_PowerLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=63 | |||
if (data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then | |||
call Set_PowerLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_PowerLed=Kelly' | |||
#endif | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_PowerLed() | |||
! implicit none | |||
! end subroutine | |||
module CTdsPowerLedNotification | |||
use OperationScenariosModule | |||
use SimulationVariables | |||
implicit none | |||
contains | |||
subroutine Evaluate_PowerLed() | |||
use CCommon | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_PowerLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=63 | |||
if (data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then | |||
call Set_PowerLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_PowerLed=Kelly' | |||
#endif | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_PowerLed() | |||
! implicit none | |||
! end subroutine | |||
end module CTdsPowerLedNotification |
@@ -1,59 +1,59 @@ | |||
module CTdsTorqueWrenchLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_TorqueWrenchLed() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_TorqueWrenchLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=81 | |||
if((Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_BEGIN .or.& | |||
Get_TdsBackupClamp() == BACKUP_CLAMP_FW_BEGIN) .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_TorqueWrenchLed(LED_BLINK) | |||
return | |||
endif | |||
!TOPDRIVE-CODE=81 | |||
if(Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_TorqueWrenchLed(LED_ON) | |||
return | |||
endif | |||
call Set_TorqueWrenchLed(LED_OFF) | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_SwingLed=Kelly' | |||
#endif | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_TorqueWrenchLed() | |||
! implicit none | |||
! end subroutine | |||
module CTdsTorqueWrenchLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_TorqueWrenchLed() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_TorqueWrenchLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=81 | |||
if((Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_BEGIN .or.& | |||
Get_TdsBackupClamp() == BACKUP_CLAMP_FW_BEGIN) .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_TorqueWrenchLed(LED_BLINK) | |||
return | |||
endif | |||
!TOPDRIVE-CODE=81 | |||
if(Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_TorqueWrenchLed(LED_ON) | |||
return | |||
endif | |||
call Set_TorqueWrenchLed(LED_OFF) | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_SwingLed=Kelly' | |||
#endif | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_TorqueWrenchLed() | |||
! implicit none | |||
! end subroutine | |||
end module CTdsTorqueWrenchLedNotification |
@@ -1,287 +1,287 @@ | |||
module CTongNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_TongNotification() | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_TongNotification=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=50 | |||
if (((Get_HookHeight() >= (TL() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + NFC() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG)) .or.& | |||
(Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG))).and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
((Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .or.& | |||
Get_Tong() == TONG_NEUTRAL ) .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING) .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=51 | |||
if (GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=52 | |||
if (GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_TongNotification=Kelly' | |||
#endif | |||
!OPERATION-CODE=44 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
!((Get_HookHeight() >= 65.0 .and. Get_HookHeight() <= 70.0) .or.& | |||
! (Get_HookHeight() >= 96.0 .and. Get_HookHeight() <= 101.0)).and.& | |||
((Get_HookHeight() >= (data%State%OperationScenario%HKL + Get_NearFloorConnection() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%TG)) .or.& | |||
(Get_HookHeight() >= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%PL -data%State%OperationScenario%RE) .and. Get_HookHeight() <= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%TG + data%State%OperationScenario%PL))).and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=45 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_HookHeight() >= 66 .and. Get_HookHeight() <= 69 .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=46 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=47 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=48 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=50 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
((Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + Get_NearFloorConnection() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG)) .or.& | |||
(Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%TG - data%State%OperationScenario%ECG + data%State%OperationScenario%SL))).and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=51 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=52 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
! Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& | |||
! Get_Swing() == SWING_WELL_END .and.& | |||
! Get_Slips() == SLIPS_SET_END) then | |||
! | |||
! call Set_TongNotification(.true.) | |||
! return | |||
!end if | |||
! | |||
call Set_TongNotification(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_TongNotification() | |||
! implicit none | |||
! call data%State%unitySignals%OnOperationConditionChange%Add(Evaluate_TongNotification) | |||
! ! call softwareInputs%OnHookHeightChange%Add(Evaluate_TongNotification) | |||
! call UnityInputs%OnJointConnectionPossibleChange%Add(Evaluate_TongNotification) | |||
! call UnityInputs%OnSingleSetInMouseHoleChange%Add(Evaluate_TongNotification) | |||
! call data%State%OperationScenario%OnElevatorConnectionChange%Add(Evaluate_TongNotification) | |||
! call KellyConnectionEnum%OnKellyConnectionChange%Add(Evaluate_TongNotification) | |||
! call data%State%unitySignals%OnSwingChange%Add(Evaluate_TongNotification) | |||
! call data%State%unitySignals%OnSlipsChange%Add(Evaluate_TongNotification) | |||
! end subroutine | |||
module CTongNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_TongNotification() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_TongNotification=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=50 | |||
if (((Get_HookHeight() >= (TL() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + NFC() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG)) .or.& | |||
(Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG))).and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
((Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .or.& | |||
Get_Tong() == TONG_NEUTRAL ) .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING) .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=51 | |||
if (GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=52 | |||
if (GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_TongNotification=Kelly' | |||
#endif | |||
!OPERATION-CODE=44 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
!((Get_HookHeight() >= 65.0 .and. Get_HookHeight() <= 70.0) .or.& | |||
! (Get_HookHeight() >= 96.0 .and. Get_HookHeight() <= 101.0)).and.& | |||
((Get_HookHeight() >= (data%State%OperationScenario%HKL + Get_NearFloorConnection() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%TG)) .or.& | |||
(Get_HookHeight() >= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%PL -data%State%OperationScenario%RE) .and. Get_HookHeight() <= (data%State%OperationScenario%HKL + Get_NearFloorConnection() + data%State%OperationScenario%TG + data%State%OperationScenario%PL))).and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=45 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_HookHeight() >= 66 .and. Get_HookHeight() <= 69 .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=46 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=47 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=48 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=50 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
((Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + Get_NearFloorConnection() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG)) .or.& | |||
(Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%TG - data%State%OperationScenario%ECG + data%State%OperationScenario%SL))).and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=51 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=52 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_JointConnectionPossible() .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND .and.& | |||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_TongNotification(.true.) | |||
return | |||
end if | |||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
! Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& | |||
! Get_Swing() == SWING_WELL_END .and.& | |||
! Get_Slips() == SLIPS_SET_END) then | |||
! | |||
! call Set_TongNotification(.true.) | |||
! return | |||
!end if | |||
! | |||
call Set_TongNotification(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_TongNotification() | |||
! implicit none | |||
! call data%State%unitySignals%OnOperationConditionChange%Add(Evaluate_TongNotification) | |||
! ! call softwareInputs%OnHookHeightChange%Add(Evaluate_TongNotification) | |||
! call UnityInputs%OnJointConnectionPossibleChange%Add(Evaluate_TongNotification) | |||
! call UnityInputs%OnSingleSetInMouseHoleChange%Add(Evaluate_TongNotification) | |||
! call data%State%OperationScenario%OnElevatorConnectionChange%Add(Evaluate_TongNotification) | |||
! call KellyConnectionEnum%OnKellyConnectionChange%Add(Evaluate_TongNotification) | |||
! call data%State%unitySignals%OnSwingChange%Add(Evaluate_TongNotification) | |||
! call data%State%unitySignals%OnSlipsChange%Add(Evaluate_TongNotification) | |||
! end subroutine | |||
end module CTongNotification |
@@ -1,216 +1,216 @@ | |||
module CUnlatchLedNotification | |||
use OperationScenariosModule | |||
use CLog4 | |||
implicit none | |||
contains | |||
subroutine Evaluate_UnlatchLed() | |||
use CCommon | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_UnlatchLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=47 | |||
if (Get_HookHeight() <= (TL() + NFC() - data%State%OperationScenario%ECG) .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_ElevatorPickup() == .false. .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING) .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_UnlatchLed(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=48 | |||
if ((Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC()) .and. Get_HookHeight() <= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() + data%State%OperationScenario%TG)) .and.& | |||
GetStandRack() > 80 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_UnlatchLed(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=49 | |||
if ((Get_HookHeight() >= TL() .and. Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SG)) .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_FillMouseHoleLed() == .false.) then | |||
call Set_UnlatchLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_UnlatchLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=40 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() - data%State%OperationScenario%ECG) .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_Elevator() == ELEVATOR_LATCH_STRING_END .and.& | |||
(Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.& | |||
!(Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.& | |||
!Get_LatchLed() == .false. | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END ) then | |||
call Set_UnlatchLed(.true.) | |||
!call Set_LatchLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=41 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection()) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection() + data%State%OperationScenario%LG) .and.& | |||
!Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL + RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG) .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_StandRack() < 80 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
!Get_Elevator() == ELEVATOR_UNLATCH_STAND_END .and.& | |||
!Get_LatchLed() == .false. | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_UnlatchLed(.true.) | |||
!call Set_LatchLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=42 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= data%State%OperationScenario%HL .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%SG) .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_Elevator() == ELEVATOR_UNLATCH_SINGLE_END .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
!Get_LatchLed() == .false. .and.& | |||
Get_FillMouseHoleLed() == .false.) then | |||
call Set_UnlatchLed(.true.) | |||
!call Set_LatchLed(.false.) | |||
return | |||
end if | |||
!call Log_4('OPERATION-CODE=43-OPERATION_DRILL=', Get_OperationCondition() == OPERATION_DRILL) | |||
!call Log_4('OPERATION-CODE=43-Get_HookHeight=', Get_HookHeight() >= 27.41) | |||
!call Log_4('OPERATION-CODE=43-Get_Swing()=', Get_Swing() == SWING_RAT_HOLE_END) | |||
!call Log_4('OPERATION-CODE=43-Get_LatchLed()=', Get_LatchLed() == .false.) | |||
!OPERATION-CODE=43 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_HookHeight() >= 27.41 .and.& | |||
!Get_LatchLed() == .false. | |||
Get_Swing() == SWING_RAT_HOLE_END) then | |||
!call Log_4('OPERATION-CODE=43-call Set_UnlatchLed(.true.)') | |||
call Set_UnlatchLed(.true.) | |||
!call Set_LatchLed(.false.) | |||
return | |||
end if | |||
call Set_UnlatchLed(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_UnlatchLed() | |||
! implicit none | |||
! !**call data%State%unitySignals%OnOperationConditionChange%Add(Evaluate_UnlatchLed) | |||
! ! call softwareInputs%OnHookHeightChange%Add(Evaluate_UnlatchLed) | |||
! ! call softwareInputs%OnStandRackChanged%Add(Evaluate_UnlatchLed) | |||
! call data%State%OperationScenario%OnElevatorConnectionChange%Add(Evaluate_UnlatchLed) | |||
! !**call data%State%unitySignals%OnSwingChange%Add(Evaluate_UnlatchLed) | |||
! !**call data%State%unitySignals%OnSlipsChange%Add(Evaluate_UnlatchLed) | |||
! !**call data%State%notifications%OnLatchLedChange%Add(Evaluate_UnlatchLed) | |||
! !**call data%State%notifications%OnFillMouseHoleLedChange%Add(Evaluate_UnlatchLed) | |||
! end subroutine | |||
module CUnlatchLedNotification | |||
use OperationScenariosModule | |||
use CLog4 | |||
implicit none | |||
contains | |||
subroutine Evaluate_UnlatchLed() | |||
use CCommon | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_UnlatchLed=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=47 | |||
if (Get_HookHeight() <= (TL() + NFC() - data%State%OperationScenario%ECG) .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_ElevatorPickup() == .false. .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING) .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_UnlatchLed(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=48 | |||
if ((Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC()) .and. Get_HookHeight() <= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() + data%State%OperationScenario%TG)) .and.& | |||
GetStandRack() > 80 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_UnlatchLed(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=49 | |||
if ((Get_HookHeight() >= TL() .and. Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SG)) .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_FillMouseHoleLed() == .false.) then | |||
call Set_UnlatchLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_UnlatchLed=Kelly' | |||
#endif | |||
!OPERATION-CODE=40 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() - data%State%OperationScenario%ECG) .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_Elevator() == ELEVATOR_LATCH_STRING_END .and.& | |||
(Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.& | |||
!(Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.& | |||
!Get_LatchLed() == .false. | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END ) then | |||
call Set_UnlatchLed(.true.) | |||
!call Set_LatchLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=41 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection()) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection() + data%State%OperationScenario%LG) .and.& | |||
!Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL + RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG) .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
Get_StandRack() < 80 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
!Get_Elevator() == ELEVATOR_UNLATCH_STAND_END .and.& | |||
!Get_LatchLed() == .false. | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_Slips() == SLIPS_SET_END) then | |||
call Set_UnlatchLed(.true.) | |||
!call Set_LatchLed(.false.) | |||
return | |||
end if | |||
!OPERATION-CODE=42 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= data%State%OperationScenario%HL .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%SG) .and.& | |||
(Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.& | |||
Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.& | |||
!Get_Elevator() == ELEVATOR_UNLATCH_SINGLE_END .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
!Get_LatchLed() == .false. .and.& | |||
Get_FillMouseHoleLed() == .false.) then | |||
call Set_UnlatchLed(.true.) | |||
!call Set_LatchLed(.false.) | |||
return | |||
end if | |||
!call Log_4('OPERATION-CODE=43-OPERATION_DRILL=', Get_OperationCondition() == OPERATION_DRILL) | |||
!call Log_4('OPERATION-CODE=43-Get_HookHeight=', Get_HookHeight() >= 27.41) | |||
!call Log_4('OPERATION-CODE=43-Get_Swing()=', Get_Swing() == SWING_RAT_HOLE_END) | |||
!call Log_4('OPERATION-CODE=43-Get_LatchLed()=', Get_LatchLed() == .false.) | |||
!OPERATION-CODE=43 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_HookHeight() >= 27.41 .and.& | |||
!Get_LatchLed() == .false. | |||
Get_Swing() == SWING_RAT_HOLE_END) then | |||
!call Log_4('OPERATION-CODE=43-call Set_UnlatchLed(.true.)') | |||
call Set_UnlatchLed(.true.) | |||
!call Set_LatchLed(.false.) | |||
return | |||
end if | |||
call Set_UnlatchLed(.false.) | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_UnlatchLed() | |||
! implicit none | |||
! !**call data%State%unitySignals%OnOperationConditionChange%Add(Evaluate_UnlatchLed) | |||
! ! call softwareInputs%OnHookHeightChange%Add(Evaluate_UnlatchLed) | |||
! ! call softwareInputs%OnStandRackChanged%Add(Evaluate_UnlatchLed) | |||
! call data%State%OperationScenario%OnElevatorConnectionChange%Add(Evaluate_UnlatchLed) | |||
! !**call data%State%unitySignals%OnSwingChange%Add(Evaluate_UnlatchLed) | |||
! !**call data%State%unitySignals%OnSlipsChange%Add(Evaluate_UnlatchLed) | |||
! !**call data%State%notifications%OnLatchLedChange%Add(Evaluate_UnlatchLed) | |||
! !**call data%State%notifications%OnFillMouseHoleLedChange%Add(Evaluate_UnlatchLed) | |||
! end subroutine | |||
end module CUnlatchLedNotification |
@@ -1,25 +1,25 @@ | |||
module NotificationVariables | |||
! use CVoidEventHandlerCollection | |||
implicit none | |||
type::NotificationType | |||
logical :: CloseKellyCockLed = .false. | |||
logical :: CloseSafetyValveLed = .false. | |||
integer :: operation_CloseSafetyValveLed = 0 | |||
logical :: FillMouseHoleLed = .false. | |||
logical :: IrIBopLed = .false. | |||
logical :: IrSafetyValveLed = .false. | |||
integer :: operation_IrSafetyValveLed = 0 | |||
logical :: LatchLed = .false. | |||
logical :: OpenKellyCockLed = .false. | |||
logical :: OpenSafetyValveLed = .false. | |||
integer :: operation_OpenSafetyValveLed = 0 | |||
logical :: SlipsNotification = .false. | |||
logical :: SwingLed = .false. | |||
logical :: IbopLed = .false. | |||
logical :: PowerLed = .false. | |||
integer :: TorqueWrenchLed = 0 | |||
logical :: TongNotification = .false. | |||
logical :: UnlatchLed = .false. | |||
end type NotificationType | |||
contains | |||
module NotificationVariables | |||
! use CVoidEventHandlerCollection | |||
implicit none | |||
type::NotificationType | |||
logical :: CloseKellyCockLed = .false. | |||
logical :: CloseSafetyValveLed = .false. | |||
integer :: operation_CloseSafetyValveLed = 0 | |||
logical :: FillMouseHoleLed = .false. | |||
logical :: IrIBopLed = .false. | |||
logical :: IrSafetyValveLed = .false. | |||
integer :: operation_IrSafetyValveLed = 0 | |||
logical :: LatchLed = .false. | |||
logical :: OpenKellyCockLed = .false. | |||
logical :: OpenSafetyValveLed = .false. | |||
integer :: operation_OpenSafetyValveLed = 0 | |||
logical :: SlipsNotification = .false. | |||
logical :: SwingLed = .false. | |||
logical :: IbopLed = .false. | |||
logical :: PowerLed = .false. | |||
integer :: TorqueWrenchLed = 0 | |||
logical :: TongNotification = .false. | |||
logical :: UnlatchLed = .false. | |||
end type NotificationType | |||
contains | |||
end module NotificationVariables |
@@ -1,408 +1,408 @@ | |||
module NotificationModule | |||
use SimulationVariables | |||
implicit none | |||
contains | |||
subroutine Set_UnlatchLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
!use CLatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%UnlatchLed == v) return | |||
#endif | |||
data%State%notifications%UnlatchLed = v | |||
if(data%State%notifications%UnlatchLed) then | |||
data%EquipmentControl%DrillingConsole%UnlatchPipeLED = 1 | |||
!call Set_LatchLed(.false.) | |||
else | |||
data%EquipmentControl%DrillingConsole%UnlatchPipeLED = 0 | |||
endif | |||
!**call data%State%notifications%OnUnlatchLedChange%RunAll() | |||
end subroutine | |||
logical function Get_UnlatchLed() | |||
implicit none | |||
Get_UnlatchLed = data%State%notifications%UnlatchLed | |||
end function | |||
subroutine Set_TongNotification(v) | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%TongNotification == v) return | |||
#endif | |||
data%State%notifications%TongNotification = v | |||
! if(associated(data%State%notifications%TongNotificationPtr)) !**call data%State%notifications%TongNotificationPtr(data%State%notifications%TongNotification) | |||
#ifdef deb | |||
print*, 'data%State%notifications%TongNotification=', data%State%notifications%TongNotification | |||
#endif | |||
!**call data%State%notifications%OnTongNotificationChange%RunAll() | |||
end subroutine | |||
logical function Get_TongNotification() | |||
implicit none | |||
Get_TongNotification = data%State%notifications%TongNotification | |||
end function | |||
subroutine Set_TorqueWrenchLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrenchLed | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%TorqueWrenchLed == v) return | |||
#endif | |||
data%State%notifications%TorqueWrenchLed = v | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrenchLed = v | |||
!**call data%State%notifications%OnTorqueWrenchLedChange%RunAll() | |||
end subroutine | |||
logical function Get_TorqueWrenchLed() | |||
implicit none | |||
Get_TorqueWrenchLed = data%State%notifications%TorqueWrenchLed | |||
end function | |||
subroutine Set_PowerLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed | |||
!use CLatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%PowerLed == v) return | |||
#endif | |||
data%State%notifications%PowerLed = v | |||
if(data%State%notifications%PowerLed) then | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed = 1 | |||
!call Set_LatchLed(.false.) | |||
else | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed = 0 | |||
endif | |||
!**call data%State%notifications%OnPowerLedChange%RunAll() | |||
end subroutine | |||
logical function Get_PowerLed() | |||
implicit none | |||
Get_PowerLed = data%State%notifications%PowerLed | |||
end function | |||
subroutine Set_IbopLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%EquipmentControl%TopDrivePanel%TopDriveIbopLed | |||
use CManifolds, Only: OpenTopDriveIBop, CloseTopDriveIBop | |||
!use CLatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%IbopLed == v) return | |||
#endif | |||
data%State%notifications%IbopLed = v | |||
if(data%State%notifications%IbopLed) then | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbopLed = 1 | |||
call CloseTopDriveIBop() | |||
else | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbopLed = 0 | |||
call OpenTopDriveIBop() | |||
endif | |||
!**call data%State%notifications%OnIbopLedChange%RunAll() | |||
end subroutine | |||
logical function Get_IbopLed() | |||
implicit none | |||
Get_IbopLed = data%State%notifications%IbopLed | |||
end function | |||
subroutine Set_SwingLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: SwingLedHw => SwingLed | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%SwingLed == v) return | |||
#endif | |||
data%State%notifications%SwingLed = v | |||
if(data%State%notifications%SwingLed) then | |||
data%EquipmentControl%DrillingConsole%SwingLed = 1 | |||
else | |||
data%EquipmentControl%DrillingConsole%SwingLed = 0 | |||
endif | |||
!**call data%State%notifications%OnSwingLedChange%RunAll() | |||
end subroutine | |||
logical function Get_SwingLed() | |||
implicit none | |||
Get_SwingLed = data%State%notifications%SwingLed | |||
end function | |||
subroutine Set_SlipsNotification(v) | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%SlipsNotification == v) return | |||
#endif | |||
data%State%notifications%SlipsNotification = v | |||
! if(associated(data%State%notifications%SlipsNotificationPtr)) !**call data%State%notifications%SlipsNotificationPtr(data%State%notifications%SlipsNotification) | |||
#ifdef deb | |||
print*, 'data%State%notifications%SlipsNotification=', data%State%notifications%SlipsNotification | |||
#endif | |||
!**call data%State%notifications%OnSlipsNotificationChange%RunAll() | |||
end subroutine | |||
logical function Get_SlipsNotification() | |||
implicit none | |||
Get_SlipsNotification = data%State%notifications%SlipsNotification | |||
end function | |||
subroutine Set_OpenSafetyValveLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: OpenSafetyValveLedHw => OpenSafetyValveLed | |||
use CManifolds, only: OpenSafetyValve_TopDrive, OpenSafetyValve_KellyMode, OpenSafetyValve_TripMode | |||
use CHoistingVariables | |||
use SimulationVariables!, only: data%State%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%OpenSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%OpenSafetyValveLed = v | |||
if(data%State%notifications%OpenSafetyValveLed) then | |||
!!call OpenSafetyValve() | |||
if(data%State%Hoisting%DriveType == TopDrive_DriveType) call OpenSafetyValve_TopDrive() | |||
if(data%State%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_OpenSafetyValveLed == 0) call OpenSafetyValve_KellyMode() | |||
if(data%State%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_OpenSafetyValveLed == 1) call OpenSafetyValve_TripMode() | |||
endif | |||
!**call data%State%notifications%OnOpenSafetyValveLedChange%RunAll() | |||
end subroutine | |||
logical function Get_OpenSafetyValveLed() | |||
implicit none | |||
Get_OpenSafetyValveLed = data%State%notifications%OpenSafetyValveLed | |||
end function | |||
subroutine Set_OpenKellyCockLed(v) | |||
! use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: OpenKellyCockLedHw => OpenKellyCockLed | |||
use CManifolds, only: OpenKellyCock | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%OpenKellyCockLed == v) return | |||
#endif | |||
data%State%notifications%OpenKellyCockLed = v | |||
if(data%State%notifications%OpenKellyCockLed) then | |||
call OpenKellyCock() | |||
endif | |||
! HAS BEEN IMPLEMENTED IN CMANIFOLD | |||
!if(OpenKellyCockLed) then | |||
! OpenKellyCockLedHw = 1 | |||
!else | |||
! OpenKellyCockLedHw = 0 | |||
!endif | |||
!**call data%State%notifications%OnOpenKellyCockLedChange%RunAll() | |||
end subroutine | |||
logical function Get_OpenKellyCockLed() | |||
implicit none | |||
Get_OpenKellyCockLed = data%State%notifications%OpenKellyCockLed | |||
end function | |||
subroutine Set_LatchLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%EquipmentControl%DrillingConsole%LatchPipeLED | |||
!use CUnlatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%LatchLed == v) return | |||
#endif | |||
data%State%notifications%LatchLed = v | |||
if(data%State%notifications%LatchLed) then | |||
data%EquipmentControl%DrillingConsole%LatchPipeLED = 1 | |||
!call Set_UnlatchLed(.false.) | |||
else | |||
data%EquipmentControl%DrillingConsole%LatchPipeLED = 0 | |||
endif | |||
!**call data%State%notifications%OnLatchLedChange%RunAll() | |||
end subroutine | |||
logical function Get_LatchLed() | |||
implicit none | |||
Get_LatchLed = data%State%notifications%LatchLed | |||
end function | |||
subroutine Set_IrSafetyValveLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%EquipmentControl%DrillingConsole%CloseKellyCockLed => IRSafetyValveLed | |||
use CManifolds, only: & | |||
InstallSafetyValve_TopDrive, & | |||
InstallSafetyValve_KellyMode, & | |||
InstallSafetyValve_TripMode, & | |||
RemoveSafetyValve_TopDrive, & | |||
RemoveSafetyValve_KellyMode, & | |||
RemoveSafetyValve_TripMode | |||
use UnitySignalVariables | |||
use UnitySignalsModule, only: Set_SafetyValve_Install, Set_SafetyValve_Remove | |||
use CHoistingVariables | |||
use SimulationVariables!, only: data%State%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%IrSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%IrSafetyValveLed = v | |||
if(data%State%notifications%IrSafetyValveLed) then | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 1 | |||
if(data%State%Hoisting%DriveType == TopDrive_DriveType) call InstallSafetyValve_TopDrive() | |||
if(data%State%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call InstallSafetyValve_KellyMode() | |||
if(data%State%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call InstallSafetyValve_TripMode() | |||
call Set_SafetyValve_Install() | |||
else | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 0 | |||
if(data%State%Hoisting%DriveType == TopDrive_DriveType) call RemoveSafetyValve_TopDrive() | |||
if(data%State%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call RemoveSafetyValve_KellyMode() | |||
if(data%State%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call RemoveSafetyValve_TripMode() | |||
call Set_SafetyValve_Remove() | |||
endif | |||
!**call data%State%notifications%OnIrSafetyValveLedChange%RunAll() | |||
end subroutine | |||
logical function Get_IrSafetyValveLed() | |||
implicit none | |||
Get_IrSafetyValveLed = data%State%notifications%IrSafetyValveLed | |||
end function | |||
subroutine Set_IrIBopLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: IRIBopLedHw => IRIBopLed | |||
use CManifolds, only: InstallIBop, RemoveIBop | |||
use UnitySignalVariables | |||
use UnitySignalsModule, only: Set_Ibop_Install, Set_Ibop_Remove | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%IrIBopLed == v) return | |||
#endif | |||
data%State%notifications%IrIBopLed = v | |||
if(data%State%notifications%IrIBopLed) then | |||
data%EquipmentControl%DrillingConsole%IRIBopLed = 1 | |||
call InstallIBop() | |||
call Set_Ibop_Install() | |||
else | |||
data%EquipmentControl%DrillingConsole%IRIBopLed = 0 | |||
call RemoveIBop() | |||
call Set_Ibop_Remove() | |||
endif | |||
!**call data%State%notifications%OnIrIBopLedChange%RunAll() | |||
end subroutine | |||
logical function Get_IrIBopLed() | |||
implicit none | |||
Get_IrIBopLed = data%State%notifications%IrIBopLed | |||
end function | |||
subroutine Set_FillMouseHoleLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: FillMouseHoleLedHw => FillMouseHoleLed | |||
! use CMouseHoleEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%FillMouseHoleLed == v) return | |||
#endif | |||
data%State%notifications%FillMouseHoleLed = v | |||
if(data%State%notifications%FillMouseHoleLed) then | |||
data%EquipmentControl%DrillingConsole%FillMouseHoleLed = 1 | |||
!call Set_MouseHole(MOUSE_HOLE_FILL) | |||
else | |||
data%EquipmentControl%DrillingConsole%FillMouseHoleLed = 0 | |||
!call Set_MouseHole(MOUSE_HOLE_EMPTY) | |||
endif | |||
!**call data%State%notifications%OnFillMouseHoleLedChange%RunAll() | |||
end subroutine | |||
logical function Get_FillMouseHoleLed() | |||
implicit none | |||
Get_FillMouseHoleLed = data%State%notifications%FillMouseHoleLed | |||
end function | |||
subroutine Set_CloseKellyCockLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: CloseKellyCockLedHw => CloseKellyCockLed | |||
use CManifolds, only: CloseKellyCock | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%CloseKellyCockLed == v) return | |||
#endif | |||
data%State%notifications%CloseKellyCockLed = v | |||
if(data%State%notifications%CloseKellyCockLed) then | |||
call CloseKellyCock() | |||
endif | |||
!**call data%State%notifications%OnCloseKellyCockLedChange%RunAll() | |||
end subroutine | |||
logical function Get_CloseKellyCockLed() | |||
implicit none | |||
Get_CloseKellyCockLed = data%State%notifications%CloseKellyCockLed | |||
end function | |||
subroutine Set_CloseSafetyValveLed(v) | |||
! use CDrillingConsoleVariables | |||
use SimulationVariables | |||
!@use ConfigurationVariables, only: CloseSafetyValveLedHw => CloseSafetyValveLed | |||
use CManifolds, only: CloseSafetyValve_TopDrive, CloseSafetyValve_KellyMode, CloseSafetyValve_TripMode | |||
use CHoistingVariables | |||
use SimulationVariables!, only: data%State%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%CloseSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%CloseSafetyValveLed = v | |||
if(data%State%notifications%CloseSafetyValveLed) then | |||
!!call CloseSafetyValve() | |||
if(data%State%Hoisting%DriveType == TopDrive_DriveType) call CloseSafetyValve_TopDrive() | |||
if(data%State%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_CloseSafetyValveLed == 0) call CloseSafetyValve_KellyMode() | |||
if(data%State%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_CloseSafetyValveLed == 1) call CloseSafetyValve_TripMode() | |||
endif | |||
!**call data%State%notifications%OnCloseSafetyValveLedChange%RunAll() | |||
end subroutine | |||
logical function Get_CloseSafetyValveLed() | |||
implicit none | |||
Get_CloseSafetyValveLed = data%State%notifications%CloseSafetyValveLed | |||
end function | |||
end module NotificationModule | |||
module NotificationModule | |||
use SimulationVariables | |||
implicit none | |||
contains | |||
subroutine Set_UnlatchLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
!use CLatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%UnlatchLed == v) return | |||
#endif | |||
data%State%notifications%UnlatchLed = v | |||
if(data%State%notifications%UnlatchLed) then | |||
data%EquipmentControl%DrillingConsole%UnlatchPipeLED = 1 | |||
!call Set_LatchLed(.false.) | |||
else | |||
data%EquipmentControl%DrillingConsole%UnlatchPipeLED = 0 | |||
endif | |||
!**call data%State%notifications%OnUnlatchLedChange%RunAll() | |||
end subroutine | |||
logical function Get_UnlatchLed() | |||
implicit none | |||
Get_UnlatchLed = data%State%notifications%UnlatchLed | |||
end function | |||
subroutine Set_TongNotification(v) | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%TongNotification == v) return | |||
#endif | |||
data%State%notifications%TongNotification = v | |||
! if(associated(data%State%notifications%TongNotificationPtr)) !**call data%State%notifications%TongNotificationPtr(data%State%notifications%TongNotification) | |||
#ifdef deb | |||
print*, 'data%State%notifications%TongNotification=', data%State%notifications%TongNotification | |||
#endif | |||
!**call data%State%notifications%OnTongNotificationChange%RunAll() | |||
end subroutine | |||
logical function Get_TongNotification() | |||
implicit none | |||
Get_TongNotification = data%State%notifications%TongNotification | |||
end function | |||
subroutine Set_TorqueWrenchLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrenchLed | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%TorqueWrenchLed == v) return | |||
#endif | |||
data%State%notifications%TorqueWrenchLed = v | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrenchLed = v | |||
!**call data%State%notifications%OnTorqueWrenchLedChange%RunAll() | |||
end subroutine | |||
logical function Get_TorqueWrenchLed() | |||
implicit none | |||
Get_TorqueWrenchLed = data%State%notifications%TorqueWrenchLed | |||
end function | |||
subroutine Set_PowerLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed | |||
!use CLatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%PowerLed == v) return | |||
#endif | |||
data%State%notifications%PowerLed = v | |||
if(data%State%notifications%PowerLed) then | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed = 1 | |||
!call Set_LatchLed(.false.) | |||
else | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed = 0 | |||
endif | |||
!**call data%State%notifications%OnPowerLedChange%RunAll() | |||
end subroutine | |||
logical function Get_PowerLed() | |||
implicit none | |||
Get_PowerLed = data%State%notifications%PowerLed | |||
end function | |||
subroutine Set_IbopLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%EquipmentControl%TopDrivePanel%TopDriveIbopLed | |||
use CManifolds, Only: OpenTopDriveIBop, CloseTopDriveIBop | |||
!use CLatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%IbopLed == v) return | |||
#endif | |||
data%State%notifications%IbopLed = v | |||
if(data%State%notifications%IbopLed) then | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbopLed = 1 | |||
call CloseTopDriveIBop() | |||
else | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbopLed = 0 | |||
call OpenTopDriveIBop() | |||
endif | |||
!**call data%State%notifications%OnIbopLedChange%RunAll() | |||
end subroutine | |||
logical function Get_IbopLed() | |||
implicit none | |||
Get_IbopLed = data%State%notifications%IbopLed | |||
end function | |||
subroutine Set_SwingLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: SwingLedHw => SwingLed | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%SwingLed == v) return | |||
#endif | |||
data%State%notifications%SwingLed = v | |||
if(data%State%notifications%SwingLed) then | |||
data%EquipmentControl%DrillingConsole%SwingLed = 1 | |||
else | |||
data%EquipmentControl%DrillingConsole%SwingLed = 0 | |||
endif | |||
!**call data%State%notifications%OnSwingLedChange%RunAll() | |||
end subroutine | |||
logical function Get_SwingLed() | |||
implicit none | |||
Get_SwingLed = data%State%notifications%SwingLed | |||
end function | |||
subroutine Set_SlipsNotification(v) | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%SlipsNotification == v) return | |||
#endif | |||
data%State%notifications%SlipsNotification = v | |||
! if(associated(data%State%notifications%SlipsNotificationPtr)) !**call data%State%notifications%SlipsNotificationPtr(data%State%notifications%SlipsNotification) | |||
#ifdef deb | |||
print*, 'data%State%notifications%SlipsNotification=', data%State%notifications%SlipsNotification | |||
#endif | |||
!**call data%State%notifications%OnSlipsNotificationChange%RunAll() | |||
end subroutine | |||
logical function Get_SlipsNotification() | |||
implicit none | |||
Get_SlipsNotification = data%State%notifications%SlipsNotification | |||
end function | |||
subroutine Set_OpenSafetyValveLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: OpenSafetyValveLedHw => OpenSafetyValveLed | |||
use CManifolds, only: OpenSafetyValve_TopDrive, OpenSafetyValve_KellyMode, OpenSafetyValve_TripMode | |||
use CHoistingVariables | |||
use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%OpenSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%OpenSafetyValveLed = v | |||
if(data%State%notifications%OpenSafetyValveLed) then | |||
!!call OpenSafetyValve() | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call OpenSafetyValve_TopDrive() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_OpenSafetyValveLed == 0) call OpenSafetyValve_KellyMode() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_OpenSafetyValveLed == 1) call OpenSafetyValve_TripMode() | |||
endif | |||
!**call data%State%notifications%OnOpenSafetyValveLedChange%RunAll() | |||
end subroutine | |||
logical function Get_OpenSafetyValveLed() | |||
implicit none | |||
Get_OpenSafetyValveLed = data%State%notifications%OpenSafetyValveLed | |||
end function | |||
subroutine Set_OpenKellyCockLed(v) | |||
! use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: OpenKellyCockLedHw => OpenKellyCockLed | |||
use CManifolds, only: OpenKellyCock | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%OpenKellyCockLed == v) return | |||
#endif | |||
data%State%notifications%OpenKellyCockLed = v | |||
if(data%State%notifications%OpenKellyCockLed) then | |||
call OpenKellyCock() | |||
endif | |||
! HAS BEEN IMPLEMENTED IN CMANIFOLD | |||
!if(OpenKellyCockLed) then | |||
! OpenKellyCockLedHw = 1 | |||
!else | |||
! OpenKellyCockLedHw = 0 | |||
!endif | |||
!**call data%State%notifications%OnOpenKellyCockLedChange%RunAll() | |||
end subroutine | |||
logical function Get_OpenKellyCockLed() | |||
implicit none | |||
Get_OpenKellyCockLed = data%State%notifications%OpenKellyCockLed | |||
end function | |||
subroutine Set_LatchLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%EquipmentControl%DrillingConsole%LatchPipeLED | |||
!use CUnlatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%LatchLed == v) return | |||
#endif | |||
data%State%notifications%LatchLed = v | |||
if(data%State%notifications%LatchLed) then | |||
data%EquipmentControl%DrillingConsole%LatchPipeLED = 1 | |||
!call Set_UnlatchLed(.false.) | |||
else | |||
data%EquipmentControl%DrillingConsole%LatchPipeLED = 0 | |||
endif | |||
!**call data%State%notifications%OnLatchLedChange%RunAll() | |||
end subroutine | |||
logical function Get_LatchLed() | |||
implicit none | |||
Get_LatchLed = data%State%notifications%LatchLed | |||
end function | |||
subroutine Set_IrSafetyValveLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%EquipmentControl%DrillingConsole%CloseKellyCockLed => IRSafetyValveLed | |||
use CManifolds, only: & | |||
InstallSafetyValve_TopDrive, & | |||
InstallSafetyValve_KellyMode, & | |||
InstallSafetyValve_TripMode, & | |||
RemoveSafetyValve_TopDrive, & | |||
RemoveSafetyValve_KellyMode, & | |||
RemoveSafetyValve_TripMode | |||
use UnitySignalVariables | |||
use UnitySignalsModule, only: Set_SafetyValve_Install, Set_SafetyValve_Remove | |||
use CHoistingVariables | |||
use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%IrSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%IrSafetyValveLed = v | |||
if(data%State%notifications%IrSafetyValveLed) then | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 1 | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call InstallSafetyValve_TopDrive() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call InstallSafetyValve_KellyMode() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call InstallSafetyValve_TripMode() | |||
call Set_SafetyValve_Install() | |||
else | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 0 | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call RemoveSafetyValve_TopDrive() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call RemoveSafetyValve_KellyMode() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call RemoveSafetyValve_TripMode() | |||
call Set_SafetyValve_Remove() | |||
endif | |||
!**call data%State%notifications%OnIrSafetyValveLedChange%RunAll() | |||
end subroutine | |||
logical function Get_IrSafetyValveLed() | |||
implicit none | |||
Get_IrSafetyValveLed = data%State%notifications%IrSafetyValveLed | |||
end function | |||
subroutine Set_IrIBopLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: IRIBopLedHw => IRIBopLed | |||
use CManifolds, only: InstallIBop, RemoveIBop | |||
use UnitySignalVariables | |||
use UnitySignalsModule, only: Set_Ibop_Install, Set_Ibop_Remove | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%IrIBopLed == v) return | |||
#endif | |||
data%State%notifications%IrIBopLed = v | |||
if(data%State%notifications%IrIBopLed) then | |||
data%EquipmentControl%DrillingConsole%IRIBopLed = 1 | |||
call InstallIBop() | |||
call Set_Ibop_Install() | |||
else | |||
data%EquipmentControl%DrillingConsole%IRIBopLed = 0 | |||
call RemoveIBop() | |||
call Set_Ibop_Remove() | |||
endif | |||
!**call data%State%notifications%OnIrIBopLedChange%RunAll() | |||
end subroutine | |||
logical function Get_IrIBopLed() | |||
implicit none | |||
Get_IrIBopLed = data%State%notifications%IrIBopLed | |||
end function | |||
subroutine Set_FillMouseHoleLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: FillMouseHoleLedHw => FillMouseHoleLed | |||
! use CMouseHoleEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%FillMouseHoleLed == v) return | |||
#endif | |||
data%State%notifications%FillMouseHoleLed = v | |||
if(data%State%notifications%FillMouseHoleLed) then | |||
data%EquipmentControl%DrillingConsole%FillMouseHoleLed = 1 | |||
!call Set_MouseHole(MOUSE_HOLE_FILL) | |||
else | |||
data%EquipmentControl%DrillingConsole%FillMouseHoleLed = 0 | |||
!call Set_MouseHole(MOUSE_HOLE_EMPTY) | |||
endif | |||
!**call data%State%notifications%OnFillMouseHoleLedChange%RunAll() | |||
end subroutine | |||
logical function Get_FillMouseHoleLed() | |||
implicit none | |||
Get_FillMouseHoleLed = data%State%notifications%FillMouseHoleLed | |||
end function | |||
subroutine Set_CloseKellyCockLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: CloseKellyCockLedHw => CloseKellyCockLed | |||
use CManifolds, only: CloseKellyCock | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%CloseKellyCockLed == v) return | |||
#endif | |||
data%State%notifications%CloseKellyCockLed = v | |||
if(data%State%notifications%CloseKellyCockLed) then | |||
call CloseKellyCock() | |||
endif | |||
!**call data%State%notifications%OnCloseKellyCockLedChange%RunAll() | |||
end subroutine | |||
logical function Get_CloseKellyCockLed() | |||
implicit none | |||
Get_CloseKellyCockLed = data%State%notifications%CloseKellyCockLed | |||
end function | |||
subroutine Set_CloseSafetyValveLed(v) | |||
! use CDrillingConsoleVariables | |||
use SimulationVariables | |||
!@use ConfigurationVariables, only: CloseSafetyValveLedHw => CloseSafetyValveLed | |||
use CManifolds, only: CloseSafetyValve_TopDrive, CloseSafetyValve_KellyMode, CloseSafetyValve_TripMode | |||
use CHoistingVariables | |||
use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%CloseSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%CloseSafetyValveLed = v | |||
if(data%State%notifications%CloseSafetyValveLed) then | |||
!!call CloseSafetyValve() | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call CloseSafetyValve_TopDrive() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_CloseSafetyValveLed == 0) call CloseSafetyValve_KellyMode() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_CloseSafetyValveLed == 1) call CloseSafetyValve_TripMode() | |||
endif | |||
!**call data%State%notifications%OnCloseSafetyValveLedChange%RunAll() | |||
end subroutine | |||
logical function Get_CloseSafetyValveLed() | |||
implicit none | |||
Get_CloseSafetyValveLed = data%State%notifications%CloseSafetyValveLed | |||
end function | |||
end module NotificationModule | |||
@@ -1,54 +1,54 @@ | |||
module CFillupHeadPermission | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_FillupHeadPermission() | |||
! use UnitySignalsModule !for CTdsConnectionModesEnum | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_FillupHeadPermission=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=66 | |||
if (Get_NearFloorConnection() >= 3 .and. Get_NearFloorConnection() <= 10 .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | |||
call Set_FillupHeadPermission(.true.) | |||
return | |||
end if | |||
call Set_FillupHeadPermission(.false.) | |||
endif | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_FillupHeadPermission=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
subroutine Subscribe_FillupHeadPermission() | |||
implicit none | |||
end subroutine | |||
module CFillupHeadPermission | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_FillupHeadPermission() | |||
! use UnitySignalsModule !for CTdsConnectionModesEnum | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_FillupHeadPermission=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=66 | |||
if (Get_NearFloorConnection() >= 3 .and. Get_NearFloorConnection() <= 10 .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | |||
call Set_FillupHeadPermission(.true.) | |||
return | |||
end if | |||
call Set_FillupHeadPermission(.false.) | |||
endif | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_FillupHeadPermission=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
subroutine Subscribe_FillupHeadPermission() | |||
implicit none | |||
end subroutine | |||
end module CFillupHeadPermission |
@@ -1,76 +1,76 @@ | |||
module CInstallFillupHeadPermission | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_InstallFillupHeadPermission() | |||
use TD_DrillStemComponents | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_InstallFillupHeadPermission=TopDrive' | |||
#endif | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_InstallFillupHeadPermission=Kelly' | |||
#endif | |||
!!OPERATION-CODE=69 | |||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
! Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
! Get_JointConnectionPossible() == .false. .and.& | |||
! Get_KellyConnection() /= KELLY_CONNECTION_STRING .and.& | |||
! Get_Slips() == SLIPS_SET_END) then | |||
! | |||
! call Set_InstallFillupHeadPermission(.true.) | |||
! return | |||
!end if | |||
!OPERATION-CODE=70 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
data%State%TD_String%TopJointHeight >= 3.0 .and. data%State%TD_String%TopJointHeight <= 9.0 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
!Get_ElevatorConnectionPossible() == .false. .and.& | |||
!Get_ElevatorConnection() /= ELEVATOR_CONNECTION_STRING .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING) then | |||
call Set_InstallFillupHeadPermission(.true.) | |||
return | |||
end if | |||
call Set_InstallFillupHeadPermission(.false.) | |||
endif | |||
end subroutine | |||
subroutine Subscribe_InstallFillupHeadPermission() | |||
implicit none | |||
! imp me... | |||
end subroutine | |||
module CInstallFillupHeadPermission | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_InstallFillupHeadPermission() | |||
use TD_DrillStemComponents | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_InstallFillupHeadPermission=TopDrive' | |||
#endif | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_InstallFillupHeadPermission=Kelly' | |||
#endif | |||
!!OPERATION-CODE=69 | |||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
! Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
! Get_JointConnectionPossible() == .false. .and.& | |||
! Get_KellyConnection() /= KELLY_CONNECTION_STRING .and.& | |||
! Get_Slips() == SLIPS_SET_END) then | |||
! | |||
! call Set_InstallFillupHeadPermission(.true.) | |||
! return | |||
!end if | |||
!OPERATION-CODE=70 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
data%State%TD_String%TopJointHeight >= 3.0 .and. data%State%TD_String%TopJointHeight <= 9.0 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
!Get_ElevatorConnectionPossible() == .false. .and.& | |||
!Get_ElevatorConnection() /= ELEVATOR_CONNECTION_STRING .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING) then | |||
call Set_InstallFillupHeadPermission(.true.) | |||
return | |||
end if | |||
call Set_InstallFillupHeadPermission(.false.) | |||
endif | |||
end subroutine | |||
subroutine Subscribe_InstallFillupHeadPermission() | |||
implicit none | |||
! imp me... | |||
end subroutine | |||
end module CInstallFillupHeadPermission |
@@ -1,36 +1,36 @@ | |||
module CInstallMudBucketPermission | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_InstallMudBucketPermission() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_InstallMudBucketPermission=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_InstallMudBucketPermission=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
subroutine Subscribe_InstallMudBucketPermission() | |||
implicit none | |||
! imp me... | |||
end subroutine | |||
module CInstallMudBucketPermission | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_InstallMudBucketPermission() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_InstallMudBucketPermission=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_InstallMudBucketPermission=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
subroutine Subscribe_InstallMudBucketPermission() | |||
implicit none | |||
! imp me... | |||
end subroutine | |||
end module CInstallMudBucketPermission |
@@ -1,93 +1,93 @@ | |||
module CIrIbopPermission | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_IrIbopPermission() | |||
use TD_DrillStemComponents | |||
use UnitySignalsModule !for CTdsConnectionModesEnum | |||
use CStudentStationVariables!, only: data%State%StudentStation%FillupHeadInstallation | |||
implicit none | |||
if (data%State%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrIbopPermission=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=58 | |||
if (GetRotaryRpm() == 0.0d0 .and.& | |||
Get_NearFloorConnection() >= 3 .and. Get_NearFloorConnection() <= 10 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||
data%State%StudentStation%FillupHeadInstallation == .false.) then | |||
call Set_IrIbopPermission(.true.) | |||
return | |||
end if | |||
call Set_IrIbopPermission(.false.) | |||
endif | |||
if (data%State%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrIbopPermission=Kelly' | |||
#endif | |||
!OPERATION-CODE=62 | |||
if (GetRotaryRpm() == 0.0d0 .and.& | |||
Get_OperationCondition() == OPERATION_TRIP .and.& | |||
!(Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .or. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.& | |||
data%State%TD_String%TopJointHeight >= 3.0 .and. data%State%TD_String%TopJointHeight <= 10.0 .and.& | |||
!Get_IbopHeight() >= 22.0 .and. Get_IbopHeight() <= 35.0 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_FillupHead() == FILLUP_HEAD_REMOVE) then | |||
call Set_IrIbopPermission(.true.) | |||
return | |||
end if | |||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
! Get_IbopHeight() >= 1 .and. Get_IbopHeight() <= 8 .and.& | |||
! Get_NearFloorConnection() >= 1 .and. Get_NearFloorConnection() <= 8 .and.& | |||
! Get_JointConnectionPossible() == .false. .and.& | |||
! Get_KellyConnection() /= KELLY_CONNECTION_STRING .and.& | |||
! Get_Swing() == SWING_WELL_END .and.& | |||
! Get_Slips() == SLIPS_SET_END) then | |||
! call Set_IrIbopPermission(.true.) | |||
! return | |||
!end if | |||
call Set_IrIbopPermission(.false.) | |||
endif | |||
end subroutine | |||
subroutine Subscribe_IrIbopPermission() | |||
implicit none | |||
end subroutine | |||
module CIrIbopPermission | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_IrIbopPermission() | |||
use TD_DrillStemComponents | |||
use UnitySignalsModule !for CTdsConnectionModesEnum | |||
use CStudentStationVariables!, only: data%State%StudentStation%FillupHeadInstallation | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrIbopPermission=TopDrive' | |||
#endif | |||
!TOPDRIVE-CODE=58 | |||
if (GetRotaryRpm() == 0.0d0 .and.& | |||
Get_NearFloorConnection() >= 3 .and. Get_NearFloorConnection() <= 10 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||
data%State%StudentStation%FillupHeadInstallation == .false.) then | |||
call Set_IrIbopPermission(.true.) | |||
return | |||
end if | |||
call Set_IrIbopPermission(.false.) | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
#ifdef OST | |||
print*, 'Evaluate_IrIbopPermission=Kelly' | |||
#endif | |||
!OPERATION-CODE=62 | |||
if (GetRotaryRpm() == 0.0d0 .and.& | |||
Get_OperationCondition() == OPERATION_TRIP .and.& | |||
!(Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .or. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.& | |||
data%State%TD_String%TopJointHeight >= 3.0 .and. data%State%TD_String%TopJointHeight <= 10.0 .and.& | |||
!Get_IbopHeight() >= 22.0 .and. Get_IbopHeight() <= 35.0 .and.& | |||
Get_JointConnectionPossible() == .false. .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_FillupHead() == FILLUP_HEAD_REMOVE) then | |||
call Set_IrIbopPermission(.true.) | |||
return | |||
end if | |||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
! Get_IbopHeight() >= 1 .and. Get_IbopHeight() <= 8 .and.& | |||
! Get_NearFloorConnection() >= 1 .and. Get_NearFloorConnection() <= 8 .and.& | |||
! Get_JointConnectionPossible() == .false. .and.& | |||
! Get_KellyConnection() /= KELLY_CONNECTION_STRING .and.& | |||
! Get_Swing() == SWING_WELL_END .and.& | |||
! Get_Slips() == SLIPS_SET_END) then | |||
! call Set_IrIbopPermission(.true.) | |||
! return | |||
!end if | |||
call Set_IrIbopPermission(.false.) | |||
endif | |||
end subroutine | |||
subroutine Subscribe_IrIbopPermission() | |||
implicit none | |||
end subroutine | |||
end module CIrIbopPermission |