From f8be172e6a641f6d5a6c7e1000fda71bf900de40 Mon Sep 17 00:00:00 2001 From: mahmood19227 Date: Tue, 28 Mar 2023 11:43:02 +0330 Subject: [PATCH] Basic Input variables put into the types #2 --- CSharp/BasicInputs/Geology/CFormation.f90 | 2 +- .../Geology/CFormationVariables.f90 | 6 +- CSharp/BasicInputs/Geology/CShoeVariables.f90 | 2 +- .../RigSpecifications/CBopStackVariables.f90 | 4 +- .../WellProfile/CPathGeneration.f90 | 2 +- .../WellProfile/CPathGenerationVariables.f90 | 4 +- .../WellProfile/CWellSurveyData.f90 | 2 +- CSharp/Common/CCommonVariables.f90 | 3 - .../ControlPanels/CHookVariables.f90 | 2 +- .../CStandPipeManifoldVariables.f90 | 4 +- .../ControlPanels/CTopDrivePanel.f90 | 16 ++-- .../ControlPanels/CTopDrivePanelVariables.f90 | 2 +- .../Common/COperationScenariosSettings.f90 | 2 +- .../Enums/CElevatorConnectionEnum.f90 | 1 + ...oseSafetyValveLedNotificationVariables.f90 | 2 +- .../Notifications/CIrIBopLedNotification.f90 | 3 +- ...CIrSafetyValveLedNotificationVariables.f90 | 2 +- ...penSafetyValveLedNotificationVariables.f90 | 4 +- .../Notifications/CTdsIbopLedNotification.f90 | 4 +- .../CTdsIbopLedNotificationVariables.f90 | 2 +- .../CTdsPowerLedNotification.f90 | 2 +- .../CTdsPowerLedNotificationVariables.f90 | 2 +- .../CTdsTorqueWrenchLedNotification.f90 | 4 +- ...dsTorqueWrenchLedNotificationVariables.f90 | 2 +- .../Permissions/CSwingDrillPermission.f90 | 3 +- .../Permissions/CSwingOffPermission.f90 | 4 +- .../Permissions/CSwingTiltPermission.f90 | 2 +- .../SoftwareInputs/CHookHeight.f90 | 4 +- .../UnitySignals/COperationConditionEnum.f90 | 4 +- .../COperationConditionEnumVariables.f90 | 3 - .../UnitySignals/CTdsBackupClamp.f90 | 4 +- .../UnitySignals/CTdsSpineEnum.f90 | 4 +- .../UnitySignals/CTdsTongEnum.f90 | 4 +- Equipments/MudSystem/MudSystem.f90 | 6 +- Equipments/TopDrive/TopDrive_MainSolver.f90 | 6 +- Equipments/TopDrive/TopDrive_Solver.f90 | 4 +- Rop/ROP_MainCalculation.f90 | 6 +- Rop/sROP_Module.f90 | 2 +- SimulationCore2.vfproj | 76 +++++++++---------- .../TD_WellReadData.f90 | 2 +- TorqueDrag/TD_StartUp/TD_StartUp.f90 | 2 +- 41 files changed, 106 insertions(+), 109 deletions(-) diff --git a/CSharp/BasicInputs/Geology/CFormation.f90 b/CSharp/BasicInputs/Geology/CFormation.f90 index 571f963..b06e9db 100644 --- a/CSharp/BasicInputs/Geology/CFormation.f90 +++ b/CSharp/BasicInputs/Geology/CFormation.f90 @@ -11,7 +11,7 @@ module CFormation integer :: i type(CFormationItem), intent(inout), target :: array(count) type(CFormationItem), pointer :: item - FormationCount = count + Formation%Count = count if(size(Formation%Formations) > 0) then deallocate(Formation%Formations) end if diff --git a/CSharp/BasicInputs/Geology/CFormationVariables.f90 b/CSharp/BasicInputs/Geology/CFormationVariables.f90 index f1b4206..235c642 100644 --- a/CSharp/BasicInputs/Geology/CFormationVariables.f90 +++ b/CSharp/BasicInputs/Geology/CFormationVariables.f90 @@ -12,10 +12,12 @@ module CFormationVariables real(8) :: ThresholdWeight real(8) :: PorePressureGradient end type CFormationItem + Type::FormationType - integer :: Formation%Count = 0 - type(CFormationItem), allocatable :: Formation%Formations(:) + integer :: Count = 0 + type(CFormationItem), allocatable :: Formations(:) End type FormationType + Type(FormationType) :: Formation contains end module CFormationVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/Geology/CShoeVariables.f90 b/CSharp/BasicInputs/Geology/CShoeVariables.f90 index bcd6c16..58daacc 100644 --- a/CSharp/BasicInputs/Geology/CShoeVariables.f90 +++ b/CSharp/BasicInputs/Geology/CShoeVariables.f90 @@ -9,6 +9,6 @@ module CShoeVariables real(8) :: Breakdown real(8) :: FracturePropagation logical :: InactiveFracture - End type Reservoir + End type ShoeType Type(ShoeType)::Shoe end module CShoeVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/CBopStackVariables.f90 b/CSharp/BasicInputs/RigSpecifications/CBopStackVariables.f90 index 429013a..951a5b7 100644 --- a/CSharp/BasicInputs/RigSpecifications/CBopStackVariables.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CBopStackVariables.f90 @@ -23,9 +23,9 @@ module CBopStackVariables real(8) :: AnnularPreventerClose real(8) :: RamStringDrag real(8) :: AnnularStringDrag - real(8) :: ChokeLineLength real(8) :: ChokeLineId - End Type BopStackType + End Type BopStackSpecificationType + Type(BopStackSpecificationType)::BopStackSpecification end module CBopStackVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 b/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 index c5db1d4..f9e0a9c 100644 --- a/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 +++ b/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 @@ -11,7 +11,7 @@ module CPathGeneration integer :: i type(CPathGenerationItem), intent(inout), target :: array(count) type(CPathGenerationItem), pointer :: item - PathGenerationCount = count + PathGeneration%ItemCount = count if(size(PathGeneration%Items) > 0) then deallocate(PathGeneration%Items) end if diff --git a/CSharp/BasicInputs/WellProfile/CPathGenerationVariables.f90 b/CSharp/BasicInputs/WellProfile/CPathGenerationVariables.f90 index 76191ea..07ac5a9 100644 --- a/CSharp/BasicInputs/WellProfile/CPathGenerationVariables.f90 +++ b/CSharp/BasicInputs/WellProfile/CPathGenerationVariables.f90 @@ -20,11 +20,11 @@ module CPathGenerationVariables Type :: PathGenerationType integer :: ItemCount = 0 - type(CPathGenerationItem), allocatable :: Items(:) - + type(CPathGenerationItem), allocatable :: Items(:) integer :: DataPointsCount = 0 type(CDataPointItem), allocatable :: DataPoints(:) End type PathGenerationType + Type(PathGenerationType)::PathGeneration end module CPathGenerationVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/WellProfile/CWellSurveyData.f90 b/CSharp/BasicInputs/WellProfile/CWellSurveyData.f90 index be9f6b2..e527b4b 100644 --- a/CSharp/BasicInputs/WellProfile/CWellSurveyData.f90 +++ b/CSharp/BasicInputs/WellProfile/CWellSurveyData.f90 @@ -11,7 +11,7 @@ module CWellSurveyData integer :: i type(CSurveyDataItem), intent(inout), target :: array(count) type(CSurveyDataItem), pointer :: item - SurveyDataCount = count + WellSurveyData%Count = count if(size(WellSurveyData%Items) > 0) then deallocate(WellSurveyData%Items) end if diff --git a/CSharp/Common/CCommonVariables.f90 b/CSharp/Common/CCommonVariables.f90 index c898e63..e6ab1d4 100644 --- a/CSharp/Common/CCommonVariables.f90 +++ b/CSharp/Common/CCommonVariables.f90 @@ -6,10 +6,7 @@ module CCommonVariables ! Input vars integer :: StandRack type(IntegerEventHandler) :: OnStandRackChange - - ! Output vars logical :: DrillWatchOperationMode - contains end module CCommonVariables \ No newline at end of file diff --git a/CSharp/Equipments/ControlPanels/CHookVariables.f90 b/CSharp/Equipments/ControlPanels/CHookVariables.f90 index 6d597b5..ee2e8dc 100644 --- a/CSharp/Equipments/ControlPanels/CHookVariables.f90 +++ b/CSharp/Equipments/ControlPanels/CHookVariables.f90 @@ -5,7 +5,7 @@ module CHookVariables Type :: HookType real :: HookHeight_S = 0.0 real :: HookHeight - type(RealEventHandlerCollection) :: Hook%OnHookHeightChange + type(RealEventHandlerCollection) :: OnHookHeightChange end type HookType Type(HookType)::Hook diff --git a/CSharp/Equipments/ControlPanels/CStandPipeManifoldVariables.f90 b/CSharp/Equipments/ControlPanels/CStandPipeManifoldVariables.f90 index 82bc7bb..fceca73 100644 --- a/CSharp/Equipments/ControlPanels/CStandPipeManifoldVariables.f90 +++ b/CSharp/Equipments/ControlPanels/CStandPipeManifoldVariables.f90 @@ -2,7 +2,7 @@ module CStandPipeManifoldVariables implicit none public - Type::StandPipeManifold + Type::StandPipeManifoldType ! Input vars logical :: StandPipeManifoldValve1 logical :: StandPipeManifoldValve2 @@ -24,5 +24,5 @@ module CStandPipeManifoldVariables real(8) :: StandPipeGauge1 real(8) :: StandPipeGauge2 End type StandPipeManifoldType - contains + type(StandPipeManifoldType)::StandPipeManifold end module CStandPipeManifoldVariables \ No newline at end of file diff --git a/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 b/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 index fa0db5e..94bdfb5 100644 --- a/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 +++ b/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 @@ -11,9 +11,9 @@ module CTopDrivePanel !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTdsPowerState' :: SetTopDriveTdsPowerState implicit none integer, intent(in) :: v - TopDriveTdsPowerState = v + TopDrivePanel%TopDriveTdsPowerState = v #ifdef deb - call Log_3( 'TopDriveTdsPowerState=', TopDriveTdsPowerState) + call Log_3( 'TopDriveTdsPowerState=', TopDrivePanel%TopDriveTdsPowerState) #endif end subroutine @@ -71,8 +71,8 @@ module CTopDrivePanel implicit none real, intent(in) :: v if (IsPortable) then - if(TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() - if(TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch == 0) then + if(TopDrivePanel%TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() + if(TopDrivePanel%TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch == 0) then DrillingConsole%RTTorqueLimitKnob = 0 TopDrivePanel%TopDriveTorqueLimitKnob = v #ifdef deb @@ -80,7 +80,7 @@ module CTopDrivePanel call Log_3( 'TopDriveTorqueLimitKnob=', TopDrivePanel%TopDriveTorqueLimitKnob ) #endif endif - if(TopDriveTdsPowerState == 0 .and. DrillingConsole%RTSwitch /= 0) then + if(TopDrivePanel%TopDriveTdsPowerState == 0 .and. DrillingConsole%RTSwitch /= 0) then TopDrivePanel%TopDriveTorqueLimitKnob = 0 DrillingConsole%RTTorqueLimitKnob = real(ScaleRange(v, 0.0, 10.0, 0.0, 6000.0), 8) #ifdef deb @@ -107,8 +107,8 @@ module CTopDrivePanel implicit none real, intent(in) :: v if (IsPortable) then - if(TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() - if(TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch == 0) then + if(TopDrivePanel%TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() + if(TopDrivePanel%TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch == 0) then DrillingConsole%RTThrottle = 0 TopDrivePanel%RpmKnob = v #ifdef deb @@ -116,7 +116,7 @@ module CTopDrivePanel call Log_3( 'RpmKnob=', TopDrivePanel%RpmKnob ) #endif endif - if(TopDriveTdsPowerState == 0 .and. DrillingConsole%RTSwitch /= 0) then + if(TopDrivePanel%TopDriveTdsPowerState == 0 .and. DrillingConsole%RTSwitch /= 0) then TopDrivePanel%RpmKnob = 0 DrillingConsole%RTThrottle = real(ScaleRange(v, 0.0, 965.0, 0.0, 250.0), 8) #ifdef deb diff --git a/CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90 b/CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90 index c13f60c..bc1c032 100644 --- a/CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90 +++ b/CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90 @@ -20,7 +20,7 @@ module CTopDrivePanelVariables integer :: LED_BLINK = 2 ! Input vars - ! Type::TopDrivePanelType + Type::TopDrivePanelType integer :: TopDriveTdsPowerState logical :: TopDriveTorqueWrench integer :: TopDriveDrillTorqueState diff --git a/CSharp/OperationScenarios/Common/COperationScenariosSettings.f90 b/CSharp/OperationScenarios/Common/COperationScenariosSettings.f90 index a632921..53e485b 100644 --- a/CSharp/OperationScenarios/Common/COperationScenariosSettings.f90 +++ b/CSharp/OperationScenarios/Common/COperationScenariosSettings.f90 @@ -154,7 +154,7 @@ module COperationScenariosSettings subroutine SetDefaultValues() use COperationScenariosVariables - use CHoistingVariables, only: Hoisting%DriveType, TopDrive_DriveType + use CHoistingVariables!, only: Hoisting%DriveType, TopDrive_DriveType use CManifolds, only: RemoveSafetyValve_TripMode, RemoveSafetyValve_KellyMode implicit none diff --git a/CSharp/OperationScenarios/Enums/CElevatorConnectionEnum.f90 b/CSharp/OperationScenarios/Enums/CElevatorConnectionEnum.f90 index 32de705..9c2dd92 100644 --- a/CSharp/OperationScenarios/Enums/CElevatorConnectionEnum.f90 +++ b/CSharp/OperationScenarios/Enums/CElevatorConnectionEnum.f90 @@ -6,6 +6,7 @@ module CElevatorConnectionEnum contains subroutine Evaluate_ElevatorConnection() + use CHoistingVariables use CCommon, only: SetStandRack implicit none diff --git a/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotificationVariables.f90 index d65dcba..83ba6a9 100644 --- a/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotificationVariables.f90 @@ -14,7 +14,7 @@ module CCloseSafetyValveLedNotificationVariables subroutine Set_CloseSafetyValveLed(v) ! use CDrillingConsoleVariables, only: CloseSafetyValveLedHw => CloseSafetyValveLed use CManifolds, only: CloseSafetyValve_TopDrive, CloseSafetyValve_KellyMode, CloseSafetyValve_TripMode - use CHoistingVariables, only: Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType + use CHoistingVariables!, only: Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType implicit none logical , intent(in) :: v #ifdef ExcludeExtraChanges diff --git a/CSharp/OperationScenarios/Notifications/CIrIBopLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CIrIBopLedNotification.f90 index ccd8174..dde447b 100644 --- a/CSharp/OperationScenarios/Notifications/CIrIBopLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CIrIBopLedNotification.f90 @@ -1,5 +1,6 @@ module CIrIBopLedNotification use COperationScenariosVariables + ! use CTopDrivePanelVariables implicit none contains @@ -66,7 +67,7 @@ module CIrIBopLedNotification !TOPDRIVE-CODE=60 if (Get_IrIbopPermission() .and.& Get_IrIBopLed() == .true. .and.& - TopDriveTdsPowerState == TdsPower_OFF) then + TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then call Set_IrIBopLed(.false.) return diff --git a/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotificationVariables.f90 index 3360792..62f08ea 100644 --- a/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotificationVariables.f90 @@ -21,7 +21,7 @@ module CIrSafetyValveLedNotificationVariables RemoveSafetyValve_KellyMode, & RemoveSafetyValve_TripMode use CSafetyValveEnumVariables, only: Set_SafetyValve_Install, Set_SafetyValve_Remove - use CHoistingVariables, only: Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType + use CHoistingVariables!, only: Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType implicit none logical , intent(in) :: v #ifdef ExcludeExtraChanges diff --git a/CSharp/OperationScenarios/Notifications/COpenSafetyValveLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/COpenSafetyValveLedNotificationVariables.f90 index 643a903..03ba175 100644 --- a/CSharp/OperationScenarios/Notifications/COpenSafetyValveLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/COpenSafetyValveLedNotificationVariables.f90 @@ -12,9 +12,9 @@ module COpenSafetyValveLedNotificationVariables contains subroutine Set_OpenSafetyValveLed(v) - ! use CDrillingConsoleVariables, only: OpenSafetyValveLedHw => OpenSafetyValveLed + use CDrillingConsoleVariables!, only: OpenSafetyValveLedHw => OpenSafetyValveLed use CManifolds, only: OpenSafetyValve_TopDrive, OpenSafetyValve_KellyMode, OpenSafetyValve_TripMode - use CHoistingVariables, only: Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType + use CHoistingVariables!, only: Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType implicit none logical , intent(in) :: v #ifdef ExcludeExtraChanges diff --git a/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotification.f90 index 40146fa..2629cd3 100644 --- a/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotification.f90 @@ -18,7 +18,7 @@ module CTdsIbopLedNotification !TOPDRIVE-CODE=61 if (Get_IbopLed() == .false. .and.& - TopDriveTdsPowerState == TdsPower_OFF .and.& + TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& TopDrivePanel%TopDriveIbop == .false.) then call Set_IbopLed(.true.) @@ -31,7 +31,7 @@ module CTdsIbopLedNotification !TOPDRIVE-CODE=62 if (Get_IbopLed() .and.& - TopDriveTdsPowerState == TdsPower_OFF .and.& + TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& TopDrivePanel%TopDriveIbop) then call Set_IbopLed(.false.) diff --git a/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotificationVariables.f90 index 638a952..3482403 100644 --- a/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotificationVariables.f90 @@ -12,7 +12,7 @@ module CTdsIbopLedNotificationVariables contains subroutine Set_IbopLed(v) - use CTopDrivePanelVariables, only: TopDrivePanel%TopDriveIbopLed + use CTopDrivePanelVariables!, only: TopDrivePanel%TopDriveIbopLed use CManifolds, Only: OpenTopDriveIBop, CloseTopDriveIBop !use CLatchLedNotification implicit none diff --git a/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotification.f90 index 72fa9c7..3ba3377 100644 --- a/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotification.f90 @@ -14,7 +14,7 @@ module CTdsPowerLedNotification #endif !TOPDRIVE-CODE=63 - if (TopDriveTdsPowerState == TdsPower_OFF) then + if (TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then call Set_PowerLed(.true.) return end if diff --git a/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotificationVariables.f90 index aff8f2c..c630217 100644 --- a/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotificationVariables.f90 @@ -12,7 +12,7 @@ module CTdsPowerLedNotificationVariables contains subroutine Set_PowerLed(v) - use CTopDrivePanelVariables, only: TopDrivePanel%TopDriveTdsPowerLed + use CTopDrivePanelVariables!, only: TopDrivePanel%TopDriveTdsPowerLed !use CLatchLedNotification implicit none logical , intent(in) :: v diff --git a/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotification.f90 index 825bb10..b4da4d9 100644 --- a/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotification.f90 @@ -14,14 +14,14 @@ module CTdsTorqueWrenchLedNotification !TOPDRIVE-CODE=81 if((Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_BEGIN .or.& Get_TdsBackupClamp() == BACKUP_CLAMP_FW_BEGIN) .and.& - TopDriveTdsPowerState /= TdsPower_OFF) then + TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then call Set_TorqueWrenchLed(LED_BLINK) return endif !TOPDRIVE-CODE=81 if(Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& - TopDriveTdsPowerState /= TdsPower_OFF) then + TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then call Set_TorqueWrenchLed(LED_ON) return endif diff --git a/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotificationVariables.f90 index a06159b..8db0229 100644 --- a/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotificationVariables.f90 @@ -12,7 +12,7 @@ module CTdsTorqueWrenchLedNotificationVariables contains subroutine Set_TorqueWrenchLed(v) - use CTopDrivePanelVariables, only: TopDrivePanel%TopDriveTorqueWrenchLed + use CTopDrivePanelVariables!, only: TopDrivePanel%TopDriveTorqueWrenchLed implicit none integer , intent(in) :: v diff --git a/CSharp/OperationScenarios/Permissions/CSwingDrillPermission.f90 b/CSharp/OperationScenarios/Permissions/CSwingDrillPermission.f90 index a41914e..174e2a3 100644 --- a/CSharp/OperationScenarios/Permissions/CSwingDrillPermission.f90 +++ b/CSharp/OperationScenarios/Permissions/CSwingDrillPermission.f90 @@ -1,5 +1,6 @@ module CSwingDrillPermission use COperationScenariosVariables + use CTopDrivePanelVariables implicit none contains @@ -16,7 +17,7 @@ module CSwingDrillPermission !TOPDRIVE-CODE=33 if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& Get_TdsSwing() == TDS_SWING_OFF_END .and.& - TopDriveTdsPowerState /= TdsPower_OFF) then + TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then call Set_SwingDrillPermission(.true.) return diff --git a/CSharp/OperationScenarios/Permissions/CSwingOffPermission.f90 b/CSharp/OperationScenarios/Permissions/CSwingOffPermission.f90 index 9b711e1..e9117b1 100644 --- a/CSharp/OperationScenarios/Permissions/CSwingOffPermission.f90 +++ b/CSharp/OperationScenarios/Permissions/CSwingOffPermission.f90 @@ -20,7 +20,7 @@ module CSwingOffPermission Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& Get_TdsSwing() == TDS_SWING_TILT_END .and.& Get_Slips() == SLIPS_SET_END .and.& - TopDriveTdsPowerState /= TdsPower_OFF) then + TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then call Set_SwingOffPermission(.true.) return @@ -33,7 +33,7 @@ module CSwingOffPermission if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& Get_TdsSwing() == TDS_SWING_DRILL_END .and.& - TopDriveTdsPowerState /= TdsPower_OFF) then + TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then call Set_SwingOffPermission(.true.) return diff --git a/CSharp/OperationScenarios/Permissions/CSwingTiltPermission.f90 b/CSharp/OperationScenarios/Permissions/CSwingTiltPermission.f90 index c120b32..7857f1b 100644 --- a/CSharp/OperationScenarios/Permissions/CSwingTiltPermission.f90 +++ b/CSharp/OperationScenarios/Permissions/CSwingTiltPermission.f90 @@ -18,7 +18,7 @@ module CSwingTiltPermission Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& Get_TdsSwing() == TDS_SWING_OFF_END .and.& Get_Slips() == SLIPS_SET_END .and.& - TopDriveTdsPowerState /= TdsPower_OFF) then + TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then call Set_SwingTiltPermission(.true.) return diff --git a/CSharp/OperationScenarios/SoftwareInputs/CHookHeight.f90 b/CSharp/OperationScenarios/SoftwareInputs/CHookHeight.f90 index 360e7d7..963f368 100644 --- a/CSharp/OperationScenarios/SoftwareInputs/CHookHeight.f90 +++ b/CSharp/OperationScenarios/SoftwareInputs/CHookHeight.f90 @@ -29,9 +29,9 @@ module CHookHeight end function subroutine Subscribe_HookHeight() - use CHookVariables, only: OnHookHeight => OnHookHeightChange + use CHookVariables!, only: OnHookHeight => OnHookHeightChange implicit none - call OnHookHeight%Add(Set_HookHeight) + call Hook%OnHookHeightChange%Add(Set_HookHeight) end subroutine end module CHookHeight \ No newline at end of file diff --git a/CSharp/OperationScenarios/UnitySignals/COperationConditionEnum.f90 b/CSharp/OperationScenarios/UnitySignals/COperationConditionEnum.f90 index 0ed9716..bcd8d94 100644 --- a/CSharp/OperationScenarios/UnitySignals/COperationConditionEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/COperationConditionEnum.f90 @@ -36,7 +36,7 @@ module COperationConditionEnum ! end subroutine subroutine ButtonPress_Latch_OperationCondition() - use CHoistingVariables, only: Hoisting%DriveType, Kelly_DriveType + use CHoistingVariables!, only: Hoisting%DriveType, Kelly_DriveType use CManifolds, only: InstallKellyCock implicit none @@ -90,7 +90,7 @@ module COperationConditionEnum end subroutine subroutine ButtonPress_Unlatch_OperationCondition() - use CHoistingVariables, only: Hoisting%DriveType, Kelly_DriveType + use CHoistingVariables!, only: Hoisting%DriveType, Kelly_DriveType use CManifolds, only: RemoveKellyCock implicit none diff --git a/CSharp/OperationScenarios/UnitySignals/COperationConditionEnumVariables.f90 b/CSharp/OperationScenarios/UnitySignals/COperationConditionEnumVariables.f90 index 6090d02..f6b8f71 100644 --- a/CSharp/OperationScenarios/UnitySignals/COperationConditionEnumVariables.f90 +++ b/CSharp/OperationScenarios/UnitySignals/COperationConditionEnumVariables.f90 @@ -39,9 +39,6 @@ module COperationConditionEnumVariables end function - - - subroutine Set_OperationCondition_WN(v) !DEC$ ATTRIBUTES DLLEXPORT :: Set_OperationCondition_WN !DEC$ ATTRIBUTES ALIAS: 'Set_OperationCondition_WN' :: Set_OperationCondition_WN diff --git a/CSharp/OperationScenarios/UnitySignals/CTdsBackupClamp.f90 b/CSharp/OperationScenarios/UnitySignals/CTdsBackupClamp.f90 index 75b90ef..9549c88 100644 --- a/CSharp/OperationScenarios/UnitySignals/CTdsBackupClamp.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CTdsBackupClamp.f90 @@ -13,7 +13,7 @@ module CTdsBackupClamp !TOPDRIVE-CODE=79 if(Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_END .and.& - TopDriveTdsPowerState /= TdsPower_OFF .and.& + TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& TopDrivePanel%TopDriveTorqueWrench) then call Set_TdsBackupClamp(BACKUP_CLAMP_FW_BEGIN) @@ -23,7 +23,7 @@ module CTdsBackupClamp !TOPDRIVE-CODE=80 if(Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_END .and.& Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_BEGIN .and.& - TopDriveTdsPowerState /= TdsPower_OFF .and.& + TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& TopDrivePanel%TopDriveTorqueWrench == .false.) then call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_BEGIN) diff --git a/CSharp/OperationScenarios/UnitySignals/CTdsSpineEnum.f90 b/CSharp/OperationScenarios/UnitySignals/CTdsSpineEnum.f90 index 2a9b2b4..719d971 100644 --- a/CSharp/OperationScenarios/UnitySignals/CTdsSpineEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CTdsSpineEnum.f90 @@ -15,7 +15,7 @@ module CTdsSpineEnum if (Get_TdsStemIn() .and.& Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& !Get_TdsConnectionPossible() .and.& - TopDriveTdsPowerState == TdsPower_FWD .and.& + TopDrivePanel%TopDriveTdsPowerState == TdsPower_FWD .and.& TopDrivePanel%TopDriveDrillTorqueState == TdsMu_SPINE) then call Set_TdsSpine(TDS_SPINE_CONNECT_BEGIN) @@ -26,7 +26,7 @@ module CTdsSpineEnum if (Get_TdsStemIn() .and.& Get_TdsTong() == TDS_TONG_BREAKOUT_END .and.& Get_TdsConnectionModes() == TDS_CONNECTION_SPINE .and.& - TopDriveTdsPowerState == TdsPower_REV .and.& + TopDrivePanel%TopDriveTdsPowerState == TdsPower_REV .and.& TopDrivePanel%TopDriveDrillTorqueState == TdsMu_SPINE) then call Set_TdsSpine(TDS_SPINE_DISCONNECT_BEGIN) diff --git a/CSharp/OperationScenarios/UnitySignals/CTdsTongEnum.f90 b/CSharp/OperationScenarios/UnitySignals/CTdsTongEnum.f90 index ec2ed5d..fca008e 100644 --- a/CSharp/OperationScenarios/UnitySignals/CTdsTongEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CTdsTongEnum.f90 @@ -16,7 +16,7 @@ module CTdsTongEnum !TOPDRIVE-CODE=1 if (Get_TdsConnectionModes() == TDS_CONNECTION_SPINE .and.& Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& - TopDriveTdsPowerState == TdsPower_FWD .and.& + TopDrivePanel%TopDriveTdsPowerState == TdsPower_FWD .and.& TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then call Set_TdsTong(TDS_TONG_MAKEUP_BEGIN) @@ -29,7 +29,7 @@ module CTdsTongEnum !TOPDRIVE-CODE=2 if (Get_TdsConnectionModes() == TDS_CONNECTION_STRING .and.& Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& - TopDriveTdsPowerState == TdsPower_REV .and.& + TopDrivePanel%TopDriveTdsPowerState == TdsPower_REV .and.& TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then call Set_TdsTong(TDS_TONG_BREAKOUT_BEGIN) diff --git a/Equipments/MudSystem/MudSystem.f90 b/Equipments/MudSystem/MudSystem.f90 index e67a34f..39a7700 100644 --- a/Equipments/MudSystem/MudSystem.f90 +++ b/Equipments/MudSystem/MudSystem.f90 @@ -630,7 +630,7 @@ module MudSystem use CDrillWatchVariables use CHOKEVARIABLES use CChokeManifoldVariables - use CTanksVariables, TripTankVolume2 => Tank%TripTankVolume, TripTankDensity2 => Tank%TripTankDensity + use CTanksVariables Use KickVariables Use CHoistingVariables @@ -2640,8 +2640,8 @@ module MudSystem !! TRIP TANK PANEL DISPLAY VALUES !!====================================================================== - TripTankVolume2= TripTankVolumeCalc/42. !(Drill Watch display) - TripTankDensity2= TripTankDensityCalc !(display) + Tank%TripTankVolume = TripTankVolumeCalc/42. !(Drill Watch display) + Tank%TripTankDensity= TripTankDensityCalc !(display) IF (DataDisplayConsole%TripTankPowerSwitch==1 .and. IsPortable==.false.) THEN diff --git a/Equipments/TopDrive/TopDrive_MainSolver.f90 b/Equipments/TopDrive/TopDrive_MainSolver.f90 index 905c21e..d8c3d22 100644 --- a/Equipments/TopDrive/TopDrive_MainSolver.f90 +++ b/Equipments/TopDrive/TopDrive_MainSolver.f90 @@ -13,7 +13,7 @@ subroutine TopDrive_MainSolver !if ( (TopDriveTdsPowerState==-1) .and. (RpmKnob==0.) ) then !FWD - if ( (TopDriveTdsPowerState==-1) .and. (IsStopped == .false.) ) then !FWD + if ( (TopDrivePanel%TopDriveTdsPowerState==-1) .and. (IsStopped == .false.) ) then !FWD TDS%SoundBlower = .true. @@ -40,7 +40,7 @@ subroutine TopDrive_MainSolver !else if ( (TopDriveTdsPowerState==1) .and. (RpmKnob==0.) ) then !REV - else if ( (TopDriveTdsPowerState==1) .and. (IsStopped == .false.) ) then !REV + else if ( (TopDrivePanel%TopDriveTdsPowerState==1) .and. (IsStopped == .false.) ) then !REV TDS%SoundBlower = .true. @@ -68,7 +68,7 @@ subroutine TopDrive_MainSolver else - if( (TopDriveTdsPowerState /= 0) .and. (IsStopped == .false.) ) then + if( (TopDrivePanel%TopDriveTdsPowerState /= 0) .and. (IsStopped == .false.) ) then TDS%SoundBlower = .true. !Call SetSoundBlowerRT(TDS%SoundBlower) TopDrivePanel%TopDriveTdsPowerLed = 1 diff --git a/Equipments/TopDrive/TopDrive_Solver.f90 b/Equipments/TopDrive/TopDrive_Solver.f90 index 811c549..2a7d6c2 100644 --- a/Equipments/TopDrive/TopDrive_Solver.f90 +++ b/Equipments/TopDrive/TopDrive_Solver.f90 @@ -42,7 +42,7 @@ subroutine TopDrive_Solver - if ( TopDriveTdsPowerState==-1 .or. TDS_OldPowerMode==-1 ) then !FWD + if ( TopDrivePanel%TopDriveTdsPowerState==-1 .or. TDS_OldPowerMode==-1 ) then !FWD if ( TopDrivePanel%TopDriveDrillTorqueState==0 .and. Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING ) then ! TdsMu_SPINE TopDrivePanel%TopDriveOperationFaultLed = 0 @@ -162,7 +162,7 @@ subroutine TopDrive_Solver TDS_OldPowerMode = -1 end if - else if ( TopDriveTdsPowerState==1 .or. TDS_OldPowerMode==1 ) then !REV + else if ( TopDrivePanel%TopDriveTdsPowerState==1 .or. TDS_OldPowerMode==1 ) then !REV if ( TopDrivePanel%TopDriveDrillTorqueState==0 .and. Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING ) then ! TdsMu_SPINE TopDrivePanel%TopDriveOperationFaultLed = 0 diff --git a/Rop/ROP_MainCalculation.f90 b/Rop/ROP_MainCalculation.f90 index e99c232..4c8482c 100644 --- a/Rop/ROP_MainCalculation.f90 +++ b/Rop/ROP_MainCalculation.f90 @@ -28,13 +28,13 @@ subroutine ROP_MainCalculation !Real(8) :: Set_ROPGauge zero_ROPcount = 0 - No_of_Formations = FormationCount + No_of_Formations = Formation%Count Drilling_verticalDepth = TD_WellTotalVerticalLength !===> MaximumWellDepthExceeded Warning - if ( Drilling_verticalDepth>=(Formation%Formations(FormationCount)%Top+Formation%Formations(FormationCount)%Thickness) ) then + if ( Drilling_verticalDepth>=(Formation%Formations(Formation%Count)%Top+Formation%Formations(Formation%Count)%Thickness) ) then Rate_of_Penetration = 0.0d0 Call Set_ROP(Rate_of_Penetration) Call Activate_MaximumWellDepthExceeded() @@ -163,7 +163,7 @@ subroutine ROP_MainCalculation Rate_of_Penetration = (f1*f2*f3*f4*f5*f6*f7*f8) ![ft/h] Rate_of_Penetration = (DINT(Rate_of_Penetration*10.d0))/10.d0 - if ( (TD_WellTotalLength==PathGeneration%Items(PathGenerationCount)%MeasuredDepth) ) then + if ( (TD_WellTotalLength==PathGeneration%Items(PathGeneration%ItemCount)%MeasuredDepth) ) then Set_ROPGauge = Rate_of_Penetration Call Set_ROP(Set_ROPGauge) ![ft/h] Old_ROPValue(4) = Rate_of_Penetration diff --git a/Rop/sROP_Module.f90 b/Rop/sROP_Module.f90 index 39ad91a..bf29dc8 100644 --- a/Rop/sROP_Module.f90 +++ b/Rop/sROP_Module.f90 @@ -30,7 +30,7 @@ subroutine Calculate_ROP - No_of_Formations = FormationCount !??????????????????????????????????????????? + No_of_Formations = Formation%Count !??????????????????????????????????????????? Drilling_Depth = TD_WellTotalLength !????????????????????????? change to vertical depth of well diff --git a/SimulationCore2.vfproj b/SimulationCore2.vfproj index 2dc139c..451e9b9 100644 --- a/SimulationCore2.vfproj +++ b/SimulationCore2.vfproj @@ -168,6 +168,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -233,47 +268,10 @@ - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/TorqueDrag/TD_ReadDataSubroutines/TD_WellReadData.f90 b/TorqueDrag/TD_ReadDataSubroutines/TD_WellReadData.f90 index cf8a9c6..24a3098 100644 --- a/TorqueDrag/TD_ReadDataSubroutines/TD_WellReadData.f90 +++ b/TorqueDrag/TD_ReadDataSubroutines/TD_WellReadData.f90 @@ -9,7 +9,7 @@ subroutine TD_WellReadData - TD_WellIntervalsCount = PathGenerationCount + 1 ! +1 is belong to ROP hole + TD_WellIntervalsCount = PathGeneration%ItemCount + 1 ! +1 is belong to ROP hole if (Allocated(TD_WellGeo)) deAllocate (TD_WellGeo) Allocate (TD_WellGeo(TD_WellIntervalsCount)) diff --git a/TorqueDrag/TD_StartUp/TD_StartUp.f90 b/TorqueDrag/TD_StartUp/TD_StartUp.f90 index 02e7774..29300ae 100644 --- a/TorqueDrag/TD_StartUp/TD_StartUp.f90 +++ b/TorqueDrag/TD_StartUp/TD_StartUp.f90 @@ -34,7 +34,7 @@ subroutine TD_StartUp Rate_of_Penetration = 0.d0 Bearing_Wear = 0.d0 FormationNumber = 0 - Old_ROPDepth = PathGeneration%Items(PathGenerationCount)%MeasuredDepth + Old_ROPDepth = PathGeneration%Items(PathGeneration%ItemCount)%MeasuredDepth Old_ROPValue = 0.d0 Set_ROPGauge = 0.d0