From c6cda164a8f177aa5393f4d0b20e039fb11d0e0c Mon Sep 17 00:00:00 2001 From: mahmood19227 Date: Mon, 27 Mar 2023 15:00:37 +0330 Subject: [PATCH] Basic Input variables put into the types --- .../BasicInputs/Bha/CStringConfiguration.f90 | 48 +- .../Bha/CStringConfigurationVariables.f90 | 13 +- .../Bha/cstringconfigurationvariables.mod | Bin 1875 -> 0 bytes CSharp/BasicInputs/CMudProperties.f90 | 84 +- .../BasicInputs/CMudPropertiesVariables.f90 | 101 +- CSharp/BasicInputs/Geology/CFormation.f90 | 18 +- .../Geology/CFormationVariables.f90 | 9 +- CSharp/BasicInputs/Geology/CReservoir.f90 | 30 +- .../Geology/CReservoirVariables.f90 | 30 +- CSharp/BasicInputs/Geology/CShoe.f90 | 12 +- CSharp/BasicInputs/Geology/CShoeVariables.f90 | 18 +- .../Geology/cformationvariables.mod | Bin 1189 -> 0 bytes .../RigSpecifications/CAccumulator.f90 | 22 +- .../CAccumulatorVariables.f90 | 28 +- .../RigSpecifications/CBopStack.f90 | 28 +- .../RigSpecifications/CBopStackVariables.f90 | 54 +- .../RigSpecifications/CHoisting.f90 | 16 +- .../RigSpecifications/CHoistingVariables.f90 | 17 +- .../BasicInputs/RigSpecifications/CPower.f90 | 16 +- .../RigSpecifications/CPowerVariables.f90 | 20 +- .../BasicInputs/RigSpecifications/CPumps.f90 | 118 +-- .../RigSpecifications/CPumpsVariables.f90 | 119 ++- .../RigSpecifications/CRigSize.f90 | 8 +- .../RigSpecifications/CRigSizeVariables.f90 | 12 +- .../caccumulatorvariables.mod | Bin 520 -> 0 bytes .../RigSpecifications/cbopstackvariables.mod | Bin 624 -> 0 bytes .../WellProfile/CCasingLinerChoke.f90 | 34 +- .../CCasingLinerChokeVariables.f90 | 40 +- .../WellProfile/CPathGeneration.f90 | 32 +- .../WellProfile/CPathGenerationVariables.f90 | 18 +- .../WellProfile/CWellSurveyData.f90 | 20 +- .../WellProfile/CWellSurveyDataVariables.f90 | 9 +- .../WellProfile/cpathgenerationvariables.mod | Bin 1564 -> 0 bytes .../ControlPanels/CBopControlPanel.f90 | 76 +- .../CBopControlPanelVariables.f90 | 70 +- .../ControlPanels/CChokeControlPanel.f90 | 42 +- .../CChokeControlPanelVariables.f90 | 41 +- .../ControlPanels/CChokeManifold.f90 | 38 +- .../ControlPanels/CChokeManifoldVariables.f90 | 65 +- .../ControlPanels/CDataDisplayConsole.f90 | 244 +++-- .../CDataDisplayConsoleVariables.f90 | 304 +++--- .../ControlPanels/CDrillingConsole.f90 | 256 ++--- .../CDrillingConsoleVariables.f90 | 247 ++--- .../ControlPanels/CHookVariables.f90 | 41 +- .../ControlPanels/CStandPipeManifold.f90 | 64 +- .../CStandPipeManifoldVariables.f90 | 43 +- .../ControlPanels/CTopDrivePanel.f90 | 90 +- .../ControlPanels/CTopDrivePanelVariables.f90 | 38 +- .../ControlPanels/cequipmentsconstants.mod | Bin 312 -> 0 bytes .../ControlPanels/ctopdrivepanelvariables.mod | Bin 748 -> 0 bytes CSharp/Equipments/DrillWatch/CDrillWatch.f90 | 38 +- .../DrillWatch/CDrillWatchVariables.f90 | 49 +- .../Equipments/MudPathFinding/CManifolds.f90 | 989 +++++++++--------- CSharp/Equipments/Tanks/CTanks.f90 | 70 +- CSharp/Equipments/Tanks/CTanksVariables.f90 | 49 +- .../Common/COperationScenariosMain.f90 | 2 +- .../Common/COperationScenariosSettings.f90 | 6 +- .../Enums/CElevatorConnectionEnum.f90 | 12 +- .../Enums/CKellyConnectionEnum.f90 | 4 +- .../Enums/CTdsConnectionModesEnum.f90 | 8 +- .../Enums/CTdsElevatorModesEnum.f90 | 4 +- .../CCloseKellyCockLedNotification.f90 | 4 +- ...CloseKellyCockLedNotificationVariables.f90 | 2 +- .../CCloseSafetyValveLedNotification.f90 | 4 +- ...oseSafetyValveLedNotificationVariables.f90 | 10 +- .../CFillMouseHoleLedNotification.f90 | 4 +- ...CFillMouseHoleLedNotificationVariables.f90 | 6 +- .../Notifications/CIrIBopLedNotification.f90 | 4 +- .../CIrIBopLedNotificationVariables.f90 | 6 +- .../CIrSafetyValveLedNotification.f90 | 8 +- ...CIrSafetyValveLedNotificationVariables.f90 | 20 +- .../Notifications/CLatchLedNotification.f90 | 4 +- .../CLatchLedNotificationVariables.f90 | 6 +- .../COpenKellyCockLedNotification.f90 | 4 +- ...COpenKellyCockLedNotificationVariables.f90 | 2 +- .../COpenSafetyValveLedNotification.f90 | 4 +- ...penSafetyValveLedNotificationVariables.f90 | 10 +- .../Notifications/CSlipsNotification.f90 | 4 +- .../Notifications/CSwingLedNotification.f90 | 4 +- .../CSwingLedNotificationVariables.f90 | 6 +- .../Notifications/CTdsIbopLedNotification.f90 | 10 +- .../CTdsIbopLedNotificationVariables.f90 | 6 +- .../CTdsPowerLedNotification.f90 | 4 +- .../CTdsPowerLedNotificationVariables.f90 | 6 +- .../CTdsTorqueWrenchLedNotification.f90 | 4 +- ...dsTorqueWrenchLedNotificationVariables.f90 | 4 +- .../Notifications/CTongNotification.f90 | 4 +- .../Notifications/CUnlatchLedNotification.f90 | 4 +- .../CUnlatchLedNotificationVariables.f90 | 6 +- .../Permissions/CFillupHeadPermission.f90 | 2 +- .../CInstallFillupHeadPermission.f90 | 4 +- .../Permissions/CIrIbopPermission.f90 | 4 +- .../Permissions/CIrSafetyValvePermission.f90 | 4 +- .../Permissions/CSwingDrillPermission.f90 | 2 +- .../Permissions/CSwingOffPermission.f90 | 2 +- .../Permissions/CSwingTiltPermission.f90 | 2 +- .../Test/TestOperationScenarios.f90 | 6 +- .../Unity/CUnityOutputs.f90 | 2 +- .../UnitySignals/CBucketEnum.f90 | 8 +- .../UnitySignals/CHeadEnum.f90 | 12 +- .../UnitySignals/COperationConditionEnum.f90 | 16 +- .../UnitySignals/CSlipsEnum.f90 | 4 +- .../UnitySignals/CSwingEnum.f90 | 4 +- .../UnitySignals/CTdsBackupClamp.f90 | 8 +- .../UnitySignals/CTdsSpineEnum.f90 | 8 +- .../UnitySignals/CTdsSwingEnum.f90 | 30 +- .../UnitySignals/CTdsTongEnum.f90 | 8 +- .../UnitySignals/CTongEnum.f90 | 12 +- CSharp/Problems/CChokeProblemsVariables.f90 | 16 +- CSharp/Problems/CGaugesProblemsVariables.f90 | 4 +- CSharp/Problems/CPumpProblemsVariables.f90 | 12 +- CSharp/Simulation/CSimulation.f90 | 18 +- Data Structures.txt | 38 + Equipments/BopStack/ANNULAR.f90 | 40 +- Equipments/BopStack/BOP.f90 | 26 +- Equipments/BopStack/BOPstartup.f90 | 74 +- Equipments/BopStack/CHOKE_LINE.f90 | 40 +- Equipments/BopStack/KILL_LINE.f90 | 40 +- Equipments/BopStack/LOSS_INPUTS.f90 | 56 +- Equipments/BopStack/PIPE_RAM1.f90 | 40 +- Equipments/BopStack/PIPE_RAM2.f90 | 40 +- Equipments/BopStack/SHEAR_RAM.f90 | 38 +- .../ChokeControl/AirPump_Choke_Subs.f90 | 14 +- Equipments/ChokeControl/CHOKE.f90 | 18 +- Equipments/ChokeControl/ChokeStartup.f90 | 2 +- .../Drawworks/DWMalfunction_ClutchEngage.f90 | 6 +- Equipments/Drawworks/DrawworksMain.f90 | 26 +- Equipments/Drawworks/Drawworks_INPUTS.f90 | 30 +- Equipments/Drawworks/Drawworks_Solver.f90 | 10 +- .../Drawworks_Solver_FreeTractionMotor.f90 | 6 +- Equipments/Drawworks/Drawworks_StartUp.f90 | 6 +- Equipments/DrillingConsole_ScrLEDs.f90 | 40 +- Equipments/MudSystem/Disconnecting_Pipe.f90 | 8 +- Equipments/MudSystem/Elements_Creation.f90 | 16 +- .../MudSystem/FillingWell_By_BellNipple.f90 | 4 +- .../Kick_Expansion_and_Contraction.f90 | 10 +- Equipments/MudSystem/Kick_Influx.f90 | 8 +- Equipments/MudSystem/Kick_Migration.f90 | 6 +- Equipments/MudSystem/MudSystem.f90 | 490 ++++----- Equipments/MudSystem/MudSystemMain.f90 | 4 +- Equipments/MudSystem/MudSystemStartup.f90 | 80 +- .../MudSystem/Plot_Final_Mud_Elements.f90 | 10 +- Equipments/MudSystem/Pump_and_Trip_In.f90 | 22 +- Equipments/MudSystem/Trip_Out_andPump.f90 | 10 +- Equipments/MudSystem/Utube1_and_Trip_In.f90 | 6 +- Equipments/MudSystem/Utube2_and_Trip_In.f90 | 6 +- Equipments/PowerLimits.f90 | 18 +- Equipments/Pumps.old/ON_mode_simulation.f90 | 80 -- Equipments/Pumps.old/Off_mode_Simulation.f90 | 51 - Equipments/Pumps.old/Pump1_OffMode_Solver.f90 | 68 -- Equipments/Pumps.old/Pump1_OnMode_Solver.f90 | 120 --- Equipments/Pumps.old/Pump2_OffMode_Solver.f90 | 69 -- Equipments/Pumps.old/Pump2_OnMode_Solver.f90 | 108 -- Equipments/Pumps.old/Pump3_OffMode_Solver.f90 | 55 - Equipments/Pumps.old/Pump3_OnMode_Solver.f90 | 57 - Equipments/Pumps.old/Pump_INPUTS.f90 | 59 -- Equipments/Pumps.old/Pump_Solver.f90 | 29 - Equipments/Pumps.old/Pump_StartUp.f90 | 52 - Equipments/Pumps.old/Pump_Total_Counts.f90 | 11 - Equipments/Pumps.old/Pump_Traction_Motor.f90 | 124 --- Equipments/Pumps.old/Pump_VARIABLES.f90 | 61 -- Equipments/Pumps.old/PumpsMain.f90 | 719 ------------- Equipments/Pumps.old/pump_diff_eqs.f90 | 105 -- Equipments/Pumps/ON_mode_simulation.f90 | 80 -- Equipments/Pumps/Off_mode_Simulation.f90 | 51 - Equipments/Pumps/Pump1_MainSolver.f90 | 151 +-- Equipments/Pumps/Pump1_OffMode_Solver.f90 | 66 -- Equipments/Pumps/Pump1_OnMode_Solver.f90 | 120 --- Equipments/Pumps/Pump2_MainSolver.f90 | 76 -- Equipments/Pumps/Pump2_OffMode_Solver.f90 | 67 -- Equipments/Pumps/Pump2_OnMode_Solver.f90 | 108 -- Equipments/Pumps/Pump3_OffMode_Solver.f90 | 54 - Equipments/Pumps/Pump3_OnMode_Solver.f90 | 57 - Equipments/Pumps/Pump_INPUTS.f90 | 59 -- Equipments/Pumps/Pump_OffMode_Solver.f90 | 52 + Equipments/Pumps/Pump_OnMode_Solver.f90 | 56 + Equipments/Pumps/Pump_Solver.f90 | 29 - Equipments/Pumps/Pump_StartUp.f90 | 73 -- Equipments/Pumps/Pump_Total_Counts.f90 | 17 - Equipments/Pumps/Pump_Traction_Motor.f90 | 124 --- Equipments/Pumps/Pump_VARIABLES.f90 | 64 -- Equipments/Pumps/PumpsMain.f90 | 358 +++---- Equipments/Pumps/Pumps_Inputs.f90 | 55 + Equipments/Pumps/Pumps_Outputs.f90 | 51 + Equipments/Pumps/Pumps_StartUp.f90 | 77 ++ Equipments/Pumps/Pumps_VARIABLES.f90 | 43 + Equipments/Pumps/pump_diff_eqs.f90 | 105 -- Equipments/RotaryTable/RTable_INPUTS.f90 | 10 +- Equipments/RotaryTable/RTable_OffMode.f90 | 6 +- Equipments/RotaryTable/RTable_Solver.f90 | 4 +- Equipments/RotaryTable/RTable_StartUp.f90 | 2 +- .../RotaryTable/RTable_Traction_Motor.f90 | 2 +- Equipments/RotaryTable/Rtable_MainSolver.f90 | 46 +- Equipments/TopDrive/TopDrive_INPUTS.f90 | 2 +- Equipments/TopDrive/TopDrive_MainSolver.f90 | 12 +- Equipments/TopDrive/TopDrive_OffMode.f90 | 8 +- Equipments/TopDrive/TopDrive_Solver.f90 | 192 ++-- Equipments/TopDrive/TopDrive_StartUp.f90 | 2 +- .../TopDrive/TopDrive_Traction_Motor.f90 | 2 +- Equipments/equipments_PowerLimit.f90 | 2 +- ...lus_and_Openhole_Pressure_Distribution.f90 | 22 +- FluidFlow/Flow_Startup.f90 | 22 +- FluidFlow/Flow_Startup_VARIABLES.f90 | 4 +- FluidFlow/Frictional_Press_Drop_Calc.f90 | 16 +- ...ontal_and_String_Pressure_Distribution.f90 | 16 +- FluidFlow/Well_Pressure_Data_Transfer.f90 | 17 +- FluidFlow/kick/Formation_Information.f90 | 24 +- FluidFlow/utubevars.mod | Bin 318 -> 0 bytes ReplaceVars.log | 0 Rop/Bit_Specification.f90 | 2 +- Rop/ROP_MainCalculation.f90 | 30 +- Rop/sROP_Module.f90 | 20 +- SimulationCore2.f90 | 4 +- SimulationCore2.vfproj | 26 +- Simulator.f90 | 2 +- .../MeshGeneration_FluidModule.f90 | 6 +- .../TD_DrillingSubs/TD_AddComponents.f90 | 4 +- .../TD_DrillingSubs/TD_BOPDiamCalculation.f90 | 12 +- .../TD_DrillStemConfiguration.f90 | 4 +- .../TD_DrillingSubs/TD_RemoveComponents.f90 | 4 +- .../TD_StringConnectionModes.f90 | 16 +- .../TD_Forces/TD_HookLoadCalculation.f90 | 16 +- TorqueDrag/TD_Forces/TD_TorqueCalculation.f90 | 4 +- .../TD_DrillStemReadData.f90 | 20 +- .../TD_ForceReadData.f90 | 4 +- .../TD_WellElementsReadData.f90 | 32 +- .../TD_WellReadData.f90 | 20 +- TorqueDrag/TD_StartUp/TD_StartUp.f90 | 12 +- TorqueDrag/TorqueDragMain.f90 | 2 +- helper.ipynb | 350 +++++++ 230 files changed, 4019 insertions(+), 6243 deletions(-) delete mode 100644 CSharp/BasicInputs/Bha/cstringconfigurationvariables.mod delete mode 100644 CSharp/BasicInputs/Geology/cformationvariables.mod delete mode 100644 CSharp/BasicInputs/RigSpecifications/caccumulatorvariables.mod delete mode 100644 CSharp/BasicInputs/RigSpecifications/cbopstackvariables.mod delete mode 100644 CSharp/BasicInputs/WellProfile/cpathgenerationvariables.mod delete mode 100644 CSharp/Equipments/ControlPanels/cequipmentsconstants.mod delete mode 100644 CSharp/Equipments/ControlPanels/ctopdrivepanelvariables.mod create mode 100644 Data Structures.txt delete mode 100644 Equipments/Pumps.old/ON_mode_simulation.f90 delete mode 100644 Equipments/Pumps.old/Off_mode_Simulation.f90 delete mode 100644 Equipments/Pumps.old/Pump1_OffMode_Solver.f90 delete mode 100644 Equipments/Pumps.old/Pump1_OnMode_Solver.f90 delete mode 100644 Equipments/Pumps.old/Pump2_OffMode_Solver.f90 delete mode 100644 Equipments/Pumps.old/Pump2_OnMode_Solver.f90 delete mode 100644 Equipments/Pumps.old/Pump3_OffMode_Solver.f90 delete mode 100644 Equipments/Pumps.old/Pump3_OnMode_Solver.f90 delete mode 100644 Equipments/Pumps.old/Pump_INPUTS.f90 delete mode 100644 Equipments/Pumps.old/Pump_Solver.f90 delete mode 100644 Equipments/Pumps.old/Pump_StartUp.f90 delete mode 100644 Equipments/Pumps.old/Pump_Total_Counts.f90 delete mode 100644 Equipments/Pumps.old/Pump_Traction_Motor.f90 delete mode 100644 Equipments/Pumps.old/Pump_VARIABLES.f90 delete mode 100644 Equipments/Pumps.old/PumpsMain.f90 delete mode 100644 Equipments/Pumps.old/pump_diff_eqs.f90 delete mode 100644 Equipments/Pumps/ON_mode_simulation.f90 delete mode 100644 Equipments/Pumps/Off_mode_Simulation.f90 delete mode 100644 Equipments/Pumps/Pump1_OffMode_Solver.f90 delete mode 100644 Equipments/Pumps/Pump1_OnMode_Solver.f90 delete mode 100644 Equipments/Pumps/Pump2_MainSolver.f90 delete mode 100644 Equipments/Pumps/Pump2_OffMode_Solver.f90 delete mode 100644 Equipments/Pumps/Pump2_OnMode_Solver.f90 delete mode 100644 Equipments/Pumps/Pump3_OffMode_Solver.f90 delete mode 100644 Equipments/Pumps/Pump3_OnMode_Solver.f90 delete mode 100644 Equipments/Pumps/Pump_INPUTS.f90 create mode 100644 Equipments/Pumps/Pump_OffMode_Solver.f90 create mode 100644 Equipments/Pumps/Pump_OnMode_Solver.f90 delete mode 100644 Equipments/Pumps/Pump_Solver.f90 delete mode 100644 Equipments/Pumps/Pump_StartUp.f90 delete mode 100644 Equipments/Pumps/Pump_Total_Counts.f90 delete mode 100644 Equipments/Pumps/Pump_Traction_Motor.f90 delete mode 100644 Equipments/Pumps/Pump_VARIABLES.f90 create mode 100644 Equipments/Pumps/Pumps_Inputs.f90 create mode 100644 Equipments/Pumps/Pumps_Outputs.f90 create mode 100644 Equipments/Pumps/Pumps_StartUp.f90 create mode 100644 Equipments/Pumps/Pumps_VARIABLES.f90 delete mode 100644 Equipments/Pumps/pump_diff_eqs.f90 delete mode 100644 FluidFlow/utubevars.mod create mode 100644 ReplaceVars.log create mode 100644 helper.ipynb diff --git a/CSharp/BasicInputs/Bha/CStringConfiguration.f90 b/CSharp/BasicInputs/Bha/CStringConfiguration.f90 index bcc792e..3d51529 100644 --- a/CSharp/BasicInputs/Bha/CStringConfiguration.f90 +++ b/CSharp/BasicInputs/Bha/CStringConfiguration.f90 @@ -14,41 +14,41 @@ module CStringConfiguration type(CStringItem), intent(inout), target :: array(count) type(CBitInfo), intent(inout) :: bit type(CStringItem), pointer :: item - BitDefinition%BitType = bit%BitType - BitDefinition%BitSize = bit%BitSize - BitDefinition%BitCodeHundreds = bit%BitCodeHundreds - BitDefinition%BitCodeTens = bit%BitCodeTens - BitDefinition%BitCodeOnes = bit%BitCodeOnes - BitDefinition%BitNozzleSize = bit%BitNozzleSize - BitDefinition%BitLength = bit%BitLength - BitDefinition%BitWeightPerLength = bit%BitWeightPerLength - BitDefinition%BitNozzleNo = bit%BitNozzleNo - BitDefinition%FloatValve = bit%FloatValve - StringConfigurationCount = count + StringConfiguration%BitDefinition%BitType = bit%BitType + StringConfiguration%BitDefinition%BitSize = bit%BitSize + StringConfiguration%BitDefinition%BitCodeHundreds = bit%BitCodeHundreds + StringConfiguration%BitDefinition%BitCodeTens = bit%BitCodeTens + StringConfiguration%BitDefinition%BitCodeOnes = bit%BitCodeOnes + StringConfiguration%BitDefinition%BitNozzleSize = bit%BitNozzleSize + StringConfiguration%BitDefinition%BitLength = bit%BitLength + StringConfiguration%BitDefinition%BitWeightPerLength = bit%BitWeightPerLength + StringConfiguration%BitDefinition%BitNozzleNo = bit%BitNozzleNo + StringConfiguration%BitDefinition%FloatValve = bit%FloatValve + StringConfiguration%StringConfigurationCount = count - if(BitDefinition%FloatValve) then + if(StringConfiguration%BitDefinition%FloatValve) then call InstallFloatValve() else call RemoveFloatValve() endif - if(size(StringConfigurations) > 0) then - deallocate(StringConfigurations) + if(size(StringConfiguration%StringConfigurations) > 0) then + deallocate(StringConfiguration%StringConfigurations) end if if(count > 0) then - allocate(StringConfigurations(count)) + allocate(StringConfiguration%StringConfigurations(count)) !j = count do i = 1, count item => array(i) - StringConfigurations(i)%ComponentType = item%ComponentType - StringConfigurations(i)%NumberOfJoint = item%NumberOfJoint - StringConfigurations(i)%LengthPerJoint = item%LengthPerJoint - StringConfigurations(i)%NominalOd = item%NominalOd - StringConfigurations(i)%NominalId = item%NominalId - StringConfigurations(i)%WeightPerLength = item%WeightPerLength - StringConfigurations(i)%ComponentLength = item%ComponentLength - StringConfigurations(i)%NominalToolJointOd = item%NominalToolJointOd - StringConfigurations(i)%Grade = item%Grade + StringConfiguration%StringConfigurations(i)%ComponentType = item%ComponentType + StringConfiguration%StringConfigurations(i)%NumberOfJoint = item%NumberOfJoint + StringConfiguration%StringConfigurations(i)%LengthPerJoint = item%LengthPerJoint + StringConfiguration%StringConfigurations(i)%NominalOd = item%NominalOd + StringConfiguration%StringConfigurations(i)%NominalId = item%NominalId + StringConfiguration%StringConfigurations(i)%WeightPerLength = item%WeightPerLength + StringConfiguration%StringConfigurations(i)%ComponentLength = item%ComponentLength + StringConfiguration%StringConfigurations(i)%NominalToolJointOd = item%NominalToolJointOd + StringConfiguration%StringConfigurations(i)%Grade = item%Grade !print*, 'type=', StringConfigurations(i)%ComponentType !print*, 'NumberOfJoint=', StringConfigurations(i)%NumberOfJoint !print*, '-----------------------------------------------------------' diff --git a/CSharp/BasicInputs/Bha/CStringConfigurationVariables.f90 b/CSharp/BasicInputs/Bha/CStringConfigurationVariables.f90 index 556e250..5ff0fb1 100644 --- a/CSharp/BasicInputs/Bha/CStringConfigurationVariables.f90 +++ b/CSharp/BasicInputs/Bha/CStringConfigurationVariables.f90 @@ -44,11 +44,12 @@ module CStringConfigurationVariables logical :: FloatValve end type CBitInfo - integer :: StringConfigurationCount = 0 - type(CStringItem), allocatable :: StringConfigurations(:) - type(CBitInfo) :: BitDefinition - - - + Type :: StringConfigurationType + integer :: StringConfigurationCount = 0 + type(CStringItem), allocatable :: StringConfigurations(:) + type(CBitInfo) :: BitDefinition + End type StringConfigurationType + Type(StringConfigurationType)::StringConfiguration + contains end module CStringConfigurationVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/Bha/cstringconfigurationvariables.mod b/CSharp/BasicInputs/Bha/cstringconfigurationvariables.mod deleted file mode 100644 index 3156bffb5f28edfb565dc3e6f25fade6e1fab835..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1875 zcmV-Z2dwxXiwFP!000001MON{bD~HTe(zt=Z|K8paTCnGA(AXL1}#8mQ0AZqIkR&-u=UzPTRjrY>pt$zMFL9sJ@1Ti5q6#q=mV z4;(vm7I+!>Pk8?4{Uq?eJM(aRKQq+Zd(HV_xKGb(JA?(YA2|22v9g2B{lMP3bJg2C z!_2|ThT$-9y+_&imhR(o5Y3<2fongko$VjXD;jk=U3`xJDE*_0;7|DJQ1b^jbiJid zVQRjOaLn^KUQ!$sW?^AE#|@n)3LRR(WpdIV7E^L#ffR)q-02JzU7aaIG}XRp<8Rs* zRWlXM#OdQiAIs@O_M3)(s$mUOZD`4WyTfA&wv044(P!*L&1;l>G?AVKf46Kw7@Jb%|Hc5U;0 zaB!Gfu6;XvvDYueBu3*KRR;A_80mBVV9=Ribn#?57^!lmUL=`;pY)kXCu1=J_??e1 z*(i-gj$>(>X1fUVl5-K{q9K6cAz=AW8*q0ojsy*kx8!hb5mfs;(?gW^{Pf@i{_?x; zdSL^nJ39seQL&$a!+jVC5jMhqay@(PFIvezPe^7U2qf}dA|D+M;K*3W0R7j~9y$p{ z^BBZJ0LVO}o_x_MC=Qbz%VdWU`u;ky$wOB0F6_%f6nG5m1tAFeFG-hV6DWa60KAQK zI`UXEObG;a&^{)C?PaKlQs2*+y66bD&d}u88i_ql;24hUA{OY{vKG$Lay>V+_HwnA z<@E>4f`rs(lCDaFkM-JmiDVeam?$#Q7EdNJ@h>{EH$uQmlIT$RaLoy|N}f{NUq9qHv!3ohY2= zD=D1s{iYPo3;$DinZo(_O@>u!Dz>a68nMq#9T7v>_vWO&bl~GxAHW!dFaX>|F&FYn z)U;;hf!~|Is!ZT!wzn7WP?1Lk!@HhpvZ;bWhPzJi+XG8wH+L3C#a_2 zY_;hJ+EcaQ83NvOtn}UKuW#Hv_AtfZZ@8bFBNEasodS0R7~{`{ZM1Q}xIHnbnyHPjlP zlG3k;0y`k*{xf+4_z4sc=t>0|^7`rEp{y8jEVE~5~bDOHdE7gdJTD;eg zsYV}Usd-*UE_xk7N~m-8c7;N$*qe{<#EM+S*SO#+g~GaUBCuHC@<)xbZHRi@QI&Pp zec&7K!(cqTtJ{YxeCmok)eSi4>J2z(=0Xn(0v5z*I_R9;qKGqJuBk1w>=Oz7U(+0} zut-;$1K(?G4lTDrZ0;Esu?UgHB8Npjnht6gEdm^d+6MCodFs{~r>R;skL4hv9OU8j z_V%u#FsmW2B2^&*2F!D@4eP*wWn35!7>OMO_G^ZSKM_$%@mL;frg}3SPmRVfQ4BA# z6T_I^Dnm<`w67IWja<-t4IPWvD!F-31-@lpHE)_TX*5;xu=h1d$qv*6U&z=<*8uov z&nEA|S#>pLFV6I)TYCK>c}544gsY;9^v~-e`{MhqNs4sQMfzuVk(PMal8cC^I&DK2 zsf5|sMSu~jTtwXSQvM@cMC7Yoq%qD5xd^$ApSz4tW43fRlg1o6;`$HyrdA7!GFcwA zyqrQ7^_ng!2@_GYUR}sWS_xp^ N{{heHCV09t005@xlEDA~ diff --git a/CSharp/BasicInputs/CMudProperties.f90 b/CSharp/BasicInputs/CMudProperties.f90 index 1e13006..10b2cc5 100644 --- a/CSharp/BasicInputs/CMudProperties.f90 +++ b/CSharp/BasicInputs/CMudProperties.f90 @@ -9,7 +9,7 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActiveMudType' :: SetActiveMudType implicit none integer, intent(in) :: v - ActiveMudType = v + MudProperties%ActiveMudType = v end subroutine subroutine SetActiveRheologyModel(v) @@ -17,9 +17,9 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActiveRheologyModel' :: SetActiveRheologyModel implicit none integer, intent(in) :: v - ActiveRheologyModel = v + MudProperties%ActiveRheologyModel = v #ifdef deb - call Log_4( '=====ActiveRheologyModel=', ActiveRheologyModel) + call Log_4( '=====ActiveRheologyModel=', MudProperties%ActiveRheologyModel) #endif end subroutine @@ -28,12 +28,12 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActiveMudVolume' :: SetActiveMudVolume implicit none real*8, intent(in) :: v - ActiveMudVolume = v + MudProperties%ActiveMudVolume = v !call Log_5('ActiveDensity=', ActiveDensity) #ifdef deb - print*, 'ActiveMudVolume=', ActiveMudVolume + print*, 'ActiveMudVolume=', MudProperties%ActiveMudVolume #endif - ActiveMudVolumeGal = v * 42.0 + MudProperties%ActiveMudVolumeGal = v * 42.0 call OnActiveMudVolumeChange%RunAll(v * 42.0d0) end subroutine @@ -42,10 +42,10 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActiveDensity' :: SetActiveDensity implicit none real*8, intent(in) :: v - ActiveDensity = v + MudProperties%ActiveDensity = v !call Log_5('ActiveDensity=', ActiveDensity) #ifdef deb - print*, 'ActiveDensity=', ActiveDensity + print*, 'ActiveDensity=', MudProperties%ActiveDensity #endif call OnActiveDensityChange%RunAll(v) end subroutine @@ -55,7 +55,7 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActiveThetaThreeHundred' :: SetActiveThetaThreeHundred implicit none real*8, intent(in) :: v - ActiveThetaThreeHundred = v + MudProperties%ActiveThetaThreeHundred = v end subroutine subroutine SetActiveThetaSixHundred(v) @@ -63,7 +63,7 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActiveThetaSixHundred' :: SetActiveThetaSixHundred implicit none real*8, intent(in) :: v - ActiveThetaSixHundred = v + MudProperties%ActiveThetaSixHundred = v end subroutine @@ -72,7 +72,7 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetReserveMudType' :: SetReserveMudType implicit none integer, intent(in) :: v - ReserveMudType = v + MudProperties%ReserveMudType = v end subroutine subroutine SetReserveMudVolume(v) @@ -80,13 +80,13 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetReserveMudVolume' :: SetReserveMudVolume implicit none real*8, intent(in) :: v - ReserveMudVolume = v + MudProperties%ReserveMudVolume = v !call Log_5('ReserveMudVolume=', ReserveMudVolume) #ifdef deb - print*, 'ReserveMudVolume=', ReserveMudVolume + print*, 'ReserveMudVolume=', MudProperties%ReserveMudVolume #endif - ReserveMudVolumeGal = v * 42.0 + MudProperties%ReserveMudVolumeGal = v * 42.0 call OnReserveMudVolumeChange%RunAll(v * 42.0d0) end subroutine @@ -95,10 +95,10 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetReserveDensity' :: SetReserveDensity implicit none real*8, intent(in) :: v - ReserveDensity = v + MudProperties%ReserveDensity = v !call Log_5('ReserveDensity=', ReserveDensity) #ifdef deb - print*, 'ReserveDensity=', ReserveDensity + print*, 'ReserveDensity=', MudProperties%ReserveDensity #endif call OnReserveDensityChange%RunAll(v) end subroutine @@ -108,7 +108,7 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetReserveThetaThreeHundred' :: SetReserveThetaThreeHundred implicit none real*8, intent(in) :: v - ReserveThetaThreeHundred = v + MudProperties%ReserveThetaThreeHundred = v end subroutine subroutine SetReserveThetaSixHundred(v) @@ -116,7 +116,7 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetReserveThetaSixHundred' :: SetReserveThetaSixHundred implicit none real*8, intent(in) :: v - ReserveThetaSixHundred = v + MudProperties%ReserveThetaSixHundred = v end subroutine @@ -125,10 +125,10 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActiveTotalTankCapacity' :: SetActiveTotalTankCapacity implicit none real*8, intent(in) :: v - ActiveTotalTankCapacity = v - ActiveTotalTankCapacityGal = v * 42.0 + MudProperties%ActiveTotalTankCapacity = v + MudProperties%ActiveTotalTankCapacityGal = v * 42.0 #ifdef deb - print*, 'ActiveTotalTankCapacity=', ActiveTotalTankCapacity + print*, 'ActiveTotalTankCapacity=', MudProperties%ActiveTotalTankCapacity #endif end subroutine @@ -137,10 +137,10 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActiveSettledContents' :: SetActiveSettledContents implicit none real*8, intent(in) :: v - ActiveSettledContents = v - ActiveSettledContentsGal = v * 42.0 + MudProperties%ActiveSettledContents = v + MudProperties%ActiveSettledContentsGal = v * 42.0 #ifdef deb - print*, 'ActiveSettledContents=', ActiveSettledContents + print*, 'ActiveSettledContents=', MudProperties%ActiveSettledContents #endif end subroutine @@ -149,10 +149,10 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActiveTotalContents' :: SetActiveTotalContents implicit none real*8, intent(in) :: v - ActiveTotalContents = v - ActiveTotalContentsGal = v * 42.0 + MudProperties%ActiveTotalContents = v + MudProperties%ActiveTotalContentsGal = v * 42.0 #ifdef deb - print*, 'ActiveTotalContents=', ActiveTotalContents + print*, 'ActiveTotalContents=', MudProperties%ActiveTotalContents #endif end subroutine @@ -161,9 +161,9 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActivePlasticViscosity' :: SetActivePlasticViscosity implicit none real*8, intent(in) :: v - ActivePlasticViscosity = v + MudProperties%ActivePlasticViscosity = v #ifdef deb - print*, 'ActivePlasticViscosity=', ActivePlasticViscosity + print*, 'ActivePlasticViscosity=', MudProperties%ActivePlasticViscosity #endif end subroutine @@ -172,9 +172,9 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActiveYieldPoint' :: SetActiveYieldPoint implicit none real*8, intent(in) :: v - ActiveYieldPoint = v + MudProperties%ActiveYieldPoint = v #ifdef deb - print*, 'ActiveYieldPoint=', ActiveYieldPoint + print*, 'ActiveYieldPoint=', MudProperties%ActiveYieldPoint #endif end subroutine @@ -183,9 +183,9 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetActiveAutoDensity' :: SetActiveAutoDensity implicit none logical, intent(in) :: v - ActiveAutoDensity = v + MudProperties%ActiveAutoDensity = v #ifdef deb - print*, 'ActiveAutoDensity=', ActiveAutoDensity + print*, 'ActiveAutoDensity=', MudProperties%ActiveAutoDensity #endif end subroutine @@ -194,9 +194,9 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetReservePlasticViscosity' :: SetReservePlasticViscosity implicit none real*8, intent(in) :: v - ReservePlasticViscosity = v + MudProperties%ReservePlasticViscosity = v #ifdef deb - print*, 'ReservePlasticViscosity=', ReservePlasticViscosity + print*, 'ReservePlasticViscosity=', MudProperties%ReservePlasticViscosity #endif end subroutine @@ -205,9 +205,9 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetReserveYieldPoint' :: SetReserveYieldPoint implicit none real*8, intent(in) :: v - ReserveYieldPoint = v + MudProperties%ReserveYieldPoint = v #ifdef deb - print*, 'ReserveYieldPoint=', ReserveYieldPoint + print*, 'ReserveYieldPoint=', MudProperties%ReserveYieldPoint #endif end subroutine @@ -216,10 +216,10 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetInitialTripTankMudVolume' :: SetInitialTripTankMudVolume implicit none real*8, intent(in) :: v - InitialTripTankMudVolume = v - InitialTripTankMudVolumeGal = v * 42.0 + MudProperties%InitialTripTankMudVolume = v + MudProperties%InitialTripTankMudVolumeGal = v * 42.0 #ifdef deb - print*, 'InitialTripTankMudVolume=', InitialTripTankMudVolume + print*, 'InitialTripTankMudVolume=', MudProperties%InitialTripTankMudVolume #endif end subroutine @@ -228,9 +228,9 @@ module CMudProperties !DEC$ ATTRIBUTES ALIAS: 'SetPedalFlowMeter' :: SetPedalFlowMeter implicit none real*8, intent(in) :: v - PedalFlowMeter = v + MudProperties%PedalFlowMeter = v #ifdef deb - print*, 'PedalFlowMeter=', PedalFlowMeter + print*, 'PedalFlowMeter=', MudProperties%PedalFlowMeter #endif end subroutine diff --git a/CSharp/BasicInputs/CMudPropertiesVariables.f90 b/CSharp/BasicInputs/CMudPropertiesVariables.f90 index e21796d..5605d61 100644 --- a/CSharp/BasicInputs/CMudPropertiesVariables.f90 +++ b/CSharp/BasicInputs/CMudPropertiesVariables.f90 @@ -24,83 +24,86 @@ module CMudPropertiesVariables INTEGER, PARAMETER :: Herschel_Bulkley_RheologyModel = 3 ! variables - 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) :: ReserveTotalTankCapacity - !real(8) :: ReserveTotalTankCapacityGal - !real(8) :: ReserveSettledContents - !real(8) :: ReserveSettledContentsGal - !real(8) :: ReserveTotalContents - !real(8) :: ReserveTotalContentsGal - real(8) :: InitialTripTankMudVolume - real(8) :: InitialTripTankMudVolumeGal - real(8) :: PedalFlowMeter - + 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) :: ReserveTotalTankCapacity + !real(8) :: ReserveTotalTankCapacityGal + !real(8) :: ReserveSettledContents + !real(8) :: ReserveSettledContentsGal + !real(8) :: ReserveTotalContents + !real(8) :: ReserveTotalContentsGal + real(8) :: InitialTripTankMudVolume + real(8) :: InitialTripTankMudVolumeGal + real(8) :: PedalFlowMeter + End type MudPropertiesType + Type(MudPropertiesType)::MudProperties + + contains - subroutine Set_ActiveMudVolume_StudentStation(v) implicit none real*8, intent(in) :: v #ifdef ExcludeExtraChanges - if(ActiveMudVolume == v) return + if(MudProperties%ActiveMudVolume == v) return #endif - ActiveMudVolume = v - if(associated(ActiveMudVolumePtr)) call ActiveMudVolumePtr(ActiveMudVolume) + MudProperties%ActiveMudVolume = v + if(associated(ActiveMudVolumePtr)) call ActiveMudVolumePtr(MudProperties%ActiveMudVolume) end subroutine subroutine Set_ActiveDensity_StudentStation(v) implicit none real*8, intent(in) :: v #ifdef ExcludeExtraChanges - if(ActiveDensity == v) return + if(MudProperties%ActiveDensity == v) return #endif - ActiveDensity = v - if(associated(ActiveDensityPtr)) call ActiveDensityPtr(ActiveDensity) + MudProperties%ActiveDensity = v + if(associated(ActiveDensityPtr)) call ActiveDensityPtr(MudProperties%ActiveDensity) end subroutine subroutine Set_ReserveMudVolume_StudentStation(v) implicit none real*8, intent(in) :: v #ifdef ExcludeExtraChanges - if(ReserveMudVolume == v) return + if(MudProperties%ReserveMudVolume == v) return #endif - ReserveMudVolume = v - if(associated(ReserveMudVolumePtr)) call ReserveMudVolumePtr(ReserveMudVolume) + MudProperties%ReserveMudVolume = v + if(associated(ReserveMudVolumePtr)) call ReserveMudVolumePtr(MudProperties%ReserveMudVolume) end subroutine subroutine Set_ReserveDensity_StudentStation(v) implicit none real*8, intent(in) :: v #ifdef ExcludeExtraChanges - if(ReserveDensity == v) return + if(MudProperties%ReserveDensity == v) return #endif - ReserveDensity = v - if(associated(ReserveDensityPtr)) call ReserveDensityPtr(ReserveDensity) + MudProperties%ReserveDensity = v + if(associated(ReserveDensityPtr)) call ReserveDensityPtr(MudProperties%ReserveDensity) end subroutine diff --git a/CSharp/BasicInputs/Geology/CFormation.f90 b/CSharp/BasicInputs/Geology/CFormation.f90 index 3f62502..571f963 100644 --- a/CSharp/BasicInputs/Geology/CFormation.f90 +++ b/CSharp/BasicInputs/Geology/CFormation.f90 @@ -12,19 +12,19 @@ module CFormation type(CFormationItem), intent(inout), target :: array(count) type(CFormationItem), pointer :: item FormationCount = count - if(size(Formations) > 0) then - deallocate(Formations) + if(size(Formation%Formations) > 0) then + deallocate(Formation%Formations) end if if(count > 0) then - allocate(Formations(count)) + allocate(Formation%Formations(count)) do i = 1, count item => array(i) - Formations(i)%Top = item%Top - Formations(i)%Thickness = item%Thickness - Formations(i)%Drillablity = item%Drillablity - Formations(i)%Abrasiveness = item%Abrasiveness - Formations(i)%ThresholdWeight = item%ThresholdWeight - Formations(i)%PorePressureGradient = item%PorePressureGradient + Formation%Formations(i)%Top = item%Top + Formation%Formations(i)%Thickness = item%Thickness + Formation%Formations(i)%Drillablity = item%Drillablity + Formation%Formations(i)%Abrasiveness = item%Abrasiveness + Formation%Formations(i)%ThresholdWeight = item%ThresholdWeight + Formation%Formations(i)%PorePressureGradient = item%PorePressureGradient !print*, "===========================" !print*, "Formations(", i, ")%Top=", Formations(i)%Top !print*, "Formations(",i,")%Thickness", Formations(i)%Thickness diff --git a/CSharp/BasicInputs/Geology/CFormationVariables.f90 b/CSharp/BasicInputs/Geology/CFormationVariables.f90 index 21fcf14..f1b4206 100644 --- a/CSharp/BasicInputs/Geology/CFormationVariables.f90 +++ b/CSharp/BasicInputs/Geology/CFormationVariables.f90 @@ -12,9 +12,10 @@ module CFormationVariables real(8) :: ThresholdWeight real(8) :: PorePressureGradient end type CFormationItem - - integer :: FormationCount = 0 - type(CFormationItem), allocatable :: Formations(:) - + Type::FormationType + integer :: Formation%Count = 0 + type(CFormationItem), allocatable :: Formation%Formations(:) + End type FormationType + Type(FormationType) :: Formation contains end module CFormationVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/Geology/CReservoir.f90 b/CSharp/BasicInputs/Geology/CReservoir.f90 index 9808aed..dcac528 100644 --- a/CSharp/BasicInputs/Geology/CReservoir.f90 +++ b/CSharp/BasicInputs/Geology/CReservoir.f90 @@ -9,7 +9,7 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetReservoirFormationNo' :: SetReservoirFormationNo implicit none integer, intent(in) :: v - FormationNo = v + Reservoir%FormationNo = v end subroutine subroutine SetFormationTop(v) @@ -17,7 +17,7 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetFormationTop' :: SetFormationTop implicit none real*8, intent(in) :: v - FormationTop = v + Reservoir%FormationTop = v end subroutine subroutine SetPressureGradient(v) @@ -25,7 +25,7 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetPressureGradient' :: SetPressureGradient implicit none real*8, intent(in) :: v - PressureGradient = v + Reservoir%PressureGradient = v end subroutine subroutine SetFormationPermeability(v) @@ -33,7 +33,7 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetFormationPermeability' :: SetFormationPermeability implicit none real*8, intent(in) :: v - FormationPermeability = v + Reservoir%FormationPermeability = v end subroutine subroutine SetGeothermalGradient(v) @@ -41,7 +41,7 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetGeothermalGradient' :: SetGeothermalGradient implicit none real*8, intent(in) :: v - GeothermalGradient = v + Reservoir%GeothermalGradient = v end subroutine subroutine SetFluidType(v) @@ -49,7 +49,7 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetFluidType' :: SetFluidType implicit none integer, intent(in) :: v - FluidType = v + Reservoir%FluidType = v end subroutine subroutine SetFluidGradient(v) @@ -57,7 +57,7 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetFluidGradient' :: SetFluidGradient implicit none real*8, intent(in) :: v - FluidGradient = v + Reservoir%FluidGradient = v end subroutine subroutine SetFluidViscosity(v) @@ -65,7 +65,7 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetFluidViscosity' :: SetFluidViscosity implicit none real*8, intent(in) :: v - FluidViscosity = v + Reservoir%FluidViscosity = v end subroutine subroutine SetInactiveInflux(v) @@ -73,7 +73,7 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetInactiveInflux' :: SetInactiveInflux implicit none logical, intent(in) :: v - InactiveInflux = v + Reservoir%InactiveInflux = v end subroutine subroutine SetMakeKickSinglePacket(v) @@ -81,9 +81,9 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetMakeKickSinglePacket' :: SetMakeKickSinglePacket implicit none logical, intent(in) :: v - MakeKickSinglePacket = v + Reservoir%MakeKickSinglePacket = v #ifdef deb - print*, 'MakeKickSinglePacket=', MakeKickSinglePacket + print*, 'MakeKickSinglePacket=', Reservoir%MakeKickSinglePacket #endif end subroutine @@ -92,9 +92,9 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetIsAutoMigrationRateSelected' :: SetIsAutoMigrationRateSelected implicit none logical, intent(in) :: v - IsAutoMigrationRateSelected = v + Reservoir%IsAutoMigrationRateSelected = v #ifdef deb - print*, 'IsAutoMigrationRateSelected=', IsAutoMigrationRateSelected + print*, 'IsAutoMigrationRateSelected=', Reservoir%IsAutoMigrationRateSelected #endif end subroutine @@ -103,9 +103,9 @@ module CReservoir !DEC$ ATTRIBUTES ALIAS: 'SetAutoMigrationRate' :: SetAutoMigrationRate implicit none real*8, intent(in) :: v - AutoMigrationRate = v + Reservoir%AutoMigrationRate = v #ifdef deb - print*, 'AutoMigrationRate=', AutoMigrationRate + print*, 'AutoMigrationRate=', Reservoir%AutoMigrationRate #endif end subroutine diff --git a/CSharp/BasicInputs/Geology/CReservoirVariables.f90 b/CSharp/BasicInputs/Geology/CReservoirVariables.f90 index 43ae73f..bf200ed 100644 --- a/CSharp/BasicInputs/Geology/CReservoirVariables.f90 +++ b/CSharp/BasicInputs/Geology/CReservoirVariables.f90 @@ -6,20 +6,20 @@ module CReservoirVariables 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 - - contains + 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 \ No newline at end of file diff --git a/CSharp/BasicInputs/Geology/CShoe.f90 b/CSharp/BasicInputs/Geology/CShoe.f90 index 20af03b..45ff1c7 100644 --- a/CSharp/BasicInputs/Geology/CShoe.f90 +++ b/CSharp/BasicInputs/Geology/CShoe.f90 @@ -9,7 +9,7 @@ module CShoe !DEC$ ATTRIBUTES ALIAS: 'SetShoeFormationNo' :: SetShoeFormationNo implicit none integer, intent(in) :: v - FormationNo = v + Shoe%FormationNo = v end subroutine subroutine SetShoeDepth(v) @@ -17,7 +17,7 @@ module CShoe !DEC$ ATTRIBUTES ALIAS: 'SetShoeDepth' :: SetShoeDepth implicit none real*8, intent(in) :: v - ShoeDepth = v + Shoe%ShoeDepth = v end subroutine subroutine SetLeakOff(v) @@ -25,7 +25,7 @@ module CShoe !DEC$ ATTRIBUTES ALIAS: 'SetLeakOff' :: SetLeakOff implicit none real*8, intent(in) :: v - LeakOff = v + Shoe%LeakOff = v end subroutine subroutine SetBreakdown(v) @@ -33,7 +33,7 @@ module CShoe !DEC$ ATTRIBUTES ALIAS: 'SetBreakdown' :: SetBreakdown implicit none real*8, intent(in) :: v - Breakdown = v + Shoe%Breakdown = v end subroutine subroutine SetFracturePropagation(v) @@ -41,7 +41,7 @@ module CShoe !DEC$ ATTRIBUTES ALIAS: 'SetFracturePropagation' :: SetFracturePropagation implicit none real*8, intent(in) :: v - FracturePropagation = v + Shoe%FracturePropagation = v end subroutine subroutine SetInactiveFracture(v) @@ -49,7 +49,7 @@ module CShoe !DEC$ ATTRIBUTES ALIAS: 'SetInactiveFracture' :: SetInactiveFracture implicit none logical, intent(in) :: v - InactiveFracture = v + Shoe%InactiveFracture = v end subroutine end module CShoe \ No newline at end of file diff --git a/CSharp/BasicInputs/Geology/CShoeVariables.f90 b/CSharp/BasicInputs/Geology/CShoeVariables.f90 index 88047bd..bcd6c16 100644 --- a/CSharp/BasicInputs/Geology/CShoeVariables.f90 +++ b/CSharp/BasicInputs/Geology/CShoeVariables.f90 @@ -1,12 +1,14 @@ module CShoeVariables implicit none - public + public ! variables - integer :: FormationNo - real(8) :: ShoeDepth - real(8) :: LeakOff - real(8) :: Breakdown - real(8) :: FracturePropagation - logical :: InactiveFracture - contains + Type::ShoeType + integer :: FormationNo + real(8) :: ShoeDepth + real(8) :: LeakOff + real(8) :: Breakdown + real(8) :: FracturePropagation + logical :: InactiveFracture + End type Reservoir + Type(ShoeType)::Shoe end module CShoeVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/Geology/cformationvariables.mod b/CSharp/BasicInputs/Geology/cformationvariables.mod deleted file mode 100644 index 258b0d35d7499b36cce367a0fdd9c8a03031cb6b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1189 zcmV;W1X}waiwFP!000001I1WfbD~HTeeYkj5t1#KlM`0Q*^v(7a?wrtg z9Y4R%)p4A>@H=N=5`~Xzn*Q~4FQQ(rkFW7X#h*Tczi{+~#ZzH2%IJ%LD<|Fx3<8$R z8O0%ELG3hE5U_-MJ&ic}jA+<5znRu|^NVhJ#Pm=xv>i(=u9d$cd~`P$>82K_0J}H9 zLKbfY+;fOx;32<3#B2bds!WT=j*UHo_>{qZ2}w~^;<}hW_y!EGqQ$=(nx;+Waos$+ zw*6ZyER$%x2A@XR`)45diiPko0nNVA&vL>YTZDwBt9ZTqNu%dgb`k};x)O$1*g_O< z0Z00p(B~vvMs#xm3A(-}``GqJhOU;+(#ttDC+Cy81QriA zVToCikr1rHbOmw1CQpciZ+3i&amNgOvLt}=0j=T@+*2*n^%Ow5ZxmIH!s6!|7xKXA zNl-_EH2RNL&<-2XqEl!)#O@9)vkPS;puaM@S+WG$y7E`aqu93ColXq|)RHpHh4zTL z4v3FXMg<;R!2^{gSj1aa)jnoPcYJC!mt6;p>yI4E_jHpWVvs4!fed5&4#A4?U3qW= z@=qSJm^~uc2mB$0JQX8rMjS`ict)@l$jz=zR7Mxuw#u3xkt+_$M(`AE!gZbHJr`>; z%kxO0W{)3ZVfuzqFCF_p#2n6E<>^Kj$s!k7xL(H#XpV&gQ%6>op(Pru2KxPVty4xv z7OoSM!@}D}<5;q0NkEox$5wmSFL(2VMpUEbhOuv|o^F|VLQDu`wH`2M!3NOsF^p}< zr=@Z5GwnL{m5Zz@nvdGa!tkkAZE zRXqL#O@~zHf-rW1=+Z|?{QMZggkLDLLahzCV{Hga-5-n*n_zPN) znPT{)3cIc6<{E5_xB-+%Nm@y>7)Mvv&~HTHx&Q? DBR5Dj diff --git a/CSharp/BasicInputs/RigSpecifications/CAccumulator.f90 b/CSharp/BasicInputs/RigSpecifications/CAccumulator.f90 index fbcdef3..1ef8958 100644 --- a/CSharp/BasicInputs/RigSpecifications/CAccumulator.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CAccumulator.f90 @@ -9,7 +9,7 @@ module CAccumulator !DEC$ ATTRIBUTES ALIAS: 'SetNumberOfBottels' :: SetNumberOfBottels implicit none integer, intent(in) :: v - NumberOfBottels = v + Accumulator%NumberOfBottels = v end subroutine subroutine SetAccumulatorSystemSize(v) @@ -17,7 +17,7 @@ module CAccumulator !DEC$ ATTRIBUTES ALIAS: 'SetAccumulatorSystemSize' :: SetAccumulatorSystemSize implicit none real*8, intent(in) :: v - AccumulatorSystemSize = v + Accumulator%AccumulatorSystemSize = v end subroutine subroutine SetOilTankVolume(v) @@ -25,7 +25,7 @@ module CAccumulator !DEC$ ATTRIBUTES ALIAS: 'SetOilTankVolume' :: SetOilTankVolume implicit none real*8, intent(in) :: v - OilTankVolume = v + Accumulator%OilTankVolume = v end subroutine subroutine SetPrechargePressure(v) @@ -33,7 +33,7 @@ module CAccumulator !DEC$ ATTRIBUTES ALIAS: 'SetPrechargePressure' :: SetPrechargePressure implicit none real*8, intent(in) :: v - PrechargePressure = v + Accumulator%PrechargePressure = v end subroutine subroutine SetAccumulatorMinimumOperatingPressure(v) @@ -41,7 +41,7 @@ module CAccumulator !DEC$ ATTRIBUTES ALIAS: 'SetAccumulatorMinimumOperatingPressure' :: SetAccumulatorMinimumOperatingPressure implicit none real*8, intent(in) :: v - AccumulatorMinimumOperatingPressure = v + Accumulator%AccumulatorMinimumOperatingPressure = v end subroutine subroutine SetElectricPumpOutput(v) @@ -49,7 +49,7 @@ module CAccumulator !DEC$ ATTRIBUTES ALIAS: 'SetElectricPumpOutput' :: SetElectricPumpOutput implicit none real*8, intent(in) :: v - ElectricPumpOutput = v + Accumulator%ElectricPumpOutput = v end subroutine subroutine SetStartPressure(v) @@ -57,7 +57,7 @@ module CAccumulator !DEC$ ATTRIBUTES ALIAS: 'SetStartPressure' :: SetStartPressure implicit none real*8, intent(in) :: v - StartPressure = v + Accumulator%StartPressure = v end subroutine subroutine SetStopPressure(v) @@ -65,7 +65,7 @@ module CAccumulator !DEC$ ATTRIBUTES ALIAS: 'SetStopPressure' :: SetStopPressure implicit none real*8, intent(in) :: v - StopPressure = v + Accumulator%StopPressure = v end subroutine subroutine SetAirPlungerPumpOutput(v) @@ -73,7 +73,7 @@ module CAccumulator !DEC$ ATTRIBUTES ALIAS: 'SetAirPlungerPumpOutput' :: SetAirPlungerPumpOutput implicit none real*8, intent(in) :: v - AirPlungerPumpOutput = v + Accumulator%AirPlungerPumpOutput = v end subroutine subroutine SetStartPressure2(v) @@ -81,7 +81,7 @@ module CAccumulator !DEC$ ATTRIBUTES ALIAS: 'SetStartPressure2' :: SetStartPressure2 implicit none real*8, intent(in) :: v - StartPressure2 = v + Accumulator%StartPressure2 = v end subroutine subroutine SetStopPressure2(v) @@ -89,7 +89,7 @@ module CAccumulator !DEC$ ATTRIBUTES ALIAS: 'SetStopPressure2' :: SetStopPressure2 implicit none real*8, intent(in) :: v - StopPressure2 = v + Accumulator%StopPressure2 = v end subroutine end module CAccumulator \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/CAccumulatorVariables.f90 b/CSharp/BasicInputs/RigSpecifications/CAccumulatorVariables.f90 index f669f54..5421017 100644 --- a/CSharp/BasicInputs/RigSpecifications/CAccumulatorVariables.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CAccumulatorVariables.f90 @@ -1,18 +1,18 @@ module CAccumulatorVariables implicit none public - - 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 - - contains + 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 \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/CBopStack.f90 b/CSharp/BasicInputs/RigSpecifications/CBopStack.f90 index 09016e6..4153fb4 100644 --- a/CSharp/BasicInputs/RigSpecifications/CBopStack.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CBopStack.f90 @@ -91,7 +91,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetLowerRamOpen' :: SetLowerRamOpen implicit none real*8, intent(in) :: v - LowerRamOpen = v + BopStackSpecification%LowerRamOpen = v end subroutine subroutine SetLowerRamClose(v) @@ -99,7 +99,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetLowerRamClose' :: SetLowerRamClose implicit none real*8, intent(in) :: v - LowerRamClose = v + BopStackSpecification%LowerRamClose = v end subroutine subroutine SetChokeOpen(v) @@ -107,7 +107,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetChokeOpen' :: SetChokeOpen implicit none real*8, intent(in) :: v - ChokeOpen = v + BopStackSpecification%ChokeOpen = v end subroutine subroutine SetChokeClose(v) @@ -115,7 +115,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetChokeClose' :: SetChokeClose implicit none real*8, intent(in) :: v - ChokeClose = v + BopStackSpecification%ChokeClose = v end subroutine subroutine SetBlindRamOpen(v) @@ -123,7 +123,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetBlindRamOpen' :: SetBlindRamOpen implicit none real*8, intent(in) :: v - BlindRamOpen = v + BopStackSpecification%BlindRamOpen = v end subroutine subroutine SetBlindRamClose(v) @@ -131,7 +131,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetBlindRamClose' :: SetBlindRamClose implicit none real*8, intent(in) :: v - BlindRamClose = v + BopStackSpecification%BlindRamClose = v end subroutine subroutine SetUpperRamOpen(v) @@ -139,7 +139,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetUpperRamOpen' :: SetUpperRamOpen implicit none real*8, intent(in) :: v - UpperRamOpen = v + BopStackSpecification%UpperRamOpen = v end subroutine subroutine SetUpperRamClose(v) @@ -147,7 +147,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetUpperRamClose' :: SetUpperRamClose implicit none real*8, intent(in) :: v - UpperRamClose = v + BopStackSpecification%UpperRamClose = v end subroutine subroutine SetAnnularPreventerOpen(v) @@ -155,7 +155,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetAnnularPreventerOpen' :: SetAnnularPreventerOpen implicit none real*8, intent(in) :: v - AnnularPreventerOpen = v + BopStackSpecification%AnnularPreventerOpen = v end subroutine subroutine SetAnnularPreventerClose(v) @@ -163,7 +163,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetAnnularPreventerClose' :: SetAnnularPreventerClose implicit none real*8, intent(in) :: v - AnnularPreventerClose = v + BopStackSpecification%AnnularPreventerClose = v end subroutine subroutine SetRamStringDrag(v) @@ -171,7 +171,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetRamStringDrag' :: SetRamStringDrag implicit none real*8, intent(in) :: v - RamStringDrag = v + BopStackSpecification%RamStringDrag = v end subroutine subroutine SetAnnularStringDrag(v) @@ -179,7 +179,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetAnnularStringDrag' :: SetAnnularStringDrag implicit none real*8, intent(in) :: v - AnnularStringDrag = v + BopStackSpecification%AnnularStringDrag = v end subroutine subroutine SetChokeLineLength(v) @@ -187,7 +187,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetChokeLineLength' :: SetChokeLineLength implicit none real*8, intent(in) :: v - ChokeLineLength = v + BopStackSpecification%ChokeLineLength = v end subroutine subroutine SetChokeLineId(v) @@ -195,7 +195,7 @@ module CBopStack !DEC$ ATTRIBUTES ALIAS: 'SetChokeLineId' :: SetChokeLineId implicit none real*8, intent(in) :: v - ChokeLineId = v + BopStackSpecification%ChokeLineId = v end subroutine end module CBopStack \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/CBopStackVariables.f90 b/CSharp/BasicInputs/RigSpecifications/CBopStackVariables.f90 index 598d586..429013a 100644 --- a/CSharp/BasicInputs/RigSpecifications/CBopStackVariables.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CBopStackVariables.f90 @@ -1,31 +1,31 @@ module CBopStackVariables implicit none public - - 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 - - contains + 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 BopStackType + Type(BopStackSpecificationType)::BopStackSpecification end module CBopStackVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/CHoisting.f90 b/CSharp/BasicInputs/RigSpecifications/CHoisting.f90 index 8151be3..e884b2a 100644 --- a/CSharp/BasicInputs/RigSpecifications/CHoisting.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CHoisting.f90 @@ -10,9 +10,9 @@ module CHoisting use CIrSafetyValveLedNotificationVariables, only: Set_IrSafetyValveLed implicit none integer, intent(in) :: v - DriveType = v + Hoisting%DriveType = v #ifdef deb - print*, 'DriveType=', DriveType + print*, 'DriveType=', Hoisting%DriveType #endif if(v == TopDrive_DriveType) then ! top drive mode call RemoveKellyCock() @@ -36,7 +36,7 @@ module CHoisting !DEC$ ATTRIBUTES ALIAS: 'SetTravelingBlockWeight' :: SetTravelingBlockWeight implicit none real*8, intent(in) :: v - TravelingBlockWeight = v + Hoisting%TravelingBlockWeight = v end subroutine subroutine SetTopDriveWeight(v) @@ -44,7 +44,7 @@ module CHoisting !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveWeight' :: SetTopDriveWeight implicit none real*8, intent(in) :: v - TopDriveWeight = v + Hoisting%TopDriveWeight = v end subroutine subroutine SetKellyWeight(v) @@ -52,7 +52,7 @@ module CHoisting !DEC$ ATTRIBUTES ALIAS: 'SetKellyWeight' :: SetKellyWeight implicit none real*8, intent(in) :: v - KellyWeight = v + Hoisting%KellyWeight = v end subroutine subroutine SetNumberOfLine(v) @@ -60,9 +60,9 @@ module CHoisting !DEC$ ATTRIBUTES ALIAS: 'SetNumberOfLine' :: SetNumberOfLine implicit none integer, intent(in) :: v - NumberOfLine = v + Hoisting%NumberOfLine = v #ifdef deb - print*, 'NumberOfLine=', NumberOfLine + print*, 'NumberOfLine=', Hoisting%NumberOfLine #endif end subroutine @@ -71,6 +71,6 @@ module CHoisting !DEC$ ATTRIBUTES ALIAS: 'SetDrillingLineBreakingLoad' :: SetDrillingLineBreakingLoad implicit none real*8, intent(in) :: v - DrillingLineBreakingLoad = v + Hoisting%DrillingLineBreakingLoad = v end subroutine end module CHoisting \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/CHoistingVariables.f90 b/CSharp/BasicInputs/RigSpecifications/CHoistingVariables.f90 index 2ee1f38..3f9fa20 100644 --- a/CSharp/BasicInputs/RigSpecifications/CHoistingVariables.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CHoistingVariables.f90 @@ -5,12 +5,15 @@ module CHoistingVariables integer :: TopDrive_DriveType = 0 integer :: Kelly_DriveType = 1 + ! variables - integer :: DriveType - real(8) :: TravelingBlockWeight - real(8) :: TopDriveWeight - real(8) :: KellyWeight - integer :: NumberOfLine - real(8) :: DrillingLineBreakingLoad - contains + Type::HoistingType + integer :: DriveType + real(8) :: TravelingBlockWeight + real(8) :: TopDriveWeight + real(8) :: KellyWeight + integer :: NumberOfLine + real(8) :: DrillingLineBreakingLoad + End type HoistingType + Type(HoistingType)::Hoisting end module CHoistingVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/CPower.f90 b/CSharp/BasicInputs/RigSpecifications/CPower.f90 index bfbb7b2..bc228ee 100644 --- a/CSharp/BasicInputs/RigSpecifications/CPower.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CPower.f90 @@ -9,7 +9,7 @@ module CPower !DEC$ ATTRIBUTES ALIAS: 'SetNumberOfgenerators' :: SetNumberOfgenerators implicit none integer, intent(in) :: v - NumberOfgenerators = v + Power%NumberOfgenerators = v end subroutine subroutine SetGeneratorPowerRating(v) @@ -17,7 +17,7 @@ module CPower !DEC$ ATTRIBUTES ALIAS: 'SetGeneratorPowerRating' :: SetGeneratorPowerRating implicit none real*8, intent(in) :: v - GeneratorPowerRating = v + Power%GeneratorPowerRating = v end subroutine subroutine SetMudPump1(v) @@ -25,7 +25,7 @@ module CPower !DEC$ ATTRIBUTES ALIAS: 'SetMudPump1' :: SetMudPump1 implicit none real*8, intent(in) :: v - MudPump1 = v + Power%MudPump1 = v end subroutine subroutine SetMudPump2(v) @@ -33,7 +33,7 @@ module CPower !DEC$ ATTRIBUTES ALIAS: 'SetMudPump2' :: SetMudPump2 implicit none real*8, intent(in) :: v - MudPump2 = v + Power%MudPump2 = v end subroutine subroutine SetCementPump(v) @@ -41,7 +41,7 @@ module CPower !DEC$ ATTRIBUTES ALIAS: 'SetCementPump' :: SetCementPump implicit none real*8, intent(in) :: v - CementPump = v + Power%CementPump = v end subroutine subroutine SetRotaryTable(v) @@ -49,7 +49,7 @@ module CPower !DEC$ ATTRIBUTES ALIAS: 'SetRotaryTable' :: SetRotaryTable implicit none real*8, intent(in) :: v - RotaryTable = v + Power%RotaryTable = v end subroutine subroutine SetDrawworks(v) @@ -57,7 +57,7 @@ module CPower !DEC$ ATTRIBUTES ALIAS: 'SetDrawworks' :: SetDrawworks implicit none real*8, intent(in) :: v - Drawworks = v + Power%Drawworks = v end subroutine subroutine SetTopDrive(v) @@ -65,7 +65,7 @@ module CPower !DEC$ ATTRIBUTES ALIAS: 'SetTopDrive' :: SetTopDrive implicit none real*8, intent(in) :: v - TopDrive = v + Power%TopDrive = v end subroutine end module CPower \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/CPowerVariables.f90 b/CSharp/BasicInputs/RigSpecifications/CPowerVariables.f90 index 33b3796..90d08db 100644 --- a/CSharp/BasicInputs/RigSpecifications/CPowerVariables.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CPowerVariables.f90 @@ -2,13 +2,15 @@ module CPowerVariables implicit none public ! variables - integer :: NumberOfgenerators - real(8) :: GeneratorPowerRating - real(8) :: MudPump1 - real(8) :: MudPump2 - real(8) :: CementPump - real(8) :: RotaryTable - real(8) :: Drawworks - real(8) :: TopDrive - contains + 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 \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/CPumps.f90 b/CSharp/BasicInputs/RigSpecifications/CPumps.f90 index 605bf84..75408c4 100644 --- a/CSharp/BasicInputs/RigSpecifications/CPumps.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CPumps.f90 @@ -10,10 +10,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump1LinerDiameter' :: SetMudPump1LinerDiameter implicit none real*8, intent(in) :: v - MudPump1LinerDiameter = v + PumpsSpecification%MudPump1LinerDiameter = v call CalcPump1OutputBblStroke() #ifdef deb - call Log_4( 'MudPump1LinerDiameter=', MudPump1LinerDiameter) + call Log_4( 'MudPump1LinerDiameter=', PumpsSpecification%MudPump1LinerDiameter) #endif end subroutine @@ -22,7 +22,7 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump1Stroke' :: SetMudPump1Stroke implicit none real*8, intent(in) :: v - MudPump1Stroke = v + PumpsSpecification%MudPump1Stroke = v !call CalcMudPump1LinerDiameter() call CalcPump1OutputBblStroke() #ifdef deb @@ -35,7 +35,7 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump1MechanicalEfficiency' :: SetMudPump1MechanicalEfficiency implicit none real*8, intent(in) :: v - MudPump1MechanicalEfficiency = v + PumpsSpecification%MudPump1MechanicalEfficiency = v end subroutine subroutine SetMudPump1VolumetricEfficiency(v) @@ -43,11 +43,11 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump1VolumetricEfficiency' :: SetMudPump1VolumetricEfficiency implicit none real*8, intent(in) :: v - MudPump1VolumetricEfficiency = v + PumpsSpecification%MudPump1VolumetricEfficiency = v !call CalcMudPump1LinerDiameter() call CalcPump1OutputBblStroke() #ifdef deb - call Log_4( 'MudPump1VolumetricEfficiency=', MudPump1VolumetricEfficiency) + call Log_4( 'MudPump1VolumetricEfficiency=', PumpsSpecification%MudPump1VolumetricEfficiency) #endif end subroutine @@ -56,9 +56,9 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump1Output' :: SetMudPump1Output implicit none real*8, intent(in) :: v - MudPump1Output = v + PumpsSpecification%MudPump1Output = v #ifdef deb - print*, 'MudPump1Output=', MudPump1Output + print*, 'MudPump1Output=', PumpsSpecification%MudPump1Output #endif end subroutine @@ -67,10 +67,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump1OutputBblStroke' :: SetMudPump1OutputBblStroke implicit none real*8, intent(in) :: v - MudPump1OutputBblStroke = v + PumpsSpecification%MudPump1OutputBblStroke = v call CalcMudPump1LinerDiameter() #ifdef deb - print*, 'MudPump1OutputBblStroke=', MudPump1OutputBblStroke + print*, 'MudPump1OutputBblStroke=', PumpsSpecification%MudPump1OutputBblStroke #endif end subroutine @@ -79,7 +79,7 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump1Maximum' :: SetMudPump1Maximum implicit none real*8, intent(in) :: v - MudPump1Maximum = v + PumpsSpecification%MudPump1Maximum = v end subroutine subroutine SetMudPump1ReliefValvePressure(v) @@ -87,7 +87,7 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump1ReliefValvePressure' :: SetMudPump1ReliefValvePressure implicit none real*8, intent(in) :: v - MudPump1ReliefValvePressure = v + PumpsSpecification%MudPump1ReliefValvePressure = v end subroutine @@ -97,10 +97,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump2LinerDiameter' :: SetMudPump2LinerDiameter implicit none real*8, intent(in) :: v - MudPump2LinerDiameter = v + PumpsSpecification%MudPump2LinerDiameter = v call CalcPump2OutputBblStroke() #ifdef deb - call Log_4( 'MudPump2LinerDiameter=', MudPump2LinerDiameter) + call Log_4( 'MudPump2LinerDiameter=', PumpsSpecification%MudPump2LinerDiameter) #endif end subroutine @@ -109,11 +109,11 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump2Stroke' :: SetMudPump2Stroke implicit none real*8, intent(in) :: v - MudPump2Stroke = v + PumpsSpecification%MudPump2Stroke = v !call CalcMudPump2LinerDiameter() call CalcPump2OutputBblStroke() #ifdef deb - call Log_4( 'MudPump2Stroke=', MudPump2Stroke) + call Log_4( 'MudPump2Stroke=', PumpsSpecification%MudPump2Stroke) #endif end subroutine @@ -122,7 +122,7 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump2MechanicalEfficiency' :: SetMudPump2MechanicalEfficiency implicit none real*8, intent(in) :: v - MudPump2MechanicalEfficiency = v + PumpsSpecification%MudPump2MechanicalEfficiency = v end subroutine subroutine SetMudPump2VolumetricEfficiency(v) @@ -130,11 +130,11 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump2VolumetricEfficiency' :: SetMudPump2VolumetricEfficiency implicit none real*8, intent(in) :: v - MudPump2VolumetricEfficiency = v + PumpsSpecification%MudPump2VolumetricEfficiency = v !call CalcMudPump2LinerDiameter() call CalcPump2OutputBblStroke() #ifdef deb - call Log_4( 'MudPump2VolumetricEfficiency=', MudPump2VolumetricEfficiency) + call Log_4( 'MudPump2VolumetricEfficiency=', PumpsSpecification%MudPump2VolumetricEfficiency) #endif end subroutine @@ -143,9 +143,9 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump2Output' :: SetMudPump2Output implicit none real*8, intent(in) :: v - MudPump2Output = v + PumpsSpecification%MudPump2Output = v #ifdef deb - print*, 'MudPump2Output=', MudPump2Output + print*, 'MudPump2Output=', PumpsSpecification%MudPump2Output #endif end subroutine @@ -154,10 +154,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump2OutputBblStroke' :: SetMudPump2OutputBblStroke implicit none real*8, intent(in) :: v - MudPump2OutputBblStroke = v + PumpsSpecification%MudPump2OutputBblStroke = v call CalcMudPump2LinerDiameter() #ifdef deb - print*, 'MudPump2OutputBblStroke=', MudPump2OutputBblStroke + print*, 'MudPump2OutputBblStroke=', PumpsSpecification%MudPump2OutputBblStroke #endif end subroutine @@ -166,7 +166,7 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump2Maximum' :: SetMudPump2Maximum implicit none real*8, intent(in) :: v - MudPump2Maximum = v + PumpsSpecification%MudPump2Maximum = v end subroutine subroutine SetMudPump2ReliefValvePressure(v) @@ -174,7 +174,7 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump2ReliefValvePressure' :: SetMudPump2ReliefValvePressure implicit none real*8, intent(in) :: v - MudPump2ReliefValvePressure = v + PumpsSpecification%MudPump2ReliefValvePressure = v end subroutine @@ -184,10 +184,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetCementPumpLinerDiameter' :: SetCementPumpLinerDiameter implicit none real*8, intent(in) :: v - CementPumpLinerDiameter = v + PumpsSpecification%CementPumpLinerDiameter = v call CalcPump3OutputBblStroke() #ifdef deb - call Log_4( 'CementPumpLinerDiameter=', CementPumpLinerDiameter) + call Log_4( 'CementPumpLinerDiameter=', PumpsSpecification%CementPumpLinerDiameter) #endif end subroutine @@ -196,11 +196,11 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetCementPumpStroke' :: SetCementPumpStroke implicit none real*8, intent(in) :: v - CementPumpStroke = v + PumpsSpecification%CementPumpStroke = v !call CalcMudPump3LinerDiameter() call CalcPump3OutputBblStroke() #ifdef deb - call Log_4( 'CementPumpStroke=', CementPumpStroke) + call Log_4( 'CementPumpStroke=', PumpsSpecification%CementPumpStroke) #endif end subroutine @@ -209,7 +209,7 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetCementPumpMechanicalEfficiency' :: SetCementPumpMechanicalEfficiency implicit none real*8, intent(in) :: v - CementPumpMechanicalEfficiency = v + PumpsSpecification%CementPumpMechanicalEfficiency = v end subroutine subroutine SetCementPumpVolumetricEfficiency(v) @@ -217,11 +217,11 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetCementPumpVolumetricEfficiency' :: SetCementPumpVolumetricEfficiency implicit none real*8, intent(in) :: v - CementPumpVolumetricEfficiency = v + PumpsSpecification%CementPumpVolumetricEfficiency = v !call CalcMudPump3LinerDiameter() call CalcPump3OutputBblStroke() #ifdef deb - call Log_4( 'CementPumpVolumetricEfficiency=', CementPumpVolumetricEfficiency) + call Log_4( 'CementPumpVolumetricEfficiency=', PumpsSpecification%CementPumpVolumetricEfficiency) #endif end subroutine @@ -230,9 +230,9 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetCementPumpOutput' :: SetCementPumpOutput implicit none real*8, intent(in) :: v - CementPumpOutput = v + PumpsSpecification%CementPumpOutput = v #ifdef deb - print*, 'CementPumpOutput=', CementPumpOutput + print*, 'CementPumpOutput=', PumpsSpecification%CementPumpOutput #endif end subroutine @@ -241,10 +241,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetCementPumpOutputBblStroke' :: SetCementPumpOutputBblStroke implicit none real*8, intent(in) :: v - CementPumpOutputBblStroke = v + PumpsSpecification%CementPumpOutputBblStroke = v call CalcMudPump3LinerDiameter() #ifdef deb - print*, 'CementPumpOutputBblStroke=', CementPumpOutputBblStroke + print*, 'CementPumpOutputBblStroke=', PumpsSpecification%CementPumpOutputBblStroke #endif end subroutine @@ -253,7 +253,7 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetCementPumpMaximum' :: SetCementPumpMaximum implicit none real*8, intent(in) :: v - CementPumpMaximum = v + PumpsSpecification%CementPumpMaximum = v end subroutine subroutine SetCementPumpReliefValvePressure(v) @@ -261,7 +261,7 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetCementPumpReliefValvePressure' :: SetCementPumpReliefValvePressure implicit none real*8, intent(in) :: v - CementPumpReliefValvePressure = v + PumpsSpecification%CementPumpReliefValvePressure = v end subroutine subroutine SetMudPump1ReliefValveIsSet(v) @@ -269,10 +269,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump1ReliefValveIsSet' :: SetMudPump1ReliefValveIsSet implicit none logical, intent(in) :: v - if (MudPump1ReliefValveIsSet == v) return - MudPump1ReliefValveIsSet = v + if (PumpsSpecification%MudPump1ReliefValveIsSet == v) return + PumpsSpecification%MudPump1ReliefValveIsSet = v #ifdef deb - print*, 'MudPump1ReliefValveIsSet=', MudPump1ReliefValveIsSet + print*, 'MudPump1ReliefValveIsSet=', PumpsSpecification%MudPump1ReliefValveIsSet #endif end subroutine @@ -281,10 +281,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetMudPump2ReliefValveIsSet' :: SetMudPump2ReliefValveIsSet implicit none logical, intent(in) :: v - if (MudPump2ReliefValveIsSet == v) return - MudPump2ReliefValveIsSet = v + if (PumpsSpecification%MudPump2ReliefValveIsSet == v) return + PumpsSpecification%MudPump2ReliefValveIsSet = v #ifdef deb - print*, 'MudPump2ReliefValveIsSet=', MudPump2ReliefValveIsSet + print*, 'MudPump2ReliefValveIsSet=', PumpsSpecification%MudPump2ReliefValveIsSet #endif end subroutine @@ -293,10 +293,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetCementPumpReliefValveIsSet' :: SetCementPumpReliefValveIsSet implicit none logical, intent(in) :: v - if (CementPumpReliefValveIsSet == v) return - CementPumpReliefValveIsSet = v + if (PumpsSpecification%CementPumpReliefValveIsSet == v) return + PumpsSpecification%CementPumpReliefValveIsSet = v #ifdef deb - print*, 'CementPumpReliefValveIsSet=', CementPumpReliefValveIsSet + print*, 'CementPumpReliefValveIsSet=', PumpsSpecification%CementPumpReliefValveIsSet #endif end subroutine @@ -310,10 +310,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetManualPumpPower' :: SetManualPumpPower implicit none logical, intent(in) :: v - ManualPumpPower = v + PumpsSpecification%ManualPumpPower = v call ChangeValve(23, v) #ifdef deb - print*, 'ManualPumpPower=', ManualPumpPower + print*, 'ManualPumpPower=', PumpsSpecification%ManualPumpPower #endif end subroutine @@ -322,10 +322,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetValve1' :: SetValve1 implicit none logical, intent(in) :: v - Valve1 = v + PumpsSpecification%Valve1 = v call ChangeValve(22, v) #ifdef deb - print*, 'Valve1=', Valve1 + print*, 'Valve1=', PumpsSpecification%Valve1 #endif end subroutine @@ -334,10 +334,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetValve2' :: SetValve2 implicit none logical, intent(in) :: v - Valve2 = v + PumpsSpecification%Valve2 = v call ChangeValve(19, v) #ifdef deb - print*, 'Valve2=', Valve2 + print*, 'Valve2=', PumpsSpecification%Valve2 #endif end subroutine @@ -346,10 +346,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetValve3' :: SetValve3 implicit none logical, intent(in) :: v - Valve3 = v + PumpsSpecification%Valve3 = v call ChangeValve(21, v) #ifdef deb - print*, 'Valve3=', Valve3 + print*, 'Valve3=', PumpsSpecification%Valve3 #endif end subroutine @@ -358,10 +358,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetValve4' :: SetValve4 implicit none logical, intent(in) :: v - Valve4 = v + PumpsSpecification%Valve4 = v call ChangeValve(20, v) #ifdef deb - print*, 'Valve4=', Valve4 + print*, 'Valve4=', PumpsSpecification%Valve4 #endif end subroutine @@ -370,10 +370,10 @@ module CPumps !DEC$ ATTRIBUTES ALIAS: 'SetValve5' :: SetValve5 implicit none logical, intent(in) :: v - Valve5 = v + PumpsSpecification%Valve5 = v call ChangeValve(24, v) #ifdef deb - print*, 'Valve5=', Valve5 + print*, 'Valve5=', PumpsSpecification%Valve5 #endif end subroutine diff --git a/CSharp/BasicInputs/RigSpecifications/CPumpsVariables.f90 b/CSharp/BasicInputs/RigSpecifications/CPumpsVariables.f90 index 34dd64e..1511cdc 100644 --- a/CSharp/BasicInputs/RigSpecifications/CPumpsVariables.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CPumpsVariables.f90 @@ -5,43 +5,46 @@ module CPumpsVariables ! Pumps Specifications - 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 + 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 @@ -199,62 +202,62 @@ module CPumpsVariables use, intrinsic :: IEEE_ARITHMETIC implicit none real(8) :: a - a = (MathPI / 4.d0) * MudPump1Stroke * 3.0d0 * MudPump1VolumetricEfficiency / 9702.03d0 - a = dsqrt(MudPump1OutputBblStroke / a) + a = (MathPI / 4.d0) * PumpsSpecification%MudPump1Stroke * 3.0d0 * PumpsSpecification%MudPump1VolumetricEfficiency / 9702.03d0 + a = dsqrt(PumpsSpecification%MudPump1OutputBblStroke / a) if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then - MudPump1LinerDiameter = 0.0 + PumpsSpecification%MudPump1LinerDiameter = 0.0 else - MudPump1LinerDiameter = a + PumpsSpecification%MudPump1LinerDiameter = a endif - call SetMudPump1LinerDiameterN(MudPump1LinerDiameter) + call SetMudPump1LinerDiameterN(PumpsSpecification%MudPump1LinerDiameter) end subroutine subroutine CalcMudPump2LinerDiameter() use, intrinsic :: IEEE_ARITHMETIC implicit none real(8) :: a - a = (MathPI / 4.d0) * MudPump2Stroke * 3.0d0 * MudPump2VolumetricEfficiency / 9702.03d0 - a = dsqrt(MudPump2OutputBblStroke / a) + a = (MathPI / 4.d0) * PumpsSpecification%MudPump2Stroke * 3.0d0 * PumpsSpecification%MudPump2VolumetricEfficiency / 9702.03d0 + a = dsqrt(PumpsSpecification%MudPump2OutputBblStroke / a) if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then - MudPump2LinerDiameter = 0.0 + PumpsSpecification%MudPump2LinerDiameter = 0.0 else - MudPump2LinerDiameter = a + PumpsSpecification%MudPump2LinerDiameter = a endif - call SetMudPump2LinerDiameterN(MudPump2LinerDiameter) + call SetMudPump2LinerDiameterN(PumpsSpecification%MudPump2LinerDiameter) end subroutine subroutine CalcMudPump3LinerDiameter() use, intrinsic :: IEEE_ARITHMETIC implicit none real(8) :: a - a = (MathPI / 4.d0) * CementPumpStroke * 3.0d0 * CementPumpVolumetricEfficiency / 9702.03d0 - a = dsqrt(CementPumpOutputBblStroke / a) + a = (MathPI / 4.d0) * PumpsSpecification%CementPumpStroke * 3.0d0 * PumpsSpecification%CementPumpVolumetricEfficiency / 9702.03d0 + a = dsqrt(PumpsSpecification%CementPumpOutputBblStroke / a) if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then - CementPumpLinerDiameter = 0.0 + PumpsSpecification%CementPumpLinerDiameter = 0.0 else - CementPumpLinerDiameter = a + PumpsSpecification%CementPumpLinerDiameter = a endif - call SetMudPump3LinerDiameterN(CementPumpLinerDiameter) + call SetMudPump3LinerDiameterN(PumpsSpecification%CementPumpLinerDiameter) end subroutine subroutine CalcPump1OutputBblStroke() implicit none - MudPump1OutputBblStroke = (MathPI / 4.d0) * (MudPump1LinerDiameter**2) * MudPump1Stroke * 3.0d0 * MudPump1VolumetricEfficiency / 9702.03d0 - call SetMudPump1OutputBblStrokeN(MudPump1OutputBblStroke) + PumpsSpecification%MudPump1OutputBblStroke = (MathPI / 4.d0) * (PumpsSpecification%MudPump1LinerDiameter**2) * PumpsSpecification%MudPump1Stroke * 3.0d0 * PumpsSpecification%MudPump1VolumetricEfficiency / 9702.03d0 + call SetMudPump1OutputBblStrokeN(PumpsSpecification%MudPump1OutputBblStroke) end subroutine subroutine CalcPump2OutputBblStroke() implicit none - MudPump2OutputBblStroke = (MathPI / 4.d0) * (MudPump2LinerDiameter**2) * MudPump2Stroke * 3.0d0 * MudPump2VolumetricEfficiency / 9702.03d0 - call SetMudPump2OutputBblStrokeN(MudPump2OutputBblStroke) + PumpsSpecification%MudPump2OutputBblStroke = (MathPI / 4.d0) * (PumpsSpecification%MudPump2LinerDiameter**2) * PumpsSpecification%MudPump2Stroke * 3.0d0 * PumpsSpecification%MudPump2VolumetricEfficiency / 9702.03d0 + call SetMudPump2OutputBblStrokeN(PumpsSpecification%MudPump2OutputBblStroke) end subroutine subroutine CalcPump3OutputBblStroke() implicit none - CementPumpOutputBblStroke = (MathPI / 4.d0) * (CementPumpLinerDiameter**2) * CementPumpStroke * 3.0d0 * CementPumpVolumetricEfficiency / 9702.03d0 - call SetMudPump3OutputBblStrokeN(CementPumpOutputBblStroke) + PumpsSpecification%CementPumpOutputBblStroke = (MathPI / 4.d0) * (PumpsSpecification%CementPumpLinerDiameter**2) * PumpsSpecification%CementPumpStroke * 3.0d0 * PumpsSpecification%CementPumpVolumetricEfficiency / 9702.03d0 + call SetMudPump3OutputBblStrokeN(PumpsSpecification%CementPumpOutputBblStroke) end subroutine end module CPumpsVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/CRigSize.f90 b/CSharp/BasicInputs/RigSpecifications/CRigSize.f90 index e10dff3..1f4a127 100644 --- a/CSharp/BasicInputs/RigSpecifications/CRigSize.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CRigSize.f90 @@ -8,7 +8,7 @@ module CRigSize !DEC$ ATTRIBUTES ALIAS: 'SetRigType' :: SetRigType implicit none integer, intent(in) :: v - RigType = v + RigSize%RigType = v end subroutine subroutine SetCrownHeight(v) @@ -16,7 +16,7 @@ module CRigSize !DEC$ ATTRIBUTES ALIAS: 'SetCrownHeight' :: SetCrownHeight implicit none real*8, intent(in) :: v - CrownHeight = v + RigSize%CrownHeight = v end subroutine subroutine SetMonkeyBoandHeight(v) @@ -24,7 +24,7 @@ module CRigSize !DEC$ ATTRIBUTES ALIAS: 'SetMonkeyBoandHeight' :: SetMonkeyBoandHeight implicit none real*8, intent(in) :: v - MonkeyBoandHeight = v + RigSize%MonkeyBoandHeight = v end subroutine subroutine SetRigFloorHeight(v) @@ -32,6 +32,6 @@ module CRigSize !DEC$ ATTRIBUTES ALIAS: 'SetRigFloorHeight' :: SetRigFloorHeight implicit none real*8, intent(in) :: v - RigFloorHeight = v + RigSize%RigFloorHeight = v end subroutine end module CRigSize \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/CRigSizeVariables.f90 b/CSharp/BasicInputs/RigSpecifications/CRigSizeVariables.f90 index 647bf16..e7e96ee 100644 --- a/CSharp/BasicInputs/RigSpecifications/CRigSizeVariables.f90 +++ b/CSharp/BasicInputs/RigSpecifications/CRigSizeVariables.f90 @@ -5,9 +5,11 @@ module CRigSizeVariables integer :: Convensional_RigSize = 0 ! variables - integer :: RigType - real(8) :: CrownHeight - real(8) :: MonkeyBoandHeight - real(8) :: RigFloorHeight - contains + Type:: RigSizeType + integer :: RigType + real(8) :: CrownHeight + real(8) :: MonkeyBoandHeight + real(8) :: RigFloorHeight + End type RigSizeType + Type(RigSizeType)::RigSize end module CRigSizeVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/RigSpecifications/caccumulatorvariables.mod b/CSharp/BasicInputs/RigSpecifications/caccumulatorvariables.mod deleted file mode 100644 index b01733b25cad8593a073d9ec87f3c54b2bf487f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 520 zcmV+j0{8tNiwFP!000001I?CEZ<{a>$KU-a?#;33(}-@gAi3m2giKqel`l);us#YGO-8e*W5C7M0L zT8a$l`*<$JS4Oppmyth>1NJ@QS(zr<1h_)7*p0pO;j+-*PPb# zRO~vGmUWnr%S7^Il`{2iJtnBv>%&{Ts2TK;8Mb^j;N%%1ZS&fUa=hu~8%`y5>P!NLm`J98e++{OTZI-mHizqpE=r3VDa z6C?^fX9AGB;I;9T26;}c3POVy@al)sEK~gFtGGK_^cS@Iu&4vLmZR6=|7uZ>a+TKz~}%!~RDtkYm6`p{P;X z4eKgZ|7Gbd0$Axp>dU6I4k+!*#I!3+QT%o-|K--S1}`Bmvy{~hpxgORz&?4{5*VNp zXB#oHb1H8FL)5C>1a4ZSlECeeCJ`8+HVGgwK594uM_p*wUJD&;C*!k^R?j#Gee?^B Kp$P0G3IG6_GyER_ diff --git a/CSharp/BasicInputs/RigSpecifications/cbopstackvariables.mod b/CSharp/BasicInputs/RigSpecifications/cbopstackvariables.mod deleted file mode 100644 index cc48d2cd0646192c6412560ea4d24f8b8b1baf1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 624 zcmV-$0+0P4iwFP!000001I?Gqj-o&mhWGUpXNN9&QlPZjJ9V518ASuOvtff+A|q0y zK>PLQC`}_5JMCm*D$&UK1LmXZuXFkNV{R?2p$P}RIfe{QOe6u1Kv8uCJi*+QZD1?- z0lXJyA^0EWrHQk$jhSPzH#;~SLpQ|-##}IGZ0}qVJ0mv4dzRzs&h>^T{xm6LSf9xUlBqJOE?1m>Oea`D71Q6QDpd z9&0k3LjN2CC6@pZFJT5uiEDP}X4(A>82(Z$g=n{3{_;2uTBBzaYHFlaE9k6o_B<;v)f7dIRYb z&e{C?>leM4|9r0Lx|0yH`wl7T zQNaS^3x13?A(od=LO?7m`ydQuJtVyhPu5(m_A@?7-G`+l=U6MhXoRW%lwE zbkZ~!QFyM6A{2V{=AS~JRN8F{gXTr0aOr%ndP-DOQtskV(i-|ElslzP1%+<8Hy|kK zrD}}AbGiPZ(z~uW8276={`^0KdRE2dr`0@$np(>oC~Bm7R#EKKPY0^qsvl9)+vG2u KHEp*?5&!_=Z6)mh diff --git a/CSharp/BasicInputs/WellProfile/CCasingLinerChoke.f90 b/CSharp/BasicInputs/WellProfile/CCasingLinerChoke.f90 index cfcaeb3..e93359d 100644 --- a/CSharp/BasicInputs/WellProfile/CCasingLinerChoke.f90 +++ b/CSharp/BasicInputs/WellProfile/CCasingLinerChoke.f90 @@ -9,7 +9,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetCasingDepth' :: SetCasingDepth implicit none real*8, intent(in) :: v - CasingDepth = v + CasingLinerChoke%CasingDepth = v end subroutine subroutine SetCasingId(v) @@ -17,7 +17,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetCasingId' :: SetCasingId implicit none real*8, intent(in) :: v - CasingId = v + CasingLinerChoke%CasingId = v end subroutine subroutine SetCasingOd(v) @@ -25,7 +25,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetCasingOd' :: SetCasingOd implicit none real*8, intent(in) :: v - CasingOd = v + CasingLinerChoke%CasingOd = v end subroutine subroutine SetCasingWeight(v) @@ -33,7 +33,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetCasingWeight' :: SetCasingWeight implicit none real*8, intent(in) :: v - CasingWeight = v + CasingLinerChoke%CasingWeight = v end subroutine subroutine SetCasingCollapsePressure(v) @@ -41,7 +41,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetCasingCollapsePressure' :: SetCasingCollapsePressure implicit none real*8, intent(in) :: v - CasingCollapsePressure = v + CasingLinerChoke%CasingCollapsePressure = v end subroutine subroutine SetCasingTensileStrength(v) @@ -49,7 +49,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetCasingTensileStrength' :: SetCasingTensileStrength implicit none real*8, intent(in) :: v - CasingTensileStrength = v + CasingLinerChoke%CasingTensileStrength = v end subroutine @@ -64,7 +64,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetLinerTopDepth' :: SetLinerTopDepth implicit none real*8, intent(in) :: v - LinerTopDepth = v + CasingLinerChoke%LinerTopDepth = v end subroutine subroutine SetLinerLength(v) @@ -72,7 +72,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetLinerLength' :: SetLinerLength implicit none real*8, intent(in) :: v - LinerLength = v + CasingLinerChoke%LinerLength = v end subroutine subroutine SetLinerId(v) @@ -80,7 +80,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetLinerId' :: SetLinerId implicit none real*8, intent(in) :: v - LinerId = v + CasingLinerChoke%LinerId = v end subroutine subroutine SetLinerOd(v) @@ -88,7 +88,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetLinerOd' :: SetLinerOd implicit none real*8, intent(in) :: v - LinerOd = v + CasingLinerChoke%LinerOd = v end subroutine subroutine SetLinerWeight(v) @@ -96,7 +96,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetLinerWeight' :: SetLinerWeight implicit none real*8, intent(in) :: v - LinerWeight = v + CasingLinerChoke%LinerWeight = v end subroutine subroutine SetLinerCollapsePressure(v) @@ -104,7 +104,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetLinerCollapsePressure' :: SetLinerCollapsePressure implicit none real*8, intent(in) :: v - LinerCollapsePressure = v + CasingLinerChoke%LinerCollapsePressure = v end subroutine subroutine SetLinerTensileStrength(v) @@ -112,7 +112,7 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetLinerTensileStrength' :: SetLinerTensileStrength implicit none real*8, intent(in) :: v - LinerTensileStrength = v + CasingLinerChoke%LinerTensileStrength = v end subroutine @@ -122,9 +122,9 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetOpenHoleId' :: SetOpenHoleId implicit none real*8, intent(in) :: v - OpenHoleId = v + CasingLinerChoke%OpenHoleId = v #ifdef deb - print*, 'OpenHoleId=', OpenHoleId + print*, 'OpenHoleId=', CasingLinerChoke%OpenHoleId #endif end subroutine @@ -133,9 +133,9 @@ module CCasingLinerChoke !DEC$ ATTRIBUTES ALIAS: 'SetOpenHoleLength' :: SetOpenHoleLength implicit none real*8, intent(in) :: v - OpenHoleLength = v + CasingLinerChoke%OpenHoleLength = v #ifdef deb - print*, 'OpenHoleLength=', OpenHoleLength + print*, 'OpenHoleLength=', CasingLinerChoke%OpenHoleLength #endif end subroutine diff --git a/CSharp/BasicInputs/WellProfile/CCasingLinerChokeVariables.f90 b/CSharp/BasicInputs/WellProfile/CCasingLinerChokeVariables.f90 index 605f5d6..71f6833 100644 --- a/CSharp/BasicInputs/WellProfile/CCasingLinerChokeVariables.f90 +++ b/CSharp/BasicInputs/WellProfile/CCasingLinerChokeVariables.f90 @@ -1,24 +1,26 @@ module CCasingLinerChokeVariables - implicit none + implicit none public ! variables - 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 - + 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 \ No newline at end of file diff --git a/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 b/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 index 862a383..c5db1d4 100644 --- a/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 +++ b/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 @@ -12,20 +12,20 @@ module CPathGeneration type(CPathGenerationItem), intent(inout), target :: array(count) type(CPathGenerationItem), pointer :: item PathGenerationCount = count - if(size(PathGenerations) > 0) then - deallocate(PathGenerations) + if(size(PathGeneration%Items) > 0) then + deallocate(PathGeneration%Items) end if if(count > 0) then - allocate(PathGenerations(count)) + allocate(PathGeneration%Items(count)) do i = 1, count item => array(i) - PathGenerations(i)%HoleType = item%HoleType - PathGenerations(i)%Angle = item%Angle - PathGenerations(i)%Length = item%Length - PathGenerations(i)%FinalAngle = item%FinalAngle - PathGenerations(i)%TotalLength = item%TotalLength - PathGenerations(i)%MeasuredDepth = item%MeasuredDepth - PathGenerations(i)%TotalVerticalDepth = item%TotalVerticalDepth + PathGeneration%Items(i)%HoleType = item%HoleType + PathGeneration%Items(i)%Angle = item%Angle + PathGeneration%Items(i)%Length = item%Length + PathGeneration%Items(i)%FinalAngle = item%FinalAngle + PathGeneration%Items(i)%TotalLength = item%TotalLength + PathGeneration%Items(i)%MeasuredDepth = item%MeasuredDepth + PathGeneration%Items(i)%TotalVerticalDepth = item%TotalVerticalDepth end do end if @@ -41,16 +41,16 @@ module CPathGeneration integer :: i type(CDataPointItem), intent(inout), target :: array(count) type(CDataPointItem), pointer :: item - PathGenerationDataPointsCount = count - if(size(PathGenerationDataPoints) > 0) then - deallocate(PathGenerationDataPoints) + PathGeneration%DataPointsCount = count + if(size(PathGeneration%DataPoints) > 0) then + deallocate(PathGeneration%DataPoints) end if if(count > 0) then - allocate(PathGenerationDataPoints(count)) + allocate(PathGeneration%DataPoints(count)) do i = 1, count item => array(i) - PathGenerationDataPoints(i)%X = item%X - PathGenerationDataPoints(i)%Y = item%Y + PathGeneration%DataPoints(i)%X = item%X + PathGeneration%DataPoints(i)%Y = item%Y end do end if diff --git a/CSharp/BasicInputs/WellProfile/CPathGenerationVariables.f90 b/CSharp/BasicInputs/WellProfile/CPathGenerationVariables.f90 index 5b70248..76191ea 100644 --- a/CSharp/BasicInputs/WellProfile/CPathGenerationVariables.f90 +++ b/CSharp/BasicInputs/WellProfile/CPathGenerationVariables.f90 @@ -17,12 +17,14 @@ module CPathGenerationVariables real(8) :: X real(8) :: Y end type CDataPointItem - - integer :: PathGenerationCount = 0 - type(CPathGenerationItem), allocatable :: PathGenerations(:) - - integer :: PathGenerationDataPointsCount = 0 - type(CDataPointItem), allocatable :: PathGenerationDataPoints(:) - - contains + + 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 \ No newline at end of file diff --git a/CSharp/BasicInputs/WellProfile/CWellSurveyData.f90 b/CSharp/BasicInputs/WellProfile/CWellSurveyData.f90 index 3678afe..be9f6b2 100644 --- a/CSharp/BasicInputs/WellProfile/CWellSurveyData.f90 +++ b/CSharp/BasicInputs/WellProfile/CWellSurveyData.f90 @@ -12,20 +12,20 @@ module CWellSurveyData type(CSurveyDataItem), intent(inout), target :: array(count) type(CSurveyDataItem), pointer :: item SurveyDataCount = count - if(size(WellSurveyData) > 0) then - deallocate(WellSurveyData) + if(size(WellSurveyData%Items) > 0) then + deallocate(WellSurveyData%Items) end if if(count > 0) then - allocate(WellSurveyData(count)) + allocate(WellSurveyData%Items(count)) do i = 1, count item => array(i) - WellSurveyData(i)%MeasuredDepth = item%MeasuredDepth - WellSurveyData(i)%Inclination = item%Inclination - WellSurveyData(i)%Azimoth = item%Azimoth - WellSurveyData(i)%TotalVerticalDepth = item%TotalVerticalDepth - WellSurveyData(i)%X = item%X - WellSurveyData(i)%Y = item%Y - WellSurveyData(i)%Z = item%Z + 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 diff --git a/CSharp/BasicInputs/WellProfile/CWellSurveyDataVariables.f90 b/CSharp/BasicInputs/WellProfile/CWellSurveyDataVariables.f90 index 3a998fe..9324737 100644 --- a/CSharp/BasicInputs/WellProfile/CWellSurveyDataVariables.f90 +++ b/CSharp/BasicInputs/WellProfile/CWellSurveyDataVariables.f90 @@ -12,9 +12,12 @@ module CWellSurveyDataVariables real(8) :: Y real(8) :: Z end type CSurveyDataItem + + Type :: WellSurveyDataType + integer :: Count = 0 + type(CSurveyDataItem), allocatable :: Items(:) + End Type WellSurveyDataType - integer :: SurveyDataCount = 0 - type(CSurveyDataItem), allocatable :: WellSurveyData(:) - + Type(WellSurveyDataType)::WellSurveyData contains end module CWellSurveyDataVariables \ No newline at end of file diff --git a/CSharp/BasicInputs/WellProfile/cpathgenerationvariables.mod b/CSharp/BasicInputs/WellProfile/cpathgenerationvariables.mod deleted file mode 100644 index b24e01b475c632160c6455f94f0232d98353930e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1564 zcmV+%2IKi3iwFP!000001MON}bD~HTeeYk!Q#W&RHceyluXz% zY9X1O?62Po2mu6aBI9JIwh}8r?7rvpz4zSPjq^Lhv`tCJ&-=~G*2mxc@EGiOm|_G9 zuS4I9{0)8#_s@9!$HOw*|K+cv#JUmRjW3X0t zhZp$dXMekeVUNKUZZEy)Y3}d*Fd4G)!od5o^^doPE~#8%7A^qW9mDF2gp<;4U5Tr8YdU9B87Fz zX1&vJi#=3hZabg;3uB7#dU2 zKJvCCOYnmrFqnGwz2i&hZ#MqnCxKv3>j1?l3fA710Lc%Ci2l??6a|*&IA(|#kQdk8 z_>XP?y5crzid(53ZPn+bJ}b#orKzS6$+@~%0x{M8&5~A10#Pz;^$y;GHMJ#kuGlI5 zlcr(zwCI_}oiQ)a1(rM^%Z`QiCRDj@RE3!8x5)eQft;Dr!Yf;vmbo#bGP$HpY9Ti! zAoo*z*vwGu#&DD}gmT-b|1#qpTPxsmzf|HjfPrGA)`Q^AtTQac=BS3|^&wZR84WyiN7GQLQ>X%=Q#cp+qI$mLB*vgM+^=CvPT^Kd zZyiw#R++`_=(;O;b1Z6L{0_&Rw^{8ARxjI$aEm0u{l40CwR*GS$5!vGAI;T!@^jRi zqwCdMyrFt?Ouc$n+Q3_>H^do=>>dgtirh0Ru|JA#s-W-&(4yUpwUCx)I z^@wez$XaPF?i^jVRYS*fMTcaT%cmBdumf`O4CsFf{-hP?MGgyN=4kB%YBj%*z!_ph zhM0#MQAV}izw9Csu-P7y2=3V)GeuFVq^Md+8$mNw(0Q;EEi)q79ydcrlBOB5WG6Gs zRM2$`0;u&wr$mT>DQ3zYC_-{0*S``)wwWTahpyy#N`>}rr_o1Tl>m`zt_vz$@C<73 zOikxe^b9`p3@Q_2lhe1jhv@4_gXfF#)!G-I$ycHF5_cPE0lcViyny*pt#8@nSSRT) zdRv1r@fu8x*?rR*&X=#159>7_JlOSwiR9tLhgkcyZShV&I?2DHAghQ5>Y1X7`EiLI(H1mB8G`lcuAmGma|Z1t|{rC zY6=+ia$jB}-#tcQu<`4`cikZuSga(?QHrqJjt1zw3{_zYbn;v^05NJ=c=+whec8guA9PrG3tLprkFF2kd)Pi5m#0>P*T zgJabBIbu9)L^7PLhu0 OhUi~9>&4E7C;$NTA`3MD diff --git a/CSharp/Equipments/ControlPanels/CBopControlPanel.f90 b/CSharp/Equipments/ControlPanels/CBopControlPanel.f90 index 56077c2..ba8ce92 100644 --- a/CSharp/Equipments/ControlPanels/CBopControlPanel.f90 +++ b/CSharp/Equipments/ControlPanels/CBopControlPanel.f90 @@ -10,9 +10,9 @@ module CBopControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetAnnularRegulatorSetControl' :: SetAnnularRegulatorSetControl implicit none real*8, intent(in) :: v - AnnularRegulatorSetControl = v + BopControlPanel%AnnularRegulatorSetControl = v #ifdef deb - print*, 'AnnularRegulatorSetControl=', AnnularRegulatorSetControl + print*, 'AnnularRegulatorSetControl=', BopControlPanel%AnnularRegulatorSetControl #endif end subroutine @@ -21,9 +21,9 @@ module CBopControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetAirMasterValve' :: SetAirMasterValve implicit none real*8, intent(in) :: v - AirMasterValve = v + BopControlPanel%AirMasterValve = v #ifdef deb - print*, 'AirMasterValve=', AirMasterValve + print*, 'AirMasterValve=', BopControlPanel%AirMasterValve #endif end subroutine @@ -32,9 +32,9 @@ module CBopControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetByePassValve' :: SetByePassValve implicit none real*8, intent(in) :: v - ByePassValve = v + BopControlPanel%ByePassValve = v #ifdef deb - print*, 'ByePassValve=', ByePassValve + print*, 'ByePassValve=', BopControlPanel%ByePassValve #endif end subroutine @@ -43,9 +43,9 @@ module CBopControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetAnnularValve' :: SetAnnularValve implicit none real*8, intent(in) :: v - AnnularValve = v + BopControlPanel%AnnularValve = v #ifdef deb - print*, 'AnnularValve=', AnnularValve + print*, 'AnnularValve=', BopControlPanel%AnnularValve #endif end subroutine @@ -54,9 +54,9 @@ module CBopControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetUpperRamsValve' :: SetUpperRamsValve implicit none real*8, intent(in) :: v - UpperRamsValve = v + BopControlPanel%UpperRamsValve = v #ifdef deb - print*, 'UpperRamsValve=', UpperRamsValve + print*, 'UpperRamsValve=', BopControlPanel%UpperRamsValve #endif end subroutine @@ -65,9 +65,9 @@ module CBopControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetMiddleRamsValve' :: SetMiddleRamsValve implicit none real*8, intent(in) :: v - MiddleRamsValve = v + BopControlPanel%MiddleRamsValve = v #ifdef deb - print*, 'MiddleRamsValve=', MiddleRamsValve + print*, 'MiddleRamsValve=', BopControlPanel%MiddleRamsValve #endif end subroutine @@ -76,9 +76,9 @@ module CBopControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetKillLineValve' :: SetKillLineValve implicit none real*8, intent(in) :: v - KillLineValve = v + BopControlPanel%KillLineValve = v #ifdef deb - print*, 'KillLineValve=', KillLineValve + print*, 'KillLineValve=', BopControlPanel%KillLineValve #endif end subroutine @@ -87,9 +87,9 @@ module CBopControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetChokeLineValve' :: SetChokeLineValve implicit none real*8, intent(in) :: v - ChokeLineValve = v + BopControlPanel%ChokeLineValve = v #ifdef deb - print*, 'ChokeLineValve=', ChokeLineValve + print*, 'ChokeLineValve=', BopControlPanel%ChokeLineValve #endif end subroutine @@ -98,9 +98,9 @@ module CBopControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetLowerRamsValve' :: SetLowerRamsValve implicit none real*8, intent(in) :: v - LowerRamsValve = v + BopControlPanel%LowerRamsValve = v #ifdef deb - print*, 'LowerRamsValve=', LowerRamsValve + print*, 'LowerRamsValve=', BopControlPanel%LowerRamsValve #endif end subroutine @@ -110,21 +110,21 @@ module CBopControlPanel !DEC$ ATTRIBUTES DLLEXPORT :: GetManifoldPressureGauge !DEC$ ATTRIBUTES ALIAS: 'GetManifoldPressureGauge' :: GetManifoldPressureGauge implicit none - GetManifoldPressureGauge = ManifoldPressureGauge + GetManifoldPressureGauge = BopControlPanel%ManifoldPressureGauge end function real(8) function GetAirSupplyPressureGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetAirSupplyPressureGauge !DEC$ ATTRIBUTES ALIAS: 'GetAirSupplyPressureGauge' :: GetAirSupplyPressureGauge implicit none - GetAirSupplyPressureGauge = AirSupplyPressureGauge + GetAirSupplyPressureGauge = BopControlPanel%AirSupplyPressureGauge end function real(8) function GetAccumulatorPressureGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetAccumulatorPressureGauge !DEC$ ATTRIBUTES ALIAS: 'GetAccumulatorPressureGauge' :: GetAccumulatorPressureGauge implicit none - GetAccumulatorPressureGauge = AccumulatorPressureGauge + GetAccumulatorPressureGauge = BopControlPanel%AccumulatorPressureGauge !GetAccumulatorPressureGauge = 2000.0d0 end function @@ -132,119 +132,119 @@ module CBopControlPanel !DEC$ ATTRIBUTES DLLEXPORT :: GetAnnularPressureGauge !DEC$ ATTRIBUTES ALIAS: 'GetAnnularPressureGauge' :: GetAnnularPressureGauge implicit none - GetAnnularPressureGauge = AnnularPressureGauge + GetAnnularPressureGauge = BopControlPanel%AnnularPressureGauge end function integer function GetAnnularOpenLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetAnnularOpenLED !DEC$ ATTRIBUTES ALIAS: 'GetAnnularOpenLED' :: GetAnnularOpenLED implicit none - GetAnnularOpenLED = AnnularOpenLED + GetAnnularOpenLED = BopControlPanel%AnnularOpenLED end function integer function GetAnnularCloseLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetAnnularCloseLED !DEC$ ATTRIBUTES ALIAS: 'GetAnnularCloseLED' :: GetAnnularCloseLED implicit none - GetAnnularCloseLED = AnnularCloseLED + GetAnnularCloseLED = BopControlPanel%AnnularCloseLED end function integer function GetUpperRamsOpenLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetUpperRamsOpenLED !DEC$ ATTRIBUTES ALIAS: 'GetUpperRamsOpenLED' :: GetUpperRamsOpenLED implicit none - GetUpperRamsOpenLED = UpperRamsOpenLED + GetUpperRamsOpenLED = BopControlPanel%UpperRamsOpenLED end function integer function GetUpperRamsCloseLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetUpperRamsCloseLED !DEC$ ATTRIBUTES ALIAS: 'GetUpperRamsCloseLED' :: GetUpperRamsCloseLED implicit none - GetUpperRamsCloseLED = UpperRamsCloseLED + GetUpperRamsCloseLED = BopControlPanel%UpperRamsCloseLED end function integer function GetMiddleRamsOpenLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetMiddleRamsOpenLED !DEC$ ATTRIBUTES ALIAS: 'GetMiddleRamsOpenLED' :: GetMiddleRamsOpenLED implicit none - GetMiddleRamsOpenLED = MiddleRamsOpenLED + GetMiddleRamsOpenLED = BopControlPanel%MiddleRamsOpenLED end function integer function GetMiddleRamsCloseLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetMiddleRamsCloseLED !DEC$ ATTRIBUTES ALIAS: 'GetMiddleRamsCloseLED' :: GetMiddleRamsCloseLED implicit none - GetMiddleRamsCloseLED = MiddleRamsCloseLED + GetMiddleRamsCloseLED = BopControlPanel%MiddleRamsCloseLED end function integer function GetKillLineOpenLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetKillLineOpenLED !DEC$ ATTRIBUTES ALIAS: 'GetKillLineOpenLED' :: GetKillLineOpenLED implicit none - GetKillLineOpenLED = KillLineOpenLED + GetKillLineOpenLED = BopControlPanel%KillLineOpenLED end function integer function GetKillLineCloseLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetKillLineCloseLED !DEC$ ATTRIBUTES ALIAS: 'GetKillLineCloseLED' :: GetKillLineCloseLED implicit none - GetKillLineCloseLED = KillLineCloseLED + GetKillLineCloseLED = BopControlPanel%KillLineCloseLED end function integer function GetChokeLineOpenLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetChokeLineOpenLED !DEC$ ATTRIBUTES ALIAS: 'GetChokeLineOpenLED' :: GetChokeLineOpenLED implicit none - GetChokeLineOpenLED = ChokeLineOpenLED + GetChokeLineOpenLED = BopControlPanel%ChokeLineOpenLED end function integer function GetChokeLineCloseLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetChokeLineCloseLED !DEC$ ATTRIBUTES ALIAS: 'GetChokeLineCloseLED' :: GetChokeLineCloseLED implicit none - GetChokeLineCloseLED = ChokeLineCloseLED + GetChokeLineCloseLED = BopControlPanel%ChokeLineCloseLED end function integer function GetLowerRamsOpenLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetLowerRamsOpenLED !DEC$ ATTRIBUTES ALIAS: 'GetLowerRamsOpenLED' :: GetLowerRamsOpenLED implicit none - GetLowerRamsOpenLED = LowerRamsOpenLED + GetLowerRamsOpenLED = BopControlPanel%LowerRamsOpenLED end function integer function GetLowerRamsCloseLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetLowerRamsCloseLED !DEC$ ATTRIBUTES ALIAS: 'GetLowerRamsCloseLED' :: GetLowerRamsCloseLED implicit none - GetLowerRamsCloseLED = LowerRamsCloseLED + GetLowerRamsCloseLED = BopControlPanel%LowerRamsCloseLED end function real(8) function GetAnnularStatus() !DEC$ ATTRIBUTES DLLEXPORT :: GetAnnularStatus !DEC$ ATTRIBUTES ALIAS: 'GetAnnularStatus' :: GetAnnularStatus implicit none - GetAnnularStatus = AnnularStatus + GetAnnularStatus = BopControlPanel%AnnularStatus end function real(8) function GetUpperRamsStatus() !DEC$ ATTRIBUTES DLLEXPORT :: GetUpperRamsStatus !DEC$ ATTRIBUTES ALIAS: 'GetUpperRamsStatus' :: GetUpperRamsStatus implicit none - GetUpperRamsStatus = UpperRamsStatus + GetUpperRamsStatus = BopControlPanel%UpperRamsStatus end function real(8) function GetMiddleRamsStatus() !DEC$ ATTRIBUTES DLLEXPORT :: GetMiddleRamsStatus !DEC$ ATTRIBUTES ALIAS: 'GetMiddleRamsStatus' :: GetMiddleRamsStatus implicit none - GetMiddleRamsStatus = MiddleRamsStatus + GetMiddleRamsStatus = BopControlPanel%MiddleRamsStatus end function real(8) function GetLowerRamsStatus() !DEC$ ATTRIBUTES DLLEXPORT :: GetLowerRamsStatus !DEC$ ATTRIBUTES ALIAS: 'GetLowerRamsStatus' :: GetLowerRamsStatus implicit none - GetLowerRamsStatus = LowerRamsStatus + GetLowerRamsStatus = BopControlPanel%LowerRamsStatus end function end module CBopControlPanel diff --git a/CSharp/Equipments/ControlPanels/CBopControlPanelVariables.f90 b/CSharp/Equipments/ControlPanels/CBopControlPanelVariables.f90 index e1d2ef9..56a6de7 100644 --- a/CSharp/Equipments/ControlPanels/CBopControlPanelVariables.f90 +++ b/CSharp/Equipments/ControlPanels/CBopControlPanelVariables.f90 @@ -1,42 +1,42 @@ module CBopControlPanelVariables implicit none public - - ! 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 + 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 - contains - + ! 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 + type(BopControlPanelType) :: BopControlPanel + contains subroutine OpenAnnular() use CManifolds implicit none diff --git a/CSharp/Equipments/ControlPanels/CChokeControlPanel.f90 b/CSharp/Equipments/ControlPanels/CChokeControlPanel.f90 index 3238dc0..49b6b4b 100644 --- a/CSharp/Equipments/ControlPanels/CChokeControlPanel.f90 +++ b/CSharp/Equipments/ControlPanels/CChokeControlPanel.f90 @@ -10,9 +10,9 @@ module CChokeControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetChokePanelPumpSelectorSwitch' :: SetChokePanelPumpSelectorSwitch implicit none integer, intent(in) :: v - ChokePanelPumpSelectorSwitch = v + ChokeControlPanel%ChokePanelPumpSelectorSwitch = v #ifdef deb - print*, 'ChokePanelPumpSelectorSwitch=', ChokePanelPumpSelectorSwitch + print*, 'ChokePanelPumpSelectorSwitch=', ChokeControlPanel%ChokePanelPumpSelectorSwitch #endif end subroutine @@ -21,9 +21,9 @@ module CChokeControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetChokePanelStrokeResetSwitch' :: SetChokePanelStrokeResetSwitch implicit none logical, intent(in) :: v - ChokePanelStrokeResetSwitch = v + ChokeControlPanel%ChokePanelStrokeResetSwitch = v #ifdef deb - print*, 'ChokePanelStrokeResetSwitch=', ChokePanelStrokeResetSwitch + print*, 'ChokePanelStrokeResetSwitch=', ChokeControlPanel%ChokePanelStrokeResetSwitch #endif end subroutine @@ -32,9 +32,9 @@ module CChokeControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetChokeSelectorSwitch' :: SetChokeSelectorSwitch implicit none logical, intent(in) :: v - ChokeSelectorSwitch = v + ChokeControlPanel%ChokeSelectorSwitch = v #ifdef deb - print*, 'ChokeSelectorSwitch=', ChokeSelectorSwitch + print*, 'ChokeSelectorSwitch=', ChokeControlPanel%ChokeSelectorSwitch #endif end subroutine @@ -49,12 +49,12 @@ module CChokeControlPanel !character(5) :: zone !integer,dimension(8) :: values - ChokeRateControlKnob = v + 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=', ChokeRateControlKnob + print*, 'ChokeRateControlKnob=', ChokeControlPanel%ChokeRateControlKnob #endif end subroutine @@ -63,9 +63,9 @@ module CChokeControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetChokeControlLever' :: SetChokeControlLever implicit none real*8, intent(in) :: v - ChokeControlLever = v + ChokeControlPanel%ChokeControlLever = v #ifdef deb - print*, 'ChokeControlLever=', ChokeControlLever + print*, 'ChokeControlLever=', ChokeControlPanel%ChokeControlLever #endif end subroutine @@ -74,9 +74,9 @@ module CChokeControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetChokePanelRigAirSwitch' :: SetChokePanelRigAirSwitch implicit none logical, intent(in) :: v - ChokePanelRigAirSwitch = v + ChokeControlPanel%ChokePanelRigAirSwitch = v #ifdef deb - print*, 'ChokePanelRigAirSwitch=', ChokePanelRigAirSwitch + print*, 'ChokePanelRigAirSwitch=', ChokeControlPanel%ChokePanelRigAirSwitch #endif end subroutine @@ -86,9 +86,9 @@ module CChokeControlPanel !DEC$ ATTRIBUTES ALIAS: 'SetEnableAutoChoke' :: SetEnableAutoChoke implicit none logical, intent(in) :: v - EnableAutoChoke = v + ChokeControlPanel%EnableAutoChoke = v #ifdef deb - print*, 'EnableAutoChoke=', EnableAutoChoke + print*, 'EnableAutoChoke=', ChokeControlPanel%EnableAutoChoke #endif end subroutine @@ -108,21 +108,21 @@ module CChokeControlPanel !DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipePressure !DEC$ ATTRIBUTES ALIAS: 'GetStandPipePressure' :: GetStandPipePressure implicit none - GetStandPipePressure = StandPipePressure + GetStandPipePressure = ChokeControlPanel%StandPipePressure end function real(8) function GetCasingPressure() !DEC$ ATTRIBUTES DLLEXPORT :: GetCasingPressure !DEC$ ATTRIBUTES ALIAS: 'GetCasingPressure' :: GetCasingPressure implicit none - GetCasingPressure = CasingPressure + GetCasingPressure = ChokeControlPanel%CasingPressure end function real(8) function GetChokePosition() !DEC$ ATTRIBUTES DLLEXPORT :: GetChokePosition !DEC$ ATTRIBUTES ALIAS: 'GetChokePosition' :: GetChokePosition implicit none - GetChokePosition = ChokePosition + GetChokePosition = ChokeControlPanel%ChokePosition end function real(8) function GetChokePanelSPMCounter() @@ -130,7 +130,7 @@ module CChokeControlPanel !DEC$ ATTRIBUTES ALIAS: 'GetChokePanelSPMCounter' :: GetChokePanelSPMCounter implicit none !GetChokePanelSPMCounter = 0 - GetChokePanelSPMCounter = ChokePanelSPMCounter + GetChokePanelSPMCounter = ChokeControlPanel%ChokePanelSPMCounter end function real(8) function GetChokePanelTotalStrokeCounter() @@ -138,21 +138,21 @@ module CChokeControlPanel !DEC$ ATTRIBUTES ALIAS: 'GetChokePanelTotalStrokeCounter' :: GetChokePanelTotalStrokeCounter implicit none !GetChokePanelTotalStrokeCounter = 0 - GetChokePanelTotalStrokeCounter = ChokePanelTotalStrokeCounter + GetChokePanelTotalStrokeCounter = ChokeControlPanel%ChokePanelTotalStrokeCounter end function integer function GetChoke1LED() !DEC$ ATTRIBUTES DLLEXPORT :: GetChoke1LED !DEC$ ATTRIBUTES ALIAS: 'GetChoke1LED' :: GetChoke1LED implicit none - GetChoke1LED = Choke1LED + GetChoke1LED = ChokeControlPanel%Choke1LED end function integer function GetChoke2LED() !DEC$ ATTRIBUTES DLLEXPORT :: GetChoke2LED !DEC$ ATTRIBUTES ALIAS: 'GetChoke2LED' :: GetChoke2LED implicit none - GetChoke2LED = Choke2LED + GetChoke2LED = ChokeControlPanel%Choke2LED end function diff --git a/CSharp/Equipments/ControlPanels/CChokeControlPanelVariables.f90 b/CSharp/Equipments/ControlPanels/CChokeControlPanelVariables.f90 index 9f60359..b5750fd 100644 --- a/CSharp/Equipments/ControlPanels/CChokeControlPanelVariables.f90 +++ b/CSharp/Equipments/ControlPanels/CChokeControlPanelVariables.f90 @@ -1,25 +1,24 @@ module CChokeControlPanelVariables - implicit none - public - - ! Input vars - integer :: ChokePanelPumpSelectorSwitch - logical :: ChokePanelStrokeResetSwitch - logical :: ChokeSelectorSwitch - real(8) :: ChokeRateControlKnob - real(8) :: ChokeControlLever - logical :: ChokePanelRigAirSwitch + implicit none + type, public :: ChokeControlPanelType + ! Input vars + integer :: ChokePanelPumpSelectorSwitch + logical :: ChokePanelStrokeResetSwitch + logical :: ChokeSelectorSwitch + real(8) :: ChokeRateControlKnob + real(8) :: ChokeControlLever + logical :: ChokePanelRigAirSwitch - logical :: EnableAutoChoke + logical :: EnableAutoChoke - ! Output vars - real(8) :: StandPipePressure - real(8) :: CasingPressure - real(8) :: ChokePosition - real(8) :: ChokePanelSPMCounter - real(8) :: ChokePanelTotalStrokeCounter - integer :: Choke1LED - integer :: Choke2LED - - contains + ! Output vars + real(8) :: StandPipePressure + real(8) :: CasingPressure + real(8) :: ChokePosition + real(8) :: ChokePanelSPMCounter + real(8) :: ChokePanelTotalStrokeCounter + integer :: Choke1LED + integer :: Choke2LED + End Type ChokeControlPanelType + Type(ChokeControlPanelType)::ChokeControlPanel end module CChokeControlPanelVariables \ No newline at end of file diff --git a/CSharp/Equipments/ControlPanels/CChokeManifold.f90 b/CSharp/Equipments/ControlPanels/CChokeManifold.f90 index 0c4bd3a..5f7b88d 100644 --- a/CSharp/Equipments/ControlPanels/CChokeManifold.f90 +++ b/CSharp/Equipments/ControlPanels/CChokeManifold.f90 @@ -11,7 +11,7 @@ module CChokeManifold !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve1' :: SetChokeManifoldValve1 implicit none logical, intent(in) :: v - ChokeManifoldValve1 = v + ChokeManifold%ChokeManifoldValve1 = v call ChangeValve(61, v) #ifdef deb !print*, 'ChokeManifoldValve1=', ChokeManifoldValve1 @@ -23,7 +23,7 @@ module CChokeManifold !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve2' :: SetChokeManifoldValve2 implicit none logical, intent(in) :: v - ChokeManifoldValve2 = v + ChokeManifold%ChokeManifoldValve2 = v call ChangeValve(64, v) #ifdef deb !print*, 'ChokeManifoldValve2=', ChokeManifoldValve2 @@ -36,11 +36,11 @@ module CChokeManifold implicit none real*8, intent(in) :: v !LeftManualChoke = abs(v-100) - LeftManualChoke = v - if(LeftManChokeOnProblem) then + ChokeManifold%LeftManualChoke = v + if(ChokeManifold%LeftManChokeOnProblem) then call ChangeValve(32, .true.) else - if(LeftManualChoke > 99.9) then + if(ChokeManifold%LeftManualChoke > 99.9) then !call Log_2( 'valve 32 is closed=', LeftManualChoke) call ChangeValve(32, .false.) else @@ -58,7 +58,7 @@ module CChokeManifold !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve4' :: SetChokeManifoldValve4 implicit none logical, intent(in) :: v - ChokeManifoldValve4 = v + ChokeManifold%ChokeManifoldValve4 = v call ChangeValve(62, v) !WRITE (*,*) ' valve 62 ', v #ifdef deb @@ -71,7 +71,7 @@ module CChokeManifold !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve5' :: SetChokeManifoldValve5 implicit none logical, intent(in) :: v - ChokeManifoldValve5 = v + ChokeManifold%ChokeManifoldValve5 = v call ChangeValve(63, v) !WRITE (*,*) ' valve 63 ', v #ifdef deb @@ -85,11 +85,11 @@ module CChokeManifold implicit none real*8, intent(in) :: v !RightManualChoke = abs(v -100) - RightManualChoke = v - if(RightManChokeOnProblem) then + ChokeManifold%RightManualChoke = v + if(ChokeManifold%RightManChokeOnProblem) then call ChangeValve(35, .true.) else - if(RightManualChoke > 99.9) then + if(ChokeManifold%RightManualChoke > 99.9) then !call Log_2( 'valve 35 is closed=', RightManualChoke) call ChangeValve(35, .false.) else @@ -107,7 +107,7 @@ module CChokeManifold !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve7' :: SetChokeManifoldValve7 implicit none logical, intent(in) :: v - ChokeManifoldValve7 = v + ChokeManifold%ChokeManifoldValve7 = v call ChangeValve(27, v) #ifdef deb !print*, 'ChokeManifoldValve7=', ChokeManifoldValve7 @@ -119,7 +119,7 @@ module CChokeManifold !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve8' :: SetChokeManifoldValve8 implicit none logical, intent(in) :: v - ChokeManifoldValve8 = v + ChokeManifold%ChokeManifoldValve8 = v call ChangeValve(28, v) !WRITE (*,*) ' valve 28 ', v #ifdef deb @@ -132,7 +132,7 @@ module CChokeManifold !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve9' :: SetChokeManifoldValve9 implicit none logical, intent(in) :: v - ChokeManifoldValve9 = v + ChokeManifold%ChokeManifoldValve9 = v call ChangeValve(29, v) #ifdef deb !print*, 'ChokeManifoldValve9=', ChokeManifoldValve9 @@ -144,7 +144,7 @@ module CChokeManifold !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve10' :: SetChokeManifoldValve10 implicit none logical, intent(in) :: v - ChokeManifoldValve10 = v + ChokeManifold%ChokeManifoldValve10 = v call ChangeValve(30, v) !WRITE (*,*) ' valve 30 ', v #ifdef deb @@ -157,7 +157,7 @@ module CChokeManifold !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve11' :: SetChokeManifoldValve11 implicit none logical, intent(in) :: v - ChokeManifoldValve11 = v + ChokeManifold%ChokeManifoldValve11 = v call ChangeValve(31, v) #ifdef deb !print*, 'ChokeManifoldValve11=', ChokeManifoldValve11 @@ -169,7 +169,7 @@ module CChokeManifold !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve12' :: SetChokeManifoldValve12 implicit none logical, intent(in) :: v - ChokeManifoldValve12 = v + ChokeManifold%ChokeManifoldValve12 = v call ChangeValve(25, v) #ifdef deb !print*, 'ChokeManifoldValve12=', ChokeManifoldValve12 @@ -181,7 +181,7 @@ module CChokeManifold !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve13' :: SetChokeManifoldValve13 implicit none logical, intent(in) :: v - ChokeManifoldValve13 = v + ChokeManifold%ChokeManifoldValve13 = v call ChangeValve(26, v) !WRITE (*,*) ' valve 26 ', v #ifdef deb @@ -196,7 +196,7 @@ module CChokeManifold !DEC$ ATTRIBUTES DLLEXPORT :: GetHydraulicChock1 !DEC$ ATTRIBUTES ALIAS: 'GetHydraulicChock1' :: GetHydraulicChock1 implicit none - GetHydraulicChock1 = HydraulicChock1 + GetHydraulicChock1 = ChokeManifold%HydraulicChock1 !GetHydraulicChock1 = 23 end function @@ -204,7 +204,7 @@ module CChokeManifold !DEC$ ATTRIBUTES DLLEXPORT :: GetHydraulicChock2 !DEC$ ATTRIBUTES ALIAS: 'GetHydraulicChock2' :: GetHydraulicChock2 implicit none - GetHydraulicChock2 = HydraulicChock2 + GetHydraulicChock2 = ChokeManifold%HydraulicChock2 !GetHydraulicChock2 = 54 end function diff --git a/CSharp/Equipments/ControlPanels/CChokeManifoldVariables.f90 b/CSharp/Equipments/ControlPanels/CChokeManifoldVariables.f90 index 21c9baa..9e528e8 100644 --- a/CSharp/Equipments/ControlPanels/CChokeManifoldVariables.f90 +++ b/CSharp/Equipments/ControlPanels/CChokeManifoldVariables.f90 @@ -2,45 +2,48 @@ module CChokeManifoldVariables use CManifolds implicit none public - - ! 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 + 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 + ! Output vars + integer :: HydraulicChock1 + integer :: HydraulicChock2 - ! Control vars - logical :: HyChock1OnProblem = .false. - logical :: HyChock2OnProblem = .false. - logical :: LeftManChokeOnProblem = .false. - logical :: RightManChokeOnProblem = .false. + ! Control vars + logical :: HyChock1OnProblem = .false. + logical :: HyChock2OnProblem = .false. + logical :: LeftManChokeOnProblem = .false. + logical :: RightManChokeOnProblem = .false. + End Type ChokeManifoldType + + Type(ChokeManifoldType)::ChokeManifold contains subroutine SetHydraulicChock1(v) implicit none integer, intent(in) :: v - HydraulicChock1 = v - if(HyChock1OnProblem) then + ChokeManifold%HydraulicChock1 = v + if(ChokeManifold%HyChock1OnProblem) then call ChangeValve(33, .true.) else if(v == 100) then - if(Valve(33)%Status) call ChangeValve(33, .false.) + if(Manifold%Valve(33)%Status) call ChangeValve(33, .false.) else - if(.not.Valve(33)%Status) call ChangeValve(33, .true.) + if(.not.Manifold%Valve(33)%Status) call ChangeValve(33, .true.) endif endif !WRITE (*,*) ' valve 33 ', Valve(33)%Status, ' arg ', v @@ -49,14 +52,14 @@ module CChokeManifoldVariables subroutine SetHydraulicChock2(v) implicit none integer, intent(in) :: v - HydraulicChock2 = v - if(HyChock2OnProblem) then + ChokeManifold%HydraulicChock2 = v + if(ChokeManifold%HyChock2OnProblem) then call ChangeValve(34, .true.) else if(v==100) then - if(Valve(34)%Status) call ChangeValve(34, .false.) + if(Manifold%Valve(34)%Status) call ChangeValve(34, .false.) else - if(.not.Valve(34)%Status) call ChangeValve(34, .true.) + if(.not.Manifold%Valve(34)%Status) call ChangeValve(34, .true.) endif endif !WRITE (*,*) ' valve 34 ', Valve(34)%Status, ' arg ', v diff --git a/CSharp/Equipments/ControlPanels/CDataDisplayConsole.f90 b/CSharp/Equipments/ControlPanels/CDataDisplayConsole.f90 index d3eea8b..a0e1015 100644 --- a/CSharp/Equipments/ControlPanels/CDataDisplayConsole.f90 +++ b/CSharp/Equipments/ControlPanels/CDataDisplayConsole.f90 @@ -4,8 +4,6 @@ module CDataDisplayConsole public contains - - !Portable subroutine SetTripAlarmLow(v) !DEC$ ATTRIBUTES DLLEXPORT :: SetTripAlarmLow @@ -13,10 +11,10 @@ module CDataDisplayConsole !use MudSystemVARIABLES, only: TripTank_MinVol_Allowded implicit none real*8, intent(in) :: v - TripAlarmLow = v + DataDisplayConsole%TripAlarmLow = v !TripTank_MinVol_Allowded = v #ifdef deb - print*, 'TripAlarmLow=', TripAlarmLow + print*, 'TripAlarmLow=', DataDisplayConsole%TripAlarmLow #endif end subroutine @@ -26,10 +24,10 @@ module CDataDisplayConsole !use MudSystemVARIABLES, only: TripTank_MaxVol_Allowded implicit none real*8, intent(in) :: v - TripAlarmHigh = v + DataDisplayConsole%TripAlarmHigh = v !TripTank_MaxVol_Allowded = v #ifdef deb - print*, 'TripAlarmHigh=', TripAlarmHigh + print*, 'TripAlarmHigh=', DataDisplayConsole%TripAlarmHigh #endif end subroutine @@ -40,10 +38,10 @@ module CDataDisplayConsole !use MudSystemVARIABLES, only: MFFI_MinPercent_Allowded implicit none real*8, intent(in) :: v - RetFlowAlarmLow = v + DataDisplayConsole%RetFlowAlarmLow = v !MFFI_MinPercent_Allowded = v #ifdef deb - print*, 'RetFlowAlarmLow=', RetFlowAlarmLow + print*, 'RetFlowAlarmLow=', DataDisplayConsole%RetFlowAlarmLow #endif end subroutine @@ -53,10 +51,10 @@ module CDataDisplayConsole !use MudSystemVARIABLES, only: MFFI_MaxPercent_Allowded implicit none real*8, intent(in) :: v - RetFlowAlarmHigh = v + DataDisplayConsole%RetFlowAlarmHigh = v !MFFI_MaxPercent_Allowded = v #ifdef deb - print*, 'RetFlowAlarmHigh=', RetFlowAlarmHigh + print*, 'RetFlowAlarmHigh=', DataDisplayConsole%RetFlowAlarmHigh #endif end subroutine @@ -66,10 +64,10 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetPitAlarmLow' :: SetPitAlarmLow implicit none real*8, intent(in) :: v - PitAlarmLow = v + DataDisplayConsole%PitAlarmLow = v !call Log_4('PitAlarmLow=', PitAlarmLow) #ifdef deb - print*, 'PitAlarmLow=', PitAlarmLow + print*, 'PitAlarmLow=', DataDisplayConsole%PitAlarmLow #endif end subroutine @@ -78,10 +76,10 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetPitAlarmHigh' :: SetPitAlarmHigh implicit none real*8, intent(in) :: v - PitAlarmHigh = v + DataDisplayConsole%PitAlarmHigh = v !call Log_4('PitAlarmHigh=', PitAlarmHigh) #ifdef deb - print*, 'PitAlarmHigh=', PitAlarmHigh + print*, 'PitAlarmHigh=', DataDisplayConsole%PitAlarmHigh #endif end subroutine @@ -106,9 +104,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetTripTankSetAlarmLow' :: SetTripTankSetAlarmLow implicit none real*8, intent(in) :: v - TripTankSetAlarmLow = v + DataDisplayConsole%TripTankSetAlarmLow = v #ifdef deb - print*, 'TripTankSetAlarmLow=', TripTankSetAlarmLow + print*, 'TripTankSetAlarmLow=', DataDisplayConsole%TripTankSetAlarmLow #endif end subroutine @@ -117,9 +115,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetTripTankSetAlarmHigh' :: SetTripTankSetAlarmHigh implicit none real*8, intent(in) :: v - TripTankSetAlarmHigh = v + DataDisplayConsole%TripTankSetAlarmHigh = v #ifdef deb - print*, 'TripTankSetAlarmHigh=', TripTankSetAlarmHigh + print*, 'TripTankSetAlarmHigh=', DataDisplayConsole%TripTankSetAlarmHigh #endif end subroutine @@ -128,9 +126,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetTripTankSetAlarmSwitch' :: SetTripTankSetAlarmSwitch implicit none integer, intent(in) :: v - TripTankSetAlarmSwitch = v + DataDisplayConsole%TripTankSetAlarmSwitch = v #ifdef deb - print*, 'TripTankSetAlarmSwitch=', TripTankSetAlarmSwitch + print*, 'TripTankSetAlarmSwitch=', DataDisplayConsole%TripTankSetAlarmSwitch #endif end subroutine @@ -140,10 +138,10 @@ module CDataDisplayConsole use CTanksVariables, only: Set_ManualPumpPower implicit none logical, intent(in) :: v - TripTankPowerSwitch = v - if(TripTankPowerSwitch) call Set_ManualPumpPower(TripTankPumpSwitch) + DataDisplayConsole%TripTankPowerSwitch = v + if(DataDisplayConsole%TripTankPowerSwitch) call Set_ManualPumpPower(DataDisplayConsole%TripTankPumpSwitch) #ifdef deb - print*, 'TripTankPowerSwitch=', TripTankPowerSwitch + print*, 'TripTankPowerSwitch=', DataDisplayConsole%TripTankPowerSwitch #endif end subroutine @@ -153,10 +151,10 @@ module CDataDisplayConsole use CTanksVariables, only: Set_ManualPumpPower implicit none logical, intent(in) :: v - TripTankPumpSwitch = v - if(TripTankPowerSwitch) call Set_ManualPumpPower(TripTankPumpSwitch) + DataDisplayConsole%TripTankPumpSwitch = v + if(DataDisplayConsole%TripTankPowerSwitch) call Set_ManualPumpPower(DataDisplayConsole%TripTankPumpSwitch) #ifdef deb - print*, 'TripTankPumpSwitch=', TripTankPumpSwitch + print*, 'TripTankPumpSwitch=', DataDisplayConsole%TripTankPumpSwitch #endif end subroutine @@ -165,9 +163,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetTripTankHornSwitch' :: SetTripTankHornSwitch implicit none logical, intent(in) :: v - TripTankHornSwitch = v + DataDisplayConsole%TripTankHornSwitch = v #ifdef deb - print*, 'TripTankHornSwitch=', TripTankHornSwitch + print*, 'TripTankHornSwitch=', DataDisplayConsole%TripTankHornSwitch #endif end subroutine @@ -176,9 +174,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetAcidGasDetectionHornSwitch' :: SetAcidGasDetectionHornSwitch implicit none logical, intent(in) :: v - AcidGasDetectionHornSwitch = v + DataDisplayConsole%AcidGasDetectionHornSwitch = v #ifdef deb - print*, 'AcidGasDetectionHornSwitch=', AcidGasDetectionHornSwitch + print*, 'AcidGasDetectionHornSwitch=', DataDisplayConsole%AcidGasDetectionHornSwitch #endif end subroutine @@ -187,9 +185,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetTotalStrokeCounterResetSwitch' :: SetTotalStrokeCounterResetSwitch implicit none logical, intent(in) :: v - TotalStrokeCounterResetSwitch = v + DataDisplayConsole%TotalStrokeCounterResetSwitch = v #ifdef deb - print*, 'TotalStrokeCounterResetSwitch=', TotalStrokeCounterResetSwitch + print*, 'TotalStrokeCounterResetSwitch=', DataDisplayConsole%TotalStrokeCounterResetSwitch #endif end subroutine @@ -199,10 +197,10 @@ module CDataDisplayConsole use CCommonVariables implicit none logical, intent(in) :: v - DrillingTrippingSelectorSwitch = v + DataDisplayConsole%DrillingTrippingSelectorSwitch = v DrillWatchOperationMode = v #ifdef deb - print*, 'DrillingTrippingSelectorSwitch=', DrillingTrippingSelectorSwitch + print*, 'DrillingTrippingSelectorSwitch=', DataDisplayConsole%DrillingTrippingSelectorSwitch #endif end subroutine @@ -211,9 +209,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMVTSetAlarmLowKnob' :: SetMVTSetAlarmLowKnob implicit none real*8, intent(in) :: v - MVTSetAlarmLowKnob = v + DataDisplayConsole%MVTSetAlarmLowKnob = v #ifdef deb - print*, 'MVTSetAlarmLowKnob=', MVTSetAlarmLowKnob + print*, 'MVTSetAlarmLowKnob=', DataDisplayConsole%MVTSetAlarmLowKnob #endif end subroutine @@ -222,9 +220,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMVTSetAlarmHighKnob' :: SetMVTSetAlarmHighKnob implicit none real*8, intent(in) :: v - MVTSetAlarmHighKnob = v + DataDisplayConsole%MVTSetAlarmHighKnob = v #ifdef deb - print*, 'MVTSetAlarmHighKnob=', MVTSetAlarmHighKnob + print*, 'MVTSetAlarmHighKnob=', DataDisplayConsole%MVTSetAlarmHighKnob #endif end subroutine @@ -233,9 +231,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMVTSetAlarmSwitch' :: SetMVTSetAlarmSwitch implicit none integer, intent(in) :: v - MVTSetAlarmSwitch = v + DataDisplayConsole%MVTSetAlarmSwitch = v #ifdef deb - print*, 'MVTSetAlarmSwitch=', MVTSetAlarmSwitch + print*, 'MVTSetAlarmSwitch=', DataDisplayConsole%MVTSetAlarmSwitch #endif end subroutine @@ -244,9 +242,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMudTank1Switch' :: SetMudTank1Switch implicit none logical, intent(in) :: v - MudTank1Switch = v + DataDisplayConsole%MudTank1Switch = v #ifdef deb - print*, 'MudTank1Switch=', MudTank1Switch + print*, 'MudTank1Switch=', DataDisplayConsole%MudTank1Switch #endif end subroutine @@ -255,9 +253,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMudTank2Switch' :: SetMudTank2Switch implicit none logical, intent(in) :: v - MudTank2Switch = v + DataDisplayConsole%MudTank2Switch = v #ifdef deb - print*, 'MudTank2Switch=', MudTank2Switch + print*, 'MudTank2Switch=', DataDisplayConsole%MudTank2Switch #endif end subroutine @@ -266,9 +264,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMudTank3Switch' :: SetMudTank3Switch implicit none logical, intent(in) :: v - MudTank3Switch = v + DataDisplayConsole%MudTank3Switch = v #ifdef deb - print*, 'MudTank3Switch=', MudTank3Switch + print*, 'MudTank3Switch=', DataDisplayConsole%MudTank3Switch #endif end subroutine @@ -277,9 +275,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMudTank4Switch' :: SetMudTank4Switch implicit none logical, intent(in) :: v - MudTank4Switch = v + DataDisplayConsole%MudTank4Switch = v #ifdef deb - print*, 'MudTank4Switch=', MudTank4Switch + print*, 'MudTank4Switch=', DataDisplayConsole%MudTank4Switch #endif end subroutine @@ -288,9 +286,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMVTFineKnob' :: SetMVTFineKnob implicit none real*8, intent(in) :: v - MVTFineKnob = v + DataDisplayConsole%MVTFineKnob = v #ifdef deb - print*, 'MVTFineKnob=', MVTFineKnob + print*, 'MVTFineKnob=', DataDisplayConsole%MVTFineKnob #endif end subroutine @@ -299,9 +297,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMVTCoarseKnob' :: SetMVTCoarseKnob implicit none real*8, intent(in) :: v - MVTCoarseKnob = v + DataDisplayConsole%MVTCoarseKnob = v #ifdef deb - print*, 'MVTCoarseKnob=', MVTCoarseKnob + print*, 'MVTCoarseKnob=', DataDisplayConsole%MVTCoarseKnob #endif end subroutine @@ -310,9 +308,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMVTHornSwitch' :: SetMVTHornSwitch implicit none logical, intent(in) :: v - MVTHornSwitch = v + DataDisplayConsole%MVTHornSwitch = v #ifdef deb - print*, 'MVTHornSwitch=', MVTHornSwitch + print*, 'MVTHornSwitch=', DataDisplayConsole%MVTHornSwitch #endif end subroutine @@ -321,9 +319,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMVTDeviationTripSelectionSwitch' :: SetMVTDeviationTripSelectionSwitch implicit none logical, intent(in) :: v - MVTDeviationTripSelectionSwitch = v + DataDisplayConsole%MVTDeviationTripSelectionSwitch = v #ifdef deb - print*, 'MVTDeviationTripSelectionSwitch=', MVTDeviationTripSelectionSwitch + print*, 'MVTDeviationTripSelectionSwitch=', DataDisplayConsole%MVTDeviationTripSelectionSwitch #endif end subroutine @@ -332,9 +330,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMVTPowerSwitch' :: SetMVTPowerSwitch implicit none logical, intent(in) :: v - MVTPowerSwitch = v + DataDisplayConsole%MVTPowerSwitch = v #ifdef deb - print*, 'MVTPowerSwitch=', MVTPowerSwitch + print*, 'MVTPowerSwitch=', DataDisplayConsole%MVTPowerSwitch #endif end subroutine @@ -343,9 +341,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMFFIResetTotalStrokes' :: SetMFFIResetTotalStrokes implicit none logical, intent(in) :: v - MFFIResetTotalStrokes = v + DataDisplayConsole%MFFIResetTotalStrokes = v #ifdef deb - print*, 'MFFIResetTotalStrokes=', MFFIResetTotalStrokes + print*, 'MFFIResetTotalStrokes=', DataDisplayConsole%MFFIResetTotalStrokes #endif end subroutine @@ -354,9 +352,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMFFIResetFillCounter' :: SetMFFIResetFillCounter implicit none logical, intent(in) :: v - MFFIResetFillCounter = v + DataDisplayConsole%MFFIResetFillCounter = v #ifdef deb - print*, 'MFFIResetFillCounter=', MFFIResetFillCounter + print*, 'MFFIResetFillCounter=', DataDisplayConsole%MFFIResetFillCounter #endif end subroutine @@ -365,9 +363,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMFFIPumpSelectorSwitch' :: SetMFFIPumpSelectorSwitch implicit none integer, intent(in) :: v - MFFIPumpSelectorSwitch = v + DataDisplayConsole%MFFIPumpSelectorSwitch = v #ifdef deb - print*, 'MFFIPumpSelectorSwitch=', MFFIPumpSelectorSwitch + print*, 'MFFIPumpSelectorSwitch=', DataDisplayConsole%MFFIPumpSelectorSwitch #endif end subroutine @@ -376,9 +374,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMFFIFillSPMSelectorSwitch' :: SetMFFIFillSPMSelectorSwitch implicit none logical, intent(in) :: v - MFFIFillSPMSelectorSwitch = v + DataDisplayConsole%MFFIFillSPMSelectorSwitch = v #ifdef deb - print*, 'MFFIFillSPMSelectorSwitch=', MFFIFillSPMSelectorSwitch + print*, 'MFFIFillSPMSelectorSwitch=', DataDisplayConsole%MFFIFillSPMSelectorSwitch #endif end subroutine @@ -387,9 +385,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMFFISetAlarmLowKnob' :: SetMFFISetAlarmLowKnob implicit none real*8, intent(in) :: v - MFFISetAlarmLowKnob = v + DataDisplayConsole%MFFISetAlarmLowKnob = v #ifdef deb - print*, 'MFFISetAlarmLowKnob=', MFFISetAlarmLowKnob + print*, 'MFFISetAlarmLowKnob=', DataDisplayConsole%MFFISetAlarmLowKnob #endif end subroutine @@ -398,9 +396,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMFFISetAlarmHighKnob' :: SetMFFISetAlarmHighKnob implicit none real*8, intent(in) :: v - MFFISetAlarmHighKnob = v + DataDisplayConsole%MFFISetAlarmHighKnob = v #ifdef deb - print*, 'MFFISetAlarmHighKnob=', MFFISetAlarmHighKnob + print*, 'MFFISetAlarmHighKnob=', DataDisplayConsole%MFFISetAlarmHighKnob #endif end subroutine @@ -409,9 +407,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMFFISetAlarmSwitch' :: SetMFFISetAlarmSwitch implicit none integer, intent(in) :: v - MFFISetAlarmSwitch = v + DataDisplayConsole%MFFISetAlarmSwitch = v #ifdef deb - print*, 'MFFISetAlarmSwitch=', MFFISetAlarmSwitch + print*, 'MFFISetAlarmSwitch=', DataDisplayConsole%MFFISetAlarmSwitch #endif end subroutine @@ -420,9 +418,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMFFIPowerSwitch' :: SetMFFIPowerSwitch implicit none logical, intent(in) :: v - MFFIPowerSwitch = v + DataDisplayConsole%MFFIPowerSwitch = v #ifdef deb - print*, 'MFFIPowerSwitch=', MFFIPowerSwitch + print*, 'MFFIPowerSwitch=', DataDisplayConsole%MFFIPowerSwitch #endif end subroutine @@ -431,9 +429,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetMFFIHornSwitch' :: SetMFFIHornSwitch implicit none logical, intent(in) :: v - MFFIHornSwitch = v + DataDisplayConsole%MFFIHornSwitch = v #ifdef deb - print*, 'MFFIHornSwitch=', MFFIHornSwitch + print*, 'MFFIHornSwitch=', DataDisplayConsole%MFFIHornSwitch #endif end subroutine @@ -453,9 +451,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetResetWob' :: SetResetWob implicit none logical, intent(in) :: v - ResetWob = v + DataDisplayConsole%ResetWob = v #ifdef deb - print*, 'ResetWob=', ResetWob + print*, 'ResetWob=', DataDisplayConsole%ResetWob #endif end subroutine @@ -464,9 +462,9 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES ALIAS: 'SetClutch' :: SetClutch implicit none logical, intent(in) :: v - Clutch = v + DataDisplayConsole%Clutch = v #ifdef deb - print*, 'Clutch=', Clutch + print*, 'Clutch=', DataDisplayConsole%Clutch #endif end subroutine @@ -476,21 +474,21 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetWOBPointer !DEC$ ATTRIBUTES ALIAS: 'GetWOBPointer' :: GetWOBPointer implicit none - GetWOBPointer = WOBPointer + GetWOBPointer = DataDisplayConsole%WOBPointer end function real(8) function GetHookLoadPointer() !DEC$ ATTRIBUTES DLLEXPORT :: GetHookLoadPointer !DEC$ ATTRIBUTES ALIAS: 'GetHookLoadPointer' :: GetHookLoadPointer implicit none - GetHookLoadPointer = HookLoadPointer + GetHookLoadPointer = DataDisplayConsole%HookLoadPointer end function real(8) function GetTripTankGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetTripTankGauge !DEC$ ATTRIBUTES ALIAS: 'GetTripTankGauge' :: GetTripTankGauge implicit none - GetTripTankGauge = TripTankGauge / 42.0 + GetTripTankGauge = DataDisplayConsole%TripTankGauge / 42.0 !GetTripTankGauge = 23 end function @@ -498,7 +496,7 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetTripTankAlarmLED !DEC$ ATTRIBUTES ALIAS: 'GetTripTankAlarmLED' :: GetTripTankAlarmLED implicit none - GetTripTankAlarmLED = TripTankAlarmLED + GetTripTankAlarmLED = DataDisplayConsole%TripTankAlarmLED !GetTripTankAlarmLED = 1 end function @@ -506,70 +504,70 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetTripTankPumpLED !DEC$ ATTRIBUTES ALIAS: 'GetTripTankPumpLED' :: GetTripTankPumpLED implicit none - GetTripTankPumpLED = TripTankPumpLED + GetTripTankPumpLED = DataDisplayConsole%TripTankPumpLED end function real(8) function GetStandPipePressureGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipePressureGauge !DEC$ ATTRIBUTES ALIAS: 'GetStandPipePressureGauge' :: GetStandPipePressureGauge implicit none - GetStandPipePressureGauge = StandPipePressureGauge + GetStandPipePressureGauge = DataDisplayConsole%StandPipePressureGauge end function real(8) function GetCasingPressureGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetCasingPressureGauge !DEC$ ATTRIBUTES ALIAS: 'GetCasingPressureGauge' :: GetCasingPressureGauge implicit none - GetCasingPressureGauge = CasingPressureGauge + GetCasingPressureGauge = DataDisplayConsole%CasingPressureGauge end function real(8) function GetMP1SPMGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetMP1SPMGauge !DEC$ ATTRIBUTES ALIAS: 'GetMP1SPMGauge' :: GetMP1SPMGauge implicit none - GetMP1SPMGauge = MP1SPMGauge + GetMP1SPMGauge = DataDisplayConsole%MP1SPMGauge end function real(8) function GetMP2SPMGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetMP2SPMGauge !DEC$ ATTRIBUTES ALIAS: 'GetMP2SPMGauge' :: GetMP2SPMGauge implicit none - GetMP2SPMGauge = MP2SPMGauge + GetMP2SPMGauge = DataDisplayConsole%MP2SPMGauge end function real(8) function GetReturnLineTempGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetReturnLineTempGauge !DEC$ ATTRIBUTES ALIAS: 'GetReturnLineTempGauge' :: GetReturnLineTempGauge implicit none - GetReturnLineTempGauge = ReturnLineTempGauge + GetReturnLineTempGauge = DataDisplayConsole%ReturnLineTempGauge end function real(8) function GetRotaryTorqueGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetRotaryTorqueGauge !DEC$ ATTRIBUTES ALIAS: 'GetRotaryTorqueGauge' :: GetRotaryTorqueGauge implicit none - GetRotaryTorqueGauge = RotaryTorqueGauge + GetRotaryTorqueGauge = DataDisplayConsole%RotaryTorqueGauge end function real(8) function GetRotaryRPMGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetRotaryRPMGauge !DEC$ ATTRIBUTES ALIAS: 'GetRotaryRPMGauge' :: GetRotaryRPMGauge implicit none - GetRotaryRPMGauge = RotaryRPMGauge + GetRotaryRPMGauge = DataDisplayConsole%RotaryRPMGauge end function integer function GetAcidGasDetectionLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetAcidGasDetectionLED !DEC$ ATTRIBUTES ALIAS: 'GetAcidGasDetectionLED' :: GetAcidGasDetectionLED implicit none - GetAcidGasDetectionLED = AcidGasDetectionLED + GetAcidGasDetectionLED = DataDisplayConsole%AcidGasDetectionLED end function real(8) function GetTotalStrokeCounter() !DEC$ ATTRIBUTES DLLEXPORT :: GetTotalStrokeCounter !DEC$ ATTRIBUTES ALIAS: 'GetTotalStrokeCounter' :: GetTotalStrokeCounter implicit none - GetTotalStrokeCounter = TotalStrokeCounter + GetTotalStrokeCounter = DataDisplayConsole%TotalStrokeCounter !GetTotalStrokeCounter = 456.9 end function @@ -577,7 +575,7 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetPitGainLossGauge !DEC$ ATTRIBUTES ALIAS: 'GetPitGainLossGauge' :: GetPitGainLossGauge implicit none - GetPitGainLossGauge = PitGainLossGauge + GetPitGainLossGauge = DataDisplayConsole%PitGainLossGauge !GetPitGainLossGauge = 44 end function @@ -585,14 +583,14 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetMudTanksVolumeGauge !DEC$ ATTRIBUTES ALIAS: 'GetMudTanksVolumeGauge' :: GetMudTanksVolumeGauge implicit none - GetMudTanksVolumeGauge = MudTanksVolumeGauge / 42.0 + GetMudTanksVolumeGauge = DataDisplayConsole%MudTanksVolumeGauge / 42.0 end function integer function GetMVTAlarmLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetMVTAlarmLED !DEC$ ATTRIBUTES ALIAS: 'GetMVTAlarmLED' :: GetMVTAlarmLED implicit none - GetMVTAlarmLED = MVTAlarmLED + GetMVTAlarmLED = DataDisplayConsole%MVTAlarmLED !GetMVTAlarmLED = 1 end function @@ -600,7 +598,7 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetReturnMudFlowGauge !DEC$ ATTRIBUTES ALIAS: 'GetReturnMudFlowGauge' :: GetReturnMudFlowGauge implicit none - GetReturnMudFlowGauge = ReturnMudFlowGauge + GetReturnMudFlowGauge = DataDisplayConsole%ReturnMudFlowGauge !GetReturnMudFlowGauge = 12 end function @@ -608,21 +606,21 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetFillStrokeCounter !DEC$ ATTRIBUTES ALIAS: 'GetFillStrokeCounter' :: GetFillStrokeCounter implicit none - GetFillStrokeCounter = FillStrokeCounter + GetFillStrokeCounter = DataDisplayConsole%FillStrokeCounter end function real(8) function GetMFFITotalStrokeCounter() !DEC$ ATTRIBUTES DLLEXPORT :: GetMFFITotalStrokeCounter !DEC$ ATTRIBUTES ALIAS: 'GetMFFITotalStrokeCounter' :: GetMFFITotalStrokeCounter implicit none - GetMFFITotalStrokeCounter = MFFITotalStrokeCounter + GetMFFITotalStrokeCounter = DataDisplayConsole%MFFITotalStrokeCounter end function integer function GetMFFIAlarmLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetMFFIAlarmLED !DEC$ ATTRIBUTES ALIAS: 'GetMFFIAlarmLED' :: GetMFFIAlarmLED implicit none - GetMFFIAlarmLED = MFFIAlarmLED + GetMFFIAlarmLED = DataDisplayConsole%MFFIAlarmLED !GetMFFIAlarmLED = 1 end function @@ -630,105 +628,105 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetMFFIPumpLED !DEC$ ATTRIBUTES ALIAS: 'GetMFFIPumpLED' :: GetMFFIPumpLED implicit none - GetMFFIPumpLED = MFFIPumpLED + GetMFFIPumpLED = DataDisplayConsole%MFFIPumpLED end function real(8) function GetTotalWellDepth() !DEC$ ATTRIBUTES DLLEXPORT :: GetTotalWellDepth !DEC$ ATTRIBUTES ALIAS: 'GetTotalWellDepth' :: GetTotalWellDepth implicit none - GetTotalWellDepth = TotalWellDepth + GetTotalWellDepth = DataDisplayConsole%TotalWellDepth end function real(8) function GetBitDepth() !DEC$ ATTRIBUTES DLLEXPORT :: GetBitDepth !DEC$ ATTRIBUTES ALIAS: 'GetBitDepth' :: GetBitDepth implicit none - GetBitDepth = BitDepth + GetBitDepth = DataDisplayConsole%BitDepth end function real(8) function GetHookLoad() !DEC$ ATTRIBUTES DLLEXPORT :: GetHookLoad !DEC$ ATTRIBUTES ALIAS: 'GetHookLoad' :: GetHookLoad implicit none - GetHookLoad = HookLoad + GetHookLoad = DataDisplayConsole%HookLoad end function real(8) function GetStandPipePressure2() !DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipePressure2 !DEC$ ATTRIBUTES ALIAS: 'GetStandPipePressure2' :: GetStandPipePressure2 implicit none - GetStandPipePressure2 = StandPipePressure + GetStandPipePressure2 = DataDisplayConsole%StandPipePressure end function real(8) function GetCasingPressure2() !DEC$ ATTRIBUTES DLLEXPORT :: GetCasingPressure2 !DEC$ ATTRIBUTES ALIAS: 'GetCasingPressure2' :: GetCasingPressure2 implicit none - GetCasingPressure2 = CasingPressure + GetCasingPressure2 = DataDisplayConsole%CasingPressure end function real(8) function GetMP1SPM() !DEC$ ATTRIBUTES DLLEXPORT :: GetMP1SPM !DEC$ ATTRIBUTES ALIAS: 'GetMP1SPM' :: GetMP1SPM implicit none - GetMP1SPM = MP1SPM + GetMP1SPM = DataDisplayConsole%MP1SPM end function real(8) function GetMP2SPM() !DEC$ ATTRIBUTES DLLEXPORT :: GetMP2SPM !DEC$ ATTRIBUTES ALIAS: 'GetMP2SPM' :: GetMP2SPM implicit none - GetMP2SPM = MP2SPM + GetMP2SPM = DataDisplayConsole%MP2SPM end function real(8) function GetRTTorque() !DEC$ ATTRIBUTES DLLEXPORT :: GetRTTorque !DEC$ ATTRIBUTES ALIAS: 'GetRTTorque' :: GetRTTorque implicit none - GetRTTorque = RTTorque + GetRTTorque = DataDisplayConsole%RTTorque end function real(8) function GetRTRPM() !DEC$ ATTRIBUTES DLLEXPORT :: GetRTRPM !DEC$ ATTRIBUTES ALIAS: 'GetRTRPM' :: GetRTRPM implicit none - GetRTRPM = RTRPM + GetRTRPM = DataDisplayConsole%RTRPM end function real(8) function GetWOP() !DEC$ ATTRIBUTES DLLEXPORT :: GetWOP !DEC$ ATTRIBUTES ALIAS: 'GetWOP' :: GetWOP implicit none - GetWOP = WOP + GetWOP = DataDisplayConsole%WOP end function real(8) function GetROP() !DEC$ ATTRIBUTES DLLEXPORT :: GetROP !DEC$ ATTRIBUTES ALIAS: 'GetROP' :: GetROP implicit none - GetROP = ROP + GetROP = DataDisplayConsole%ROP end function real(8) function GetMudWeightIn() !DEC$ ATTRIBUTES DLLEXPORT :: GetMudWeightIn !DEC$ ATTRIBUTES ALIAS: 'GetMudWeightIn' :: GetMudWeightIn implicit none - GetMudWeightIn = MudWeightIn + GetMudWeightIn = DataDisplayConsole%MudWeightIn end function real(8) function GetMudWeightOut() !DEC$ ATTRIBUTES DLLEXPORT :: GetMudWeightOut !DEC$ ATTRIBUTES ALIAS: 'GetMudWeightOut' :: GetMudWeightOut implicit none - GetMudWeightOut = MudWeightOut + GetMudWeightOut = DataDisplayConsole%MudWeightOut end function logical function GetBuzzer1() !DEC$ ATTRIBUTES DLLEXPORT :: GetBuzzer1 !DEC$ ATTRIBUTES ALIAS: 'GetBuzzer1' :: GetBuzzer1 implicit none - GetBuzzer1 = Buzzer1 + GetBuzzer1 = DataDisplayConsole%Buzzer1 !GetBuzzer1 = .true. end function @@ -736,7 +734,7 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetBuzzer2 !DEC$ ATTRIBUTES ALIAS: 'GetBuzzer2' :: GetBuzzer2 implicit none - GetBuzzer2 = Buzzer2 + GetBuzzer2 = DataDisplayConsole%Buzzer2 !GetBuzzer2 = .true. end function @@ -744,7 +742,7 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetBuzzer3 !DEC$ ATTRIBUTES ALIAS: 'GetBuzzer3' :: GetBuzzer3 implicit none - GetBuzzer3 = Buzzer3 + GetBuzzer3 = DataDisplayConsole%Buzzer3 !GetBuzzer3 = .true. end function @@ -752,7 +750,7 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetBuzzer4 !DEC$ ATTRIBUTES ALIAS: 'GetBuzzer4' :: GetBuzzer4 implicit none - GetBuzzer4 = Buzzer4 + GetBuzzer4 = DataDisplayConsole%Buzzer4 !GetBuzzer4 = .true. end function @@ -770,28 +768,28 @@ module CDataDisplayConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetPortWeightOnBit !DEC$ ATTRIBUTES ALIAS: 'GetPortWeightOnBit' :: GetPortWeightOnBit implicit none - GetPortWeightOnBit = PortWeightOnBit + GetPortWeightOnBit = DataDisplayConsole%PortWeightOnBit end function real(8) function GetPortHookLoad() !DEC$ ATTRIBUTES DLLEXPORT :: GetPortHookLoad !DEC$ ATTRIBUTES ALIAS: 'GetPortHookLoad' :: GetPortHookLoad implicit none - GetPortHookLoad = PortHookLoad + GetPortHookLoad = DataDisplayConsole%PortHookLoad end function real(8) function GetPortCasingPressure() !DEC$ ATTRIBUTES DLLEXPORT :: GetPortCasingPressure !DEC$ ATTRIBUTES ALIAS: 'GetPortCasingPressure' :: GetPortCasingPressure implicit none - GetPortCasingPressure = PortCasingPressure + GetPortCasingPressure = DataDisplayConsole%PortCasingPressure end function real(8) function GetPortPumpPressure() !DEC$ ATTRIBUTES DLLEXPORT :: GetPortPumpPressure !DEC$ ATTRIBUTES ALIAS: 'GetPortPumpPressure' :: GetPortPumpPressure implicit none - GetPortPumpPressure = PortPumpPressure + GetPortPumpPressure = DataDisplayConsole%PortPumpPressure end function diff --git a/CSharp/Equipments/ControlPanels/CDataDisplayConsoleVariables.f90 b/CSharp/Equipments/ControlPanels/CDataDisplayConsoleVariables.f90 index 1bfdd32..b9d4400 100644 --- a/CSharp/Equipments/ControlPanels/CDataDisplayConsoleVariables.f90 +++ b/CSharp/Equipments/ControlPanels/CDataDisplayConsoleVariables.f90 @@ -4,98 +4,100 @@ module CDataDisplayConsoleVariables implicit none public - !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 + 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 + Type(DataDisplayConsoleType) :: DataDisplayConsole - ! 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 - ! events procedure (ActionDualDouble), pointer :: PumpsSpmChanges => null() @@ -103,117 +105,109 @@ module CDataDisplayConsoleVariables subroutine Set_TotalDepth(v) - use CDrillWatchVariables, only: Depth + use CDrillWatchVariables!!, only: DrillingWatch%Depth use CSimulationVariables, only: SetDistanceDrilled implicit none real(8), intent(in) :: v - TotalWellDepth = v - Depth = v + DataDisplayConsole%TotalWellDepth = v + DrillingWatch%Depth = v call SetDistanceDrilled(v) end subroutine subroutine Set_BitPosition(v) - use CDrillWatchVariables, only: BitPosition + use CDrillWatchVariables!!, only: DrillingWatch%BitPosition implicit none real(8), intent(in) :: v - BitDepth = v - BitPosition = v + DataDisplayConsole%BitDepth = v + DrillingWatch%BitPosition = v end subroutine subroutine Set_RotaryTorque(v) - use CDrillWatchVariables, only: Torque + use CDrillWatchVariables!!, only: DrillingWatch%Torque implicit none real(8), intent(in) :: v - RotaryTorqueGauge = v - Torque = v - RTTorque = v + DataDisplayConsole%RotaryTorqueGauge = v + DrillingWatch%Torque = v + DataDisplayConsole%RTTorque = v end subroutine subroutine Set_MudWeightIn(v) - use CDrillWatchVariables, only: MudWeightInDw => MudWeightIn + use CDrillWatchVariables!, only: MudWeightInDw => DataDisplayConsole%MudWeightIn implicit none real(8), intent(in) :: v - MudWeightIn = v - MudWeightInDw = v + DataDisplayConsole%MudWeightIn = v + DrillingWatch%MudWeightIn = v end subroutine subroutine Set_MudWeightOut(v) - use CDrillWatchVariables, only: MudWeightOutDw => MudWeightOut + use CDrillWatchVariables!, only: MudWeightOutDw => DataDisplayConsole%MudWeightOut implicit none real(8), intent(in) :: v - MudWeightOut = v - MudWeightOutDw = v + DataDisplayConsole%MudWeightOut = v + DrillingWatch%MudWeightOut = v end subroutine subroutine Set_TripTankVolume(v) - use CDrillWatchVariables, only: TripTankVolume + use CDrillWatchVariables!, only: DrillingWatch%TripTankVolume implicit none real(8), intent(in) :: v - TripTankVolume = v + DrillingWatch%TripTankVolume = v end subroutine subroutine Set_FillVolume(v) - use CDrillWatchVariables, only: FillVolume + use CDrillWatchVariables!, only: DrillingWatch%FillVolume implicit none real(8), intent(in) :: v - FillVolume = v + DrillingWatch%FillVolume = v end subroutine - - - - - - - - subroutine Set_HookLoad(v) - use CDrillWatchVariables, only: HookLoadDw => HookLoad + use CDrillWatchVariables!, only: HookLoadDw => DataDisplayConsole%HookLoad implicit none real(8), intent(in) :: v - HookLoadPointer = v - HookLoadDw = v * 1000 - HookLoad = v + DataDisplayConsole%HookLoadPointer = v + DrillingWatch%HookLoad = v * 1000 + DataDisplayConsole%HookLoad = v end subroutine subroutine Set_WeightOnBit(v) - use CDrillWatchVariables, only: WeightOnBit + use CDrillWatchVariables!, only: DrillingWatch%WeightOnBit implicit none real(8), intent(in) :: v - WOBPointer = v - WeightOnBit = v - WOP = v + DataDisplayConsole%WOBPointer = v + DrillingWatch%WeightOnBit = v + DataDisplayConsole%WOP = v end subroutine subroutine Set_ROP(v) - use CDrillWatchVariables, only: ROPDw => ROP + use CDrillWatchVariables!, only: ROPDw => DataDisplayConsole%ROP implicit none real(8), intent(in) :: v - ROP = v - ROPDw = v + DataDisplayConsole%ROP = v + DrillingWatch%ROP = v end subroutine subroutine Set_CasingPressure(v) - use CDrillWatchVariables, only: CasingPressureDw => CasingPressure - use CChokeControlPanelVariables, only: CasingPressureChoke => CasingPressure + use CDrillWatchVariables!, only: CasingPressureDw => CasingPressure + use CChokeControlPanelVariables!, only: CasingPressureChoke => CasingPressure implicit none real(8), intent(in) :: v - CasingPressureGauge = v - CasingPressureDw = v - CasingPressureChoke = v - CasingPressure = v + DataDisplayConsole%CasingPressureGauge = v + DrillingWatch%CasingPressure = v + ChokeControlPanel%CasingPressure = v + DataDisplayConsole%CasingPressure = v end subroutine subroutine Set_StandPipePressure(v) - use CDrillWatchVariables, only: PumpPressure - use CChokeControlPanelVariables, only: StandPipePressureChoke => StandPipePressure + use CDrillWatchVariables!, only: DrillingWatch%PumpPressure + use CChokeControlPanelVariables!, only: StandPipePressureChoke => DataDisplayConsole%StandPipePressure implicit none real(8), intent(in) :: v - StandPipePressureGauge = v - PumpPressure = v - StandPipePressureChoke = v - StandPipePressure = v + DataDisplayConsole%StandPipePressureGauge = v + DrillingWatch%PumpPressure = v + ChokeControlPanel%StandPipePressure = v + DataDisplayConsole%StandPipePressure = v @@ -221,13 +215,13 @@ module CDataDisplayConsoleVariables subroutine Set_RotaryRPMGauge(v) - use CDrillWatchVariables, only: RPM + use CDrillWatchVariables!, only: DrillingWatch%RPM implicit none real(8), intent(in) :: v - RotaryRPMGauge = v - RPM = v - RTRPM = v - call OnRotaryRpmChange%RunAll(v) + DataDisplayConsole%RotaryRPMGauge = v + DrillingWatch%RPM = v + DataDisplayConsole%RTRPM = v + call DataDisplayConsole%OnRotaryRpmChange%RunAll(v) end subroutine @@ -236,22 +230,22 @@ module CDataDisplayConsoleVariables subroutine Set_MP1SPMGauge(v) implicit none real(8), intent(in) :: v - MP1SPMGauge = v - MP1SPM = v - if(associated(PumpsSpmChanges)) call PumpsSpmChanges(MP1SPMGauge, MP2SPMGauge) + DataDisplayConsole%MP1SPMGauge = v + DataDisplayConsole%MP1SPM = v + if(associated(PumpsSpmChanges)) call PumpsSpmChanges(DataDisplayConsole%MP1SPMGauge, DataDisplayConsole%MP2SPMGauge) #ifdef deb - print*, 'MP1SPMGauge=', MP1SPMGauge + print*, 'MP1SPMGauge=', DataDisplayConsole%MP1SPMGauge #endif end subroutine subroutine Set_MP2SPMGauge(v) implicit none real(8), intent(in) :: v - MP2SPMGauge = v - MP2SPM = v - if(associated(PumpsSpmChanges)) call PumpsSpmChanges(MP1SPMGauge, MP2SPMGauge) + DataDisplayConsole%MP2SPMGauge = v + DataDisplayConsole%MP2SPM = v + if(associated(PumpsSpmChanges)) call PumpsSpmChanges(DataDisplayConsole%MP1SPMGauge, DataDisplayConsole%MP2SPMGauge) #ifdef deb - print*, 'MP2SPMGauge=', MP2SPMGauge + print*, 'MP2SPMGauge=', DataDisplayConsole%MP2SPMGauge #endif end subroutine diff --git a/CSharp/Equipments/ControlPanels/CDrillingConsole.f90 b/CSharp/Equipments/ControlPanels/CDrillingConsole.f90 index 08869eb..104f1ec 100644 --- a/CSharp/Equipments/ControlPanels/CDrillingConsole.f90 +++ b/CSharp/Equipments/ControlPanels/CDrillingConsole.f90 @@ -13,9 +13,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetAssignmentSwitch' :: SetAssignmentSwitch implicit none integer, intent(in) :: v - AssignmentSwitch = v + DrillingConsole%AssignmentSwitch = v #ifdef deb - call Log_4( 'AssignmentSwitch=', AssignmentSwitch) + call Log_4( 'AssignmentSwitch=', DrillingConsole%AssignmentSwitch) #endif end subroutine @@ -24,9 +24,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetEmergencySwitch' :: SetEmergencySwitch implicit none logical, intent(in) :: v - EmergencySwitch = v + DrillingConsole%EmergencySwitch = v #ifdef deb - print*, 'EmergencySwitch=', EmergencySwitch + print*, 'EmergencySwitch=', DrillingConsole%EmergencySwitch #endif end subroutine @@ -35,9 +35,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetRTTorqueLimitKnob' :: SetRTTorqueLimitKnob implicit none real*8, intent(in) :: v - RTTorqueLimitKnob = v + DrillingConsole%RTTorqueLimitKnob = v #ifdef deb - print*, 'RTTorqueLimitKnob=', RTTorqueLimitKnob + print*, 'RTTorqueLimitKnob=', DrillingConsole%RTTorqueLimitKnob #endif end subroutine @@ -47,12 +47,12 @@ module CDrillingConsole implicit none integer, intent(in) :: v - if(MP1CPSwitch == v) return + if(DrillingConsole%MP1CPSwitch == v) return if(SimulationState == SimulationState_Started) then - MP1CPSwitchI = MP1CPSwitchI + 1 - if(MP1CPSwitchI >= 1) MP1CPSwitch = v - if(MP1CPSwitchI >= 100) MP1CPSwitchI = 1 + DrillingConsole%MP1CPSwitchI = DrillingConsole%MP1CPSwitchI + 1 + if(DrillingConsole%MP1CPSwitchI >= 1) DrillingConsole%MP1CPSwitch = v + if(DrillingConsole%MP1CPSwitchI >= 100) DrillingConsole%MP1CPSwitchI = 1 !call Log_3( "MP1CPSwitchI=", MP1CPSwitchI) !call Log_3( "MP1CPSwitch=", MP1CPSwitch) @@ -78,10 +78,10 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetMP1Throttle' :: SetMP1Throttle implicit none real*8, intent(in) :: v - if(MP1Throttle == v) return + if(DrillingConsole%MP1Throttle == v) return if(SimulationState == SimulationState_Started) then - if( abs(v - MP1Throttle) > 0.1) MP1ThrottleUpdate = .true. - if(MP1ThrottleUpdate) MP1Throttle = v + if( abs(v - DrillingConsole%MP1Throttle) > 0.1) DrillingConsole%MP1ThrottleUpdate = .true. + if(DrillingConsole%MP1ThrottleUpdate) DrillingConsole%MP1Throttle = v !call Log_3( 'v-mp1=', v) !call Log_3( 'MP1Throttle=', MP1Throttle) @@ -90,7 +90,7 @@ module CDrillingConsole !MP1Throttle = v endif #ifdef deb - print*, 'MP1Throttle=', MP1Throttle + print*, 'MP1Throttle=', DrillingConsole%MP1Throttle #endif end subroutine @@ -101,12 +101,12 @@ module CDrillingConsole logical, intent(in) :: v !call Log_3( 'v=', MP2SwitchT) - if(MP2Switch == v) return + if(DrillingConsole%MP2Switch == v) return if(SimulationState == SimulationState_Started) then - MP2SwitchI = MP2SwitchI + 1 - if(MP2SwitchI >= 1) MP2Switch = v - if(MP2SwitchI >= 100) MP2SwitchI = 1 + DrillingConsole%MP2SwitchI = DrillingConsole%MP2SwitchI + 1 + if(DrillingConsole%MP2SwitchI >= 1) DrillingConsole%MP2Switch = v + if(DrillingConsole%MP2SwitchI >= 100) DrillingConsole%MP2SwitchI = 1 !call Log_3( "MP1CPSwitchI=", MP1CPSwitchI) !call Log_3( "MP2Switch=", MP2Switch) @@ -134,10 +134,10 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetMP2Throttle' :: SetMP2Throttle implicit none real*8, intent(in) :: v - if(MP2Throttle == v) return + if(DrillingConsole%MP2Throttle == v) return if(SimulationState == SimulationState_Started) then - if( abs(v - MP2Throttle) > 0.1) MP2ThrottleUpdate = .true. - if(MP2ThrottleUpdate) MP2Throttle = v + if( abs(v - DrillingConsole%MP2Throttle) > 0.1) DrillingConsole%MP2ThrottleUpdate = .true. + if(DrillingConsole%MP2ThrottleUpdate) DrillingConsole%MP2Throttle = v !call Log_3( 'v-mp2=', v) !call Log_3( 'MP2Throttle=', MP2Throttle) @@ -146,7 +146,7 @@ module CDrillingConsole !MP2Throttle = v endif #ifdef deb - print*, 'MP2Throttle=', MP2Throttle + print*, 'MP2Throttle=', DrillingConsole%MP2Throttle #endif end subroutine @@ -155,9 +155,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetDWSwitch' :: SetDWSwitch implicit none integer, intent(in) :: v - DWSwitch = v + DrillingConsole%DWSwitch = v #ifdef deb - print*, 'DWSwitch=', DWSwitch + print*, 'DWSwitch=', DrillingConsole%DWSwitch #endif end subroutine @@ -166,9 +166,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetDWThrottle' :: SetDWThrottle implicit none real*8, intent(in) :: v - DWThrottle = v + DrillingConsole%DWThrottle = v #ifdef deb - print*, 'DWThrottle=', DWThrottle + print*, 'DWThrottle=', DrillingConsole%DWThrottle #endif end subroutine @@ -177,9 +177,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetRTSwitch' :: SetRTSwitch implicit none integer, intent(in) :: v - RTSwitch = v + DrillingConsole%RTSwitch = v #ifdef deb - print*, 'RTSwitch=', RTSwitch + print*, 'RTSwitch=', DrillingConsole%RTSwitch #endif end subroutine @@ -188,9 +188,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetRTThrottle' :: SetRTThrottle implicit none real*8, intent(in) :: v - RTThrottle = v + DrillingConsole%RTThrottle = v #ifdef deb - print*, 'RTThrottle=', RTThrottle + print*, 'RTThrottle=', DrillingConsole%RTThrottle #endif end subroutine @@ -200,10 +200,10 @@ module CDrillingConsole implicit none real*8, intent(in) :: v !if(ForceBreak) return - PreviousDWBreak = DWBreak - DWBreak = v + DrillingConsole%PreviousDWBreak = DrillingConsole%DWBreak + DrillingConsole%DWBreak = v #ifdef deb - print*, 'DWBreak=', DWBreak + print*, 'DWBreak=', DrillingConsole%DWBreak #endif end subroutine @@ -212,9 +212,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetDWAcceleretor' :: SetDWAcceleretor implicit none real*8, intent(in) :: v - DWAcceleretor = v + DrillingConsole%DWAcceleretor = v #ifdef deb - print*, 'DWAcceleretor=', DWAcceleretor + print*, 'DWAcceleretor=', DrillingConsole%DWAcceleretor #endif end subroutine @@ -223,9 +223,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetDWTransmisionLever' :: SetDWTransmisionLever implicit none real*8, intent(in) :: v - DWTransmisionLever = v + DrillingConsole%DWTransmisionLever = v #ifdef deb - print*, 'DWTransmisionLever=', DWTransmisionLever + print*, 'DWTransmisionLever=', DrillingConsole%DWTransmisionLever #endif end subroutine @@ -234,9 +234,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetDWPowerLever' :: SetDWPowerLever implicit none real*8, intent(in) :: v - DWPowerLever = v + DrillingConsole%DWPowerLever = v #ifdef deb - print*, 'DWPowerLever=', DWPowerLever + print*, 'DWPowerLever=', DrillingConsole%DWPowerLever #endif end subroutine @@ -245,8 +245,8 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetTongLever' :: SetTongLever implicit none real*8, intent(in) :: v - if (TongLever == v) return - TongLever = v + if (DrillingConsole%TongLever == v) return + DrillingConsole%TongLever = v ! if(dint(TongLever) == 1.0) then ! call OnBreakoutLeverPress%RunAll() @@ -269,7 +269,7 @@ module CDrillingConsole ! endif #ifdef deb - print*, 'TongLever=', TongLever + print*, 'TongLever=', DrillingConsole%TongLever #endif end subroutine @@ -278,9 +278,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetRTTransmissionLever' :: SetRTTransmissionLever implicit none real*8, intent(in) :: v - RTTransmissionLever = v + DrillingConsole%RTTransmissionLever = v #ifdef deb - print*, 'RTTransmissionLever=', RTTransmissionLever + print*, 'RTTransmissionLever=', DrillingConsole%RTTransmissionLever #endif end subroutine @@ -289,9 +289,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetDWClutchLever' :: SetDWClutchLever implicit none real*8, intent(in) :: v - DWClutchLever = v + DrillingConsole%DWClutchLever = v #ifdef deb - print*, 'DWClutchLever=', DWClutchLever + print*, 'DWClutchLever=', DrillingConsole%DWClutchLever #endif end subroutine @@ -300,9 +300,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetEddyBreakLever' :: SetEddyBreakLever implicit none real*8, intent(in) :: v - EddyBreakLever = v + DrillingConsole%EddyBreakLever = v #ifdef deb - print*, 'EddyBreakLever=', EddyBreakLever + print*, 'EddyBreakLever=', DrillingConsole%EddyBreakLever #endif end subroutine @@ -311,9 +311,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetAutoDW' :: SetAutoDW implicit none logical, intent(in) :: v - AutoDW = v + DrillingConsole%AutoDW = v #ifdef deb - print*, 'AutoDW=', AutoDW + print*, 'AutoDW=', DrillingConsole%AutoDW #endif end subroutine @@ -322,9 +322,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetGEN1' :: SetGEN1 implicit none logical, intent(in) :: v - GEN1 = v + DrillingConsole%GEN1 = v #ifdef deb - print*, 'GEN1=', GEN1 + print*, 'GEN1=', DrillingConsole%GEN1 #endif end subroutine @@ -333,9 +333,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetGEN2' :: SetGEN2 implicit none logical, intent(in) :: v - GEN2 = v + DrillingConsole%GEN2 = v #ifdef deb - print*, 'GEN2=', GEN2 + print*, 'GEN2=', DrillingConsole%GEN2 #endif end subroutine @@ -344,9 +344,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetGEN3' :: SetGEN3 implicit none logical, intent(in) :: v - GEN3 = v + DrillingConsole%GEN3 = v #ifdef deb - print*, 'GEN3=', GEN3 + print*, 'GEN3=', DrillingConsole%GEN3 #endif end subroutine @@ -355,9 +355,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetGEN4' :: SetGEN4 implicit none logical, intent(in) :: v - GEN4 = v + DrillingConsole%GEN4 = v #ifdef deb - print*, 'GEN4=', GEN4 + print*, 'GEN4=', DrillingConsole%GEN4 #endif end subroutine @@ -433,12 +433,12 @@ module CDrillingConsole use CManifolds, OpenKellyCockSub => OpenKellyCock implicit none logical, intent(in) :: v - if (OpenKellyCock == v) return - OpenKellyCock = v + if (DrillingConsole%OpenKellyCock == v) return + DrillingConsole%OpenKellyCock = v ! if (v) call OnOpenKellyCockPress%RunAll() - if(v .and. Permission_OpenKellyCock) call OpenKellyCockSub() + if(v .and. DrillingConsole%Permission_OpenKellyCock) call OpenKellyCockSub() #ifdef deb - print*, 'OpenKellyCock=', OpenKellyCock + print*, 'OpenKellyCock=', DrillingConsole%OpenKellyCock #endif end subroutine @@ -448,12 +448,12 @@ module CDrillingConsole use CManifolds, CloseKellyCockSub => CloseKellyCock implicit none logical, intent(in) :: v - if (CloseKellyCock == v) return - CloseKellyCock = v + if (DrillingConsole%CloseKellyCock == v) return + DrillingConsole%CloseKellyCock = v ! if (v) call OnCloseKellyCockPress%RunAll() - if(v .and. Permission_CloseKellyCock) call CloseKellyCockSub() + if(v .and. DrillingConsole%Permission_CloseKellyCock) call CloseKellyCockSub() #ifdef deb - print*, 'CloseKellyCock=', CloseKellyCock + print*, 'CloseKellyCock=', DrillingConsole%CloseKellyCock #endif end subroutine @@ -463,12 +463,12 @@ module CDrillingConsole !use CManifolds, OpenSafetyValveSub => OpenSafetyValve implicit none logical, intent(in) :: v - if (OpenSafetyValve == v) return - OpenSafetyValve = v + if (DrillingConsole%OpenSafetyValve == v) return + DrillingConsole%OpenSafetyValve = v ! if (v) call OnOpenSafetyValvePress%RunAll() !if(v .and. Permission_OpenSafetyValve) call OpenSafetyValveSub() #ifdef deb - print*, 'OpenSafetyValve=', OpenSafetyValve + print*, 'OpenSafetyValve=', DrillingConsole%OpenSafetyValve #endif end subroutine @@ -478,12 +478,12 @@ module CDrillingConsole !use CManifolds, CloseSafetyValveSub => CloseSafetyValve implicit none logical, intent(in) :: v - if (CloseSafetyValve == v) return - CloseSafetyValve = v + if (DrillingConsole%CloseSafetyValve == v) return + DrillingConsole%CloseSafetyValve = v ! if (v) call OnCloseSafetyValvePress%RunAll() !if(v .and. Permission_CloseSafetyValve) call CloseSafetyValveSub() #ifdef deb - print*, 'CloseSafetyValve=', CloseSafetyValve + print*, 'CloseSafetyValve=', DrillingConsole%CloseSafetyValve #endif end subroutine @@ -494,14 +494,14 @@ module CDrillingConsole implicit none logical, intent(in) :: v logical :: prev - if (IRSafetyValve == v) return - prev = IRSafetyValve - IRSafetyValve = v + if (DrillingConsole%IRSafetyValve == v) return + prev = DrillingConsole%IRSafetyValve + DrillingConsole%IRSafetyValve = v ! if (v) call OnIRSafetyValvePress%RunAll() !if(prev /= IRSafetyValve .and. v .and. Permission_IRSafetyValve) call ToggleSafetyValve() !if(prev /= IRSafetyValve .and. v) call ToggleSafetyValve() #ifdef deb - print*, 'IRSafetyValve=', IRSafetyValve + print*, 'IRSafetyValve=', DrillingConsole%IRSafetyValve #endif end subroutine @@ -512,14 +512,14 @@ module CDrillingConsole implicit none logical, intent(in) :: v logical :: prev - if (IRIBop == v) return - prev = IRIBop - IRIBop = v + if (DrillingConsole%IRIBop == v) return + prev = DrillingConsole%IRIBop + DrillingConsole%IRIBop = v ! if (v) call OnIRIBopPress%RunAll() !if(prev /= IRIBop .and. v .and. Permission_IRIBop) call ToggleIBop() !if(prev /= IRIBop .and. v) call ToggleIBop() #ifdef deb - print*, 'IRIBop=', IRIBop + print*, 'IRIBop=', DrillingConsole%IRIBop #endif end subroutine @@ -530,11 +530,11 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetLatchPipe' :: SetLatchPipe implicit none logical, intent(in) :: v - if (LatchPipe .eqv. v) return - LatchPipe = v + if (DrillingConsole%LatchPipe .eqv. v) return + DrillingConsole%LatchPipe = v ! if (v) call OnLatchPipePress%RunAll() #ifdef deb - print*, 'LatchPipe=', LatchPipe + print*, 'LatchPipe=', DrillingConsole%LatchPipe #endif end subroutine @@ -543,11 +543,11 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetUnlatchPipe' :: SetUnlatchPipe implicit none logical, intent(in) :: v - if (UnlatchPipe .eqv. v) return - UnlatchPipe = v + if (DrillingConsole%UnlatchPipe .eqv. v) return + DrillingConsole%UnlatchPipe = v ! if (v) call OnUnlatchPipePress%RunAll() #ifdef deb - print*, 'UnlatchPipe=', UnlatchPipe + print*, 'UnlatchPipe=', DrillingConsole%UnlatchPipe #endif end subroutine @@ -556,11 +556,11 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetSwing' :: SetSwing implicit none logical, intent(in) :: v - if (Swing .eqv. v) return - Swing = v + if (DrillingConsole%Swing .eqv. v) return + DrillingConsole%Swing = v ! if (v) call OnSwingPress%RunAll() #ifdef deb - print*, 'Swing=', Swing + print*, 'Swing=', DrillingConsole%Swing #endif end subroutine @@ -569,11 +569,11 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetFillMouseHole' :: SetFillMouseHole implicit none logical, intent(in) :: v - if (FillMouseHole .eqv. v) return - FillMouseHole = v + if (DrillingConsole%FillMouseHole .eqv. v) return + DrillingConsole%FillMouseHole = v ! if (v) call OnFillMouseHolePress%RunAll() #ifdef deb - print*, 'FillMouseHole=', FillMouseHole + print*, 'FillMouseHole=', DrillingConsole%FillMouseHole #endif end subroutine @@ -582,10 +582,10 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetSlips' :: SetSlips implicit none logical, intent(in) :: v - if (Slips .eqv. v) return - Slips = v + if (DrillingConsole%Slips .eqv. v) return + DrillingConsole%Slips = v #ifdef deb - print*, 'Slips=', Slips + print*, 'Slips=', DrillingConsole%Slips #endif ! if (v) call OnSlipsPress%RunAll() end subroutine @@ -596,9 +596,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetBrakeLeverCoefficient' :: SetBrakeLeverCoefficient implicit none real, intent(in) :: v - BrakeLeverCoefficient = v + DrillingConsole%BrakeLeverCoefficient = v #ifdef deb - print*, 'BrakeLeverCoefficient=', BrakeLeverCoefficient + print*, 'BrakeLeverCoefficient=', DrillingConsole%BrakeLeverCoefficient #endif end subroutine @@ -607,9 +607,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetHideDrillingBrake' :: SetHideDrillingBrake implicit none logical, intent(in) :: v - HideDrillingBrake = v + DrillingConsole%HideDrillingBrake = v #ifdef deb - print*, 'HideDrillingBrake=', HideDrillingBrake + print*, 'HideDrillingBrake=', DrillingConsole%HideDrillingBrake #endif end subroutine @@ -625,9 +625,9 @@ module CDrillingConsole !DEC$ ATTRIBUTES ALIAS: 'SetParkingBrake' :: SetParkingBrake implicit none logical, intent(in) :: v - ParkingBrakeBtn = v + DrillingConsole%ParkingBrakeBtn = v #ifdef deb - print*, 'ParkingBrakeBtn=', ParkingBrakeBtn + print*, 'ParkingBrakeBtn=', DrillingConsole%ParkingBrakeBtn #endif end subroutine @@ -648,7 +648,7 @@ module CDrillingConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetParkingBrakeLed !DEC$ ATTRIBUTES ALIAS: 'GetParkingBrakeLed' :: GetParkingBrakeLed implicit none - GetParkingBrakeLed = ParkingBrakeLed + GetParkingBrakeLed = DrillingConsole%ParkingBrakeLed !GetParkingBrakeLed = .true. end function @@ -689,154 +689,154 @@ module CDrillingConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetSCR1LED !DEC$ ATTRIBUTES ALIAS: 'GetSCR1LED' :: GetSCR1LED implicit none - GetSCR1LED = SCR1LED + GetSCR1LED = DrillingConsole%SCR1LED end function integer function GetSCR2LED() !DEC$ ATTRIBUTES DLLEXPORT :: GetSCR2LED !DEC$ ATTRIBUTES ALIAS: 'GetSCR2LED' :: GetSCR2LED implicit none - GetSCR2LED = SCR2LED + GetSCR2LED = DrillingConsole%SCR2LED end function integer function GetSCR3LED() !DEC$ ATTRIBUTES DLLEXPORT :: GetSCR3LED !DEC$ ATTRIBUTES ALIAS: 'GetSCR3LED' :: GetSCR3LED implicit none - GetSCR3LED = SCR3LED + GetSCR3LED = DrillingConsole%SCR3LED end function integer function GetSCR4LED() !DEC$ ATTRIBUTES DLLEXPORT :: GetSCR4LED !DEC$ ATTRIBUTES ALIAS: 'GetSCR4LED' :: GetSCR4LED implicit none - GetSCR4LED = SCR4LED + GetSCR4LED = DrillingConsole%SCR4LED end function integer function GetMP1BLWR() !DEC$ ATTRIBUTES DLLEXPORT :: GetMP1BLWR !DEC$ ATTRIBUTES ALIAS: 'GetMP1BLWR' :: GetMP1BLWR implicit none - GetMP1BLWR = MP1BLWR + GetMP1BLWR = DrillingConsole%MP1BLWR end function integer function GetMP2BLWR() !DEC$ ATTRIBUTES DLLEXPORT :: GetMP2BLWR !DEC$ ATTRIBUTES ALIAS: 'GetMP2BLWR' :: GetMP2BLWR implicit none - GetMP2BLWR = MP2BLWR + GetMP2BLWR = DrillingConsole%MP2BLWR end function integer function GetDWBLWR() !DEC$ ATTRIBUTES DLLEXPORT :: GetDWBLWR !DEC$ ATTRIBUTES ALIAS: 'GetDWBLWR' :: GetDWBLWR implicit none - GetDWBLWR = DWBLWR + GetDWBLWR = DrillingConsole%DWBLWR end function integer function GetRTBLWR() !DEC$ ATTRIBUTES DLLEXPORT :: GetRTBLWR !DEC$ ATTRIBUTES ALIAS: 'GetRTBLWR' :: GetRTBLWR implicit none - GetRTBLWR = RTBLWR + GetRTBLWR = DrillingConsole%RTBLWR end function integer function GetPWRLIM() !DEC$ ATTRIBUTES DLLEXPORT :: GetPWRLIM !DEC$ ATTRIBUTES ALIAS: 'GetPWRLIM' :: GetPWRLIM implicit none - GetPWRLIM = PWRLIM + GetPWRLIM = DrillingConsole%PWRLIM end function real(8) function GetPWRLIMMTR() !DEC$ ATTRIBUTES DLLEXPORT :: GetPWRLIMMTR !DEC$ ATTRIBUTES ALIAS: 'GetPWRLIMMTR' :: GetPWRLIMMTR implicit none - GetPWRLIMMTR = PWRLIMMTR + GetPWRLIMMTR = DrillingConsole%PWRLIMMTR end function real(8) function GetRTTorqueLimitGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetRTTorqueLimitGauge !DEC$ ATTRIBUTES ALIAS: 'GetRTTorqueLimitGauge' :: GetRTTorqueLimitGauge implicit none - GetRTTorqueLimitGauge = RTTorqueLimitGauge + GetRTTorqueLimitGauge = DrillingConsole%RTTorqueLimitGauge end function integer function GetAutoDWLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetAutoDWLED !DEC$ ATTRIBUTES ALIAS: 'GetAutoDWLED' :: GetAutoDWLED implicit none - GetAutoDWLED = AutoDWLED + GetAutoDWLED = DrillingConsole%AutoDWLED end function integer function GetGEN1BTNLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN1BTNLED !DEC$ ATTRIBUTES ALIAS: 'GetGEN1BTNLED' :: GetGEN1BTNLED implicit none - GetGEN1BTNLED = GEN1BTNLED + GetGEN1BTNLED = DrillingConsole%GEN1BTNLED end function integer function GetGEN2BTNLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN2BTNLED !DEC$ ATTRIBUTES ALIAS: 'GetGEN2BTNLED' :: GetGEN2BTNLED implicit none - GetGEN2BTNLED = GEN2BTNLED + GetGEN2BTNLED = DrillingConsole%GEN2BTNLED end function integer function GetGEN3BTNLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN3BTNLED !DEC$ ATTRIBUTES ALIAS: 'GetGEN3BTNLED' :: GetGEN3BTNLED implicit none - GetGEN3BTNLED = GEN3BTNLED + GetGEN3BTNLED = DrillingConsole%GEN3BTNLED end function integer function GetGEN4BTNLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN4BTNLED !DEC$ ATTRIBUTES ALIAS: 'GetGEN4BTNLED' :: GetGEN4BTNLED implicit none - GetGEN4BTNLED = GEN4BTNLED + GetGEN4BTNLED = DrillingConsole%GEN4BTNLED end function integer function GetOpenKellyCockLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetOpenKellyCockLed !DEC$ ATTRIBUTES ALIAS: 'GetOpenKellyCockLed' :: GetOpenKellyCockLed implicit none - GetOpenKellyCockLed = OpenKellyCockLed + GetOpenKellyCockLed = DrillingConsole%OpenKellyCockLed end function integer function GetCloseKellyCockLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetCloseKellyCockLed !DEC$ ATTRIBUTES ALIAS: 'GetCloseKellyCockLed' :: GetCloseKellyCockLed implicit none - GetCloseKellyCockLed = CloseKellyCockLed + GetCloseKellyCockLed = DrillingConsole%CloseKellyCockLed end function integer function GetOpenSafetyValveLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetOpenSafetyValveLed !DEC$ ATTRIBUTES ALIAS: 'GetOpenSafetyValveLed' :: GetOpenSafetyValveLed implicit none - GetOpenSafetyValveLed = OpenSafetyValveLed + GetOpenSafetyValveLed = DrillingConsole%OpenSafetyValveLed end function integer function GetCloseSafetyValveLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetCloseSafetyValveLed !DEC$ ATTRIBUTES ALIAS: 'GetCloseSafetyValveLed' :: GetCloseSafetyValveLed implicit none - GetCloseSafetyValveLed = CloseSafetyValveLed + GetCloseSafetyValveLed = DrillingConsole%CloseSafetyValveLed end function integer function GetIRSafetyValveLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetIRSafetyValveLed !DEC$ ATTRIBUTES ALIAS: 'GetIRSafetyValveLed' :: GetIRSafetyValveLed implicit none - GetIRSafetyValveLed = IRSafetyValveLed + GetIRSafetyValveLed = DrillingConsole%IRSafetyValveLed end function integer function GetIRIBopLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetIRIBopLed !DEC$ ATTRIBUTES ALIAS: 'GetIRIBopLed' :: GetIRIBopLed implicit none - GetIRIBopLed = IRIBopLed + GetIRIBopLed = DrillingConsole%IRIBopLed end function @@ -844,28 +844,28 @@ module CDrillingConsole !DEC$ ATTRIBUTES DLLEXPORT :: GetLatchPipeLED !DEC$ ATTRIBUTES ALIAS: 'GetLatchPipeLED' :: GetLatchPipeLED implicit none - GetLatchPipeLED = LatchPipeLED + GetLatchPipeLED = DrillingConsole%LatchPipeLED end function integer function GetUnlatchPipeLED() !DEC$ ATTRIBUTES DLLEXPORT :: GetUnlatchPipeLED !DEC$ ATTRIBUTES ALIAS: 'GetUnlatchPipeLED' :: GetUnlatchPipeLED implicit none - GetUnlatchPipeLED = UnlatchPipeLED + GetUnlatchPipeLED = DrillingConsole%UnlatchPipeLED end function integer function GetSwingLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetSwingLed !DEC$ ATTRIBUTES ALIAS: 'GetSwingLed' :: GetSwingLed implicit none - GetSwingLed = SwingLed + GetSwingLed = DrillingConsole%SwingLed end function integer function GetFillMouseHoleLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetFillMouseHoleLed !DEC$ ATTRIBUTES ALIAS: 'GetFillMouseHoleLed' :: GetFillMouseHoleLed implicit none - GetFillMouseHoleLed = FillMouseHoleLed + GetFillMouseHoleLed = DrillingConsole%FillMouseHoleLed end function end module CDrillingConsole \ No newline at end of file diff --git a/CSharp/Equipments/ControlPanels/CDrillingConsoleVariables.f90 b/CSharp/Equipments/ControlPanels/CDrillingConsoleVariables.f90 index 1f8a56d..9392128 100644 --- a/CSharp/Equipments/ControlPanels/CDrillingConsoleVariables.f90 +++ b/CSharp/Equipments/ControlPanels/CDrillingConsoleVariables.f90 @@ -1,132 +1,133 @@ module CDrillingConsoleVariables + use CVoidEventHandlerCollection implicit none public - ! 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 + 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 - 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 + real :: BrakeLeverCoefficient + logical :: HideDrillingBrake - integer :: LatchPipeLED - integer :: UnlatchPipeLED - integer :: SwingLed - integer :: FillMouseHoleLed + 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 - - contains + integer :: LatchPipeLED + integer :: UnlatchPipeLED + integer :: SwingLed + integer :: FillMouseHoleLed + END TYPE DrillingConsoleType + TYPE(DrillingConsoleType) :: DrillingConsole end module CDrillingConsoleVariables \ No newline at end of file diff --git a/CSharp/Equipments/ControlPanels/CHookVariables.f90 b/CSharp/Equipments/ControlPanels/CHookVariables.f90 index 06222ad..6d597b5 100644 --- a/CSharp/Equipments/ControlPanels/CHookVariables.f90 +++ b/CSharp/Equipments/ControlPanels/CHookVariables.f90 @@ -1,13 +1,14 @@ module CHookVariables use CRealEventHandlerCollection use CHookActions - implicit none - public - - real :: HookHeight_S = 0.0 - real :: HookHeight - type(RealEventHandlerCollection) :: OnHookHeightChange - + implicit none + Type :: HookType + real :: HookHeight_S = 0.0 + real :: HookHeight + type(RealEventHandlerCollection) :: Hook%OnHookHeightChange + end type HookType + Type(HookType)::Hook + contains subroutine Set_HookHeight(v) @@ -16,19 +17,19 @@ module CHookVariables real , intent(in) :: v #ifdef ExcludeExtraChanges - if(HookHeight == v) return + if(Hook%HookHeight == v) return #endif - HookHeight = v + Hook%HookHeight = v if(associated(HookHeightPtr)) then - call HookHeightPtr(HookHeight) + call HookHeightPtr(Hook%HookHeight) end if #ifdef deb - print*, 'HookHeight=', HookHeight + print*, 'HookHeight=', Hook%HookHeight #endif - call OnHookHeightChange%RunAll(HookHeight) + call Hook%OnHookHeightChange%RunAll(Hook%HookHeight) end subroutine @@ -36,12 +37,12 @@ module CHookVariables implicit none real , intent(in) :: v - if(v == HookHeight) then + if(v == Hook%HookHeight) then return - elseif (v > HookHeight) then + elseif (v > Hook%HookHeight) then loop1: do - call Set_HookHeight(HookHeight + 0.2) - if(abs(v - HookHeight) <= 0.1) then + call Set_HookHeight(Hook%HookHeight + 0.2) + if(abs(v - Hook%HookHeight) <= 0.1) then call Set_HookHeight(v) exit loop1 endif @@ -49,8 +50,8 @@ module CHookVariables enddo loop1 else ! v < HookHeight loop2: do - call Set_HookHeight(HookHeight - 0.2) - if(abs(HookHeight - v) <= 0.1) then + call Set_HookHeight(Hook%HookHeight - 0.2) + if(abs(Hook%HookHeight - v) <= 0.1) then call Set_HookHeight(v) exit loop2 endif @@ -67,13 +68,13 @@ module CHookVariables implicit none real , intent(in) :: v !call Set_HookHeight(v) - HookHeight_S = v + Hook%HookHeight_S = v end subroutine subroutine Update_HookHeight_From_Snapshot() implicit none - call Set_HookHeight_S(HookHeight_S) + call Set_HookHeight_S(Hook%HookHeight_S) end subroutine end module CHookVariables \ No newline at end of file diff --git a/CSharp/Equipments/ControlPanels/CStandPipeManifold.f90 b/CSharp/Equipments/ControlPanels/CStandPipeManifold.f90 index 97d1b4a..2dc7a34 100644 --- a/CSharp/Equipments/ControlPanels/CStandPipeManifold.f90 +++ b/CSharp/Equipments/ControlPanels/CStandPipeManifold.f90 @@ -11,10 +11,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve1' :: SetStandPipeManifoldValve1 implicit none logical, intent(in) :: v - StandPipeManifoldValve1 = v + StandPipeManifold%StandPipeManifoldValve1 = v call ChangeValve(13, v) #ifdef deb - print*, 'StandPipeManifoldValve1=', StandPipeManifoldValve1 + print*, 'StandPipeManifoldValve1=', StandPipeManifold%StandPipeManifoldValve1 #endif end subroutine @@ -23,10 +23,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve2' :: SetStandPipeManifoldValve2 implicit none logical, intent(in) :: v - StandPipeManifoldValve2 = v + StandPipeManifold%StandPipeManifoldValve2 = v call ChangeValve(14, v) #ifdef deb - print*, 'StandPipeManifoldValve2=', StandPipeManifoldValve2 + print*, 'StandPipeManifoldValve2=', StandPipeManifold%StandPipeManifoldValve2 #endif end subroutine @@ -35,10 +35,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve3' :: SetStandPipeManifoldValve3 implicit none logical, intent(in) :: v - StandPipeManifoldValve3 = v + StandPipeManifold%StandPipeManifoldValve3 = v call ChangeValve(15, v) #ifdef deb - print*, 'StandPipeManifoldValve3=', StandPipeManifoldValve3 + print*, 'StandPipeManifoldValve3=', StandPipeManifold%StandPipeManifoldValve3 #endif end subroutine @@ -47,10 +47,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve4' :: SetStandPipeManifoldValve4 implicit none logical, intent(in) :: v - StandPipeManifoldValve4 = v + StandPipeManifold%StandPipeManifoldValve4 = v call ChangeValve(11, v) #ifdef deb - print*, 'StandPipeManifoldValve4=', StandPipeManifoldValve4 + print*, 'StandPipeManifoldValve4=', StandPipeManifold%StandPipeManifoldValve4 #endif end subroutine @@ -59,10 +59,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve5' :: SetStandPipeManifoldValve5 implicit none logical, intent(in) :: v - StandPipeManifoldValve5 = v + StandPipeManifold%StandPipeManifoldValve5 = v call ChangeValve(12, v) #ifdef deb - print*, 'StandPipeManifoldValve5=', StandPipeManifoldValve5 + print*, 'StandPipeManifoldValve5=', StandPipeManifold%StandPipeManifoldValve5 #endif end subroutine @@ -71,10 +71,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve6' :: SetStandPipeManifoldValve6 implicit none logical, intent(in) :: v - StandPipeManifoldValve6 = v + StandPipeManifold%StandPipeManifoldValve6 = v call ChangeValve(9, v) #ifdef deb - print*, 'StandPipeManifoldValve6=', StandPipeManifoldValve6 + print*, 'StandPipeManifoldValve6=', StandPipeManifold%StandPipeManifoldValve6 #endif end subroutine @@ -83,10 +83,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve7' :: SetStandPipeManifoldValve7 implicit none logical, intent(in) :: v - StandPipeManifoldValve7 = v + StandPipeManifold%StandPipeManifoldValve7 = v call ChangeValve(10, v) #ifdef deb - print*, 'StandPipeManifoldValve7=', StandPipeManifoldValve7 + print*, 'StandPipeManifoldValve7=', StandPipeManifold%StandPipeManifoldValve7 #endif end subroutine @@ -95,10 +95,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve8' :: SetStandPipeManifoldValve8 implicit none logical, intent(in) :: v - StandPipeManifoldValve8 = v + StandPipeManifold%StandPipeManifoldValve8 = v call ChangeValve(6, v) #ifdef deb - print*, 'StandPipeManifoldValve8=', StandPipeManifoldValve8 + print*, 'StandPipeManifoldValve8=', StandPipeManifold%StandPipeManifoldValve8 #endif end subroutine @@ -107,10 +107,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve9' :: SetStandPipeManifoldValve9 implicit none logical, intent(in) :: v - StandPipeManifoldValve9 = v + StandPipeManifold%StandPipeManifoldValve9 = v call ChangeValve(7, v) #ifdef deb - print*, 'StandPipeManifoldValve9=', StandPipeManifoldValve9 + print*, 'StandPipeManifoldValve9=', StandPipeManifold%StandPipeManifoldValve9 #endif end subroutine @@ -119,10 +119,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve10' :: SetStandPipeManifoldValve10 implicit none logical, intent(in) :: v - StandPipeManifoldValve10 = v + StandPipeManifold%StandPipeManifoldValve10 = v call ChangeValve(8, v) #ifdef deb - print*, 'StandPipeManifoldValve10=', StandPipeManifoldValve10 + print*, 'StandPipeManifoldValve10=', StandPipeManifold%StandPipeManifoldValve10 #endif end subroutine @@ -131,10 +131,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve11' :: SetStandPipeManifoldValve11 implicit none logical, intent(in) :: v - StandPipeManifoldValve11 = v + StandPipeManifold%StandPipeManifoldValve11 = v call ChangeValve(1, v) #ifdef deb - print*, 'StandPipeManifoldValve11=', StandPipeManifoldValve11 + print*, 'StandPipeManifoldValve11=', StandPipeManifold%StandPipeManifoldValve11 #endif end subroutine @@ -143,10 +143,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve12' :: SetStandPipeManifoldValve12 implicit none logical, intent(in) :: v - StandPipeManifoldValve12 = v + StandPipeManifold%StandPipeManifoldValve12 = v call ChangeValve(2, v) #ifdef deb - print*, 'StandPipeManifoldValve12=', StandPipeManifoldValve12 + print*, 'StandPipeManifoldValve12=', StandPipeManifold%StandPipeManifoldValve12 #endif end subroutine @@ -155,10 +155,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve13' :: SetStandPipeManifoldValve13 implicit none logical, intent(in) :: v - StandPipeManifoldValve13 = v + StandPipeManifold%StandPipeManifoldValve13 = v call ChangeValve(3, v) #ifdef deb - print*, 'StandPipeManifoldValve13=', StandPipeManifoldValve13 + print*, 'StandPipeManifoldValve13=', StandPipeManifold%StandPipeManifoldValve13 #endif end subroutine @@ -167,10 +167,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve14' :: SetStandPipeManifoldValve14 implicit none logical, intent(in) :: v - StandPipeManifoldValve14 = v + StandPipeManifold%StandPipeManifoldValve14 = v call ChangeValve(4, v) #ifdef deb - print*, 'StandPipeManifoldValve14=', StandPipeManifoldValve14 + print*, 'StandPipeManifoldValve14=', StandPipeManifold%StandPipeManifoldValve14 #endif end subroutine @@ -179,10 +179,10 @@ module CStandPipeManifold !DEC$ ATTRIBUTES ALIAS: 'SetStandPipeManifoldValve15' :: SetStandPipeManifoldValve15 implicit none logical, intent(in) :: v - StandPipeManifoldValve15 = v + StandPipeManifold%StandPipeManifoldValve15 = v call ChangeValve(5, v) #ifdef deb - print*, 'StandPipeManifoldValve15=', StandPipeManifoldValve15 + print*, 'StandPipeManifoldValve15=', StandPipeManifold%StandPipeManifoldValve15 #endif end subroutine @@ -191,7 +191,7 @@ module CStandPipeManifold !DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipeGauge1 !DEC$ ATTRIBUTES ALIAS: 'GetStandPipeGauge1' :: GetStandPipeGauge1 implicit none - GetStandPipeGauge1 = StandPipeGauge1 + GetStandPipeGauge1 = StandPipeManifold%StandPipeGauge1 !GetStandPipeGauge1 = 567.4 end function @@ -199,7 +199,7 @@ module CStandPipeManifold !DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipeGauge2 !DEC$ ATTRIBUTES ALIAS: 'GetStandPipeGauge2' :: GetStandPipeGauge2 implicit none - GetStandPipeGauge2 = StandPipeGauge2 + GetStandPipeGauge2 = StandPipeManifold%StandPipeGauge2 !GetStandPipeGauge2 = 1564.0 end function diff --git a/CSharp/Equipments/ControlPanels/CStandPipeManifoldVariables.f90 b/CSharp/Equipments/ControlPanels/CStandPipeManifoldVariables.f90 index cbab48f..82bc7bb 100644 --- a/CSharp/Equipments/ControlPanels/CStandPipeManifoldVariables.f90 +++ b/CSharp/Equipments/ControlPanels/CStandPipeManifoldVariables.f90 @@ -2,26 +2,27 @@ module CStandPipeManifoldVariables implicit none public - ! 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 + Type::StandPipeManifold + ! 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 - - contains + ! Output vars + real(8) :: StandPipeGauge1 + real(8) :: StandPipeGauge2 + End type StandPipeManifoldType + contains end module CStandPipeManifoldVariables \ No newline at end of file diff --git a/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 b/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 index 413a3e7..fa0db5e 100644 --- a/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 +++ b/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 @@ -22,9 +22,9 @@ module CTopDrivePanel !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTorqueWrench' :: SetTopDriveTorqueWrench implicit none logical, intent(in) :: v - TopDriveTorqueWrench = v + TopDrivePanel%TopDriveTorqueWrench = v #ifdef deb - call Log_3( 'TopDriveTorqueWrench=', TopDriveTorqueWrench) + call Log_3( 'TopDriveTorqueWrench=', TopDrivePanel%TopDriveTorqueWrench) #endif end subroutine @@ -33,9 +33,9 @@ module CTopDrivePanel !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveDrillTorqueState' :: SetTopDriveDrillTorqueState implicit none integer, intent(in) :: v - TopDriveDrillTorqueState = v + TopDrivePanel%TopDriveDrillTorqueState = v #ifdef deb - call Log_3( 'TopDriveDrillTorqueState=', TopDriveDrillTorqueState) + call Log_3( 'TopDriveDrillTorqueState=', TopDrivePanel%TopDriveDrillTorqueState) #endif end subroutine @@ -44,9 +44,9 @@ module CTopDrivePanel !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveLinkTiltState' :: SetTopDriveLinkTiltState implicit none integer, intent(in) :: v - TopDriveLinkTiltState = v + TopDrivePanel%TopDriveLinkTiltState = v #ifdef deb - call Log_3( 'TopDriveLinkTiltState=', TopDriveLinkTiltState) + call Log_3( 'TopDriveLinkTiltState=', TopDrivePanel%TopDriveLinkTiltState) #endif end subroutine @@ -55,9 +55,9 @@ module CTopDrivePanel !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveIbop' :: SetTopDriveIbop implicit none logical, intent(in) :: v - TopDriveIbop = v + TopDrivePanel%TopDriveIbop = v #ifdef deb - call Log_3( 'TopDriveIbop=', TopDriveIbop) + call Log_3( 'TopDriveIbop=', TopDrivePanel%TopDriveIbop) #endif end subroutine @@ -65,33 +65,33 @@ module CTopDrivePanel !DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveTorqueLimitKnob !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTorqueLimitKnob' :: SetTopDriveTorqueLimitKnob use CSimulationVariables, only: IsPortable - use CDrillingConsoleVariables, only: RTSwitch, RTTorqueLimitKnob + use CDrillingConsoleVariables!, only: DrillingConsole%RTSwitch, DrillingConsole%RTTorqueLimitKnob use CWarningsVariables, only: Activate_TopdriveRotaryTableConfilict use CScaleRange implicit none real, intent(in) :: v if (IsPortable) then - if(TopDriveTdsPowerState /= 0 .and. RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() - if(TopDriveTdsPowerState /= 0 .and. RTSwitch == 0) then - RTTorqueLimitKnob = 0 - TopDriveTorqueLimitKnob = v + if(TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() + if(TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch == 0) then + DrillingConsole%RTTorqueLimitKnob = 0 + TopDrivePanel%TopDriveTorqueLimitKnob = v #ifdef deb - call Log_3( 'RTTorqueLimitKnob=', RTTorqueLimitKnob ) - call Log_3( 'TopDriveTorqueLimitKnob=', TopDriveTorqueLimitKnob ) + call Log_3( 'RTTorqueLimitKnob=', DrillingConsole%RTTorqueLimitKnob ) + call Log_3( 'TopDriveTorqueLimitKnob=', TopDrivePanel%TopDriveTorqueLimitKnob ) #endif endif - if(TopDriveTdsPowerState == 0 .and. RTSwitch /= 0) then - TopDriveTorqueLimitKnob = 0 - RTTorqueLimitKnob = real(ScaleRange(v, 0.0, 10.0, 0.0, 6000.0), 8) + if(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 - call Log_3( 'RTTorqueLimitKnob=', RTTorqueLimitKnob ) - call Log_3( 'TopDriveTorqueLimitKnob=', TopDriveTorqueLimitKnob ) + call Log_3( 'RTTorqueLimitKnob=', DrillingConsole%RTTorqueLimitKnob ) + call Log_3( 'TopDriveTorqueLimitKnob=', TopDrivePanel%TopDriveTorqueLimitKnob ) #endif endif else - TopDriveTorqueLimitKnob = v + TopDrivePanel%TopDriveTorqueLimitKnob = v #ifdef deb - call Log_3( 'TopDriveTorqueLimitKnob=', TopDriveTorqueLimitKnob) + call Log_3( 'TopDriveTorqueLimitKnob=', TopDrivePanel%TopDriveTorqueLimitKnob) #endif endif @@ -101,31 +101,31 @@ module CTopDrivePanel !DEC$ ATTRIBUTES DLLEXPORT :: SetRpmKnob !DEC$ ATTRIBUTES ALIAS: 'SetRpmKnob' :: SetRpmKnob use CSimulationVariables, only: IsPortable - use CDrillingConsoleVariables, only: RTSwitch, RTThrottle + use CDrillingConsoleVariables!, only: DrillingConsole%RTSwitch, DrillingConsole%RTThrottle use CWarningsVariables, only: Activate_TopdriveRotaryTableConfilict use CScaleRange implicit none real, intent(in) :: v if (IsPortable) then - if(TopDriveTdsPowerState /= 0 .and. RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() - if(TopDriveTdsPowerState /= 0 .and. RTSwitch == 0) then - RTThrottle = 0 - RpmKnob = v + if(TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() + if(TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch == 0) then + DrillingConsole%RTThrottle = 0 + TopDrivePanel%RpmKnob = v #ifdef deb - call Log_3( 'RTThrottle=', RTThrottle ) - call Log_3( 'RpmKnob=', RpmKnob ) + call Log_3( 'RTThrottle=', DrillingConsole%RTThrottle ) + call Log_3( 'RpmKnob=', TopDrivePanel%RpmKnob ) #endif endif - if(TopDriveTdsPowerState == 0 .and. RTSwitch /= 0) then - RpmKnob = 0 - RTThrottle = real(ScaleRange(v, 0.0, 965.0, 0.0, 250.0), 8) + if(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 - call Log_3( 'RpmKnob=', RpmKnob ) - call Log_3( 'RTThrottle=', RTThrottle ) + call Log_3( 'RpmKnob=', TopDrivePanel%RpmKnob ) + call Log_3( 'RTThrottle=', DrillingConsole%RTThrottle ) #endif endif else - RpmKnob = v + TopDrivePanel%RpmKnob = v endif @@ -133,9 +133,9 @@ module CTopDrivePanel if (IsPortable) then ! else - RpmKnob = v + TopDrivePanel%RpmKnob = v #ifdef deb - call Log_3( 'RpmKnob=', RpmKnob ) + call Log_3( 'RpmKnob=', TopDrivePanel%RpmKnob ) #endif endif @@ -147,7 +147,7 @@ module CTopDrivePanel !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveOperationFaultLed !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveOperationFaultLed' :: GetTopDriveOperationFaultLed implicit none - GetTopDriveOperationFaultLed = TopDriveOperationFaultLed + GetTopDriveOperationFaultLed = TopDrivePanel%TopDriveOperationFaultLed !GetTopDriveOperationFaultLed = 1 end function @@ -155,7 +155,7 @@ module CTopDrivePanel !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTdsPowerLed !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTdsPowerLed' :: GetTopDriveTdsPowerLed implicit none - GetTopDriveTdsPowerLed = TopDriveTdsPowerLed + GetTopDriveTdsPowerLed = TopDrivePanel%TopDriveTdsPowerLed !GetTopDriveTdsPowerLed = 1 end function @@ -163,7 +163,7 @@ module CTopDrivePanel !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueWrenchLed !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueWrenchLed' :: GetTopDriveTorqueWrenchLed implicit none - GetTopDriveTorqueWrenchLed = TopDriveTorqueWrenchLed + GetTopDriveTorqueWrenchLed = TopDrivePanel%TopDriveTorqueWrenchLed !GetTopDriveTorqueWrenchLed = 1 end function @@ -171,7 +171,7 @@ module CTopDrivePanel !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveLinkTiltLed !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveLinkTiltLed' :: GetTopDriveLinkTiltLed implicit none - GetTopDriveLinkTiltLed = TopDriveLinkTiltLed + GetTopDriveLinkTiltLed = TopDrivePanel%TopDriveLinkTiltLed !GetTopDriveLinkTiltLed = 1 end function @@ -179,7 +179,7 @@ module CTopDrivePanel !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveIbopLed !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveIbopLed' :: GetTopDriveIbopLed implicit none - GetTopDriveIbopLed = TopDriveIbopLed + GetTopDriveIbopLed = TopDrivePanel%TopDriveIbopLed !GetTopDriveIbopLed = 1 end function @@ -187,7 +187,7 @@ module CTopDrivePanel !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueGauge !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueGauge' :: GetTopDriveTorqueGauge implicit none - GetTopDriveTorqueGauge = TopDriveTorqueGauge + GetTopDriveTorqueGauge = TopDrivePanel%TopDriveTorqueGauge !GetTopDriveTorqueGauge = 340 end function @@ -195,7 +195,7 @@ module CTopDrivePanel !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueLimitGauge !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueLimitGauge' :: GetTopDriveTorqueLimitGauge implicit none - GetTopDriveTorqueLimitGauge = TopDriveTorqueLimitGauge + GetTopDriveTorqueLimitGauge = TopDrivePanel%TopDriveTorqueLimitGauge !GetTopDriveTorqueLimitGauge = 442 end function @@ -203,7 +203,7 @@ module CTopDrivePanel !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveRpmGauge !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveRpmGauge' :: GetTopDriveRpmGauge implicit none - GetTopDriveRpmGauge = TopDriveRpmGauge + GetTopDriveRpmGauge = TopDrivePanel%TopDriveRpmGauge !GetTopDriveRpmGauge = 67 end function diff --git a/CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90 b/CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90 index a6fc0a0..c13f60c 100644 --- a/CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90 +++ b/CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90 @@ -20,24 +20,26 @@ module CTopDrivePanelVariables integer :: LED_BLINK = 2 ! Input vars - integer :: TopDriveTdsPowerState - logical :: TopDriveTorqueWrench - integer :: TopDriveDrillTorqueState - integer :: TopDriveLinkTiltState - logical :: TopDriveIbop - real :: TopDriveTorqueLimitKnob - real :: RpmKnob + ! 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 - + + ! Output vars + integer :: TopDriveOperationFaultLed + integer :: TopDriveTdsPowerLed + integer :: TopDriveTorqueWrenchLed + integer :: TopDriveLinkTiltLed + integer :: TopDriveIbopLed + real :: TopDriveTorqueLimitGauge + real :: TopDriveTorqueGauge + real :: TopDriveRpmGauge + end type TopDrivePanelType + Type(TopDrivePanelType)::TopDrivePanel contains end module CTopDrivePanelVariables \ No newline at end of file diff --git a/CSharp/Equipments/ControlPanels/cequipmentsconstants.mod b/CSharp/Equipments/ControlPanels/cequipmentsconstants.mod deleted file mode 100644 index 4214a04d8da348b0e9c4f2a9e65b50c439e1d711..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 312 zcmV-80muFyiwFP!000001I?1bQiCuMhVOZby#a?hX$uFvA!3IS0s|B;To8hykkkPB z`a&t7P8lyAI!Pw`?`AXK?(FW~^+R7LQ1PrSDSS{-7o35#)+9&;O&Xd(E_em$P3#H& zO4Fu}qrh@vLO+9|YRjbQ5)3YAYy>ZfIK<|ATO2CNx`zg5jo_u1Fj{tMj&y;#Njl>y zzs5+G75I;hMngfJdFE_DO6dfVju6tKTY@#nvg6+EZ4>Ru192b8$|9jjLKvmzyT&M{ z8v`C#zB&3ee$qo8Jp(eH%jh%F7NnA9Pi4X03ikXLU!?n%erucXlMtOHv>ea23@cm( zdSuR=eag=CK|PUjfbab)`i356(;&X~<~pn)>!4A`y_if;+ZlF% zW?Im{zXjUzu*cP8V|wC?uA=3mQq*hkb2OPvdJYcQI`JvqQNHz9h&8>b;T5NDOxJkB zS%6pH7h}%;&{e!$%%}F#!lC=A7bLzL!-hWNbkU!_xjb4}ABh(QG=vlTEQ~qx$8Jb{ zSj|}U$h{rS)^nG8?$W2*Z<{VbwOSqjk2ewrbp(f!kAbyS%%XM55v3eE!J%E!XjsR! z+SBOqd1#?$=a)13?L64d%yMQ}EXR{kUo1|)1d{_%L6E-0pQNanJxmzL$U>j@kdYd|B?D_Ev;Q9Uys8>Bf*H{#l zEPCNN>XdNZbC;FQphECBWH*D z_ti~a?`7;_0gNgIuoShCql(z9yhEGk%wNEvn+57DmniKQttzeW1zxN)a$AagWA}Mi z;!c%#&uO@NQ#xfET{*PsQ6n9ieU3-4QJPQ@+$ao!2sZP13rUABr?CdXE$Iw_;I^by zC%A(o9WlY(O5aIv-ijXEI}qumE(&h_*jE*r6_7QmJpstfYUvHKCc04Jg1%KPBth1e z)N7MTANBOd5m)vbl_ e0_wBqBc5f@b*ftnj|`~0b@Uf1vdjj-761U CloseKellyCockLed + use CDrillingConsoleVariables!, only: CloseKellyCockLedHw => CloseKellyCockLed use CManifolds, only: CloseKellyCock implicit none logical , intent(in) :: v diff --git a/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotification.f90 index b49c748..fa9be32 100644 --- a/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotification.f90 @@ -55,7 +55,7 @@ module CCloseSafetyValveLedNotification - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_CloseSafetyValveLed=TopDrive' #endif @@ -82,7 +82,7 @@ module CCloseSafetyValveLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_CloseSafetyValveLed=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotificationVariables.f90 index 71571cb..d65dcba 100644 --- a/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CCloseSafetyValveLedNotificationVariables.f90 @@ -12,9 +12,9 @@ module CCloseSafetyValveLedNotificationVariables contains subroutine Set_CloseSafetyValveLed(v) - use CDrillingConsoleVariables, only: CloseSafetyValveLedHw => CloseSafetyValveLed + ! use CDrillingConsoleVariables, only: CloseSafetyValveLedHw => CloseSafetyValveLed use CManifolds, only: CloseSafetyValve_TopDrive, CloseSafetyValve_KellyMode, CloseSafetyValve_TripMode - use CHoistingVariables, only: DriveType, TopDrive_DriveType, Kelly_DriveType + use CHoistingVariables, only: Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType implicit none logical , intent(in) :: v #ifdef ExcludeExtraChanges @@ -24,9 +24,9 @@ module CCloseSafetyValveLedNotificationVariables if(CloseSafetyValveLed) then !!call CloseSafetyValve() - if(DriveType == TopDrive_DriveType) call CloseSafetyValve_TopDrive() - if(DriveType == Kelly_DriveType .and. operation_CloseSafetyValveLed == 0) call CloseSafetyValve_KellyMode() - if(DriveType == Kelly_DriveType .and. operation_CloseSafetyValveLed == 1) call CloseSafetyValve_TripMode() + if(Hoisting%DriveType == TopDrive_DriveType) call CloseSafetyValve_TopDrive() + if(Hoisting%DriveType == Kelly_DriveType .and. operation_CloseSafetyValveLed == 0) call CloseSafetyValve_KellyMode() + if(Hoisting%DriveType == Kelly_DriveType .and. operation_CloseSafetyValveLed == 1) call CloseSafetyValve_TripMode() endif !if(CloseSafetyValveLed) then diff --git a/CSharp/OperationScenarios/Notifications/CFillMouseHoleLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CFillMouseHoleLedNotification.f90 index ec194ba..ce2e3c4 100644 --- a/CSharp/OperationScenarios/Notifications/CFillMouseHoleLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CFillMouseHoleLedNotification.f90 @@ -41,7 +41,7 @@ module CFillMouseHoleLedNotification - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_FillMouseHoleLed=TopDrive' #endif @@ -79,7 +79,7 @@ module CFillMouseHoleLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_FillMouseHoleLed=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/CFillMouseHoleLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CFillMouseHoleLedNotificationVariables.f90 index 93270cf..c503b82 100644 --- a/CSharp/OperationScenarios/Notifications/CFillMouseHoleLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CFillMouseHoleLedNotificationVariables.f90 @@ -12,7 +12,7 @@ module CFillMouseHoleLedNotificationVariables contains subroutine Set_FillMouseHoleLed(v) - use CDrillingConsoleVariables, only: FillMouseHoleLedHw => FillMouseHoleLed + use CDrillingConsoleVariables!, only: FillMouseHoleLedHw => FillMouseHoleLed use CMouseHoleEnumVariables implicit none logical , intent(in) :: v @@ -21,10 +21,10 @@ module CFillMouseHoleLedNotificationVariables #endif FillMouseHoleLed = v if(FillMouseHoleLed) then - FillMouseHoleLedHw = 1 + DrillingConsole%FillMouseHoleLed = 1 !call Set_MouseHole(MOUSE_HOLE_FILL) else - FillMouseHoleLedHw = 0 + DrillingConsole%FillMouseHoleLed = 0 !call Set_MouseHole(MOUSE_HOLE_EMPTY) endif call OnFillMouseHoleLedChange%RunAll() diff --git a/CSharp/OperationScenarios/Notifications/CIrIBopLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CIrIBopLedNotification.f90 index d9a532e..ccd8174 100644 --- a/CSharp/OperationScenarios/Notifications/CIrIBopLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CIrIBopLedNotification.f90 @@ -45,7 +45,7 @@ module CIrIBopLedNotification - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_IrIBopLed=TopDrive' #endif @@ -83,7 +83,7 @@ module CIrIBopLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_IrIBopLed=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/CIrIBopLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CIrIBopLedNotificationVariables.f90 index e9f0809..d4bf146 100644 --- a/CSharp/OperationScenarios/Notifications/CIrIBopLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CIrIBopLedNotificationVariables.f90 @@ -12,7 +12,7 @@ module CIrIBopLedNotificationVariables contains subroutine Set_IrIBopLed(v) - use CDrillingConsoleVariables, only: IRIBopLedHw => IRIBopLed + use CDrillingConsoleVariables!, only: IRIBopLedHw => IRIBopLed use CManifolds, only: InstallIBop, RemoveIBop use CIbopEnumVariables, only: Set_Ibop_Install, Set_Ibop_Remove implicit none @@ -22,11 +22,11 @@ module CIrIBopLedNotificationVariables #endif IrIBopLed = v if(IrIBopLed) then - IRIBopLedHw = 1 + DrillingConsole%IRIBopLed = 1 call InstallIBop() call Set_Ibop_Install() else - IRIBopLedHw = 0 + DrillingConsole%IRIBopLed = 0 call RemoveIBop() call Set_Ibop_Remove() endif diff --git a/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotification.f90 index c5bd6f9..e5d03d5 100644 --- a/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotification.f90 @@ -11,7 +11,7 @@ module CIrSafetyValveLedNotification - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_IrSafetyValveLed=TopDrive' #endif @@ -31,7 +31,7 @@ module CIrSafetyValveLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_IrSafetyValveLed=Kelly' #endif @@ -87,7 +87,7 @@ module CIrSafetyValveLedNotification - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_IrSafetyValveLed=TopDrive' #endif @@ -126,7 +126,7 @@ module CIrSafetyValveLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_IrSafetyValveLed=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotificationVariables.f90 index 1aaae43..3360792 100644 --- a/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotificationVariables.f90 @@ -12,7 +12,7 @@ module CIrSafetyValveLedNotificationVariables contains subroutine Set_IrSafetyValveLed(v) - use CDrillingConsoleVariables, only: IRSafetyValveLedHw => IRSafetyValveLed + use CDrillingConsoleVariables!, only: DrillingConsole%CloseKellyCockLed => IRSafetyValveLed use CManifolds, only: & InstallSafetyValve_TopDrive, & InstallSafetyValve_KellyMode, & @@ -21,7 +21,7 @@ module CIrSafetyValveLedNotificationVariables RemoveSafetyValve_KellyMode, & RemoveSafetyValve_TripMode use CSafetyValveEnumVariables, only: Set_SafetyValve_Install, Set_SafetyValve_Remove - use CHoistingVariables, only: DriveType, TopDrive_DriveType, Kelly_DriveType + use CHoistingVariables, only: Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType implicit none logical , intent(in) :: v #ifdef ExcludeExtraChanges @@ -30,19 +30,19 @@ module CIrSafetyValveLedNotificationVariables IrSafetyValveLed = v if(IrSafetyValveLed) then - IRSafetyValveLedHw = 1 + DrillingConsole%IRSafetyValveLed = 1 - if(DriveType == TopDrive_DriveType) call InstallSafetyValve_TopDrive() - if(DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 0) call InstallSafetyValve_KellyMode() - if(DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 1) call InstallSafetyValve_TripMode() + if(Hoisting%DriveType == TopDrive_DriveType) call InstallSafetyValve_TopDrive() + if(Hoisting%DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 0) call InstallSafetyValve_KellyMode() + if(Hoisting%DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 1) call InstallSafetyValve_TripMode() call Set_SafetyValve_Install() else - IRSafetyValveLedHw = 0 + DrillingConsole%IRSafetyValveLed = 0 - if(DriveType == TopDrive_DriveType) call RemoveSafetyValve_TopDrive() - if(DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 0) call RemoveSafetyValve_KellyMode() - if(DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 1) call RemoveSafetyValve_TripMode() + if(Hoisting%DriveType == TopDrive_DriveType) call RemoveSafetyValve_TopDrive() + if(Hoisting%DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 0) call RemoveSafetyValve_KellyMode() + if(Hoisting%DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 1) call RemoveSafetyValve_TripMode() call Set_SafetyValve_Remove() endif diff --git a/CSharp/OperationScenarios/Notifications/CLatchLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CLatchLedNotification.f90 index 97d3639..5f0f9ca 100644 --- a/CSharp/OperationScenarios/Notifications/CLatchLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CLatchLedNotification.f90 @@ -11,7 +11,7 @@ module CLatchLedNotification - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_LatchLed=TopDrive' #endif @@ -106,7 +106,7 @@ module CLatchLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_LatchLed=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/CLatchLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CLatchLedNotificationVariables.f90 index 880ab81..eff29b4 100644 --- a/CSharp/OperationScenarios/Notifications/CLatchLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CLatchLedNotificationVariables.f90 @@ -12,7 +12,7 @@ module CLatchLedNotificationVariables contains subroutine Set_LatchLed(v) - use CDrillingConsoleVariables, only: LatchPipeLED + use CDrillingConsoleVariables!, only: DrillingConsole%LatchPipeLED !use CUnlatchLedNotification implicit none logical , intent(in) :: v @@ -21,10 +21,10 @@ module CLatchLedNotificationVariables #endif LatchLed = v if(LatchLed) then - LatchPipeLED = 1 + DrillingConsole%LatchPipeLED = 1 !call Set_UnlatchLed(.false.) else - LatchPipeLED = 0 + DrillingConsole%LatchPipeLED = 0 endif call OnLatchLedChange%RunAll() end subroutine diff --git a/CSharp/OperationScenarios/Notifications/COpenKellyCockLedNotification.f90 b/CSharp/OperationScenarios/Notifications/COpenKellyCockLedNotification.f90 index 4a7149b..cd4e900 100644 --- a/CSharp/OperationScenarios/Notifications/COpenKellyCockLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/COpenKellyCockLedNotification.f90 @@ -32,7 +32,7 @@ module COpenKellyCockLedNotification implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_OpenKellyCock=TopDrive' #endif @@ -41,7 +41,7 @@ module COpenKellyCockLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_OpenKellyCock=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/COpenKellyCockLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/COpenKellyCockLedNotificationVariables.f90 index 991ce97..282db3a 100644 --- a/CSharp/OperationScenarios/Notifications/COpenKellyCockLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/COpenKellyCockLedNotificationVariables.f90 @@ -12,7 +12,7 @@ module COpenKellyCockLedNotificationVariables contains subroutine Set_OpenKellyCockLed(v) - use CDrillingConsoleVariables, only: OpenKellyCockLedHw => OpenKellyCockLed + ! use CDrillingConsoleVariables!, only: OpenKellyCockLedHw => OpenKellyCockLed use CManifolds, only: OpenKellyCock implicit none logical , intent(in) :: v diff --git a/CSharp/OperationScenarios/Notifications/COpenSafetyValveLedNotification.f90 b/CSharp/OperationScenarios/Notifications/COpenSafetyValveLedNotification.f90 index 62b4fa3..0c3c06c 100644 --- a/CSharp/OperationScenarios/Notifications/COpenSafetyValveLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/COpenSafetyValveLedNotification.f90 @@ -56,7 +56,7 @@ module COpenSafetyValveLedNotification implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_OpenSafetyValve=TopDrive' #endif @@ -80,7 +80,7 @@ module COpenSafetyValveLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_OpenSafetyValve=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/COpenSafetyValveLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/COpenSafetyValveLedNotificationVariables.f90 index 573bf47..643a903 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: DriveType, TopDrive_DriveType, Kelly_DriveType + use CHoistingVariables, only: Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType implicit none logical , intent(in) :: v #ifdef ExcludeExtraChanges @@ -24,9 +24,9 @@ module COpenSafetyValveLedNotificationVariables if(OpenSafetyValveLed) then !!call OpenSafetyValve() - if(DriveType == TopDrive_DriveType) call OpenSafetyValve_TopDrive() - if(DriveType == Kelly_DriveType .and. operation_OpenSafetyValveLed == 0) call OpenSafetyValve_KellyMode() - if(DriveType == Kelly_DriveType .and. operation_OpenSafetyValveLed == 1) call OpenSafetyValve_TripMode() + if(Hoisting%DriveType == TopDrive_DriveType) call OpenSafetyValve_TopDrive() + if(Hoisting%DriveType == Kelly_DriveType .and. operation_OpenSafetyValveLed == 0) call OpenSafetyValve_KellyMode() + if(Hoisting%DriveType == Kelly_DriveType .and. operation_OpenSafetyValveLed == 1) call OpenSafetyValve_TripMode() endif !if(OpenSafetyValveLed) then diff --git a/CSharp/OperationScenarios/Notifications/CSlipsNotification.f90 b/CSharp/OperationScenarios/Notifications/CSlipsNotification.f90 index 9f9ec08..1d20f5c 100644 --- a/CSharp/OperationScenarios/Notifications/CSlipsNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CSlipsNotification.f90 @@ -9,7 +9,7 @@ module CSlipsNotification - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_SlipsNotification=TopDrive' #endif @@ -52,7 +52,7 @@ module CSlipsNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_SlipsNotification=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/CSwingLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CSwingLedNotification.f90 index ba47973..e07e60c 100644 --- a/CSharp/OperationScenarios/Notifications/CSwingLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CSwingLedNotification.f90 @@ -10,7 +10,7 @@ module CSwingLedNotification - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_SwingLed=TopDrive' #endif @@ -27,7 +27,7 @@ module CSwingLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_SwingLed=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/CSwingLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CSwingLedNotificationVariables.f90 index 0e2640b..6a24ce4 100644 --- a/CSharp/OperationScenarios/Notifications/CSwingLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CSwingLedNotificationVariables.f90 @@ -12,7 +12,7 @@ module CSwingLedNotificationVariables contains subroutine Set_SwingLed(v) - use CDrillingConsoleVariables, only: SwingLedHw => SwingLed + use CDrillingConsoleVariables!, only: SwingLedHw => SwingLed implicit none logical , intent(in) :: v @@ -21,9 +21,9 @@ module CSwingLedNotificationVariables #endif SwingLed = v if(SwingLed) then - SwingLedHw = 1 + DrillingConsole%SwingLed = 1 else - SwingLedHw = 0 + DrillingConsole%SwingLed = 0 endif call OnSwingLedChange%RunAll() end subroutine diff --git a/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotification.f90 index abda1a2..40146fa 100644 --- a/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotification.f90 @@ -8,7 +8,7 @@ module CTdsIbopLedNotification implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_IbopLed=TopDrive' #endif @@ -19,10 +19,10 @@ module CTdsIbopLedNotification !TOPDRIVE-CODE=61 if (Get_IbopLed() == .false. .and.& TopDriveTdsPowerState == TdsPower_OFF .and.& - TopDriveIbop == .false.) then + TopDrivePanel%TopDriveIbop == .false.) then call Set_IbopLed(.true.) - TopDriveLinkTiltLed = LED_OFF + TopDrivePanel%TopDriveLinkTiltLed = LED_OFF return end if @@ -32,10 +32,10 @@ module CTdsIbopLedNotification !TOPDRIVE-CODE=62 if (Get_IbopLed() .and.& TopDriveTdsPowerState == TdsPower_OFF .and.& - TopDriveIbop) then + TopDrivePanel%TopDriveIbop) then call Set_IbopLed(.false.) - TopDriveLinkTiltLed = LED_ON + TopDrivePanel%TopDriveLinkTiltLed = LED_ON return end if diff --git a/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotificationVariables.f90 index 81b19cb..638a952 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: TopDriveIbopLed + use CTopDrivePanelVariables, only: TopDrivePanel%TopDriveIbopLed use CManifolds, Only: OpenTopDriveIBop, CloseTopDriveIBop !use CLatchLedNotification implicit none @@ -23,10 +23,10 @@ module CTdsIbopLedNotificationVariables IbopLed = v if(IbopLed) then - TopDriveIbopLed = 1 + TopDrivePanel%TopDriveIbopLed = 1 call CloseTopDriveIBop() else - TopDriveIbopLed = 0 + TopDrivePanel%TopDriveIbopLed = 0 call OpenTopDriveIBop() endif diff --git a/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotification.f90 index 8cc002a..72fa9c7 100644 --- a/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotification.f90 @@ -8,7 +8,7 @@ module CTdsPowerLedNotification implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_PowerLed=TopDrive' #endif @@ -28,7 +28,7 @@ module CTdsPowerLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_PowerLed=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotificationVariables.f90 index dd39783..aff8f2c 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: TopDriveTdsPowerLed + use CTopDrivePanelVariables, only: TopDrivePanel%TopDriveTdsPowerLed !use CLatchLedNotification implicit none logical , intent(in) :: v @@ -22,10 +22,10 @@ module CTdsPowerLedNotificationVariables PowerLed = v if(PowerLed) then - TopDriveTdsPowerLed = 1 + TopDrivePanel%TopDriveTdsPowerLed = 1 !call Set_LatchLed(.false.) else - TopDriveTdsPowerLed = 0 + TopDrivePanel%TopDriveTdsPowerLed = 0 endif call OnPowerLedChange%RunAll() diff --git a/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotification.f90 index de3ddf9..825bb10 100644 --- a/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotification.f90 @@ -6,7 +6,7 @@ module CTdsTorqueWrenchLedNotification subroutine Evaluate_TorqueWrenchLed() implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_TorqueWrenchLed=TopDrive' #endif @@ -39,7 +39,7 @@ module CTdsTorqueWrenchLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_SwingLed=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotificationVariables.f90 index 7df9d67..a06159b 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: TopDriveTorqueWrenchLed + use CTopDrivePanelVariables, only: TopDrivePanel%TopDriveTorqueWrenchLed implicit none integer , intent(in) :: v @@ -20,7 +20,7 @@ module CTdsTorqueWrenchLedNotificationVariables if(TorqueWrenchLed == v) return #endif TorqueWrenchLed = v - TopDriveTorqueWrenchLed = v + TopDrivePanel%TopDriveTorqueWrenchLed = v call OnTorqueWrenchLedChange%RunAll() end subroutine diff --git a/CSharp/OperationScenarios/Notifications/CTongNotification.f90 b/CSharp/OperationScenarios/Notifications/CTongNotification.f90 index 4104cff..21437c2 100644 --- a/CSharp/OperationScenarios/Notifications/CTongNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CTongNotification.f90 @@ -10,7 +10,7 @@ module CTongNotification - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_TongNotification=TopDrive' #endif @@ -86,7 +86,7 @@ module CTongNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_TongNotification=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/CUnlatchLedNotification.f90 b/CSharp/OperationScenarios/Notifications/CUnlatchLedNotification.f90 index 1c6e71c..568bd4f 100644 --- a/CSharp/OperationScenarios/Notifications/CUnlatchLedNotification.f90 +++ b/CSharp/OperationScenarios/Notifications/CUnlatchLedNotification.f90 @@ -9,7 +9,7 @@ module CUnlatchLedNotification implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_UnlatchLed=TopDrive' #endif @@ -92,7 +92,7 @@ module CUnlatchLedNotification - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_UnlatchLed=Kelly' #endif diff --git a/CSharp/OperationScenarios/Notifications/CUnlatchLedNotificationVariables.f90 b/CSharp/OperationScenarios/Notifications/CUnlatchLedNotificationVariables.f90 index 79cd0a0..f06968b 100644 --- a/CSharp/OperationScenarios/Notifications/CUnlatchLedNotificationVariables.f90 +++ b/CSharp/OperationScenarios/Notifications/CUnlatchLedNotificationVariables.f90 @@ -12,7 +12,7 @@ module CUnlatchLedNotificationVariables contains subroutine Set_UnlatchLed(v) - use CDrillingConsoleVariables, only: UnlatchPipeLED + use CDrillingConsoleVariables!, only: DrillingConsole%UnlatchPipeLED !use CLatchLedNotification implicit none logical , intent(in) :: v @@ -22,10 +22,10 @@ module CUnlatchLedNotificationVariables UnlatchLed = v if(UnlatchLed) then - UnlatchPipeLED = 1 + DrillingConsole%UnlatchPipeLED = 1 !call Set_LatchLed(.false.) else - UnlatchPipeLED = 0 + DrillingConsole%UnlatchPipeLED = 0 endif call OnUnlatchLedChange%RunAll() diff --git a/CSharp/OperationScenarios/Permissions/CFillupHeadPermission.f90 b/CSharp/OperationScenarios/Permissions/CFillupHeadPermission.f90 index 4b4df41..4f24c6f 100644 --- a/CSharp/OperationScenarios/Permissions/CFillupHeadPermission.f90 +++ b/CSharp/OperationScenarios/Permissions/CFillupHeadPermission.f90 @@ -9,7 +9,7 @@ module CFillupHeadPermission - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_FillupHeadPermission=TopDrive' #endif diff --git a/CSharp/OperationScenarios/Permissions/CInstallFillupHeadPermission.f90 b/CSharp/OperationScenarios/Permissions/CInstallFillupHeadPermission.f90 index aa429ee..fcabe7c 100644 --- a/CSharp/OperationScenarios/Permissions/CInstallFillupHeadPermission.f90 +++ b/CSharp/OperationScenarios/Permissions/CInstallFillupHeadPermission.f90 @@ -10,7 +10,7 @@ module CInstallFillupHeadPermission - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_InstallFillupHeadPermission=TopDrive' #endif @@ -24,7 +24,7 @@ module CInstallFillupHeadPermission - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_InstallFillupHeadPermission=Kelly' #endif diff --git a/CSharp/OperationScenarios/Permissions/CIrIbopPermission.f90 b/CSharp/OperationScenarios/Permissions/CIrIbopPermission.f90 index a603ca9..220331d 100644 --- a/CSharp/OperationScenarios/Permissions/CIrIbopPermission.f90 +++ b/CSharp/OperationScenarios/Permissions/CIrIbopPermission.f90 @@ -9,7 +9,7 @@ module CIrIbopPermission implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_IrIbopPermission=TopDrive' #endif @@ -39,7 +39,7 @@ module CIrIbopPermission - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_IrIbopPermission=Kelly' #endif diff --git a/CSharp/OperationScenarios/Permissions/CIrSafetyValvePermission.f90 b/CSharp/OperationScenarios/Permissions/CIrSafetyValvePermission.f90 index fc930e9..0706422 100644 --- a/CSharp/OperationScenarios/Permissions/CIrSafetyValvePermission.f90 +++ b/CSharp/OperationScenarios/Permissions/CIrSafetyValvePermission.f90 @@ -11,7 +11,7 @@ module CIrSafetyValvePermission - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_IrSafetyValvePermission=TopDrive' #endif @@ -40,7 +40,7 @@ module CIrSafetyValvePermission - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_IrSafetyValvePermission=Kelly' #endif diff --git a/CSharp/OperationScenarios/Permissions/CSwingDrillPermission.f90 b/CSharp/OperationScenarios/Permissions/CSwingDrillPermission.f90 index 5b98892..a41914e 100644 --- a/CSharp/OperationScenarios/Permissions/CSwingDrillPermission.f90 +++ b/CSharp/OperationScenarios/Permissions/CSwingDrillPermission.f90 @@ -8,7 +8,7 @@ module CSwingDrillPermission implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_SwingDrillPermission=TopDrive' #endif diff --git a/CSharp/OperationScenarios/Permissions/CSwingOffPermission.f90 b/CSharp/OperationScenarios/Permissions/CSwingOffPermission.f90 index c219d50..9b711e1 100644 --- a/CSharp/OperationScenarios/Permissions/CSwingOffPermission.f90 +++ b/CSharp/OperationScenarios/Permissions/CSwingOffPermission.f90 @@ -8,7 +8,7 @@ module CSwingOffPermission implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_SwingOffPermission=TopDrive' #endif diff --git a/CSharp/OperationScenarios/Permissions/CSwingTiltPermission.f90 b/CSharp/OperationScenarios/Permissions/CSwingTiltPermission.f90 index 8aca7c9..c120b32 100644 --- a/CSharp/OperationScenarios/Permissions/CSwingTiltPermission.f90 +++ b/CSharp/OperationScenarios/Permissions/CSwingTiltPermission.f90 @@ -7,7 +7,7 @@ module CSwingTiltPermission subroutine Evaluate_SwingTiltPermission() implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_SwingTiltPermission=TopDrive' #endif diff --git a/CSharp/OperationScenarios/Test/TestOperationScenarios.f90 b/CSharp/OperationScenarios/Test/TestOperationScenarios.f90 index 903a2ff..44e0924 100644 --- a/CSharp/OperationScenarios/Test/TestOperationScenarios.f90 +++ b/CSharp/OperationScenarios/Test/TestOperationScenarios.f90 @@ -291,14 +291,14 @@ module TestOperationScenarios !DEC$ ATTRIBUTES DLLEXPORT :: GetFloorHeightU !DEC$ ATTRIBUTES ALIAS: 'GetFloorHeightU' :: GetFloorHeightU implicit none - GetFloorHeightU = RigFloorHeight + GetFloorHeightU = RigSize%RigFloorHeight end function real(8) function GetCrownHeightU() !DEC$ ATTRIBUTES DLLEXPORT :: GetCrownHeightU !DEC$ ATTRIBUTES ALIAS: 'GetCrownHeightU' :: GetCrownHeightU implicit none - GetCrownHeightU = CrownHeight + GetCrownHeightU = RigSize%CrownHeight end function real(8) function GetKellyHoseVibrationRateU() @@ -313,7 +313,7 @@ module TestOperationScenarios !DEC$ ATTRIBUTES ALIAS: 'GetDriveTypeU' :: GetDriveTypeU implicit none - GetDriveTypeU = DriveType + GetDriveTypeU = Hoisting%DriveType end function logical function GetElevatorConnectionPossibility() diff --git a/CSharp/OperationScenarios/Unity/CUnityOutputs.f90 b/CSharp/OperationScenarios/Unity/CUnityOutputs.f90 index 60e559a..663057e 100644 --- a/CSharp/OperationScenarios/Unity/CUnityOutputs.f90 +++ b/CSharp/OperationScenarios/Unity/CUnityOutputs.f90 @@ -56,7 +56,7 @@ module CUnityOutputs use CDataDisplayConsoleVariables implicit none PumpsSpmChanges => Calc_KellyHoseVibrationRate - call OnRotaryRpmChange%Add(Set_RotaryRpm) + call DataDisplayConsole%OnRotaryRpmChange%Add(Set_RotaryRpm) end subroutine diff --git a/CSharp/OperationScenarios/UnitySignals/CBucketEnum.f90 b/CSharp/OperationScenarios/UnitySignals/CBucketEnum.f90 index fbaf3fb..9cc822d 100644 --- a/CSharp/OperationScenarios/UnitySignals/CBucketEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CBucketEnum.f90 @@ -43,12 +43,12 @@ module CBucketEnum implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_MudBoxInstallation=TopDrive' #endif endif - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_MudBoxInstallation=Kelly' #endif @@ -68,12 +68,12 @@ module CBucketEnum implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_MudBoxRemove=TopDrive' #endif endif - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_MudBoxRemove=Kelly' #endif diff --git a/CSharp/OperationScenarios/UnitySignals/CHeadEnum.f90 b/CSharp/OperationScenarios/UnitySignals/CHeadEnum.f90 index 869e1f4..89e1ea5 100644 --- a/CSharp/OperationScenarios/UnitySignals/CHeadEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CHeadEnum.f90 @@ -8,7 +8,7 @@ module CHeadEnum implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_FillupHead=TopDrive' #endif @@ -19,7 +19,7 @@ module CHeadEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_FillupHead=Kelly' #endif @@ -48,7 +48,7 @@ module CHeadEnum - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_FillupHeadInstallation=TopDrive' #endif @@ -70,7 +70,7 @@ module CHeadEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_FillupHeadInstallation=Kelly' #endif @@ -102,7 +102,7 @@ module CHeadEnum - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_FillupHeadRemove=TopDrive' #endif @@ -123,7 +123,7 @@ module CHeadEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_FillupHeadRemove=Kelly' #endif diff --git a/CSharp/OperationScenarios/UnitySignals/COperationConditionEnum.f90 b/CSharp/OperationScenarios/UnitySignals/COperationConditionEnum.f90 index 0719827..0ed9716 100644 --- a/CSharp/OperationScenarios/UnitySignals/COperationConditionEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/COperationConditionEnum.f90 @@ -36,12 +36,12 @@ module COperationConditionEnum ! end subroutine subroutine ButtonPress_Latch_OperationCondition() - use CHoistingVariables, only: DriveType, Kelly_DriveType + use CHoistingVariables, only: Hoisting%DriveType, Kelly_DriveType use CManifolds, only: InstallKellyCock implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_Latch_OperationCondition=TopDrive' #endif @@ -54,7 +54,7 @@ module COperationConditionEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_Latch_OperationCondition=Kelly' #endif @@ -71,7 +71,7 @@ module COperationConditionEnum call Set_LatchLed(.false.) call Set_UnlatchLed(.true.) call Set_Kelly(KELLY_INSTALL) - if(DriveType == Kelly_DriveType) then + if(Hoisting%DriveType == Kelly_DriveType) then call InstallKellyCock() !drill mode endif return @@ -90,11 +90,11 @@ module COperationConditionEnum end subroutine subroutine ButtonPress_Unlatch_OperationCondition() - use CHoistingVariables, only: DriveType, Kelly_DriveType + use CHoistingVariables, only: Hoisting%DriveType, Kelly_DriveType use CManifolds, only: RemoveKellyCock implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_Unlatch_OperationCondition=TopDrive' #endif @@ -107,7 +107,7 @@ module COperationConditionEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_Unlatch_OperationConditions=Kelly' #endif @@ -127,7 +127,7 @@ module COperationConditionEnum call Set_LatchLed(.true.) call Set_UnlatchLed(.false.) call Set_IrSafetyValveLed(.false.) - if(DriveType == Kelly_DriveType) then ! top drive mode + if(Hoisting%DriveType == Kelly_DriveType) then ! top drive mode call RemoveKellyCock() !trip mode endif return diff --git a/CSharp/OperationScenarios/UnitySignals/CSlipsEnum.f90 b/CSharp/OperationScenarios/UnitySignals/CSlipsEnum.f90 index da01d13..7c2d8cd 100644 --- a/CSharp/OperationScenarios/UnitySignals/CSlipsEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CSlipsEnum.f90 @@ -43,7 +43,7 @@ module CSlipsEnum - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_Slips=TopDrive' #endif @@ -96,7 +96,7 @@ module CSlipsEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_Slips=Kelly' #endif diff --git a/CSharp/OperationScenarios/UnitySignals/CSwingEnum.f90 b/CSharp/OperationScenarios/UnitySignals/CSwingEnum.f90 index 9bdf9bd..8a1fe8b 100644 --- a/CSharp/OperationScenarios/UnitySignals/CSwingEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CSwingEnum.f90 @@ -40,7 +40,7 @@ module CSwingEnum - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_Swing=TopDrive' #endif @@ -54,7 +54,7 @@ module CSwingEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_Swing=Kelly' #endif diff --git a/CSharp/OperationScenarios/UnitySignals/CTdsBackupClamp.f90 b/CSharp/OperationScenarios/UnitySignals/CTdsBackupClamp.f90 index 62dcb4c..75b90ef 100644 --- a/CSharp/OperationScenarios/UnitySignals/CTdsBackupClamp.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CTdsBackupClamp.f90 @@ -6,7 +6,7 @@ module CTdsBackupClamp subroutine Evaluate_TdsBackupClamp() implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_TdsBackupClamp=TopDrive' #endif @@ -14,7 +14,7 @@ module CTdsBackupClamp !TOPDRIVE-CODE=79 if(Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_END .and.& TopDriveTdsPowerState /= TdsPower_OFF .and.& - TopDriveTorqueWrench) then + TopDrivePanel%TopDriveTorqueWrench) then call Set_TdsBackupClamp(BACKUP_CLAMP_FW_BEGIN) @@ -24,7 +24,7 @@ module CTdsBackupClamp if(Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_END .and.& Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_BEGIN .and.& TopDriveTdsPowerState /= TdsPower_OFF .and.& - TopDriveTorqueWrench == .false.) then + TopDrivePanel%TopDriveTorqueWrench == .false.) then call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_BEGIN) @@ -41,7 +41,7 @@ module CTdsBackupClamp - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_TdsBackupClamp=Kelly' #endif diff --git a/CSharp/OperationScenarios/UnitySignals/CTdsSpineEnum.f90 b/CSharp/OperationScenarios/UnitySignals/CTdsSpineEnum.f90 index ded19cc..2a9b2b4 100644 --- a/CSharp/OperationScenarios/UnitySignals/CTdsSpineEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CTdsSpineEnum.f90 @@ -6,7 +6,7 @@ module CTdsSpineEnum subroutine Evaluate_TdsSpine() implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_TdsSpine=TopDrive' #endif @@ -16,7 +16,7 @@ module CTdsSpineEnum Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& !Get_TdsConnectionPossible() .and.& TopDriveTdsPowerState == TdsPower_FWD .and.& - TopDriveDrillTorqueState == TdsMu_SPINE) then + TopDrivePanel%TopDriveDrillTorqueState == TdsMu_SPINE) then call Set_TdsSpine(TDS_SPINE_CONNECT_BEGIN) return @@ -27,7 +27,7 @@ module CTdsSpineEnum Get_TdsTong() == TDS_TONG_BREAKOUT_END .and.& Get_TdsConnectionModes() == TDS_CONNECTION_SPINE .and.& TopDriveTdsPowerState == TdsPower_REV .and.& - TopDriveDrillTorqueState == TdsMu_SPINE) then + TopDrivePanel%TopDriveDrillTorqueState == TdsMu_SPINE) then call Set_TdsSpine(TDS_SPINE_DISCONNECT_BEGIN) return @@ -45,7 +45,7 @@ module CTdsSpineEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_TdsSpine=Kelly' #endif diff --git a/CSharp/OperationScenarios/UnitySignals/CTdsSwingEnum.f90 b/CSharp/OperationScenarios/UnitySignals/CTdsSwingEnum.f90 index c8fe34c..f9a29e8 100644 --- a/CSharp/OperationScenarios/UnitySignals/CTdsSwingEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CTdsSwingEnum.f90 @@ -6,7 +6,7 @@ module CTdsSwingEnum subroutine Evaluate_TdsSwing() implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_TdsSwing=TopDrive' #endif @@ -16,10 +16,10 @@ module CTdsSwingEnum if (Get_SwingDrillPermission() .and.& Get_TdsSwing() == TDS_SWING_OFF_END .and.& Get_FillMouseHoleLed() == .false. .and.& - TopDriveLinkTiltState == TdsLinkTilt_DRILL) then + TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_DRILL) then call Set_TdsSwing(TDS_SWING_DRILL_BEGIN) - TopDriveLinkTiltLed = LED_ON + TopDrivePanel%TopDriveLinkTiltLed = LED_ON return end if @@ -28,10 +28,10 @@ module CTdsSwingEnum !TOPDRIVE-CODE=38 if (Get_SwingTiltPermission() .and.& Get_TdsSwing() == TDS_SWING_TILT_END .and.& - TopDriveLinkTiltState == TdsLinkTilt_TILT) then + TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then call Set_TdsSwing(TDS_SWING_TILT_BEGIN) - TopDriveLinkTiltLed = LED_ON + TopDrivePanel%TopDriveLinkTiltLed = LED_ON return end if @@ -41,10 +41,10 @@ module CTdsSwingEnum if (Get_SwingOffPermission() .and.& Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& Get_TdsSwing() == TDS_SWING_OFF_END .and.& - TopDriveLinkTiltState == TdsLinkTilt_OFF) then + TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then call Set_TdsSwing(TDS_SWING_OFF_BEGIN) - TopDriveLinkTiltLed = LED_ON + TopDrivePanel%TopDriveLinkTiltLed = LED_ON return end if @@ -56,10 +56,10 @@ module CTdsSwingEnum if (Get_SwingTiltPermission() .and.& Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& Get_TdsSwing() == TDS_SWING_OFF_END .and.& - TopDriveLinkTiltState == TdsLinkTilt_TILT) then + TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then call Set_TdsSwing(TDS_SWING_TILT_BEGIN) - TopDriveLinkTiltLed = LED_ON + TopDrivePanel%TopDriveLinkTiltLed = LED_ON return end if @@ -71,10 +71,10 @@ module CTdsSwingEnum if (Get_SwingOffPermission() .and.& Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& Get_TdsSwing() == TDS_SWING_TILT_END .and.& - TopDriveLinkTiltState == TdsLinkTilt_OFF) then + TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then call Set_TdsSwing(TDS_SWING_OFF_BEGIN) - TopDriveLinkTiltLed = LED_ON + TopDrivePanel%TopDriveLinkTiltLed = LED_ON return end if @@ -87,10 +87,10 @@ module CTdsSwingEnum Get_SwingTiltPermission() .and.& Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.& Get_TdsSwing() == TDS_SWING_OFF_END .and.& - TopDriveLinkTiltState == TdsLinkTilt_TILT) then + TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then call Set_TdsSwing(TDS_SWING_TILT_BEGIN) - TopDriveLinkTiltLed = LED_ON + TopDrivePanel%TopDriveLinkTiltLed = LED_ON return end if @@ -102,10 +102,10 @@ module CTdsSwingEnum Get_SwingOffPermission() .and.& Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.& Get_TdsSwing() == TDS_SWING_TILT_END .and.& - TopDriveLinkTiltState == TdsLinkTilt_OFF) then + TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then call Set_TdsSwing(TDS_SWING_OFF_BEGIN) - TopDriveLinkTiltLed = LED_ON + TopDrivePanel%TopDriveLinkTiltLed = LED_ON return end if diff --git a/CSharp/OperationScenarios/UnitySignals/CTdsTongEnum.f90 b/CSharp/OperationScenarios/UnitySignals/CTdsTongEnum.f90 index 9fc4dae..ec2ed5d 100644 --- a/CSharp/OperationScenarios/UnitySignals/CTdsTongEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CTdsTongEnum.f90 @@ -6,7 +6,7 @@ module CTdsTongEnum subroutine Evaluate_TdsTong() implicit none - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_TdsTong=TopDrive' #endif @@ -17,7 +17,7 @@ module CTdsTongEnum if (Get_TdsConnectionModes() == TDS_CONNECTION_SPINE .and.& Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& TopDriveTdsPowerState == TdsPower_FWD .and.& - TopDriveDrillTorqueState == TdsMu_TORQ) then + TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then call Set_TdsTong(TDS_TONG_MAKEUP_BEGIN) !TopDriveTorqueWrenchLed = LED_ON @@ -30,7 +30,7 @@ module CTdsTongEnum if (Get_TdsConnectionModes() == TDS_CONNECTION_STRING .and.& Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& TopDriveTdsPowerState == TdsPower_REV .and.& - TopDriveDrillTorqueState == TdsMu_TORQ) then + TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then call Set_TdsTong(TDS_TONG_BREAKOUT_BEGIN) !TopDriveTorqueWrenchLed = LED_ON @@ -48,7 +48,7 @@ module CTdsTongEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_TdsTong=Kelly' #endif diff --git a/CSharp/OperationScenarios/UnitySignals/CTongEnum.f90 b/CSharp/OperationScenarios/UnitySignals/CTongEnum.f90 index edfb28d..bb4b1c5 100644 --- a/CSharp/OperationScenarios/UnitySignals/CTongEnum.f90 +++ b/CSharp/OperationScenarios/UnitySignals/CTongEnum.f90 @@ -48,7 +48,7 @@ module CTongEnum - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_Breakout_TongNotification=TopDrive' #endif @@ -70,7 +70,7 @@ module CTongEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_Breakout_TongNotification=Kelly' #endif @@ -111,7 +111,7 @@ module CTongEnum - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_Makeup_TongNotification=TopDrive' #endif @@ -133,7 +133,7 @@ module CTongEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_Makeup_TongNotification=Kelly' #endif @@ -160,7 +160,7 @@ module CTongEnum - if (DriveType == TopDrive_DriveType) then + if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'ButtonPress_Neutral_TongNotification=TopDrive' #endif @@ -173,7 +173,7 @@ module CTongEnum - if (DriveType == Kelly_DriveType) then + if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'ButtonPress_Neutral_TongNotification=Kelly' #endif diff --git a/CSharp/Problems/CChokeProblemsVariables.f90 b/CSharp/Problems/CChokeProblemsVariables.f90 index 72ae275..26c3fc3 100644 --- a/CSharp/Problems/CChokeProblemsVariables.f90 +++ b/CSharp/Problems/CChokeProblemsVariables.f90 @@ -141,8 +141,8 @@ module CChokeProblemsVariables if(status == Clear_StatusType) CHOOKE(1)%WashoutMalf = 0 if(status == Executed_StatusType) CHOOKE(1)%WashoutMalf = 1 - if(status == Clear_StatusType) HyChock1OnProblem = .false. - if(status == Executed_StatusType) HyChock1OnProblem = .true. + if(status == Clear_StatusType) ChokeManifold%HyChock1OnProblem = .false. + if(status == Executed_StatusType) ChokeManifold%HyChock1OnProblem = .true. endsubroutine subroutine ChangeHydraulicChoke2Plugged(status) @@ -172,8 +172,8 @@ module CChokeProblemsVariables if(status == Clear_StatusType) CHOOKE(2)%WashoutMalf = 0 if(status == Executed_StatusType) CHOOKE(2)%WashoutMalf = 1 - if(status == Clear_StatusType) HyChock2OnProblem = .false. - if(status == Executed_StatusType) HyChock2OnProblem = .true. + if(status == Clear_StatusType) ChokeManifold%HyChock2OnProblem = .false. + if(status == Executed_StatusType) ChokeManifold%HyChock2OnProblem = .true. endsubroutine subroutine ChangeManualChoke1Plugged(status) @@ -202,8 +202,8 @@ module CChokeProblemsVariables if(status == Clear_StatusType) ManChoke1Washout = 0 if(status == Executed_StatusType) ManChoke1Washout = 1 - if(status == Clear_StatusType) LeftManChokeOnProblem = .false. - if(status == Executed_StatusType) LeftManChokeOnProblem = .true. + if(status == Clear_StatusType) ChokeManifold%LeftManChokeOnProblem = .false. + if(status == Executed_StatusType) ChokeManifold%LeftManChokeOnProblem = .true. endsubroutine subroutine ChangeManualChoke2Plugged(status) @@ -232,8 +232,8 @@ module CChokeProblemsVariables if(status == Clear_StatusType) ManChoke2Washout = 0 if(status == Executed_StatusType) ManChoke2Washout = 1 - if(status == Clear_StatusType) RightManChokeOnProblem = .false. - if(status == Executed_StatusType) RightManChokeOnProblem = .true. + if(status == Clear_StatusType) ChokeManifold%RightManChokeOnProblem = .false. + if(status == Executed_StatusType) ChokeManifold%RightManChokeOnProblem = .true. endsubroutine subroutine ChangeChokePanelAirFail(status) diff --git a/CSharp/Problems/CGaugesProblemsVariables.f90 b/CSharp/Problems/CGaugesProblemsVariables.f90 index 43723c6..a114297 100644 --- a/CSharp/Problems/CGaugesProblemsVariables.f90 +++ b/CSharp/Problems/CGaugesProblemsVariables.f90 @@ -223,7 +223,7 @@ module CGaugesProblemsVariables endsubroutine subroutine ChangePump1Strokes(status) - use Pump_VARIABLES + use Pumps_VARIABLES implicit none integer, intent (in) :: status if(associated(Pump1StrokesPtr)) call Pump1StrokesPtr(status) @@ -232,7 +232,7 @@ module CGaugesProblemsVariables endsubroutine subroutine ChangePump2Strokes(status) - use Pump_VARIABLES + use Pumps_VARIABLES implicit none integer, intent (in) :: status if(associated(Pump2StrokesPtr)) call Pump2StrokesPtr(status) diff --git a/CSharp/Problems/CPumpProblemsVariables.f90 b/CSharp/Problems/CPumpProblemsVariables.f90 index fc82247..d633d87 100644 --- a/CSharp/Problems/CPumpProblemsVariables.f90 +++ b/CSharp/Problems/CPumpProblemsVariables.f90 @@ -84,7 +84,7 @@ module CPumpProblemsVariables subroutine ChangePump1PowerFail(status) - Use Pump_VARIABLES + Use Pumps_VARIABLES implicit none integer, intent (in) :: status if(associated(Pump1PowerFailPtr)) call Pump1PowerFailPtr(status) @@ -93,7 +93,7 @@ module CPumpProblemsVariables endsubroutine subroutine ChangePump1BlowPopOffValve(status) - Use Pump_VARIABLES + Use Pumps_VARIABLES implicit none integer, intent (in) :: status if(associated(Pump1BlowPopOffValvePtr)) call Pump1BlowPopOffValvePtr(status) @@ -102,7 +102,7 @@ module CPumpProblemsVariables endsubroutine subroutine ChangePump2PowerFail(status) - Use Pump_VARIABLES + Use Pumps_VARIABLES implicit none integer, intent (in) :: status if(associated(Pump2PowerFailPtr)) call Pump2PowerFailPtr(status) @@ -111,7 +111,7 @@ module CPumpProblemsVariables endsubroutine subroutine ChangePump2BlowPopOffValve(status) - Use Pump_VARIABLES + Use Pumps_VARIABLES implicit none integer, intent (in) :: status if(associated(Pump2BlowPopOffValvePtr)) call Pump2BlowPopOffValvePtr(status) @@ -120,7 +120,7 @@ module CPumpProblemsVariables endsubroutine subroutine ChangeCementPumpPowerFail(status) - Use Pump_VARIABLES + Use Pumps_VARIABLES implicit none integer, intent (in) :: status if(associated(CementPumpPowerFailPtr)) call CementPumpPowerFailPtr(status) @@ -129,7 +129,7 @@ module CPumpProblemsVariables endsubroutine subroutine ChangeCementPumpBlowPopOffValve(status) - Use Pump_VARIABLES + Use Pumps_VARIABLES implicit none integer, intent (in) :: status if(associated(CementPumpBlowPopOffValvePtr)) call CementPumpBlowPopOffValvePtr(status) diff --git a/CSharp/Simulation/CSimulation.f90 b/CSharp/Simulation/CSimulation.f90 index 101aaa2..af8230d 100644 --- a/CSharp/Simulation/CSimulation.f90 +++ b/CSharp/Simulation/CSimulation.f90 @@ -635,16 +635,16 @@ module CSimulation subroutine StopSimulation !DEC$ ATTRIBUTES DLLEXPORT::StopSimulation !DEC$ ATTRIBUTES ALIAS: 'StopSimulation' :: StopSimulation - use CDrillingConsoleVariables, only: MP1CPSwitchI, MP2SwitchI, MP1CPSwitch, MP2Switch, MP1Throttle, MP2Throttle, MP1ThrottleUpdate, MP2ThrottleUpdate + use CDrillingConsoleVariables!, only: DrillingConsole%MP1CPSwitchI, DrillingConsole%MP2SwitchI, DrillingConsole%MP1CPSwitch, DrillingConsole%MP2Switch, DrillingConsole%MP1Throttle, DrillingConsole%MP2Throttle, DrillingConsole%MP1ThrottleUpdate, DrillingConsole%MP2ThrottleUpdate implicit none - MP1CPSwitchI = 0 - MP1CPSwitch = 0 - MP2SwitchI = 0 - MP2Switch = .false. - MP1ThrottleUpdate = .false. - MP2ThrottleUpdate = .false. - MP1Throttle = -1.0 - MP2Throttle = -1.0 + DrillingConsole%MP1CPSwitchI = 0 + DrillingConsole%MP1CPSwitch = 0 + DrillingConsole%MP2SwitchI = 0 + DrillingConsole%MP2Switch = .false. + DrillingConsole%MP1ThrottleUpdate = .false. + DrillingConsole%MP2ThrottleUpdate = .false. + DrillingConsole%MP1Throttle = -1.0 + DrillingConsole%MP2Throttle = -1.0 !MP1Throttle = 0.0 !MP2Throttle = 0.0 diff --git a/Data Structures.txt b/Data Structures.txt new file mode 100644 index 0000000..8f52cb6 --- /dev/null +++ b/Data Structures.txt @@ -0,0 +1,38 @@ +CSharp: + BasicInputs: + Bha: + StringConfiguration + Geology: + Formation + Reservoir + Shoe + RigSpecification: + Accumulator + BopStackSpecification + Hoisting + Power + PumpsSpecification + RigSize + WellProfile: + CasingLinerChoke + PathGeneration + WellSurveyData + MudProperties + + + Equipments: + ControlPanel: + BopControlPanel + CholeControlPanel + ChokeManifold + DataDisplayConsole + DrillingConsole + Hook + StandPipleManifold + TopDrivePanel + ِDrillWatch + DrillingWatch + MudPathfinding: + Manifold + Tanks: + Tank diff --git a/Equipments/BopStack/ANNULAR.f90 b/Equipments/BopStack/ANNULAR.f90 index 3bad676..25eb2fe 100644 --- a/Equipments/BopStack/ANNULAR.f90 +++ b/Equipments/BopStack/ANNULAR.f90 @@ -15,7 +15,7 @@ SUBROUTINE ANNULAR RAM(1)%SuccessionCounter = RAM(1)%SuccessionCounter + 1 - if (AnnularValve == 1.0 .and. AnnularFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%AnnularValve == 1.0 .and. AnnularFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then if (AnnularCloseLedMine == LedOn) then RETURN @@ -37,9 +37,9 @@ SUBROUTINE ANNULAR RAM(1)%First_CloseTimecheck= 1 - AnnularOpenLed = LedOff + BopControlPanel%AnnularOpenLED = LedOff AnnularOpenLedMine = LedOff - AnnularCloseLed = LedOn !LedBlinking + BopControlPanel%AnnularCloseLED = LedOn !LedBlinking RAM(1)%FourwayValve = 1 @@ -69,7 +69,7 @@ SUBROUTINE ANNULAR if (finished_Annular==1) then AnnularLeverOld=-1.0 else - AnnularLeverOld=AnnularValve + AnnularLeverOld=BopControlPanel%AnnularValve endif finished_Annular=0 AnnularIsClosing = .true. @@ -77,14 +77,14 @@ SUBROUTINE ANNULAR RAM(2)%bop_type = 3 !AbopAnnular=963.1 !(in^2) - AbopAnnular=(AnnularPreventerClose*231.)/((IDAnnularBase-ODDrillpipe_inAnnularBase)/2.) ! 231 in^3 = 1 gal + AbopAnnular=(BopStackSpecification%AnnularPreventerClose*231.)/((IDAnnularBase-ODDrillpipe_inAnnularBase)/2.) ! 231 in^3 = 1 gal NeededVolumeAnnular=AbopAnnular*(IDAnnularBase-max(ODDrillpipe_inAnnular,ODDrillpipe_inAnnularBase))/(2.*231) !=17.98 galon for IDAnnularBase=13 5/8 , ODDrillpipe_inAnnularBase=5 !WRITE(*,*) 'a)NeededVolumeAnnular=' , NeededVolumeAnnular !write(*,*) 'close 1' endif - if (AnnularValve == -1.0 .and. AnnularFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1 ) then + if (BopControlPanel%AnnularValve == -1.0 .and. AnnularFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1 ) then if (AnnularOpenLedMine == LedOn) then RETURN @@ -110,9 +110,9 @@ SUBROUTINE ANNULAR RAM(1)%First_OpenTimecheck= 1 - AnnularCloseLed = LedOff !new + BopControlPanel%AnnularCloseLED = LedOff !new AnnularCloseLedMine = LedOff !new - AnnularOpenLed = LedOn !LedBlinking + BopControlPanel%AnnularOpenLED = LedOn !LedBlinking RAM(1)%FourwayValve = 1 @@ -149,7 +149,7 @@ SUBROUTINE ANNULAR if (finished_Annular==1) then AnnularLeverOld=1.0 else - AnnularLeverOld=AnnularValve + AnnularLeverOld=BopControlPanel%AnnularValve endif finished_Annular=0 AnnularIsOpening = .true. @@ -164,7 +164,7 @@ SUBROUTINE ANNULAR RAM(1)%bop_type = 3 !AbopAnnular=758.48 !(in^2) - AbopAnnular=(AnnularPreventerOpen*231)/((IDAnnularBase-max(ODDrillpipe_inAnnular,ODDrillpipe_inAnnularBase))/2.) + AbopAnnular=(BopStackSpecification%AnnularPreventerOpen*231)/((IDAnnularBase-max(ODDrillpipe_inAnnular,ODDrillpipe_inAnnularBase))/2.) NeededVolumeAnnular=AbopAnnular*(IDAnnularBase-ODDrillpipe_inAnnular)/(2.*231) !=14.16 galon for IDAnnularBase=13 5/8 , ODDrillpipe_inAnnular=5 !write(*,*) 'open 1' @@ -218,7 +218,7 @@ SUBROUTINE ANNULAR_SUB ! CALL CPU_TIME(Annular_StartTime) - if (AnnularValve == 1.0 .and. AnnularLeverOld == -1.0 .and. AnnularFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%AnnularValve == 1.0 .and. AnnularLeverOld == -1.0 .and. AnnularFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then if ( RAM(1)%First_CloseTimecheck == 0 ) then @@ -236,9 +236,9 @@ SUBROUTINE ANNULAR_SUB if ( RAM(1)%SuccessionCounter >= int(2.5/DeltaT_BOP) ) then !return - AnnularOpenLed = LedOff + BopControlPanel%AnnularOpenLED = LedOff AnnularOpenLedMine = LedOff - AnnularCloseLed = LedOn !LedBlinking + BopControlPanel%AnnularCloseLED = LedOn !LedBlinking RAM(1)%FourwayValve = 1 @@ -259,13 +259,13 @@ SUBROUTINE ANNULAR_SUB Annular_closed=0 !Annular_closed_withPossibility= Annular_closed * TD_BOPConnectionPossibility(1) p_annular=pa_annular - AnnularLeverOld = AnnularValve + AnnularLeverOld = BopControlPanel%AnnularValve CALL OpenAnnular Annular_Situation_forTD= 0 ! open - for TD code RAM(1)%bop_type = 3 !AbopAnnular=963.1 !(in^2) - AbopAnnular=(AnnularPreventerClose*231)/((IDAnnularBase-ODDrillpipe_inAnnularBase)/2.) + AbopAnnular=(BopStackSpecification%AnnularPreventerClose*231)/((IDAnnularBase-ODDrillpipe_inAnnularBase)/2.) !write(*,*) 'NeededVolumeShearRams1=',NeededVolumeShearRams NeededVolumeAnnular=AbopAnnular*(IDAnnular-max(ODDrillpipe_inAnnular,ODDrillpipe_inAnnularBase))/(2*231.) ! write(*,*) 'NeededVolumeAnnular=',NeededVolumeAnnular @@ -279,7 +279,7 @@ SUBROUTINE ANNULAR_SUB endif - if (AnnularValve == -1.0 .and. AnnularLeverOld == 1.0 .and. p_acc>acc_MinPressure .and. AnnularFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1 ) then + if (BopControlPanel%AnnularValve == -1.0 .and. AnnularLeverOld == 1.0 .and. p_acc>acc_MinPressure .and. AnnularFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1 ) then !CasingPressure : PressureGauges(2) *****temp conditionssssss @@ -298,9 +298,9 @@ SUBROUTINE ANNULAR_SUB if ( RAM(1)%SuccessionCounter >= int(2.5/DeltaT_BOP) ) then !return - AnnularCloseLed = LedOff + BopControlPanel%AnnularCloseLED = LedOff AnnularCloseLedMine= LedOff - AnnularOpenLed = LedOn !LedBlinking + BopControlPanel%AnnularOpenLED = LedOn !LedBlinking RAM(1)%FourwayValve = 1 @@ -323,13 +323,13 @@ SUBROUTINE ANNULAR_SUB Annular_closed=0 !Annular_closed_withPossibility= Annular_closed * TD_BOPConnectionPossibility(1) p_annular=pa_annular - AnnularLeverOld = AnnularValve + AnnularLeverOld = BopControlPanel%AnnularValve CALL OpenAnnular Annular_Situation_forTD= 0 ! open - for TD code RAM(1)%bop_type = 3 !AbopAnnular=758.48 !(in^2) - AbopAnnular=(AnnularPreventerOpen*231)/((IDAnnularBase-ODDrillpipe_inAnnularBase)/2.) + AbopAnnular=(BopStackSpecification%AnnularPreventerOpen*231)/((IDAnnularBase-ODDrillpipe_inAnnularBase)/2.) NeededVolumeAnnular=AbopAnnular*(IDAnnularBase-IDAnnular)/(2*231.) RAM(1)%vdis_bottles=0. RAM(1)%fvr_air=0. diff --git a/Equipments/BopStack/BOP.f90 b/Equipments/BopStack/BOP.f90 index e7c5d52..f92b9a7 100644 --- a/Equipments/BopStack/BOP.f90 +++ b/Equipments/BopStack/BOP.f90 @@ -14,7 +14,7 @@ module BOP write(*,*) 'BOP_timeCounter=' , BOP_timeCounter - AirSupplyPressureGauge= (1 - AirSupplyPressureGaugeMalf)* (1 - RigAirMalf) *120. !psi + BopControlPanel%AirSupplyPressureGauge= (1 - AirSupplyPressureGaugeMalf)* (1 - RigAirMalf) *120. !psi if (pram_reg < 2300.) then @@ -99,17 +99,17 @@ module BOP !===================================================================== ! BYPASS POSITION !===================================================================== - if(ByePassValve == -1.0 .and. AirMasterValve==1) then + if(BopControlPanel%ByePassValve == -1.0 .and. BopControlPanel%AirMasterValve==1) then ByPassOld= -1.0 !write(*,*) 'ByePassValve to -1' ,ByePassValve - elseif(ByePassValve == 1.0 .and. AirMasterValve==1) then + elseif(BopControlPanel%ByePassValve == 1.0 .and. BopControlPanel%AirMasterValve==1) then ByPassOld= 1.0 !write(*,*) 'ByePassValve to 1=' ,ByePassValve endif !write(*,*) 'ByePassValve,ByPassOld=' ,ByePassValve,ByPassOld !===================================================================== !WRITE(*,*) 'AnnularRegulatorSetControl====' , AnnularRegulatorSetControl - Pannular_regset=min(AnnularRegulatorSetControl,1700.) ! for changing its set conditions instantaneously + Pannular_regset=min(BopControlPanel%AnnularRegulatorSetControl,1700.) ! for changing its set conditions instantaneously if (Annular_closed==1) then if (FirstSet==1) then ! code start Pannular_reg= Pannular_regset @@ -136,9 +136,9 @@ module BOP !=================================================================== if (FirstSet== 1) then !new= (1 - AnnularPressureGaugeMalf) * min(AnnularRegulatorSetControl,1700.) - CALL Pannular_regDelay%AddToFirst( (1 - AnnularPressureGaugeMalf) * min(AnnularRegulatorSetControl,1700.) ) + CALL Pannular_regDelay%AddToFirst( (1 - AnnularPressureGaugeMalf) * min(BopControlPanel%AnnularRegulatorSetControl,1700.) ) CALL Pannular_regDelay%Remove(Pannular_regDelay%Length()) - AnnularPressureGauge= Pannular_regDelay%Last() + BopControlPanel%AnnularPressureGauge= Pannular_regDelay%Last() !AnnularPressureGauge= (1 - AnnularPressureGaugeMalf) * min(AnnularRegulatorSetControl,1700.) !write(*,*) 'set 1' , AnnularPressureGauge else !FirstSet== 0 @@ -146,7 +146,7 @@ module BOP CALL Pannular_regDelay%AddToFirst( (1 - AnnularPressureGaugeMalf) * Pannular_reg) CALL Pannular_regDelay%Remove(Pannular_regDelay%Length()) - AnnularPressureGauge= Pannular_regDelay%Last() + BopControlPanel%AnnularPressureGauge= Pannular_regDelay%Last() !AnnularPressureGauge= (1 - AnnularPressureGaugeMalf) * Pannular_reg !write(*,*) 'set 0' , AnnularPressureGauge endif @@ -279,12 +279,12 @@ module BOP endif - MiddleRamsStatus = IDshearBop - UpperRamsStatus = IDPipeRam1 - LowerRamsStatus = IDPipeRam2 - AnnularStatus = IDAnnular - AccumulatorPressureGauge = (1 - AccumulatorPressureGaugeMalf) * p_acc - ManifoldPressureGauge= (1 - ManifoldPressureGaugeMalf) * pram_reg + BopControlPanel%MiddleRamsStatus = IDshearBop + BopControlPanel%UpperRamsStatus = IDPipeRam1 + BopControlPanel%LowerRamsStatus = IDPipeRam2 + BopControlPanel%AnnularStatus = IDAnnular + BopControlPanel%AccumulatorPressureGauge = (1 - AccumulatorPressureGaugeMalf) * p_acc + BopControlPanel%ManifoldPressureGauge= (1 - ManifoldPressureGaugeMalf) * pram_reg !AnnularPressureGauge=Pannular_reg ! ! WRITE(60,60) RAM(2)%time,RAM(2)%Q,RAM(2)%vdis_tot,p_acc, & diff --git a/Equipments/BopStack/BOPstartup.f90 b/Equipments/BopStack/BOPstartup.f90 index f95c4e1..3d62b25 100644 --- a/Equipments/BopStack/BOPstartup.f90 +++ b/Equipments/BopStack/BOPstartup.f90 @@ -58,7 +58,7 @@ Cumulative_AirVolume= 0.0 bottle_capacity=10 !(GALON) -nobottles=NumberOfBottels +nobottles=Accumulator%NumberOfBottels @@ -69,7 +69,7 @@ nobottles=NumberOfBottels !fvr_tot=40 !(GALON) IN CHARGED POSITION prams_regset=1500 !RamsReglatorSet !=1500 DEFAULT regulator set pressure (PSI) acc_ChargedPressure=3000 !charged(PSI) -acc_MinPressure=AccumulatorMinimumOperatingPressure !1200 !discharged(PSI) +acc_MinPressure=Accumulator%AccumulatorMinimumOperatingPressure !1200 !discharged(PSI) !acc_precharge=1000 @@ -78,18 +78,18 @@ fvr_tot=(-2451*(acc_ChargedPressure**(-0.8202))+8.435)*nobottles ! IT IS WRRI !write(*,*) 'fvr_tot=',fvr_tot !ELECTRIC_PUMPON=2800 -ELECTRIC_PUMPON=StartPressure +ELECTRIC_PUMPON=Accumulator%StartPressure !ELECTRIC_PUMPOFF=acc_ChargedPressure !=3000 psi -ELECTRIC_PUMPOFF=StopPressure +ELECTRIC_PUMPOFF=Accumulator%StopPressure !QELECTRIC_PUMP=12 !(gpm) -QELECTRIC_PUMP=ElectricPumpOutput +QELECTRIC_PUMP=Accumulator%ElectricPumpOutput !AIR_PUMPON=2600 -AIR_PUMPON=StartPressure2 +AIR_PUMPON=Accumulator%StartPressure2 !AIR_PUMPOFF=2900 -AIR_PUMPOFF=StopPressure2 +AIR_PUMPOFF=Accumulator%StopPressure2 @@ -152,12 +152,12 @@ ODDrillpipe_inKillLine=5 RAM_COURSE=320.2 !milimeter H_REGRAM=0 !(m)<<<<<<<<<<<<<<<<<<<<<<<< -H_ShearRamBop=(GroundLevel-BlindRamHeight)*0.3048 ! foot to meter -H_PipeRam1Bop=(GroundLevel-UpperRamHeight)*0.3048 ! foot to meter -H_PipeRam2Bop=(GroundLevel-LowerRamHeight)*0.3048 ! foot to meter -H_AnnularBop=(GroundLevel-AnnularPreventerHeight)*0.3048 ! foot to meter -H_ChokeLineBop=(GroundLevel-KillHeight)*0.3048 ! foot to meter -H_KillLineBop=(GroundLevel-KillHeight)*0.3048 ! foot to meter +H_ShearRamBop=(BopStackSpecification%GroundLevel-BopStackSpecification%BlindRamHeight)*0.3048 ! foot to meter +H_PipeRam1Bop=(BopStackSpecification%GroundLevel-BopStackSpecification%UpperRamHeight)*0.3048 ! foot to meter +H_PipeRam2Bop=(BopStackSpecification%GroundLevel-BopStackSpecification%LowerRamHeight)*0.3048 ! foot to meter +H_AnnularBop=(BopStackSpecification%GroundLevel-BopStackSpecification%AnnularPreventerHeight)*0.3048 ! foot to meter +H_ChokeLineBop=(BopStackSpecification%GroundLevel-BopStackSpecification%KillHeight)*0.3048 ! foot to meter +H_KillLineBop=(BopStackSpecification%GroundLevel-BopStackSpecification%KillHeight)*0.3048 ! foot to meter p_acc=acc_ChargedPressure @@ -193,11 +193,11 @@ counter_airp=1 !======================BOP INPUTS(CONSTANTS)=========================== - if (PrechargePressure == 1400.) then + if (Accumulator%PrechargePressure == 1400.) then b1=1396; b2=0.17; b3=3.873; b4=1.101 - elseif (PrechargePressure == 2000.) then + elseif (Accumulator%PrechargePressure == 2000.) then b1=1980; b2=0.1237; b3=15.69; b4=1.029 - elseif (PrechargePressure == 600.) then + elseif (Accumulator%PrechargePressure == 600.) then b1=591.9; b2=0.1968; b3=2.887; b4=0.9757 else !(PrechargePressure == 1000.) then ! this is for precharge=1000 psi b1=993.7; b2=0.164; b3=5.492; b4=0.9796 @@ -231,18 +231,18 @@ RAM%vdis_elecp=0 RAM%timecounter_ram=0 RAM%Q=0 pram_reg=prams_regset !psi !RamsReglatorSet -Pannular_reg=min(AnnularRegulatorSetControl,1700.) +Pannular_reg=min(BopControlPanel%AnnularRegulatorSetControl,1700.) -MiddleRamsStatus= IDshearBop -UpperRamsStatus= IDPipeRam1 -LowerRamsStatus= IDPipeRam2 -AnnularStatus = IDAnnular +BopControlPanel%MiddleRamsStatus= IDshearBop +BopControlPanel%UpperRamsStatus= IDPipeRam1 +BopControlPanel%LowerRamsStatus= IDPipeRam2 +BopControlPanel%AnnularStatus = IDAnnular -AccumulatorPressureGauge = p_acc +BopControlPanel%AccumulatorPressureGauge = p_acc RAM%time=0 @@ -259,47 +259,47 @@ RAM%time=0 !60 FORMAT(11(f18.5)) - MiddleRamsOpenLED = LedOn + BopControlPanel%MiddleRamsOpenLED = LedOn MiddleRamsOpenLEDMine = LedOn - MiddleRamsCloseLED = LedOff + BopControlPanel%MiddleRamsCloseLED = LedOff MiddleRamsCloseLEDMine = LedOff ShearRamIsOpening = .false. ShearRamIsClosing = .false. - UpperRamsOpenLED = LedOn + BopControlPanel%UpperRamsOpenLED = LedOn UpperRamsOpenLEDMine = LedOn - UpperRamsCloseLED = LedOff + BopControlPanel%UpperRamsCloseLED = LedOff UpperRamsCloseLEDMine = LedOff PipeRam1IsOpening = .false. PipeRam1IsClosing = .false. - LowerRamsOpenLED = LedOn + BopControlPanel%LowerRamsOpenLED = LedOn LowerRamsOpenLEDMine = LedOn - LowerRamsCloseLED = LedOff + BopControlPanel%LowerRamsCloseLED = LedOff LowerRamsCloseLEDMine = LedOff PipeRam2IsOpening = .false. PipeRam2IsClosing = .false. - ChokeLineOpenLED = LedOff + BopControlPanel%ChokeLineOpenLED = LedOff ChokeLineOpenLEDMine = LedOff - ChokeLineCloseLED = LedOn + BopControlPanel%ChokeLineCloseLED = LedOn ChokeLineCloseLEDMine = LedOn ChokeLineIsOpening = .false. ChokeLineIsClosing = .false. - KillLineOpenLed = LedOff + BopControlPanel%KillLineOpenLED = LedOff KillLineOpenLedMine = LedOff - KillLineCloseLed = LedOn + BopControlPanel%KillLineCloseLED = LedOn KillLineCloseLedMine = LedOn KillLineIsOpening = .false. KillLineIsClosing = .false. - AnnularOpenLed = LedOn + BopControlPanel%AnnularOpenLED = LedOn AnnularOpenLedMine = LedOn - AnnularCloseLed = LedOff + BopControlPanel%AnnularCloseLED = LedOff AnnularCloseLedMine = LedOff AnnularIsOpening = .false. @@ -308,14 +308,14 @@ RAM%time=0 FirstSet=1 RamsFirstSet=1 - ManifoldPressureGauge=prams_regset !RamsReglatorSet - AnnularPressureGauge= (1 - AnnularPressureGaugeMalf) * min(AnnularRegulatorSetControl,1700.) + BopControlPanel%ManifoldPressureGauge=prams_regset !RamsReglatorSet + BopControlPanel%AnnularPressureGauge= (1 - AnnularPressureGaugeMalf) * min(BopControlPanel%AnnularRegulatorSetControl,1700.) PannularTimeStepDelay = int(1./DeltaT_BOP) ! 1/0.1 : for 1 sec delay in AnnRegulator shot time DO i = 1 , PannularTimeStepDelay - CALL Pannular_regDelay%AddToFirst(AnnularPressureGauge) + CALL Pannular_regDelay%AddToFirst(BopControlPanel%AnnularPressureGauge) END DO diff --git a/Equipments/BopStack/CHOKE_LINE.f90 b/Equipments/BopStack/CHOKE_LINE.f90 index 340f58f..c027af9 100644 --- a/Equipments/BopStack/CHOKE_LINE.f90 +++ b/Equipments/BopStack/CHOKE_LINE.f90 @@ -18,7 +18,7 @@ SUBROUTINE CHOKE_LINE RAM(5)%SuccessionCounter = RAM(5)%SuccessionCounter + 1 - if (ChokeLineValve == -1.0 .and. RigAirMalf==0 .and. AirMasterValve==1 .and. p_acc>acc_MinPressure) then + if (BopControlPanel%ChokeLineValve == -1.0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1 .and. p_acc>acc_MinPressure) then if ( RAM(5)%SuccessionCounter /= RAM(5)%SuccessionCounterOld+1 ) then RAM(5)%SuccessionCounter = 0 ! also in starup @@ -54,20 +54,20 @@ SUBROUTINE CHOKE_LINE if (finished_ChokeLine==1) then ChokeLineLeverOld= 1.0 else - ChokeLineLeverOld=ChokeLineValve + ChokeLineLeverOld=BopControlPanel%ChokeLineValve endif finished_ChokeLine=0 ChokeLineIsOpening = .true. - ChokeLineCloseLED = LedOff + BopControlPanel%ChokeLineCloseLED = LedOff ChokeLineCloseLEDMine = LedOff - ChokeLineOpenLED = LedOn !LedBlinking + BopControlPanel%ChokeLineOpenLED = LedOn !LedBlinking RAM(5)%bop_type = 3 !AbopChokeLine=196.67 - AbopChokeLine=(ChokeClose*231)/((IDChokeLineBase-ODDrillpipe_inChokeLineBase)/2.) + AbopChokeLine=(BopStackSpecification%ChokeClose*231)/((IDChokeLineBase-ODDrillpipe_inChokeLineBase)/2.) NeededVolumeChokeLine=AbopChokeLine*(IDChokeLineBase-max(ODDrillpipe_inChokeLine,ODDrillpipe_inChokeLineBase))/(2.*231) !1.5 galon for each BOP endif - if (ChokeLineValve == 1.0 .and. RigAirMalf==0 .and. AirMasterValve==1 .and. p_acc>acc_MinPressure) then + if (BopControlPanel%ChokeLineValve == 1.0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1 .and. p_acc>acc_MinPressure) then if ( RAM(5)%SuccessionCounter /= RAM(5)%SuccessionCounterOld+1 ) then @@ -106,7 +106,7 @@ SUBROUTINE CHOKE_LINE if (finished_ChokeLine==1) then ChokeLineLeverOld= -1.0 else - ChokeLineLeverOld=ChokeLineValve + ChokeLineLeverOld=BopControlPanel%ChokeLineValve endif finished_ChokeLine=0 ChokeLineIsClosing = .true. @@ -116,14 +116,14 @@ SUBROUTINE CHOKE_LINE ! RETURN !end if - ChokeLineCloseLed = LedOff !new + BopControlPanel%ChokeLineCloseLED = LedOff !new ChokeLineCloseLedMine = LedOff !new - ChokeLineCloseLED = LedOn !LedBlinking + BopControlPanel%ChokeLineCloseLED = LedOn !LedBlinking RAM(5)%bop_type = 3 !AbopChokeLine=196.67 - AbopChokeLine=(ChokeOpen*231)/((IDChokeLineBase-ODDrillpipe_inChokeLineBase)/2.) + AbopChokeLine=(BopStackSpecification%ChokeOpen*231)/((IDChokeLineBase-ODDrillpipe_inChokeLineBase)/2.) NeededVolumeChokeLine=AbopChokeLine*(IDChokeLineBase-max(ODDrillpipe_inChokeLine,ODDrillpipe_inChokeLineBase))/(2.*231) !1.5 galon for each BOP endif @@ -168,7 +168,7 @@ SUBROUTINE CHOKE_LINE_SUB RAM(5)%SuccessionCounter = RAM(5)%SuccessionCounter + 1 - if (ChokeLineValve == 1.0 .and. ChokeLineLeverOld == -1.0 .and. RigAirMalf==0 .and. AirMasterValve==1 .and. p_acc>acc_MinPressure) then + if (BopControlPanel%ChokeLineValve == 1.0 .and. ChokeLineLeverOld == -1.0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1 .and. p_acc>acc_MinPressure) then if ( RAM(5)%First_CloseTimecheck == 0 ) then @@ -193,14 +193,14 @@ SUBROUTINE CHOKE_LINE_SUB ChokeLine_closed=0 RAM(5)%p_bop=pa - ChokeLineLeverOld = ChokeLineValve - ChokeLineOpenLED = LedOff + ChokeLineLeverOld = BopControlPanel%ChokeLineValve + BopControlPanel%ChokeLineOpenLED = LedOff ChokeLineOpenLEDMine = LedOff - ChokeLineCloseLED = LedOn !LedBlinking + BopControlPanel%ChokeLineCloseLED = LedOn !LedBlinking CALL OpenChokeLine RAM(5)%bop_type = 3 !AbopChokeLine=196.67 - AbopChokeLine=(ChokeClose*231)/((IDChokeLineBase-ODDrillpipe_inChokeLineBase)/2.) + AbopChokeLine=(BopStackSpecification%ChokeClose*231)/((IDChokeLineBase-ODDrillpipe_inChokeLineBase)/2.) NeededVolumeChokeLine=AbopChokeLine*(IDChokeLine-max(ODDrillpipe_inChokeLine,ODDrillpipe_inChokeLineBase))/(2.*231) RAM(5)%vdis_bottles=0. @@ -210,7 +210,7 @@ SUBROUTINE CHOKE_LINE_SUB ChokeLineIsOpening = .false. endif - if (ChokeLineValve == -1.0 .and. ChokeLineLeverOld == 1.0 .and. p_acc>acc_MinPressure .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%ChokeLineValve == -1.0 .and. ChokeLineLeverOld == 1.0 .and. p_acc>acc_MinPressure .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then if ( RAM(5)%First_OpenTimecheck == 0 ) then @@ -232,14 +232,14 @@ SUBROUTINE CHOKE_LINE_SUB ChokeLine_closed=0 RAM(5)%p_bop=pa - ChokeLineLeverOld = ChokeLineValve - ChokeLineCloseLED = LedOff + ChokeLineLeverOld = BopControlPanel%ChokeLineValve + BopControlPanel%ChokeLineCloseLED = LedOff ChokeLineCloseLEDMine = LedOff - ChokeLineOpenLED = LedOn !LedBlinking + BopControlPanel%ChokeLineOpenLED = LedOn !LedBlinking CALL OpenChokeLine RAM(5)%bop_type = 3 !AbopChokeLine=196.67 - AbopChokeLine=(ChokeOpen*231)/((IDChokeLineBase-ODDrillpipe_inChokeLineBase)/2.) + AbopChokeLine=(BopStackSpecification%ChokeOpen*231)/((IDChokeLineBase-ODDrillpipe_inChokeLineBase)/2.) NeededVolumeChokeLine=AbopChokeLine*(IDChokeLineBase-IDChokeLine)/(2.*231) RAM(5)%vdis_bottles=0. RAM(5)%fvr_air=0. diff --git a/Equipments/BopStack/KILL_LINE.f90 b/Equipments/BopStack/KILL_LINE.f90 index 78446cd..c869a0a 100644 --- a/Equipments/BopStack/KILL_LINE.f90 +++ b/Equipments/BopStack/KILL_LINE.f90 @@ -19,7 +19,7 @@ SUBROUTINE KILL_LINE RAM(6)%SuccessionCounter = RAM(6)%SuccessionCounter + 1 - if (KillLineValve == -1.0 .and. RigAirMalf==0 .and. AirMasterValve==1 .and. p_acc>acc_MinPressure) then + if (BopControlPanel%KillLineValve == -1.0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1 .and. p_acc>acc_MinPressure) then if ( RAM(6)%SuccessionCounter /= RAM(6)%SuccessionCounterOld+1 ) then RAM(6)%SuccessionCounter = 0 ! also in starup @@ -54,20 +54,20 @@ SUBROUTINE KILL_LINE if (finished_KillLine==1) then KillLineLeverOld= 1.0 else - KillLineLeverOld=KillLineValve + KillLineLeverOld=BopControlPanel%KillLineValve endif finished_KillLine=0 KillLineIsOpening = .true. - KillLineCloseLed = LedOff + BopControlPanel%KillLineCloseLED = LedOff KillLineCloseLedMine = LedOff - KillLineOpenLed = LedOn !LedBlinking + BopControlPanel%KillLineOpenLED = LedOn !LedBlinking RAM(6)%bop_type = 3 !AbopKillLine=196.67 - AbopKillLine=(KillClose*231)/((IDKillLineBase-ODDrillpipe_inKillLineBase)/2.) + AbopKillLine=(BopStackSpecification%KillClose*231)/((IDKillLineBase-ODDrillpipe_inKillLineBase)/2.) NeededVolumeKillLine=AbopKillLine*(IDKillLineBase-max(ODDrillpipe_inKillLine,ODDrillpipe_inKillLineBase))/(2.*231) !1.5 galon for each BOP endif - if (KillLineValve == 1.0 .and. RigAirMalf==0 .and. AirMasterValve==1 .and. p_acc>acc_MinPressure) then + if (BopControlPanel%KillLineValve == 1.0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1 .and. p_acc>acc_MinPressure) then if ( RAM(6)%SuccessionCounter /= RAM(6)%SuccessionCounterOld+1 ) then @@ -106,7 +106,7 @@ SUBROUTINE KILL_LINE if (finished_KillLine==1) then KillLineLeverOld= -1.0 else - KillLineLeverOld=KillLineValve + KillLineLeverOld=BopControlPanel%KillLineValve endif finished_KillLine=0 KillLineIsClosing = .true. @@ -116,13 +116,13 @@ SUBROUTINE KILL_LINE ! RETURN !end if - KillLineCloseLed = LedOff !new + BopControlPanel%KillLineCloseLED = LedOff !new KillLineCloseLedMine = LedOff !new - KillLineCloseLed = LedOn !LedBlinking + BopControlPanel%KillLineCloseLED = LedOn !LedBlinking RAM(6)%bop_type = 3 !AbopKillLine=196.67 - AbopKillLine=(KillOpen*231)/((IDKillLineBase-ODDrillpipe_inKillLineBase)/2.) + AbopKillLine=(BopStackSpecification%KillOpen*231)/((IDKillLineBase-ODDrillpipe_inKillLineBase)/2.) NeededVolumeKillLine=AbopKillLine*(IDKillLineBase-max(ODDrillpipe_inKillLine,ODDrillpipe_inKillLineBase))/(2.*231) !1.5 galon for each BOP endif @@ -167,7 +167,7 @@ SUBROUTINE KILL_LINE_SUB - if (KillLineValve == 1.0 .and. KillLineLeverOld == -1.0 .and. RigAirMalf==0 .and. AirMasterValve==1 .and. p_acc>acc_MinPressure) then + if (BopControlPanel%KillLineValve == 1.0 .and. KillLineLeverOld == -1.0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1 .and. p_acc>acc_MinPressure) then if ( RAM(6)%First_CloseTimecheck == 0 ) then @@ -192,14 +192,14 @@ SUBROUTINE KILL_LINE_SUB KillLine_closed=0 RAM(6)%p_bop=pa - KillLineLeverOld = KillLineValve - KillLineOpenLed = LedOff + KillLineLeverOld = BopControlPanel%KillLineValve + BopControlPanel%KillLineOpenLED = LedOff KillLineOpenLedMine = LedOff - KillLineCloseLed = LedOn !LedBlinking + BopControlPanel%KillLineCloseLED = LedOn !LedBlinking CALL OpenKillLine RAM(6)%bop_type = 3 !AbopKillLine=196.67 - AbopKillLine=(KillClose*231)/((IDKillLineBase-ODDrillpipe_inKillLineBase)/2.) + AbopKillLine=(BopStackSpecification%KillClose*231)/((IDKillLineBase-ODDrillpipe_inKillLineBase)/2.) NeededVolumeKillLine=AbopKillLine*(IDKillLine-max(ODDrillpipe_inKillLine,ODDrillpipe_inKillLineBase))/(2.*231) RAM(6)%vdis_bottles=0. @@ -209,7 +209,7 @@ SUBROUTINE KILL_LINE_SUB KillLineIsOpening = .false. endif - if (KillLineValve == -1.0 .and. KillLineLeverOld == 1.0 .and. p_acc>acc_MinPressure .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%KillLineValve == -1.0 .and. KillLineLeverOld == 1.0 .and. p_acc>acc_MinPressure .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then if ( RAM(6)%First_OpenTimecheck == 0 ) then @@ -231,14 +231,14 @@ SUBROUTINE KILL_LINE_SUB KillLine_closed=0 RAM(6)%p_bop=pa - KillLineLeverOld = KillLineValve - KillLineCloseLed = LedOff + KillLineLeverOld = BopControlPanel%KillLineValve + BopControlPanel%KillLineCloseLED = LedOff KillLineCloseLedMine = LedOff - KillLineOpenLed = LedOn !LedBlinking + BopControlPanel%KillLineOpenLED = LedOn !LedBlinking CALL OpenKillLine RAM(6)%bop_type = 3 !AbopKillLine=196.67 - AbopKillLine=(KillOpen*231)/((IDKillLineBase-ODDrillpipe_inKillLineBase)/2.) + AbopKillLine=(BopStackSpecification%KillOpen*231)/((IDKillLineBase-ODDrillpipe_inKillLineBase)/2.) NeededVolumeKillLine=AbopKillLine*(IDKillLineBase-IDKillLine)/(2.*231) RAM(6)%vdis_bottles=0. RAM(6)%fvr_air=0. diff --git a/Equipments/BopStack/LOSS_INPUTS.f90 b/Equipments/BopStack/LOSS_INPUTS.f90 index 8100d2c..50a7ff3 100644 --- a/Equipments/BopStack/LOSS_INPUTS.f90 +++ b/Equipments/BopStack/LOSS_INPUTS.f90 @@ -338,9 +338,9 @@ implicit none !Pannular_regset=min(AnnularRegulatorSetControl,1700.) ! for changing its set conditions instantaneously !write(*,*) 'pumps_charge_bottle' - if(ByePassValve == -1.0) then + if(BopControlPanel%ByePassValve == -1.0) then ByPassOld= -1.0 - elseif(ByePassValve == 1.0) then + elseif(BopControlPanel%ByePassValve == 1.0) then ByPassOld= 1.0 endif @@ -682,9 +682,9 @@ enddo RAM(RNUMBER)%loss_after= RAM(RNUMBER)%pipe_loss2+ RAM(RNUMBER)%minor_loss2+ RAM(RNUMBER)%static_loss2 !(psi) !======================================================= - if(ByePassValve == -1.0) then + if(BopControlPanel%ByePassValve == -1.0) then ByPassOld= -1.0 - elseif(ByePassValve == 1.0) then + elseif(BopControlPanel%ByePassValve == 1.0) then ByPassOld= 1.0 endif ! write(*,*) 'ByPassOld=', ByPassOld @@ -789,9 +789,9 @@ if (ramtype==1) then !for shear ram if (ShearRamIsClosing) then IDshearBop=0. + ShearIsNotAllowed*ODDrillpipe_inShearRam - MiddleRamsCloseLED = LedOn + BopControlPanel%MiddleRamsCloseLED = LedOn MiddleRamsCloseLEDMine = LedOn - MiddleRamsOpenLED = LedOff + BopControlPanel%MiddleRamsOpenLED = LedOff MiddleRamsOpenLEDMine = LedOff if (TD_BOPConnectionPossibility(3) == 1 .and. ShearIsNotAllowed==0) then CALL CloseMiddleRams @@ -801,9 +801,9 @@ if (ramtype==1) then !for shear ram if (ShearRamIsOpening) then IDshearBop=IDshearBopBase - MiddleRamsOpenLED = LedOn + BopControlPanel%MiddleRamsOpenLED = LedOn MiddleRamsOpenLEDMine = LedOn - MiddleRamsCloseLED = LedOff + BopControlPanel%MiddleRamsCloseLED = LedOff MiddleRamsCloseLEDMine = LedOff CALL OpenMiddleRams ShearBop_Situation_forTD= 0 ! open - for TD code @@ -833,9 +833,9 @@ if (ramtype==2) then !for pipe ram1 if (PipeRam1IsClosing) then IDPipeRam1=max(ODDrillpipe_inPipeRam1,ODDrillpipe_inPipeRam1Base) - UpperRamsCloseLED = LedOn + BopControlPanel%UpperRamsCloseLED = LedOn UpperRamsCloseLEDMine = LedOn - UpperRamsOpenLED = LedOff + BopControlPanel%UpperRamsOpenLED = LedOff UpperRamsOpenLEDMine = LedOff if (TD_BOPConnectionPossibility(2) == 1) then CALL CloseUpperRams ! for C code @@ -848,9 +848,9 @@ if (ramtype==2) then !for pipe ram1 if (PipeRam1IsOpening) then IDPipeRam1=IDPipeRamBase - UpperRamsOpenLED = LedOn + BopControlPanel%UpperRamsOpenLED = LedOn UpperRamsOpenLEDMine = LedOn - UpperRamsCloseLED = LedOff + BopControlPanel%UpperRamsCloseLED = LedOff UpperRamsCloseLEDMine = LedOff Call OpenUpperRams ! for C code PipeRam1_Situation_forTD= 0 ! open - for TD code @@ -881,9 +881,9 @@ if (ramtype==3) then !for pipe ram2 if (PipeRam2IsClosing) then IDPipeRam2=max(ODDrillpipe_inPipeRam2,ODDrillpipe_inPipeRam1Base) - LowerRamsCloseLED = LedOn + BopControlPanel%LowerRamsCloseLED = LedOn LowerRamsCloseLEDMine = LedOn - LowerRamsOpenLED = LedOff + BopControlPanel%LowerRamsOpenLED = LedOff LowerRamsOpenLEDMine = LedOff if (TD_BOPConnectionPossibility(4) == 1) then CALL CloseLowerRams @@ -893,9 +893,9 @@ if (ramtype==3) then !for pipe ram2 if (PipeRam2IsOpening) then IDPipeRam2=IDPipeRamBase - LowerRamsOpenLED = LedOn + BopControlPanel%LowerRamsOpenLED = LedOn LowerRamsOpenLEDMine = LedOn - LowerRamsCloseLED = LedOff + BopControlPanel%LowerRamsCloseLED = LedOff LowerRamsCloseLEDMine = LedOff CALL OpenLowerRams PipeRam2_Situation_forTD= 0 ! open - for TD code @@ -925,18 +925,18 @@ if (ramtype==4) then !for Choke Line if (ChokeLineIsClosing) then IDChokeLine=max(ODDrillpipe_inChokeLine,ODDrillpipe_inChokeLineBase) - ChokeLineCloseLED = LedOn + BopControlPanel%ChokeLineCloseLED = LedOn ChokeLineCloseLEDMine = LedOn - ChokeLineOpenLED = LedOff + BopControlPanel%ChokeLineOpenLED = LedOff ChokeLineOpenLEDMine = LedOff CALL CloseChokeLine endif if (ChokeLineIsOpening) then IDChokeLine=IDChokeLineBase - ChokeLineOpenLED = LedOn + BopControlPanel%ChokeLineOpenLED = LedOn ChokeLineOpenLEDMine = LedOn - ChokeLineCloseLED = LedOff + BopControlPanel%ChokeLineCloseLED = LedOff ChokeLineCloseLEDMine = LedOff CALL OpenChokeLine endif @@ -964,18 +964,18 @@ if (ramtype==5) then !for Kill Line if (KillLineIsClosing) then IDKillLine=max(ODDrillpipe_inKillLine,ODDrillpipe_inKillLineBase) - KillLineCloseLed = LedOn + BopControlPanel%KillLineCloseLED = LedOn KillLineCloseLedMine = LedOn - KillLineOpenLed = LedOff + BopControlPanel%KillLineOpenLED = LedOff KillLineOpenLedMine = LedOff CALL CloseKillLine endif if (KillLineIsOpening) then IDKillLine=IDKillLineBase - KillLineOpenLed = LedOn + BopControlPanel%KillLineOpenLED = LedOn KillLineOpenLedMine = LedOn - KillLineCloseLed = LedOff + BopControlPanel%KillLineCloseLED = LedOff KillLineCloseLedMine = LedOff CALL OpenKillLine endif @@ -1233,10 +1233,10 @@ p_acc=b1*exp(b2*fvr/nobottles)+b3*exp(b4*fvr/nobottles) !(psig)<<<< 8=no. of bot if (AnnularIsClosing) then IDAnnular=max(ODDrillpipe_inAnnular,ODDrillpipe_inAnnularBase) - AnnularCloseLed = LedOn + BopControlPanel%AnnularCloseLED = LedOn AnnularCloseLedMine = LedOn - AnnularOpenLed = LedOff + BopControlPanel%AnnularOpenLED = LedOff AnnularOpenLedMine = LedOff if (TD_BOPConnectionPossibility(1) == 1) then @@ -1250,10 +1250,10 @@ p_acc=b1*exp(b2*fvr/nobottles)+b3*exp(b4*fvr/nobottles) !(psig)<<<< 8=no. of bot if (AnnularIsOpening) then IDAnnular=IDAnnularBase - AnnularOpenLed = LedOn + BopControlPanel%AnnularOpenLED = LedOn AnnularOpenLedMine = LedOn - AnnularCloseLed = LedOff + BopControlPanel%AnnularCloseLED = LedOff AnnularCloseLedMine = LedOff CALL OpenAnnular diff --git a/Equipments/BopStack/PIPE_RAM1.f90 b/Equipments/BopStack/PIPE_RAM1.f90 index e534ae9..fcc97cc 100644 --- a/Equipments/BopStack/PIPE_RAM1.f90 +++ b/Equipments/BopStack/PIPE_RAM1.f90 @@ -13,7 +13,7 @@ SUBROUTINE PIPE_RAMS1 ! START CONDITIONS FOR PIPE RAMS 1 !===================================================================== RAM(2)%SuccessionCounter = RAM(2)%SuccessionCounter + 1 - if (UpperRamsValve == 1.0 .and. UpperRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%UpperRamsValve == 1.0 .and. UpperRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then if (UpperRamsCloseLEDMine == LedOn) then RETURN end if @@ -33,9 +33,9 @@ SUBROUTINE PIPE_RAMS1 RAM(2)%First_CloseTimecheck= 1 - UpperRamsOpenLED = LedOff + BopControlPanel%UpperRamsOpenLED = LedOff UpperRamsOpenLEDMine = LedOff - UpperRamsCloseLED = LedOn !LedBlinking + BopControlPanel%UpperRamsCloseLED = LedOn !LedBlinking RAM(2)%FourwayValve = 1 endif @@ -64,7 +64,7 @@ SUBROUTINE PIPE_RAMS1 if (finished_pipe1==1) then PipeRams1LeverOld=-1.0 else - PipeRams1LeverOld=UpperRamsValve + PipeRams1LeverOld=BopControlPanel%UpperRamsValve endif finished_pipe1=0 PipeRam1IsClosing = .true. @@ -72,11 +72,11 @@ SUBROUTINE PIPE_RAMS1 RAM(2)%bop_type = 3 !AbopPipeRam=196.67 - AbopPipeRam=(UpperRamClose*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) + AbopPipeRam=(BopStackSpecification%UpperRamClose*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) NeededVolumePipeRams1=AbopPipeRam*(IDPipeRamBase-max(ODDrillpipe_inPipeRam1,ODDrillpipe_inPipeRam1Base))/(2.*231) !3.67 galon for each BOP endif - if (UpperRamsValve == -1.0 .and. UpperRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%UpperRamsValve == -1.0 .and. UpperRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then if (UpperRamsOpenLEDMine == LedOn) then RETURN @@ -96,9 +96,9 @@ SUBROUTINE PIPE_RAMS1 RAM(2)%First_OpenTimecheck= 1 - UpperRamsCloseLed = LedOff !new + BopControlPanel%UpperRamsCloseLED = LedOff !new UpperRamsCloseLedMine = LedOff !new - UpperRamsOpenLED = LedOn !LedBlinking + BopControlPanel%UpperRamsOpenLED = LedOn !LedBlinking RAM(2)%FourwayValve = 1 @@ -129,7 +129,7 @@ SUBROUTINE PIPE_RAMS1 if (finished_pipe1==1) then PipeRams1LeverOld=1.0 else - PipeRams1LeverOld=UpperRamsValve + PipeRams1LeverOld=BopControlPanel%UpperRamsValve endif finished_pipe1=0 PipeRam1IsOpening = .true. @@ -144,7 +144,7 @@ SUBROUTINE PIPE_RAMS1 RAM(2)%bop_type = 3 !AbopPipeRam=186.5 - AbopPipeRam=(UpperRamOpen*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) + AbopPipeRam=(BopStackSpecification%UpperRamOpen*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) NeededVolumePipeRams1=AbopPipeRam*(IDPipeRamBase-max(ODDrillpipe_inPipeRam1,ODDrillpipe_inPipeRam1Base))/(2.*231) !3.48 galon for each BOP endif @@ -186,7 +186,7 @@ SUBROUTINE PIPE_RAMS1_SUB RAM(2)%SuccessionCounter = RAM(2)%SuccessionCounter + 1 - if (UpperRamsValve == 1.0 .and. PipeRams1LeverOld == -1.0 .and. UpperRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%UpperRamsValve == 1.0 .and. PipeRams1LeverOld == -1.0 .and. UpperRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then @@ -206,9 +206,9 @@ SUBROUTINE PIPE_RAMS1_SUB if ( RAM(2)%SuccessionCounter >= int(2.5/DeltaT_BOP) ) then !return - UpperRamsOpenLED = LedOff + BopControlPanel%UpperRamsOpenLED = LedOff UpperRamsOpenLEDMine = LedOff - UpperRamsCloseLED = LedOn !LedBlinking + BopControlPanel%UpperRamsCloseLED = LedOn !LedBlinking RAM(2)%FourwayValve = 1 @@ -229,12 +229,12 @@ SUBROUTINE PIPE_RAMS1_SUB CALL OpenUpperRams ! for C code PipeRam1_Situation_forTD= 0 ! open - for TD code RAM(2)%p_bop=pa - PipeRams1LeverOld = UpperRamsValve + PipeRams1LeverOld = BopControlPanel%UpperRamsValve RAM(2)%bop_type = 3 !AbopPipeRam=196.67 - AbopPipeRam=(UpperRamClose*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) + AbopPipeRam=(BopStackSpecification%UpperRamClose*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) !write(*,*) 'NeededVolumeShearRams1=',NeededVolumeShearRams NeededVolumePipeRams1=AbopPipeRam*(IDPipeRam1-max(ODDrillpipe_inPipeRam1,ODDrillpipe_inPipeRam1Base))/(2.*231) ! write(*,*) 'NeededVolumeShearRams2=',NeededVolumeShearRams @@ -246,7 +246,7 @@ SUBROUTINE PIPE_RAMS1_SUB PipeRam1IsOpening = .false. endif - if (UpperRamsValve == -1.0 .and. PipeRams1LeverOld == 1.0 .and. UpperRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%UpperRamsValve == -1.0 .and. PipeRams1LeverOld == 1.0 .and. UpperRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then if ( RAM(2)%First_OpenTimecheck == 0 ) then @@ -262,9 +262,9 @@ SUBROUTINE PIPE_RAMS1_SUB if ( RAM(2)%SuccessionCounter >= int(2.5/DeltaT_BOP) ) then !return - UpperRamsCloseLED = LedOff + BopControlPanel%UpperRamsCloseLED = LedOff UpperRamsCloseLEDMine = LedOff - UpperRamsOpenLED = LedOn !LedBlinking + BopControlPanel%UpperRamsOpenLED = LedOn !LedBlinking RAM(2)%FourwayValve = 1 @@ -287,11 +287,11 @@ SUBROUTINE PIPE_RAMS1_SUB CALL OpenUpperRams PipeRam1_Situation_forTD= 0 ! open - for TD code RAM(2)%p_bop=pa - PipeRams1LeverOld = UpperRamsValve + PipeRams1LeverOld = BopControlPanel%UpperRamsValve RAM(2)%bop_type = 3 !AbopPipeRam=186.5 - AbopPipeRam=(UpperRamOpen*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) + AbopPipeRam=(BopStackSpecification%UpperRamOpen*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) NeededVolumePipeRams1=AbopPipeRam*(IDPipeRamBase-IDPipeRam1)/(2.*231) RAM(2)%vdis_bottles=0. RAM(2)%fvr_air=0. diff --git a/Equipments/BopStack/PIPE_RAM2.f90 b/Equipments/BopStack/PIPE_RAM2.f90 index c26b1f4..ad492eb 100644 --- a/Equipments/BopStack/PIPE_RAM2.f90 +++ b/Equipments/BopStack/PIPE_RAM2.f90 @@ -18,7 +18,7 @@ SUBROUTINE PIPE_RAMS2 RAM(3)%SuccessionCounter = RAM(3)%SuccessionCounter + 1 - if (LowerRamsValve == 1.0 .and. LowerRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%LowerRamsValve == 1.0 .and. LowerRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then !write(*,*) 'close 1' @@ -41,9 +41,9 @@ SUBROUTINE PIPE_RAMS2 RAM(3)%First_CloseTimecheck= 1 - LowerRamsOpenLED = LedOff + BopControlPanel%LowerRamsOpenLED = LedOff LowerRamsOpenLEDMine = LedOff - LowerRamsCloseLED = LedOn !LedBlinking + BopControlPanel%LowerRamsCloseLED = LedOn !LedBlinking RAM(3)%FourwayValve = 1 @@ -75,7 +75,7 @@ SUBROUTINE PIPE_RAMS2 if (finished_pipe2==1) then PipeRams2LeverOld=-1.0 else - PipeRams2LeverOld=LowerRamsValve + PipeRams2LeverOld=BopControlPanel%LowerRamsValve endif finished_pipe2=0 PipeRam2IsClosing = .true. @@ -84,12 +84,12 @@ SUBROUTINE PIPE_RAMS2 RAM(3)%bop_type = 3 !AbopPipeRam=196.67 - AbopPipeRam=(LowerRamClose*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) + AbopPipeRam=(BopStackSpecification%LowerRamClose*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) NeededVolumePipeRams2=AbopPipeRam*(IDPipeRamBase-max(ODDrillpipe_inPipeRam2,ODDrillpipe_inPipeRam1Base))/(2.*231) !galon for each BOP !write(*,*) 'close 1' endif - if (LowerRamsValve == -1.0 .and. LowerRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%LowerRamsValve == -1.0 .and. LowerRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then !write(*,*) 'open 1' if (LowerRamsOpenLEDMine == LedOn) then @@ -111,9 +111,9 @@ SUBROUTINE PIPE_RAMS2 RAM(3)%First_OpenTimecheck= 1 - LowerRamsCloseLed = LedOff !new + BopControlPanel%LowerRamsCloseLED = LedOff !new LowerRamsCloseLedMine = LedOff !new - LowerRamsOpenLED = LedOn !LedBlinking + BopControlPanel%LowerRamsOpenLED = LedOn !LedBlinking RAM(3)%FourwayValve = 1 @@ -143,7 +143,7 @@ SUBROUTINE PIPE_RAMS2 if (finished_pipe2==1) then PipeRams2LeverOld=1.0 else - PipeRams2LeverOld=LowerRamsValve + PipeRams2LeverOld=BopControlPanel%LowerRamsValve endif finished_pipe2=0 PipeRam2IsOpening = .true. @@ -157,7 +157,7 @@ SUBROUTINE PIPE_RAMS2 RAM(3)%bop_type = 3 !AbopPipeRam=186.5 - AbopPipeRam=(LowerRamOpen*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) + AbopPipeRam=(BopStackSpecification%LowerRamOpen*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) NeededVolumePipeRams2=AbopPipeRam*(IDPipeRamBase-max(ODDrillpipe_inPipeRam2,ODDrillpipe_inPipeRam1Base))/(2.*231) !galon for each BOP !write(*,*) 'open 1' @@ -207,7 +207,7 @@ SUBROUTINE PIPE_RAMS2_SUB RAM(3)%SuccessionCounter = RAM(3)%SuccessionCounter + 1 - if (LowerRamsValve == 1.0 .and. PipeRams2LeverOld == -1.0 .and. LowerRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%LowerRamsValve == 1.0 .and. PipeRams2LeverOld == -1.0 .and. LowerRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then !write(*,*) 'close 3' @@ -227,9 +227,9 @@ SUBROUTINE PIPE_RAMS2_SUB if ( RAM(3)%SuccessionCounter >= int(2.5/DeltaT_BOP) ) then !return - LowerRamsOpenLED = LedOff + BopControlPanel%LowerRamsOpenLED = LedOff LowerRamsOpenLEDMine = LedOff - LowerRamsCloseLED = LedOn !LedBlinking + BopControlPanel%LowerRamsCloseLED = LedOn !LedBlinking RAM(3)%FourwayValve = 1 @@ -251,13 +251,13 @@ SUBROUTINE PIPE_RAMS2_SUB PipeRam2_closed=0 !PipeRam2_closed_withPossibility= PipeRam2_closed * TD_BOPConnectionPossibility(4) RAM(3)%p_bop=pa - PipeRams2LeverOld = LowerRamsValve + PipeRams2LeverOld = BopControlPanel%LowerRamsValve CALL OpenLowerRams PipeRam2_Situation_forTD= 0 ! open - for TD code RAM(3)%bop_type = 3 !AbopPipeRam=196.67 - AbopPipeRam=(LowerRamClose*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) + AbopPipeRam=(BopStackSpecification%LowerRamClose*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) NeededVolumePipeRams2=AbopPipeRam*(IDPipeRam2-max(ODDrillpipe_inPipeRam2,ODDrillpipe_inPipeRam1Base))/(2.*231) RAM(3)%vdis_bottles=0. @@ -269,7 +269,7 @@ SUBROUTINE PIPE_RAMS2_SUB endif - if (LowerRamsValve == -1.0 .and. PipeRams2LeverOld == 1.0 .and. LowerRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%LowerRamsValve == -1.0 .and. PipeRams2LeverOld == 1.0 .and. LowerRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then !write(*,*) 'open 3' @@ -286,9 +286,9 @@ SUBROUTINE PIPE_RAMS2_SUB if ( RAM(3)%SuccessionCounter >= int(2.5/DeltaT_BOP) ) then !return - LowerRamsCloseLED = LedOff + BopControlPanel%LowerRamsCloseLED = LedOff LowerRamsCloseLEDMine = LedOff - LowerRamsOpenLED = LedOn !LedBlinking + BopControlPanel%LowerRamsOpenLED = LedOn !LedBlinking RAM(3)%FourwayValve = 1 @@ -308,13 +308,13 @@ SUBROUTINE PIPE_RAMS2_SUB PipeRam2_closed=0 !PipeRam2_closed_withPossibility= PipeRam2_closed * TD_BOPConnectionPossibility(4) RAM(3)%p_bop=pa - PipeRams2LeverOld = LowerRamsValve + PipeRams2LeverOld = BopControlPanel%LowerRamsValve CALL OpenLowerRams PipeRam2_Situation_forTD= 0 ! open - for TD code RAM(3)%bop_type = 3 !AbopPipeRam=186.5 - AbopPipeRam=(LowerRamOpen*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) + AbopPipeRam=(BopStackSpecification%LowerRamOpen*231)/((IDPipeRamBase-ODDrillpipe_inPipeRam1Base)/2.) NeededVolumePipeRams2=AbopPipeRam*(IDPipeRamBase-IDPipeRam2)/(2.*231) RAM(3)%vdis_bottles=0. RAM(3)%fvr_air=0. diff --git a/Equipments/BopStack/SHEAR_RAM.f90 b/Equipments/BopStack/SHEAR_RAM.f90 index 418f3cc..d59c3a2 100644 --- a/Equipments/BopStack/SHEAR_RAM.f90 +++ b/Equipments/BopStack/SHEAR_RAM.f90 @@ -17,7 +17,7 @@ SUBROUTINE SHEAR_RAMS RAM(4)%SuccessionCounter = RAM(4)%SuccessionCounter + 1 - if (MiddleRamsValve == 1.0 .and. MiddleRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%MiddleRamsValve == 1.0 .and. MiddleRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then if (MiddleRamsCloseLEDMine == LedOn) then RETURN @@ -38,9 +38,9 @@ SUBROUTINE SHEAR_RAMS RAM(4)%First_CloseTimecheck= 1 - MiddleRamsOpenLED = LedOff + BopControlPanel%MiddleRamsOpenLED = LedOff MiddleRamsOpenLEDMine = LedOff - MiddleRamsCloseLED = LedOn !LedBlinking + BopControlPanel%MiddleRamsCloseLED = LedOn !LedBlinking RAM(4)%FourwayValve = 1 @@ -71,7 +71,7 @@ SUBROUTINE SHEAR_RAMS if (finished_shear==1) then ShearRamsLeverOld=-1.0 else - ShearRamsLeverOld=MiddleRamsValve + ShearRamsLeverOld=BopControlPanel%MiddleRamsValve endif finished_shear=0 ShearRamIsClosing = .true. @@ -80,14 +80,14 @@ SUBROUTINE SHEAR_RAMS RAM(4)%bop_type = 2 !NeededVolumeShearRams=5.8 !galon for each BOP !AbopShearRam=196.67 !(in^2) - AbopShearRam=(BlindRamClose*231)/(IDshearBopBase/2.) + AbopShearRam=(BopStackSpecification%BlindRamClose*231)/(IDshearBopBase/2.) !NeededVolumeShearRams=BlindRamClose !galon for each BOP **changed NeededVolumeShearRams=AbopShearRam*(IDshearBopBase-ShearIsNotAllowed*ODDrillpipe_inShearRam)/(2.*231) !3.67 galon for each BOP ! **changed va=AbopShearRam*(IDshearBopBase-ODDrillpipe_inShearRam)/(2.*231) vb=NeededVolumeShearRams endif - if (MiddleRamsValve == -1.0 .and. MiddleRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%MiddleRamsValve == -1.0 .and. MiddleRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then if (MiddleRamsOpenLEDMine == LedOn) then RETURN @@ -107,9 +107,9 @@ SUBROUTINE SHEAR_RAMS RAM(4)%First_OpenTimecheck= 1 - MiddleRamsCloseLed = LedOff !new + BopControlPanel%MiddleRamsCloseLED = LedOff !new MiddleRamsCloseLedMine = LedOff !new - MiddleRamsOpenLED = LedOn !LedBlinking + BopControlPanel%MiddleRamsOpenLED = LedOn !LedBlinking endif @@ -139,7 +139,7 @@ SUBROUTINE SHEAR_RAMS if (finished_shear==1) then ShearRamsLeverOld=1.0 else - ShearRamsLeverOld=MiddleRamsValve + ShearRamsLeverOld=BopControlPanel%MiddleRamsValve endif finished_shear=0 ShearRamIsOpening = .true. @@ -154,7 +154,7 @@ SUBROUTINE SHEAR_RAMS RAM(4)%bop_type = 3 !AbopShearRam=186.5 !(in^2) - AbopShearRam=(BlindRamOpen*231)/(IDshearBopBase/2.) + AbopShearRam=(BopStackSpecification%BlindRamOpen*231)/(IDshearBopBase/2.) !NeededVolumeShearRams=5.5 !galon for each BOP !NeededVolumeShearRams=BlindRamOpen ! **changed NeededVolumeShearRams=AbopShearRam*(IDshearBopBase-ShearIsNotAllowed*ODDrillpipe_inShearRam)/(2.*231) !3.67 galon for each BOP ! **changed @@ -195,7 +195,7 @@ SUBROUTINE SHEAR_RAMS_SUB - if (MiddleRamsValve == 1.0 .and. ShearRamsLeverOld == -1.0 .and. MiddleRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%MiddleRamsValve == 1.0 .and. ShearRamsLeverOld == -1.0 .and. MiddleRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then if ( RAM(4)%First_CloseTimecheck == 0 ) then @@ -214,9 +214,9 @@ SUBROUTINE SHEAR_RAMS_SUB if ( RAM(4)%SuccessionCounter >= int(2.5/DeltaT_BOP) ) then !return - MiddleRamsOpenLED = LedOff + BopControlPanel%MiddleRamsOpenLED = LedOff MiddleRamsOpenLEDMine = LedOff - MiddleRamsCloseLED = LedOn !LedBlinking + BopControlPanel%MiddleRamsCloseLED = LedOn !LedBlinking RAM(4)%FourwayValve = 1 @@ -238,14 +238,14 @@ SUBROUTINE SHEAR_RAMS_SUB ShearBop_closed=0 !ShearBop_closed_withPossibility= ShearBop_closed * TD_BOPConnectionPossibility(3) RAM(4)%p_bop=pa - ShearRamsLeverOld = MiddleRamsValve + ShearRamsLeverOld = BopControlPanel%MiddleRamsValve CALL OpenMiddleRams ! for C code ShearBop_Situation_forTD= 0 ! open - for TD code RAM(4)%bop_type = 2 !AbopShearRam=196.67 - AbopShearRam=(BlindRamClose*231)/(IDshearBopBase/2.) + AbopShearRam=(BopStackSpecification%BlindRamClose*231)/(IDshearBopBase/2.) !NeededVolumeShearRams=AbopShearRam*IDshearBop/(2.*231) ! **changed NeededVolumeShearRams=AbopShearRam*(IDshearBop-ShearIsNotAllowed*ODDrillpipe_inShearRam)/(2.*231) ! **changed @@ -257,7 +257,7 @@ SUBROUTINE SHEAR_RAMS_SUB ShearRamIsOpening = .false. endif - if (MiddleRamsValve == -1.0 .and. ShearRamsLeverOld == 1.0 .and. MiddleRamsFailureMalf==0 .and. RigAirMalf==0 .and. AirMasterValve==1) then + if (BopControlPanel%MiddleRamsValve == -1.0 .and. ShearRamsLeverOld == 1.0 .and. MiddleRamsFailureMalf==0 .and. RigAirMalf==0 .and. BopControlPanel%AirMasterValve==1) then if ( RAM(4)%First_OpenTimecheck == 0 ) then @@ -273,9 +273,9 @@ SUBROUTINE SHEAR_RAMS_SUB if ( RAM(4)%SuccessionCounter >= int(2.5/DeltaT_BOP) ) then !return - MiddleRamsCloseLED = LedOff + BopControlPanel%MiddleRamsCloseLED = LedOff MiddleRamsCloseLEDMine = LedOff - MiddleRamsOpenLED = LedOn !LedBlinking + BopControlPanel%MiddleRamsOpenLED = LedOn !LedBlinking RAM(4)%FourwayValve = 1 @@ -294,7 +294,7 @@ SUBROUTINE SHEAR_RAMS_SUB ShearBop_closed=0 !ShearBop_closed_withPossibility= ShearBop_closed * TD_BOPConnectionPossibility(3) RAM(4)%p_bop=pa - ShearRamsLeverOld = MiddleRamsValve + ShearRamsLeverOld = BopControlPanel%MiddleRamsValve CALL OpenMiddleRams ShearBop_Situation_forTD= 0 ! open - for TD code diff --git a/Equipments/ChokeControl/AirPump_Choke_Subs.f90 b/Equipments/ChokeControl/AirPump_Choke_Subs.f90 index 28b8579..3ab3900 100644 --- a/Equipments/ChokeControl/AirPump_Choke_Subs.f90 +++ b/Equipments/ChokeControl/AirPump_Choke_Subs.f90 @@ -105,13 +105,13 @@ SUBROUTINE PIPE_RAMS_CHOKE(CHNUMBER) Integer I - loop3: do while (ABS(ChokeControlLever)==1.0 .AND. ChokePanelRigAirSwitch == 1 .AND. CHOOKE(CHNUMBER)%FailMalf==0 .AND. ChokeAirFail==0) - if (ChokeControlLever == 1.0) then + loop3: do while (ABS(ChokeControlPanel%ChokeControlLever)==1.0 .AND. ChokeControlPanel%ChokePanelRigAirSwitch == 1 .AND. CHOOKE(CHNUMBER)%FailMalf==0 .AND. ChokeAirFail==0) + if (ChokeControlPanel%ChokeControlLever == 1.0) then CHOOKE(CHNUMBER)%ChokeIsClosing = .true. CHOOKE(CHNUMBER)%ChokeIsOpening = .false. endif - if (ChokeControlLever == -1.0) then + if (ChokeControlPanel%ChokeControlLever == -1.0) then CHOOKE(CHNUMBER)%ChokeIsOpening = .true. CHOOKE(CHNUMBER)%ChokeIsClosing = .false. endif @@ -243,7 +243,7 @@ losses_air=pipe_loss1air+minor_loss1air+static_loss1air !(psi) Qiter=QAIR_PUMP - QAIR_PUMP=QAIR_PUMP*(ChokeRateControlKnob/10.) ! final Q (gpm) + QAIR_PUMP=QAIR_PUMP*(ChokeControlPanel%ChokeRateControlKnob/10.) ! final Q (gpm) Cumulative_AirVolume_Choke= Cumulative_AirVolume_Choke + ((QAIR_PUMP * DeltaT_Choke / 60.0 ) / (1.5*0.004329004) ) ! =strokes @@ -303,10 +303,10 @@ alpha_lossesair=losses_air CHOOKE(CHNUMBER)%PercentClose= CHOOKE(CHNUMBER)%PassedCourse/CourseBase - IF (Choke1LED==1) THEN - ChokePosition= (1 - GaugeChokePositionMailf) * CHOOKE(1)%PercentClose*10 + IF (ChokeControlPanel%Choke1LED==1) THEN + ChokeControlPanel%ChokePosition= (1 - GaugeChokePositionMailf) * CHOOKE(1)%PercentClose*10 ELSE ! Choke2LED==1 - ChokePosition= (1 - GaugeChokePositionMailf) * CHOOKE(2)%PercentClose*10 + ChokeControlPanel%ChokePosition= (1 - GaugeChokePositionMailf) * CHOOKE(2)%PercentClose*10 ENDIF !CALL SetHydraulicChock1(nint(MIN(CHOOKE(1)%PercentClose / 0.91 , 1.0)*100)) diff --git a/Equipments/ChokeControl/CHOKE.f90 b/Equipments/ChokeControl/CHOKE.f90 index bac2dc7..c1e302b 100644 --- a/Equipments/ChokeControl/CHOKE.f90 +++ b/Equipments/ChokeControl/CHOKE.f90 @@ -37,20 +37,20 @@ module choke !=========================================================================== - IF(ChokeSelectorSwitch== 1) THEN - Choke1LED=1 - Choke2LED=0 + IF(ChokeControlPanel%ChokeSelectorSwitch== 1) THEN + ChokeControlPanel%Choke1LED=1 + ChokeControlPanel%Choke2LED=0 CHNUMBER=1 ELSE - Choke2LED=1 - Choke1LED=0 + ChokeControlPanel%Choke2LED=1 + ChokeControlPanel%Choke1LED=0 CHNUMBER=2 ENDIF - if (ABS(ChokeControlLever)==1.0 .AND. ChokePanelRigAirSwitch == 1 .AND. (CHOOKE(1)%FailMalf==0 .OR. CHOOKE(2)%FailMalf==0)) then + if (ABS(ChokeControlPanel%ChokeControlLever)==1.0 .AND. ChokeControlPanel%ChokePanelRigAirSwitch == 1 .AND. (CHOOKE(1)%FailMalf==0 .OR. CHOOKE(2)%FailMalf==0)) then CALL PIPE_RAMS_CHOKE(CHNUMBER) end if @@ -58,10 +58,10 @@ module choke - IF (Choke1LED==1) THEN - ChokePosition= (1 - GaugeChokePositionMailf) * CHOOKE(1)%PercentClose*10 ! display monitor + IF (ChokeControlPanel%Choke1LED==1) THEN + ChokeControlPanel%ChokePosition= (1 - GaugeChokePositionMailf) * CHOOKE(1)%PercentClose*10 ! display monitor ELSE ! Choke2LED==1 - ChokePosition= (1 - GaugeChokePositionMailf) * CHOOKE(2)%PercentClose*10 ! display monitor + ChokeControlPanel%ChokePosition= (1 - GaugeChokePositionMailf) * CHOOKE(2)%PercentClose*10 ! display monitor ENDIF diff --git a/Equipments/ChokeControl/ChokeStartup.f90 b/Equipments/ChokeControl/ChokeStartup.f90 index 783f94f..f8dc0e5 100644 --- a/Equipments/ChokeControl/ChokeStartup.f90 +++ b/Equipments/ChokeControl/ChokeStartup.f90 @@ -95,7 +95,7 @@ DeltaPlug2Percent = 0.0 !======================AIRPUMP INPUTS(CONSTANTS)=========================== CourseBase= 24. !cm CHOOKE%PassedCourse= 0. - ChokePosition=0. + ChokeControlPanel%ChokePosition=0. Acylinder= PI*(8.**2)/4. ! (CM^2), 8=DIAMETER, 24=course , 3785.412: cm^3 to galon diff --git a/Equipments/Drawworks/DWMalfunction_ClutchEngage.f90 b/Equipments/Drawworks/DWMalfunction_ClutchEngage.f90 index 9399564..ed3545d 100644 --- a/Equipments/Drawworks/DWMalfunction_ClutchEngage.f90 +++ b/Equipments/Drawworks/DWMalfunction_ClutchEngage.f90 @@ -17,11 +17,11 @@ subroutine DWMalfunction_ClutchEngage Drawworks%SoundClutch = .false. Call SetSoundDwClutch(Drawworks%SoundClutch) end if - if ( DW_OldClutchMode/=0 .and. DWClutchLever==0 ) then + if ( DW_OldClutchMode/=0 .and. DrillingConsole%DWClutchLever==0 ) then Drawworks%SoundClutch = .true. Call SetSoundDwClutch(Drawworks%SoundClutch) end if - DW_OldClutchMode = DWClutchLever + DW_OldClutchMode = DrillingConsole%DWClutchLever @@ -46,7 +46,7 @@ subroutine DWMalfunction_ClutchEngage end if - Drawworks%ClutchMode = DWClutchLever + Drawworks%ClutchMode = DrillingConsole%DWClutchLever diff --git a/Equipments/Drawworks/DrawworksMain.f90 b/Equipments/Drawworks/DrawworksMain.f90 index bdf0b49..ebf4592 100644 --- a/Equipments/Drawworks/DrawworksMain.f90 +++ b/Equipments/Drawworks/DrawworksMain.f90 @@ -52,14 +52,14 @@ module DrawworksMain if (IsPortable) then Drawworks%AssignmentSwitch = 1 else - Drawworks%AssignmentSwitch = AssignmentSwitch + Drawworks%AssignmentSwitch = DrillingConsole%AssignmentSwitch end if - if((any(Drawworks%AssignmentSwitch==(/1,2,3,4,5,7,8,9,10,11/))) .and. (DWSwitch==-1) .and. (DWThrottle==0.)) then + if((any(Drawworks%AssignmentSwitch==(/1,2,3,4,5,7,8,9,10,11/))) .and. (DrillingConsole%DWSwitch==-1) .and. (DrillingConsole%DWThrottle==0.)) then Drawworks%SoundBlower = .true. Call SetSoundBlowerDW(Drawworks%SoundBlower) - DWBLWR = 1 + DrillingConsole%DWBLWR = 1 loopDrawworks1 : do @@ -67,7 +67,7 @@ module DrawworksMain if (IsPortable) then Drawworks%AssignmentSwitch = 1 else - Drawworks%AssignmentSwitch = AssignmentSwitch + Drawworks%AssignmentSwitch = DrillingConsole%AssignmentSwitch end if if(any(Drawworks%AssignmentSwitch==(/1,2,5,7,8,9,10,11/))) then Drawworks%NumberOfTracMotor = 2.0d0 @@ -90,17 +90,17 @@ module DrawworksMain Call SetSoundDwRev( Drawworks%SoundRev ) Call DWBrakeSound end if - DW_OldTransMode = DWTransmisionLever + DW_OldTransMode = DrillingConsole%DWTransmisionLever if (IsPortable) then Drawworks%AssignmentSwitch = 1 else - Drawworks%AssignmentSwitch = AssignmentSwitch + Drawworks%AssignmentSwitch = DrillingConsole%AssignmentSwitch end if - if ((any(Drawworks%AssignmentSwitch==(/6,12/))) .or. (any(DWSwitch==(/0,1/))) .or. (IsStopped == .true.)) then + if ((any(Drawworks%AssignmentSwitch==(/6,12/))) .or. (any(DrillingConsole%DWSwitch==(/0,1/))) .or. (IsStopped == .true.)) then Drawworks%SoundBlower = .false. Call SetSoundBlowerDW(Drawworks%SoundBlower) - DWBLWR = 0 + DrillingConsole%DWBLWR = 0 !Call Drawworks_Solver_FreeTractionMotor exit loopDrawworks1 end if @@ -120,16 +120,16 @@ module DrawworksMain if (IsPortable) then Drawworks%AssignmentSwitch = 1 else - Drawworks%AssignmentSwitch = AssignmentSwitch + Drawworks%AssignmentSwitch = DrillingConsole%AssignmentSwitch end if - if((any(Drawworks%AssignmentSwitch==(/1,2,3,4,5,7,8,9,10,11/))) .and. (DWSwitch==-1)) then + if((any(Drawworks%AssignmentSwitch==(/1,2,3,4,5,7,8,9,10,11/))) .and. (DrillingConsole%DWSwitch==-1)) then Drawworks%SoundBlower = .true. Call SetSoundBlowerDW(Drawworks%SoundBlower) - DWBLWR = 1 + DrillingConsole%DWBLWR = 1 else Drawworks%SoundBlower = .false. Call SetSoundBlowerDW(Drawworks%SoundBlower) - DWBLWR = 0 + DrillingConsole%DWBLWR = 0 end if Call Drawworks_Solver_FreeTractionMotor @@ -147,7 +147,7 @@ module DrawworksMain Call SetSoundDwRev( Drawworks%SoundRev ) Call DWBrakeSound end if - DW_OldTransMode = DWTransmisionLever + DW_OldTransMode = DrillingConsole%DWTransmisionLever end if diff --git a/Equipments/Drawworks/Drawworks_INPUTS.f90 b/Equipments/Drawworks/Drawworks_INPUTS.f90 index 2f82d70..812c1c3 100644 --- a/Equipments/Drawworks/Drawworks_INPUTS.f90 +++ b/Equipments/Drawworks/Drawworks_INPUTS.f90 @@ -27,12 +27,12 @@ subroutine Drawworks_INPUTS - Drawworks%TransMode = DWTransmisionLever - Drawworks%Direction_Var = DWSwitch + Drawworks%TransMode = DrillingConsole%DWTransmisionLever + Drawworks%Direction_Var = DrillingConsole%DWSwitch if (IsPortable) then - if (Drawworks%Direction_Var==-1 .and. Clutch==1) then !in FWD mode + if (Drawworks%Direction_Var==-1 .and. DataDisplayConsole%Clutch==1) then !in FWD mode Drawworks%Conv_Ratio = Drawworks%FWD_Conv_Ratio(Drawworks%ClutchMode,Drawworks%TransMode) else Drawworks%Conv_Ratio = 1.d0 @@ -50,26 +50,26 @@ subroutine Drawworks_INPUTS !===> Main Brake and Eddy Brake - Drawworks%EddyBreak = EddyBreakLever*0.5 !0 Brake Load (Main Brake) - Drawworks%BreakLoad = DrillingLineBreakingLoad ![Lbf] + Drawworks%BreakLoad = Hoisting%DrillingLineBreakingLoad ![Lbf] Drawworks%BreakLoad = 4.448221619*Drawworks%BreakLoad ![N] @@ -81,7 +81,7 @@ subroutine Drawworks_INPUTS !===> min&max Hook Height - if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL ) then + if ( Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL ) then if ( Get_Swing()==SWING_WELL_END .and. Get_KellyConnection()==KELLY_CONNECTION_NOTHING ) then DW_DrillModeCond = 1 Drawworks%min_Hook_Height = TD_TopJointHeight+HKL-RE ![ft] HKL=63.76=Kelly Ass. Height , RE=Release @@ -107,7 +107,7 @@ subroutine Drawworks_INPUTS Drawworks%min_Hook_Height = 66.d0-RE ![ft] Drawworks%max_Hook_Height = 120.d0 ![ft] end if - else if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_TRIP ) then + else if ( Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_TRIP ) then if ( Get_Swing()==SWING_WELL_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING ) then DW_DrillModeCond = 7 Drawworks%min_Hook_Height = 18.38d0 ![ft] @@ -153,7 +153,7 @@ subroutine Drawworks_INPUTS Drawworks%min_Hook_Height = 18.38d0 !????????????????? ![ft] Drawworks%max_Hook_Height = 140.d0 ![ft] end if - else if ( DriveType==0 ) then + else if ( Hoisting%DriveType==0 ) then if ( Get_TdsSwing()==TDS_SWING_TILT_END ) then if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_LATCH_SINGLE ) then DW_DrillModeCond = 15 @@ -215,12 +215,12 @@ subroutine Drawworks_INPUTS !===> SLIPS SET , No Motion - if ( DriveType==1 .and. Get_Slips() == SLIPS_SET_END .and. Get_KellyConnection() == KELLY_CONNECTION_STRING ) then + if ( Hoisting%DriveType==1 .and. Get_Slips() == SLIPS_SET_END .and. Get_KellyConnection() == KELLY_CONNECTION_STRING ) then Drawworks%ManualBreak = 100.d0 Drawworks%N_ref = 0.d0 end if - if ( DriveType==0 .and. Get_Slips() == SLIPS_SET_END .and. (Get_TdsConnectionModes()==TDS_CONNECTION_SPINE .or. Get_TdsConnectionModes()==TDS_CONNECTION_STRING) ) then + if ( Hoisting%DriveType==0 .and. Get_Slips() == SLIPS_SET_END .and. (Get_TdsConnectionModes()==TDS_CONNECTION_SPINE .or. Get_TdsConnectionModes()==TDS_CONNECTION_STRING) ) then Drawworks%ManualBreak = 100.d0 Drawworks%N_ref = 0.d0 end if diff --git a/Equipments/Drawworks/Drawworks_Solver.f90 b/Equipments/Drawworks/Drawworks_Solver.f90 index f1d2482..021241c 100644 --- a/Equipments/Drawworks/Drawworks_Solver.f90 +++ b/Equipments/Drawworks/Drawworks_Solver.f90 @@ -31,8 +31,8 @@ subroutine Drawworks_Solver !>>>>>>>>>>>>>>>>>>>> N_Ref <<<<<<<<<<<<<<<<<<<<<<<< - Drawworks%N_Throtle = DWThrottle ![rpm] - Drawworks%N_Accelarator = (DWAcceleretor/100.0)*965.0 ![rpm] + Drawworks%N_Throtle = DrillingConsole%DWThrottle ![rpm] + Drawworks%N_Accelarator = (DrillingConsole%DWAcceleretor/100.0)*965.0 ![rpm] !print* , 'Drawworks%N_Throtle=' , Drawworks%N_Throtle !print* , 'DWAcceleretor=' , DWAcceleretor !print* , 'Drawworks%N_Accelarator=' , Drawworks%N_Accelarator @@ -242,14 +242,14 @@ subroutine Drawworks_Solver !==================================================== ! ELEVATOR CONNECTION STRING (SLIPS SET , No Motion) !==================================================== - if ( DriveType==1 .and. Get_Slips() == SLIPS_SET_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and. Drawworks%motion/=-1 ) then + if ( Hoisting%DriveType==1 .and. Get_Slips() == SLIPS_SET_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and. Drawworks%motion/=-1 ) then !if ( Drawworks%motion/=-1 ) then Call DWFixModeMotion return !end if end if - if ( DriveType==0 .and. Get_Slips() == SLIPS_SET_END .and. (Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_STRING) .and. Drawworks%motion/=-1 ) then + if ( Hoisting%DriveType==0 .and. Get_Slips() == SLIPS_SET_END .and. (Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_STRING) .and. Drawworks%motion/=-1 ) then !if ( Drawworks%motion/=-1 ) then Call DWFixModeMotion return @@ -317,7 +317,7 @@ subroutine Drawworks_Solver !==================================================== ! TopDrive (TdsStemIn) !==================================================== - if ( (DriveType==0) .and. (Get_TdsStemIn()) .and. Get_Slips() == SLIPS_SET_END ) then + if ( (Hoisting%DriveType==0) .and. (Get_TdsStemIn()) .and. Get_Slips() == SLIPS_SET_END ) then if ( Drawworks%motion==1 ) then Drawworks%Hook_Height_final = 3.280839895*Drawworks%Hook_Height ![ft] Call Set_HookHeight(real(Drawworks%Hook_Height_final)) diff --git a/Equipments/Drawworks/Drawworks_Solver_FreeTractionMotor.f90 b/Equipments/Drawworks/Drawworks_Solver_FreeTractionMotor.f90 index 11ba187..525a1bd 100644 --- a/Equipments/Drawworks/Drawworks_Solver_FreeTractionMotor.f90 +++ b/Equipments/Drawworks/Drawworks_Solver_FreeTractionMotor.f90 @@ -205,14 +205,14 @@ subroutine Drawworks_Solver_FreeTractionMotor !==================================================== ! ELEVATOR CONNECTION STRING (SLIPS SET , No Motion) !==================================================== - if ( DriveType==1 .and. Get_Slips() == SLIPS_SET_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and. Drawworks%motion/=-1 ) then + if ( Hoisting%DriveType==1 .and. Get_Slips() == SLIPS_SET_END .and. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and. Drawworks%motion/=-1 ) then !if ( Drawworks%motion/=-1 ) then Call DWFixModeMotion return !end if end if - if ( DriveType==0 .and. Get_Slips() == SLIPS_SET_END .and. (Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_STRING) .and. Drawworks%motion/=-1 ) then + if ( Hoisting%DriveType==0 .and. Get_Slips() == SLIPS_SET_END .and. (Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_STRING) .and. Drawworks%motion/=-1 ) then !if ( Drawworks%motion/=-1 ) then Call DWFixModeMotion return @@ -278,7 +278,7 @@ subroutine Drawworks_Solver_FreeTractionMotor !==================================================== ! TopDrive (TdsStemIn) !==================================================== - if ( (DriveType==0) .and. (Get_TdsStemIn()) .and. Get_Slips() == SLIPS_SET_END ) then + if ( (Hoisting%DriveType==0) .and. (Get_TdsStemIn()) .and. Get_Slips() == SLIPS_SET_END ) then if ( Drawworks%motion==1 ) then Drawworks%Hook_Height_final = 3.280839895*Drawworks%Hook_Height ![ft] Call Set_HookHeight(real(Drawworks%Hook_Height_final)) diff --git a/Equipments/Drawworks/Drawworks_StartUp.f90 b/Equipments/Drawworks/Drawworks_StartUp.f90 index 30714d7..524c8ff 100644 --- a/Equipments/Drawworks/Drawworks_StartUp.f90 +++ b/Equipments/Drawworks/Drawworks_StartUp.f90 @@ -34,7 +34,7 @@ subroutine Drawworks_StartUp !===> Number of Line - Drawworks%NumberOfLine = NumberOfLine + Drawworks%NumberOfLine = Hoisting%NumberOfLine @@ -74,8 +74,8 @@ subroutine Drawworks_StartUp Drawworks%FWD_Conv_Ratio(-1,1) = 1.0d0/.110 Drawworks%FWD_Conv_Ratio(-1,-1) = 1.0d0/.0630 - DW_OldTransMode = DWTransmisionLever - DW_OldClutchMode = DWClutchLever + DW_OldTransMode = DrillingConsole%DWTransmisionLever + DW_OldClutchMode = DrillingConsole%DWClutchLever diff --git a/Equipments/DrillingConsole_ScrLEDs.f90 b/Equipments/DrillingConsole_ScrLEDs.f90 index dce188e..c26465b 100644 --- a/Equipments/DrillingConsole_ScrLEDs.f90 +++ b/Equipments/DrillingConsole_ScrLEDs.f90 @@ -8,38 +8,38 @@ subroutine DrillingConsole_ScrLEDs !===> Torque Limit - RTTorqueLimitGauge = sngl(1-RTable%TorqueLimitGaugeMalf)*(RTTorqueLimitKnob/10.d0)*7000.d0 !tabdile bazeye 0-10 be 0-7000 taghribi anjam shode, baadan eslah shavad ?????? + DrillingConsole%RTTorqueLimitGauge = sngl(1-RTable%TorqueLimitGaugeMalf)*(DrillingConsole%RTTorqueLimitKnob/10.d0)*7000.d0 !tabdile bazeye 0-10 be 0-7000 taghribi anjam shode, baadan eslah shavad ?????? - if((any(AssignmentSwitch==(/1,2,3,4,8,9,10,11/)))) then + if((any(DrillingConsole%AssignmentSwitch==(/1,2,3,4,8,9,10,11/)))) then - SCR1LED=1 - SCR2LED=1 - SCR3LED=1 - SCR4LED=1 + DrillingConsole%SCR1LED=1 + DrillingConsole%SCR2LED=1 + DrillingConsole%SCR3LED=1 + DrillingConsole%SCR4LED=1 - else if (AssignmentSwitch == 5) then + else if (DrillingConsole%AssignmentSwitch == 5) then - SCR1LED=1 - SCR2LED=1 - SCR3LED=0 - SCR4LED=1 + DrillingConsole%SCR1LED=1 + DrillingConsole%SCR2LED=1 + DrillingConsole%SCR3LED=0 + DrillingConsole%SCR4LED=1 - else if (AssignmentSwitch == 7) then + else if (DrillingConsole%AssignmentSwitch == 7) then - SCR1LED=1 - SCR2LED=1 - SCR3LED=1 - SCR4LED=0 + DrillingConsole%SCR1LED=1 + DrillingConsole%SCR2LED=1 + DrillingConsole%SCR3LED=1 + DrillingConsole%SCR4LED=0 else - SCR1LED=0 - SCR2LED=0 - SCR3LED=0 - SCR4LED=0 + DrillingConsole%SCR1LED=0 + DrillingConsole%SCR2LED=0 + DrillingConsole%SCR3LED=0 + DrillingConsole%SCR4LED=0 end if diff --git a/Equipments/MudSystem/Disconnecting_Pipe.f90 b/Equipments/MudSystem/Disconnecting_Pipe.f90 index 5bf5661..7ee6371 100644 --- a/Equipments/MudSystem/Disconnecting_Pipe.f90 +++ b/Equipments/MudSystem/Disconnecting_Pipe.f90 @@ -3,9 +3,9 @@ subroutine DisconnectingPipe ! is called in subroutine CirculationCodeSelect Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES use CDrillWatchVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + ! !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables Use KickVariables @@ -26,11 +26,11 @@ subroutine DisconnectingPipe ! is called in subroutine CirculationCodeSelect ! ======if(ExcessMudVolume <= 0.) No Modification Needed Because Removed Pipe was Empty===== - if (Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and. Valve(56)%Status == .False.) ExcessMudVolume= 0.d0 !Valve(56)%Status == .False. :: safety valve installed + if (Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and. Manifold%Valve(56)%Status == .False.) ExcessMudVolume= 0.d0 !Valve(56)%Status == .False. :: safety valve installed if (ExcessMudVolume > 0.) then - if ( Valve(53)%Status == .true. ) then + if ( Manifold%Valve(53)%Status == .true. ) then MudBucketVolume= ExcessMudVolume else MudBucketVolume= 0.0 diff --git a/Equipments/MudSystem/Elements_Creation.f90 b/Equipments/MudSystem/Elements_Creation.f90 index 316e127..000de73 100644 --- a/Equipments/MudSystem/Elements_Creation.f90 +++ b/Equipments/MudSystem/Elements_Creation.f90 @@ -3,14 +3,14 @@ subroutine ElementsCreation ! is called in subroutine Fluid_Flow_Solver Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES !USE CHOKEVARIABLES !USE CDataDisplayConsoleVariables , StandPipePressureDataDisplay=>StandPipePressure !use CManifolds use CDrillWatchVariables !use CHOKEVARIABLES !use CChokeManifoldVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + ! !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables Use KickVariables @@ -133,7 +133,7 @@ ALLOCATE (Xstart_OpSection(F_BottomHoleIntervalCounts),Xend_OpSection(F_BottomHo call Hz_Mud_Backhead_section%AddToFirst (1) call Hz_Mud_Forehead_X%AddToFirst (Xend_PipeSection(1)) call Hz_Mud_Forehead_section%AddToFirst (1) - call Hz_Density%AddToFirst (ActiveDensity) ! initial(ppg) + call Hz_Density%AddToFirst (MudProperties%ActiveDensity) ! initial(ppg) call Hz_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call Hz_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call Hz_MudOrKick%AddToFirst (0) @@ -144,7 +144,7 @@ ALLOCATE (Xstart_OpSection(F_BottomHoleIntervalCounts),Xend_OpSection(F_BottomHo call St_Mud_Backhead_section%AddToFirst (2) call St_Mud_Forehead_X%AddToFirst (Xend_PipeSection(F_StringIntervalCounts)) call St_Mud_Forehead_section%AddToFirst (F_StringIntervalCounts) - call St_Density%AddToFirst (ActiveDensity) ! initial(ppg) + call St_Density%AddToFirst (MudProperties%ActiveDensity) ! initial(ppg) call St_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call St_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call St_MudOrKick%AddToFirst (0) @@ -155,7 +155,7 @@ ALLOCATE (Xstart_OpSection(F_BottomHoleIntervalCounts),Xend_OpSection(F_BottomHo call Ann_Mud_Backhead_section%AddToFirst (F_StringIntervalCounts+1) call Ann_Mud_Forehead_X%AddToFirst (Xend_PipeSection(NoPipeSections)) call Ann_Mud_Forehead_section%AddToFirst (NoPipeSections) - call Ann_Density%AddToFirst (ActiveDensity) ! initial(ppg) + call Ann_Density%AddToFirst (MudProperties%ActiveDensity) ! initial(ppg) call Ann_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call Ann_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call Ann_MudOrKick%AddToFirst (0) @@ -169,9 +169,9 @@ ALLOCATE (Xstart_OpSection(F_BottomHoleIntervalCounts),Xend_OpSection(F_BottomHo call ChokeLine_MudDischarged_Volume%AddToFirst(ChokeLine_VolumeCapacity) call ChokeLine_Mud_Backhead_X%AddToFirst (0.0d0) call ChokeLine_Mud_Backhead_section%AddToFirst (1) - call ChokeLine_Mud_Forehead_X%AddToFirst (ChokeLineLength) + call ChokeLine_Mud_Forehead_X%AddToFirst (BopStackSpecification%ChokeLineLength) call ChokeLine_Mud_Forehead_section%AddToFirst (1) - call ChokeLine_Density%AddToFirst (ActiveDensity) ! initial(ppg) + call ChokeLine_Density%AddToFirst (MudProperties%ActiveDensity) ! initial(ppg) call ChokeLine_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call ChokeLine_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call ChokeLine_MudOrKick%AddToFirst (0) @@ -182,7 +182,7 @@ ALLOCATE (Xstart_OpSection(F_BottomHoleIntervalCounts),Xend_OpSection(F_BottomHo call Op_Mud_Backhead_section%AddToFirst (1) call Op_Mud_Forehead_X%AddToFirst (Xend_OpSection(F_BottomHoleIntervalCounts)) call Op_Mud_Forehead_section%AddToFirst (F_BottomHoleIntervalCounts) - call Op_Density%AddToFirst (ActiveDensity) + call Op_Density%AddToFirst (MudProperties%ActiveDensity) call Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call Op_MudOrKick%AddToFirst (0) diff --git a/Equipments/MudSystem/FillingWell_By_BellNipple.f90 b/Equipments/MudSystem/FillingWell_By_BellNipple.f90 index cfa5af7..77f5cee 100644 --- a/Equipments/MudSystem/FillingWell_By_BellNipple.f90 +++ b/Equipments/MudSystem/FillingWell_By_BellNipple.f90 @@ -6,9 +6,9 @@ subroutine FillingWell_By_BellNipple ! is called in subroutine CirculationCo Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES use CDrillWatchVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables Use KickVariables diff --git a/Equipments/MudSystem/Kick_Expansion_and_Contraction.f90 b/Equipments/MudSystem/Kick_Expansion_and_Contraction.f90 index 277aa6f..1166d23 100644 --- a/Equipments/MudSystem/Kick_Expansion_and_Contraction.f90 +++ b/Equipments/MudSystem/Kick_Expansion_and_Contraction.f90 @@ -3,9 +3,9 @@ subroutine Kick_Expansion ! is called in subroutine CirculationCodeSelect Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES use CDrillWatchVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables USE CReservoirVariables @@ -127,9 +127,9 @@ subroutine Kick_Contraction ! is called in subroutine CirculationCodeSelect Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES use CDrillWatchVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables USE CReservoirVariables @@ -151,7 +151,7 @@ subroutine Kick_Contraction ! is called in subroutine CirculationCodeSelect !********************************************************* !write(*,*) 'Kick Contraction' - !MUD(2)%Q= Total_Pump_Gpm + !MUD(2)%Q= total_pumps%Total_Pump_GPM StringFlowRate= MUD(2)%Q AnnulusFlowRate= MUD(2)%Q diff --git a/Equipments/MudSystem/Kick_Influx.f90 b/Equipments/MudSystem/Kick_Influx.f90 index c29d54a..ee0ea03 100644 --- a/Equipments/MudSystem/Kick_Influx.f90 +++ b/Equipments/MudSystem/Kick_Influx.f90 @@ -3,9 +3,9 @@ subroutine Kick_Influx ! is called in subroutine CirculationCodeSelect Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES use CDrillWatchVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables Use KickVariables @@ -147,7 +147,7 @@ subroutine ShoeLostSub ! is called in subroutine CirculationCodeSelect UGBOSuccessionCounter = UGBOSuccessionCounter + 1 !write(*,*) 'check point 1' - if (InactiveFracture == .FALSE. .AND. ((ShoeMudPressure >= FormationLostPressure) .or. ShoeFractured )) then + if (Shoe%InactiveFracture == .FALSE. .AND. ((ShoeMudPressure >= FormationLostPressure) .or. ShoeFractured )) then !write(*,*) 'check point 2 ,UGBOSuccessionCounter' , UGBOSuccessionCounter ! if ShoeFractured changed to true , then time counter is not needed more @@ -187,7 +187,7 @@ subroutine ShoeLostSub ! is called in subroutine CirculationCodeSelect do imud= 1, Ann_Mud_Forehead_X%Length() - IF ( ShoeLost .and. ShoeDepth < Ann_Mud_Backhead_X%Array(imud) .and. ShoeDepth >= Ann_Mud_Forehead_X%Array(imud) & + IF ( ShoeLost .and. Shoe%ShoeDepth < Ann_Mud_Backhead_X%Array(imud) .and. Shoe%ShoeDepth >= Ann_Mud_Forehead_X%Array(imud) & .and. Ann_MudOrKick%Array(imud) == 0 .and. WellHeadIsOpen == .FALSE. ) then Kickexpansion_DueToMudLost= .true. diff --git a/Equipments/MudSystem/Kick_Migration.f90 b/Equipments/MudSystem/Kick_Migration.f90 index 377589d..f8d9040 100644 --- a/Equipments/MudSystem/Kick_Migration.f90 +++ b/Equipments/MudSystem/Kick_Migration.f90 @@ -3,9 +3,9 @@ subroutine Kick_Migration ! is called in subroutine CirculationCodeSelect Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES use CDrillWatchVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables USE CReservoirVariables @@ -18,7 +18,7 @@ subroutine Kick_Migration ! is called in subroutine CirculationCodeSelect integer jopelement,jopmud,jopsection,CuttingValue - !MUD(2)%Q= Total_Pump_Gpm + !MUD(2)%Q= total_pumps%Total_Pump_GPM !StringFlowRate= MUD(2)%Q !AnnulusFlowRate= MUD(2)%Q ! diff --git a/Equipments/MudSystem/MudSystem.f90 b/Equipments/MudSystem/MudSystem.f90 index ba554ae..e67a34f 100644 --- a/Equipments/MudSystem/MudSystem.f90 +++ b/Equipments/MudSystem/MudSystem.f90 @@ -317,9 +317,9 @@ module MudSystem write(*,*) 'MudVolume_InjectedFromAnn-WellToBellNipple=' , MudVolume_InjectedFromAnn - write(*,*) 'int:::=' , (Ann_Mud_Forehead_X%Last() - AboveAnnularHeight) + write(*,*) 'int:::=' , (Ann_Mud_Forehead_X%Last() - BopStackSpecification%AboveAnnularHeight) write(*,*) 'Ann_Mud_Forehead_X%Last()=' , Ann_Mud_Forehead_X%Last() - write(*,*) 'AboveAnnularHeight=' , AboveAnnularHeight + write(*,*) 'AboveAnnularHeight=' , BopStackSpecification%AboveAnnularHeight write(*,*) 'Ann_Density%Last()=' , Ann_Density%Last() CALL ErrorStop('error stop1') @@ -624,13 +624,13 @@ module MudSystem subroutine main Use GeoElements_FluidModule - USE Pump_VARIABLES + USE Pumps_VARIABLES USE CHOKEVARIABLES - USE CDataDisplayConsoleVariables , StandPipePressureDataDisplay=>StandPipePressure - use CDrillWatchVariables , MudWeightIn2 => MudWeightIn, MudWeightOut2 => MudWeightOut, PumpPressureDW => PumpPressure + USE CDataDisplayConsoleVariables + use CDrillWatchVariables use CHOKEVARIABLES use CChokeManifoldVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + use CTanksVariables, TripTankVolume2 => Tank%TripTankVolume, TripTankDensity2 => Tank%TripTankDensity Use KickVariables Use CHoistingVariables @@ -641,7 +641,7 @@ module MudSystem MudSys_timeCounter = MudSys_timeCounter + 1 - if (ChokePanelStrokeResetSwitch == 1) then + if (ChokeControlPanel%ChokePanelStrokeResetSwitch == 1) then MudSys_timeCounter= 0 endif @@ -656,9 +656,9 @@ module MudSystem - if (MudPump1ReliefValveIsSet==.false.) MudPump1ReliefValvePressure=6000. - if (MudPump2ReliefValveIsSet==.false.) MudPump2ReliefValvePressure=6000. - if (CementPumpReliefValveIsSet==.false.) CementPumpReliefValvePressure=6000. + if (PumpsSpecification%MudPump1ReliefValveIsSet==.false.) PumpsSpecification%MudPump1ReliefValvePressure=6000. + if (PumpsSpecification%MudPump2ReliefValveIsSet==.false.) PumpsSpecification%MudPump2ReliefValvePressure=6000. + if (PumpsSpecification%CementPumpReliefValveIsSet==.false.) PumpsSpecification%CementPumpReliefValvePressure=6000. @@ -728,7 +728,7 @@ module MudSystem endif - ActiveTankVolume=min(ActiveTankVolume , ActiveTotalTankCapacityGal-ActiveSettledContentsGal) + ActiveTankVolume=min(ActiveTankVolume , MudProperties%ActiveTotalTankCapacityGal-MudProperties%ActiveSettledContentsGal) !if ActiveTankVolume is higher, excess amount is dumped endif @@ -757,12 +757,12 @@ module MudSystem PumpsDumpFlowRate= jj2*(1-H82)*DumpPump1*PUMP(1)%Flow_Rate + jj12*(1-H83)*DumpPump2*PUMP(2)%Flow_Rate + jj13*(1-H84)*DumpCementPump*PUMP(3)%Flow_Rate !write(*,*) 'PumpsDumpFlowRate=' , PumpsDumpFlowRate - if (DriveType==1 .and. PumpsDumpFlowRate > 0.0 .and. (DumpFromKelly_Pump1 .or. DumpFromKelly_Pump2 .or. DumpFromKelly_Pump3)) then + if (Hoisting%DriveType==1 .and. PumpsDumpFlowRate > 0.0 .and. (DumpFromKelly_Pump1 .or. DumpFromKelly_Pump2 .or. DumpFromKelly_Pump3)) then !write(*,*) 'Set_FlowFromKelly(.TRUE.)' call Activate_PumpWithKellyDisconnected() !write(*,*) 'PumpsDumpFlowRate=' , PumpsDumpFlowRate CALL Set_FlowFromKelly(min(PumpsDumpFlowRate/6.,100.)) ! .TRUE. before - elseif (DriveType==1) then + elseif (Hoisting%DriveType==1) then call Deactivate_PumpWithKellyDisconnected() CALL Set_FlowFromKelly(0.0) ! .FALSE. before !write(*,*) 'Set_FlowFromKelly(.FALSE.)' @@ -771,11 +771,11 @@ module MudSystem !write(*,*) 'DumpFromFillupHead_Pump1=' , DumpFromFillupHead_Pump1 - if (DriveType==0 .and. PumpsDumpFlowRate > 0.0 .and. (DumpFromTopDrive_Pump1 .or. DumpFromTopDrive_Pump2 .or. DumpFromTopDrive_Pump3)) then + if (Hoisting%DriveType==0 .and. PumpsDumpFlowRate > 0.0 .and. (DumpFromTopDrive_Pump1 .or. DumpFromTopDrive_Pump2 .or. DumpFromTopDrive_Pump3)) then !write(*,*) 'Set_FlowFromKelly(.TRUE.)' call Activate_PumpWithTopdriveDisconnected() CALL Set_FlowFromKelly(min(PumpsDumpFlowRate/6.,100.)) ! .TRUE. before - elseif (DriveType==0) then + elseif (Hoisting%DriveType==0) then call Deactivate_PumpWithTopdriveDisconnected() CALL Set_FlowFromKelly(0.0) ! .FALSE. before !write(*,*) 'Set_FlowFromKelly(.FALSE.)' @@ -805,21 +805,21 @@ module MudSystem ! ****** Calculating Maximum Working Pressure - if (MudPump1ReliefValveIsSet) then - MaxWorkingPressure1= MudPump1ReliefValvePressure + if (PumpsSpecification%MudPump1ReliefValveIsSet) then + MaxWorkingPressure1= PumpsSpecification%MudPump1ReliefValvePressure else MaxWorkingPressure1= 6000. !psi endif - if (MudPump2ReliefValveIsSet) then - MaxWorkingPressure2= MudPump2ReliefValvePressure + if (PumpsSpecification%MudPump2ReliefValveIsSet) then + MaxWorkingPressure2= PumpsSpecification%MudPump2ReliefValvePressure else MaxWorkingPressure2= 6000. !psi endif - if (CementPumpReliefValveIsSet) then - MaxWorkingPressure3= CementPumpReliefValveIsSet + if (PumpsSpecification%CementPumpReliefValveIsSet) then + MaxWorkingPressure3= PumpsSpecification%CementPumpReliefValveIsSet else MaxWorkingPressure3= 6000. !psi endif @@ -889,16 +889,16 @@ module MudSystem PumpPressure1= PumpToManifoldCompressedMudVol / (MudCompressibility * PumpToManifoldMudVol) write(*,*) '21)PumpPressure1=' , PumpPressure1 - WRITE (*,*) ' valve 1 ', Valve(1)%Status - WRITE (*,*) ' valve 4 ', Valve(4)%Status - WRITE (*,*) ' valve 6 ', Valve(6)%Status - WRITE (*,*) ' valve 7 ', Valve(7)%Status - WRITE (*,*) ' valve 8 ', Valve(8)%Status - WRITE (*,*) ' valve 9 ', Valve(9)%Status - WRITE (*,*) ' valve 13 ', Valve(13)%Status - WRITE (*,*) ' valve 68 ', Valve(68)%Status - WRITE (*,*) ' valve 69 ', Valve(69)%Status - WRITE (*,*) ' valve 48 ', Valve(48)%Status + WRITE (*,*) ' valve 1 ', Manifold%Valve(1)%Status + WRITE (*,*) ' valve 4 ', Manifold%Valve(4)%Status + WRITE (*,*) ' valve 6 ', Manifold%Valve(6)%Status + WRITE (*,*) ' valve 7 ', Manifold%Valve(7)%Status + WRITE (*,*) ' valve 8 ', Manifold%Valve(8)%Status + WRITE (*,*) ' valve 9 ', Manifold%Valve(9)%Status + WRITE (*,*) ' valve 13 ', Manifold%Valve(13)%Status + WRITE (*,*) ' valve 68 ', Manifold%Valve(68)%Status + WRITE (*,*) ' valve 69 ', Manifold%Valve(69)%Status + WRITE (*,*) ' valve 48 ', Manifold%Valve(48)%Status !call DisplayOpenPathsWrite() @@ -909,16 +909,16 @@ module MudSystem PumpPressure2= PumpToManifoldCompressedMudVol / (MudCompressibility * PumpToManifoldMudVol) write(*,*) '22)PumpPressure1=' , PumpPressure2 - WRITE (*,*) ' -valve 1 ', Valve(1)%Status - WRITE (*,*) ' -valve 4 ', Valve(4)%Status - WRITE (*,*) ' -valve 6 ', Valve(6)%Status - WRITE (*,*) ' -valve 7 ', Valve(7)%Status - WRITE (*,*) ' -valve 8 ', Valve(8)%Status - WRITE (*,*) ' -valve 9 ', Valve(9)%Status - WRITE (*,*) ' -valve 13 ', Valve(13)%Status - WRITE (*,*) ' -valve 68 ', Valve(68)%Status - WRITE (*,*) ' -valve 69 ', Valve(69)%Status - WRITE (*,*) ' -valve 48 ', Valve(48)%Status + WRITE (*,*) ' -valve 1 ', Manifold%Valve(1)%Status + WRITE (*,*) ' -valve 4 ', Manifold%Valve(4)%Status + WRITE (*,*) ' -valve 6 ', Manifold%Valve(6)%Status + WRITE (*,*) ' -valve 7 ', Manifold%Valve(7)%Status + WRITE (*,*) ' -valve 8 ', Manifold%Valve(8)%Status + WRITE (*,*) ' -valve 9 ', Manifold%Valve(9)%Status + WRITE (*,*) ' -valve 13 ', Manifold%Valve(13)%Status + WRITE (*,*) ' -valve 68 ', Manifold%Valve(68)%Status + WRITE (*,*) ' -valve 69 ', Manifold%Valve(69)%Status + WRITE (*,*) ' -valve 48 ', Manifold%Valve(48)%Status !call DisplayOpenPathsWrites() ENDIF @@ -946,7 +946,7 @@ module MudSystem ! Pump1BlownStarted = .TRUE. !endif !write(*,*) 'SimulationTime===', SimulationTime, Pump1BlownInTimeStep - if(MudPump1ReliefValveIsSet .and. Pump1BlownCount >= BlownThreshold) then + if(PumpsSpecification%MudPump1ReliefValveIsSet .and. Pump1BlownCount >= BlownThreshold) then write(*,*) 'valve 65 open, BLOWN' call ChangeValve(65, .TRUE.) PumpToManifoldCompressedMudVol= 0.0 @@ -978,7 +978,7 @@ module MudSystem ! Pump2BlownStarted = .TRUE. !endif !if (MudPump2ReliefValveIsSet .and. SimulationTime >= Pump2BlownInTimeStep .and. Pump2BlownStarted) then - if (MudPump2ReliefValveIsSet .and. Pump2BlownCount >= BlownThreshold) then + if (PumpsSpecification%MudPump2ReliefValveIsSet .and. Pump2BlownCount >= BlownThreshold) then write(*,*) 'valve 66 open, BLOWN' call ChangeValve(66, .TRUE.) PumpToManifoldCompressedMudVol= 0.0 @@ -998,7 +998,7 @@ module MudSystem if(PumpPressure3 >= MaxWorkingPressure3 .and. MP3_Q > 0.0 ) then Pump3BlownCount = Pump3BlownCount + 1 - if (CementPumpReliefValveIsSet .and. Pump3BlownCount >= BlownThreshold) then + if (PumpsSpecification%CementPumpReliefValveIsSet .and. Pump3BlownCount >= BlownThreshold) then !write(*,*) 'valve 67 open, BLOWN' call ChangeValve(67, .TRUE.) PumpToManifoldCompressedMudVol= 0.0 @@ -1068,7 +1068,7 @@ module MudSystem if (j4 > 0) then - BellNipple_FlowCoef= 13.625/(13.625+ChokeLineId) ! 13.625= BellNipple ID (inch) + BellNipple_FlowCoef= 13.625/(13.625+BopStackSpecification%ChokeLineId) ! 13.625= BellNipple ID (inch) MUD(7)%Q= BellNipple_FlowCoef * MUD(7)%Q endif @@ -1088,7 +1088,7 @@ module MudSystem sys_total_injected= sys_total_injected+ MudVolume_InjectedFromAnn - if (ChokePanelStrokeResetSwitch == 1) then + if (ChokeControlPanel%ChokePanelStrokeResetSwitch == 1) then sys_total_injected= 0. endif @@ -1198,7 +1198,7 @@ module MudSystem - ActiveTankVolume=min(ActiveTankVolume , ActiveTotalTankCapacityGal-ActiveSettledContentsGal) + ActiveTankVolume=min(ActiveTankVolume , MudProperties%ActiveTotalTankCapacityGal-MudProperties%ActiveSettledContentsGal) !if ActiveTankVolume is higher, excess amount is dumped endif @@ -1266,7 +1266,7 @@ module MudSystem MUD(3)%Q = min(MUD(3)%Q , PedalMeter) !write(*,*) 'MUD(3)%Q=' , MUD(3)%Q - IF (ActiveAutoDensity == .FALSE.) THEN + IF (MudProperties%ActiveAutoDensity == .FALSE.) THEN ActiveTankDensity= ((ActiveTankDensity*ActiveTankVolume)+(BellNippleDensity*(MUD(3)%Q/60.)*DeltaT_Mudline))/(ActiveTankVolume+((MUD(3)%Q/60.)*DeltaT_Mudline)) ActiveTankVolume= ActiveTankVolume+ ((MUD(3)%Q/60.)*DeltaT_Mudline) @@ -1274,17 +1274,17 @@ module MudSystem !write(*,*) 'active increase bell 1=' , ((MUD(3)%Q/60.)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. BellNippleDensity > ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. BellNippleDensity > ActiveTankDensity) THEN ActiveTankVolume= ActiveTankVolume+ ((20.8d0-BellNippleDensity)/(20.8d0-ActiveTankDensity))*((MUD(3)%Q/60.d0)*DeltaT_Mudline) ! asumed cutting density = 20.8 ppg !write(*,*) 'active increase bell 2=' , ((20.8d0-BellNippleDensity)/(20.8d0-ActiveTankDensity))*((MUD(3)%Q/60.d0)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. BellNippleDensity < 5.0) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. BellNippleDensity < 5.0) THEN ActiveTankVolume= ActiveTankVolume+ ((2.d0-BellNippleDensity)/(2.d0-ActiveTankDensity))*((MUD(3)%Q/60.d0)*DeltaT_Mudline) ! asumed GAS density = 2.0 ppg !write(*,*) 'active increase bell 3=' , ((2.d0-BellNippleDensity)/(2.d0-ActiveTankDensity))*((MUD(3)%Q/60.d0)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. 5.0 < BellNippleDensity .and. BellNippleDensity <= ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. 5.0 < BellNippleDensity .and. BellNippleDensity <= ActiveTankDensity) THEN !write(*,*) ' Auto true 3' @@ -1298,26 +1298,26 @@ module MudSystem MUD(3)%Q = min(MUD(3)%Q , PedalMeter) - IF (ActiveAutoDensity == .FALSE.) THEN + IF (MudProperties%ActiveAutoDensity == .FALSE.) THEN TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(BellNippleDensity*(MUD(3)%Q/60.)*DeltaT_Mudline))/(TripTankVolumeCalc+((MUD(3)%Q/60.)*DeltaT_Mudline)) TripTankVolumeCalc= TripTankVolumeCalc+ (MUD(3)%Q/60.)*DeltaT_Mudline - ELSEIF (ActiveAutoDensity .and. BellNippleDensity > ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. BellNippleDensity > ActiveTankDensity) THEN AddedVolumeToTank= ((20.8d0-BellNippleDensity)/(20.8d0-ActiveTankDensity))*((MUD(3)%Q/60.d0)*DeltaT_Mudline) TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ActiveTankDensity*AddedVolumeToTank))/(TripTankVolumeCalc+AddedVolumeToTank) TripTankVolumeCalc= TripTankVolumeCalc+ AddedVolumeToTank - ELSEIF (ActiveAutoDensity .and. BellNippleDensity < 5.0) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. BellNippleDensity < 5.0) THEN AddedVolumeToTank= ((2.d0-BellNippleDensity)/(2.d0-ActiveTankDensity))*((MUD(3)%Q/60.d0)*DeltaT_Mudline) ! asumed GAS density = 2.0 ppg TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ActiveTankDensity*AddedVolumeToTank))/(TripTankVolumeCalc+AddedVolumeToTank) TripTankVolumeCalc= TripTankVolumeCalc+ AddedVolumeToTank - ELSEIF (ActiveAutoDensity .and. 5.0 < BellNippleDensity .and. BellNippleDensity <= ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. 5.0 < BellNippleDensity .and. BellNippleDensity <= ActiveTankDensity) THEN AddedVolumeToTank= ((MUD(3)%Q/60.d0)*DeltaT_Mudline) TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ActiveTankDensity*AddedVolumeToTank))/(TripTankVolumeCalc+AddedVolumeToTank) @@ -1343,7 +1343,7 @@ module MudSystem MUD(3)%Q = min(MUD(3)%Q , PedalMeter) - IF (ActiveAutoDensity == .FALSE.) THEN + IF (MudProperties%ActiveAutoDensity == .FALSE.) THEN ActiveTankDensity= ((ActiveTankDensity*ActiveTankVolume)+(BellNippleDensity*(0.5*MUD(3)%Q/60.)*DeltaT_Mudline))/(ActiveTankVolume+((0.5*MUD(3)%Q/60.)*DeltaT_Mudline)) TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(BellNippleDensity*(0.5*MUD(3)%Q/60.)*DeltaT_Mudline))/(TripTankVolumeCalc+((0.5*MUD(3)%Q/60.)*DeltaT_Mudline)) @@ -1351,7 +1351,7 @@ module MudSystem ActiveTankVolume= ActiveTankVolume+ ((0.5*MUD(3)%Q/60.)*DeltaT_Mudline) TripTankVolumeCalc= TripTankVolumeCalc+ ((0.5*MUD(3)%Q/60.)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. BellNippleDensity > ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. BellNippleDensity > ActiveTankDensity) THEN AddedVolumeToTank= ((20.8d0-BellNippleDensity)/(20.8d0-ActiveTankDensity))*((0.5d0*MUD(3)%Q/60.d0)*DeltaT_Mudline) @@ -1360,7 +1360,7 @@ module MudSystem ActiveTankVolume= ActiveTankVolume+ AddedVolumeToTank TripTankVolumeCalc= TripTankVolumeCalc+ AddedVolumeToTank - ELSEIF (ActiveAutoDensity .and. 5.0 < ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. 5.0 < ActiveTankDensity) THEN AddedVolumeToTank= ((2.d0-BellNippleDensity)/(2.d0-ActiveTankDensity))*((0.5d0*MUD(3)%Q/60.d0)*DeltaT_Mudline) ! asumed GAS density = 2.0 ppg TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ActiveTankDensity*AddedVolumeToTank))/(TripTankVolumeCalc+AddedVolumeToTank) @@ -1368,7 +1368,7 @@ module MudSystem ActiveTankVolume= ActiveTankVolume+ AddedVolumeToTank TripTankVolumeCalc= TripTankVolumeCalc+ AddedVolumeToTank - ELSEIF (ActiveAutoDensity .and. 5.0 < BellNippleDensity .and. BellNippleDensity <= ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. 5.0 < BellNippleDensity .and. BellNippleDensity <= ActiveTankDensity) THEN AddedVolumeToTank= ((MUD(3)%Q/60.d0)*DeltaT_Mudline) TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ActiveTankDensity*AddedVolumeToTank))/(TripTankVolumeCalc+AddedVolumeToTank) @@ -1390,7 +1390,7 @@ module MudSystem total_active_increase= total_active_increase + active_increase - if (ChokePanelStrokeResetSwitch == 1) then + if (ChokeControlPanel%ChokePanelStrokeResetSwitch == 1) then total_active_increase= 0. endif @@ -1405,7 +1405,7 @@ module MudSystem TripTankVolumeCalc = min(TripTankVolumeCalc,50.*42.) !50. BBL *42. gal/BBL = gal !if TripTankVolumeCalc>50 BBl, excess value(TripTankVolumeCalc-50) is dumped - ActiveTankVolume = min(ActiveTankVolume , ActiveTotalTankCapacityGal - ActiveSettledContentsGal) + ActiveTankVolume = min(ActiveTankVolume , MudProperties%ActiveTotalTankCapacityGal - MudProperties%ActiveSettledContentsGal) !if ActiveTankVolume is higher, excess amount is dumped !write(*,*) 'BellNippleDensity=' , BellNippleDensity @@ -1483,7 +1483,7 @@ module MudSystem if (j9 > 0) then - ChokeLine_FlowCoef= ChokeLineId/(13.625+ChokeLineId) ! 13.625= BellNipple ID (inch) + ChokeLine_FlowCoef= BopStackSpecification%ChokeLineId/(13.625+BopStackSpecification%ChokeLineId) ! 13.625= BellNipple ID (inch) MUD(4)%Q= ChokeLine_FlowCoef * MUD(4)%Q endif @@ -1509,27 +1509,27 @@ module MudSystem ! IN ALL CONDITIONS EFFECT OF 78 IS COMPUTED BY RealJ4 if (C71==1 .and. C77==0) then !(volumes in galon) RealJ4: 1 OR 2(IF 78 IS OPEN) - IF (ActiveAutoDensity == .FALSE.) THEN + IF (MudProperties%ActiveAutoDensity == .FALSE.) THEN ActiveTankDensity= ((ActiveTankDensity*ActiveTankVolume)+(ChokeOutletDensity*((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline))/(ActiveTankVolume+(((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline)) ActiveTankVolume= ActiveTankVolume+ (((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline) !write(*,*) 'active increase choke1=' , (((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline) ChokeManifoldDumpVolume= ChokeManifoldDumpVolume+ C78*(((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. ChokeOutletDensity > ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. ChokeOutletDensity > ActiveTankDensity) THEN ActiveTankVolume= ActiveTankVolume+ ((20.8d0-ChokeOutletDensity)/(20.8d0-ActiveTankDensity))*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) ! asumed cutting density = 20.8 ppg ChokeManifoldDumpVolume= ChokeManifoldDumpVolume+ C78*(((1./RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) !write(*,*) 'active increase choke2=' , ((20.8d0-ChokeOutletDensity)/(20.8d0-ActiveTankDensity))*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. ChokeOutletDensity < 5.0) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. ChokeOutletDensity < 5.0) THEN ActiveTankVolume= ActiveTankVolume+ ((2.d0-ChokeOutletDensity)/(2.d0-ActiveTankDensity))*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) ! asumed GAS density = 2.0 ppg ChokeManifoldDumpVolume= ChokeManifoldDumpVolume+ C78*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) !write(*,*) 'active increase choke3=' ,((2.d0-ChokeOutletDensity)/(2.d0-ActiveTankDensity))*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. 5.0 < ChokeOutletDensity .and. ChokeOutletDensity <= ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. 5.0 < ChokeOutletDensity .and. ChokeOutletDensity <= ActiveTankDensity) THEN !write(*,*) ' Auto true 3' @@ -1546,13 +1546,13 @@ module MudSystem if (C77==1 .and. C71==0) then !RealJ4: 1 OR 2(IF 78 IS OPEN) - IF (ActiveAutoDensity == .FALSE.) THEN + IF (MudProperties%ActiveAutoDensity == .FALSE.) THEN TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ChokeOutletDensity*((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline))/(TripTankVolumeCalc+(((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline)) TripTankVolumeCalc= TripTankVolumeCalc+ (((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline) ChokeManifoldDumpVolume= ChokeManifoldDumpVolume+ C78*(((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. ChokeOutletDensity > ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. ChokeOutletDensity > ActiveTankDensity) THEN AddedVolumeToTank= ((20.8d0-ChokeOutletDensity)/(20.8d0-ActiveTankDensity))*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ActiveTankDensity*AddedVolumeToTank))/(TripTankVolumeCalc+AddedVolumeToTank) @@ -1562,7 +1562,7 @@ module MudSystem ChokeManifoldDumpVolume= ChokeManifoldDumpVolume+ C78*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. ChokeOutletDensity < 5.0) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. ChokeOutletDensity < 5.0) THEN AddedVolumeToTank= ((2.d0-ChokeOutletDensity)/(2.d0-ActiveTankDensity))*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) ! asumed GAS density = 2.0 ppg TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ActiveTankDensity*AddedVolumeToTank))/(TripTankVolumeCalc+AddedVolumeToTank) @@ -1571,7 +1571,7 @@ module MudSystem ChokeManifoldDumpVolume= ChokeManifoldDumpVolume+ C78*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. 5.0 < ChokeOutletDensity .and. ChokeOutletDensity <= ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. 5.0 < ChokeOutletDensity .and. ChokeOutletDensity <= ActiveTankDensity) THEN AddedVolumeToTank= (((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ActiveTankDensity*AddedVolumeToTank))/(TripTankVolumeCalc+AddedVolumeToTank) @@ -1588,7 +1588,7 @@ module MudSystem if (C71==1 .and. C77==1) then !RealJ4: 2 OR 3(IF 78 IS OPEN) - IF (ActiveAutoDensity == .FALSE.) THEN + IF (MudProperties%ActiveAutoDensity == .FALSE.) THEN ActiveTankDensity= ((ActiveTankDensity*ActiveTankVolume)+(ChokeOutletDensity*((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline))/(ActiveTankVolume+(((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline)) TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ChokeOutletDensity*((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline))/(TripTankVolumeCalc+(((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline)) @@ -1597,7 +1597,7 @@ module MudSystem ChokeManifoldDumpVolume= ChokeManifoldDumpVolume+ C78*(((1./RealJ4)*MUD(4)%Q/60.)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. ChokeOutletDensity > ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. ChokeOutletDensity > ActiveTankDensity) THEN AddedVolumeToTank= ((20.8d0-ChokeOutletDensity)/(20.8d0-ActiveTankDensity))*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) @@ -1608,7 +1608,7 @@ module MudSystem ChokeManifoldDumpVolume= ChokeManifoldDumpVolume+ C78*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. 5.0 < ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. 5.0 < ActiveTankDensity) THEN AddedVolumeToTank= ((2.d0-ChokeOutletDensity)/(2.d0-ActiveTankDensity))*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) ! asumed GAS density = 2.0 ppg TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ActiveTankDensity*AddedVolumeToTank))/(TripTankVolumeCalc+AddedVolumeToTank) @@ -1618,7 +1618,7 @@ module MudSystem ChokeManifoldDumpVolume= ChokeManifoldDumpVolume+ C78*(((1.d0/RealJ4)*MUD(4)%Q/60.d0)*DeltaT_Mudline) - ELSEIF (ActiveAutoDensity .and. 5.0 < ChokeOutletDensity .and. ChokeOutletDensity <= ActiveTankDensity) THEN + ELSEIF (MudProperties%ActiveAutoDensity .and. 5.0 < ChokeOutletDensity .and. ChokeOutletDensity <= ActiveTankDensity) THEN AddedVolumeToTank= ((1.d0/RealJ4)*MUD(4)%Q/60.d0) TripTankDensityCalc= ((TripTankDensityCalc*TripTankVolumeCalc)+(ActiveTankDensity*AddedVolumeToTank))/(TripTankVolumeCalc+AddedVolumeToTank) @@ -1649,7 +1649,7 @@ module MudSystem TripTankVolumeCalc=min(TripTankVolumeCalc,50.*42.) !50. BBL *42. gal/BBL = gal !if TripTankVolumeCalc>50 BBl, excess value(TripTankVolumeCalc-50) is dumped - ActiveTankVolume=min(ActiveTankVolume , ActiveTotalTankCapacityGal-ActiveSettledContentsGal) + ActiveTankVolume=min(ActiveTankVolume , MudProperties%ActiveTotalTankCapacityGal-MudProperties%ActiveSettledContentsGal) !if ActiveTankVolume is higher, excess amount is dumped endif @@ -1760,7 +1760,7 @@ module MudSystem TripTankVolumeCalc=min(TripTankVolumeCalc,50.*42.) !50. BBL *42. gal/BBL = gal !if TripTankVolumeCalc>50 BBl, excess value(TripTankVolumeCalc-50) is dumped - ActiveTankVolume=min(ActiveTankVolume , ActiveTotalTankCapacityGal-ActiveSettledContentsGal) + ActiveTankVolume=min(ActiveTankVolume , MudProperties%ActiveTotalTankCapacityGal-MudProperties%ActiveSettledContentsGal) !if ActiveTankVolume is higher, excess amount is dumped endif @@ -1825,7 +1825,7 @@ module MudSystem endif - StandPipeGauge1= (1 - StandPipeGauge1Malf) * PressureGauge75 ! for STManifold Display + StandPipeManifold%StandPipeGauge1= (1 - StandPipeGauge1Malf) * PressureGauge75 ! for STManifold Display !write(*,*) 'PressureGauge75=' , PressureGauge75 !P1toSt= jj2*(1-H82)*(1-DumpPump1)*G82 !P2toSt= jj12*(1-H83)*(1-DumpPump2)*G83 @@ -1857,7 +1857,7 @@ module MudSystem !if (L78 == 1) PressureGauge76= 0. !Dump to Gauge76 endif - StandPipeGauge2= (1 - StandPipeGauge2Malf) * PressureGauge76 ! for STManifold Display + StandPipeManifold%StandPipeGauge2= (1 - StandPipeGauge2Malf) * PressureGauge76 ! for STManifold Display !=========================================================================================================================== !=========================================================================================================================== ! @@ -1882,10 +1882,10 @@ module MudSystem if (TapSelector == .false.) then - PumpPressureDW= PressureGauge75 !for DrillWatch Display + DrillingWatch%PumpPressure= PressureGauge75 !for DrillWatch Display CALL Set_StandPipePressure(real((1-DrillPipePressureMalf)*PressureGauge75 , 8)) !for Data Display Console else - PumpPressureDW= PressureGauge76 !for DrillWatch Display + DrillingWatch%PumpPressure= PressureGauge76 !for DrillWatch Display CALL Set_StandPipePressure(real((1-DrillPipePressureMalf)*PressureGauge76 , 8)) !for Data Display Console endif @@ -1929,7 +1929,7 @@ module MudSystem !write(*,*) 'Active-decline=' , A71*(((1./RealJ2)*PUMP(1)%Flow_Rate/60.)*DeltaT_Mudline) total_decrease= total_decrease+ A71*(((1./RealJ2)*PUMP(1)%Flow_Rate/60.)*DeltaT_Mudline) - if (ChokePanelStrokeResetSwitch == 1) then + if (ChokeControlPanel%ChokePanelStrokeResetSwitch == 1) then total_decrease= 0. endif !write(*,*) 'total_decrease=' , total_decrease @@ -2089,7 +2089,7 @@ module MudSystem CompressedMudDensity= Suction_Density_MudSystem - MudWeightIn2= Suction_Density_MudSystem !for drillwatch display + DrillingWatch%MudWeightIn= Suction_Density_MudSystem !for drillwatch display MUD(2)%Q= jj2*(1-H82)*(1-DumpPump1)*G82*PUMP(1)%Flow_Rate + jj12*(1-H83)*(1-DumpPump2)*G83*PUMP(2)%Flow_Rate + jj13*(1-H84)*(1-DumpCementPump)*G84*PUMP(3)%Flow_Rate @@ -2221,13 +2221,13 @@ module MudSystem !!====================================================================== - IF (Valve(65)%Status == .TRUE.) call Activate_Pump1PopOffValveBlown() !Pump1PopOffValveBlown= .TRUE. - IF (Valve(66)%Status == .TRUE.) call Activate_Pump2PopOffValveBlown() ! Pump2PopOffValveBlown= .TRUE. - IF (Valve(67)%Status == .TRUE.) call Activate_Pump3PopOffValveBlown() !Pump2PopOffValveBlown= .TRUE. + IF (Manifold%Valve(65)%Status == .TRUE.) call Activate_Pump1PopOffValveBlown() !Pump1PopOffValveBlown= .TRUE. + IF (Manifold%Valve(66)%Status == .TRUE.) call Activate_Pump2PopOffValveBlown() ! Pump2PopOffValveBlown= .TRUE. + IF (Manifold%Valve(67)%Status == .TRUE.) call Activate_Pump3PopOffValveBlown() !Pump2PopOffValveBlown= .TRUE. - IF (ActiveTankVolume >= (ActiveTotalTankCapacityGal-ActiveSettledContentsGal)) THEN - ActiveTankVolume = (ActiveTotalTankCapacityGal-ActiveSettledContentsGal) + IF (ActiveTankVolume >= (MudProperties%ActiveTotalTankCapacityGal-MudProperties%ActiveSettledContentsGal)) THEN + ActiveTankVolume = (MudProperties%ActiveTotalTankCapacityGal-MudProperties%ActiveSettledContentsGal) call Activate_ActiveTankOverflow() ELSE call Deactivate_ActiveTankOverflow() @@ -2245,7 +2245,7 @@ module MudSystem call Set_ActiveDensity_StudentStation(real(ActiveTankDensity,8)) call Set_ReserveMudVolume_StudentStation(real(ReserveTankVolume/42.,8)) ! 42: gal to bbl call Set_ReserveDensity_StudentStation(real(ReserveTankDensity,8)) - KillMudVolume= ReserveTankVolume/42. ! for DrillWatch + DrillingWatch%KillMudVolume= ReserveTankVolume/42. ! for DrillWatch !PitGainLose= @@ -2254,32 +2254,32 @@ module MudSystem !!====================================================================== - IF (TotalStrokeCounterResetSwitch == 1) then !for drilling data display + IF (DataDisplayConsole%TotalStrokeCounterResetSwitch == 1) then !for drilling data display TotalStrokesPump1=0. TotalStrokesPump2=0. ENDIF - TotalStrokesPump1=TotalStrokesPump1+((MP1SPMGauge)/60.)*DeltaT_Mudline !for drilling data display - TotalStrokesPump2=TotalStrokesPump2+((MP2SPMGauge)/60.)*DeltaT_Mudline !for drilling data display - GraphTotalStrokes=GraphTotalStrokes+((MP1SPMGauge)/60.)*DeltaT_Mudline+((MP2SPMGauge)/60.)*DeltaT_Mudline + TotalStrokesPump1=TotalStrokesPump1+((DataDisplayConsole%MP1SPMGauge)/60.)*DeltaT_Mudline !for drilling data display + TotalStrokesPump2=TotalStrokesPump2+((DataDisplayConsole%MP2SPMGauge)/60.)*DeltaT_Mudline !for drilling data display + GraphTotalStrokes=GraphTotalStrokes+((DataDisplayConsole%MP1SPMGauge)/60.)*DeltaT_Mudline+((DataDisplayConsole%MP2SPMGauge)/60.)*DeltaT_Mudline - Total_Stroke_Counter_For_Plot = Total_Stroke_Counter_For_Plot + ((MP1SPMGauge + MP2SPMGauge) / 60.0) * DeltaT_Mudline + total_pumps%Total_Stroke_Counter_For_Plot = total_pumps%Total_Stroke_Counter_For_Plot + ((DataDisplayConsole%MP1SPMGauge + DataDisplayConsole%MP2SPMGauge) / 60.0) * DeltaT_Mudline - CALL SetTotalStrokes(INT(Total_Stroke_Counter_For_Plot)) + CALL SetTotalStrokes(INT(total_pumps%Total_Stroke_Counter_For_Plot)) - TotalStrokeCounter= real(nint(TotalStrokesPump1+TotalStrokesPump2)) !for drilling data display + DataDisplayConsole%TotalStrokeCounter= real(nint(TotalStrokesPump1+TotalStrokesPump2)) !for drilling data display !=========================================================================== ! MUD PUMP STROKES ! & TOTAL STROKE- CHOKE CONTROL PANEL !=========================================================================== !write(*,*) 'a)))' , ChokePanelStrokeResetSwitch - if (ChokePanelStrokeResetSwitch == 1) then - IF (ChokePanelPumpSelectorSwitch == 1) THEN + if (ChokeControlPanel%ChokePanelStrokeResetSwitch == 1) then + IF (ChokeControlPanel%ChokePanelPumpSelectorSwitch == 1) THEN !write(*,*) '1 reset' TotalStrokes1 =0. - elseif (ChokePanelPumpSelectorSwitch == 2) THEN + elseif (ChokeControlPanel%ChokePanelPumpSelectorSwitch == 2) THEN !write(*,*) '2 reset' TotalStrokes2 =0. else @@ -2293,20 +2293,20 @@ module MudSystem !write(*,*) 'b)))' , ChokePanelStrokeResetSwitch - TotalStrokes1= TotalStrokes1+((MP1SPMGauge)/60.)*DeltaT_Mudline - TotalStrokes2= TotalStrokes2+((MP2SPMGauge)/60.)*DeltaT_Mudline + TotalStrokes1= TotalStrokes1+((DataDisplayConsole%MP1SPMGauge)/60.)*DeltaT_Mudline + TotalStrokes2= TotalStrokes2+((DataDisplayConsole%MP2SPMGauge)/60.)*DeltaT_Mudline - IF (ChokePanelPumpSelectorSwitch == 1) THEN - ChokePanelSPMCounter = real(nint(MP1SPMGauge)) - ChokePanelTotalStrokeCounter = real(nint(TotalStrokes1)) - ELSEIF (ChokePanelPumpSelectorSwitch == 2) THEN - ChokePanelSPMCounter = real(nint(MP2SPMGauge)) - ChokePanelTotalStrokeCounter = real(nint(TotalStrokes2)) + IF (ChokeControlPanel%ChokePanelPumpSelectorSwitch == 1) THEN + ChokeControlPanel%ChokePanelSPMCounter = real(nint(DataDisplayConsole%MP1SPMGauge)) + ChokeControlPanel%ChokePanelTotalStrokeCounter = real(nint(TotalStrokes1)) + ELSEIF (ChokeControlPanel%ChokePanelPumpSelectorSwitch == 2) THEN + ChokeControlPanel%ChokePanelSPMCounter = real(nint(DataDisplayConsole%MP2SPMGauge)) + ChokeControlPanel%ChokePanelTotalStrokeCounter = real(nint(TotalStrokes2)) ELSE - ChokePanelSPMCounter= real(nint(MP1SPMGauge+MP2SPMGauge)) - ChokePanelTotalStrokeCounter = real(nint(TotalStrokes1+TotalStrokes2)) + ChokeControlPanel%ChokePanelSPMCounter= real(nint(DataDisplayConsole%MP1SPMGauge+DataDisplayConsole%MP2SPMGauge)) + ChokeControlPanel%ChokePanelTotalStrokeCounter = real(nint(TotalStrokes1+TotalStrokes2)) ENDIF ! ChokePanelStrokeResetSwitch = 0 @@ -2317,7 +2317,7 @@ module MudSystem !!====================================================================== - PitVolume= ActiveTankVolume/42.d0 !(bbl) For DrillWatch Display + DrillingWatch%PitVolume= ActiveTankVolume/42.d0 !(bbl) For DrillWatch Display !write(*,*) 'PitVolume,ActiveTankVolume=' ,PitVolume,ActiveTankVolume @@ -2331,11 +2331,11 @@ module MudSystem - IF (MVTPowerSwitch==1) THEN - MudTanksVolumeGauge= (1 - MudTanksVolumeGaugeMalf) *((MudTank1_vol*MudTank1Switch)+(MudTank2_vol*MudTank2Switch)+ & - (MudTank3_vol*MudTank3Switch)+(MudTank4_vol*MudTank4Switch)+ActiveTankSettled) !(gal) - ELSEIF (MVTPowerSwitch==0) THEN - MudTanksVolumeGauge= (1 - MudTanksVolumeGaugeMalf) *0. + IF (DataDisplayConsole%MVTPowerSwitch==1) THEN + DataDisplayConsole%MudTanksVolumeGauge= (1 - MudTanksVolumeGaugeMalf) *((MudTank1_vol*DataDisplayConsole%MudTank1Switch)+(MudTank2_vol*DataDisplayConsole%MudTank2Switch)+ & + (MudTank3_vol*DataDisplayConsole%MudTank3Switch)+(MudTank4_vol*DataDisplayConsole%MudTank4Switch)+ActiveTankSettled) !(gal) + ELSEIF (DataDisplayConsole%MVTPowerSwitch==0) THEN + DataDisplayConsole%MudTanksVolumeGauge= (1 - MudTanksVolumeGaugeMalf) *0. ENDIF !!====================================================================== @@ -2345,27 +2345,27 @@ module MudSystem - IF (MVTPowerSwitch==1 .and. IsPortable==.false.) THEN + IF (DataDisplayConsole%MVTPowerSwitch==1 .and. IsPortable==.false.) THEN - IF (MVTSetAlarmSwitch==0) THEN + IF (DataDisplayConsole%MVTSetAlarmSwitch==0) THEN - PitGainLossGauge= ( ((ActiveTankVolume/42.) - RefrencePitVolume)) - PitGainLossGaugeMalf*(( ((ActiveTankVolume/42.) - RefrencePitVolume))+50) !(bbl) + DataDisplayConsole%PitGainLossGauge= ( ((ActiveTankVolume/42.) - RefrencePitVolume)) - PitGainLossGaugeMalf*(( ((ActiveTankVolume/42.) - RefrencePitVolume))+50) !(bbl) - ELSEIF (MVTSetAlarmSwitch==-1) THEN + ELSEIF (DataDisplayConsole%MVTSetAlarmSwitch==-1) THEN - MVT_MinVol_Allowded= PitGainLossZero+ MIN(0.,(MVTSetAlarmLowKnob-50))-0.1 - PitGainLossGauge= MVT_MinVol_Allowded - PitGainLossGaugeMalf*(MVT_MinVol_Allowded+50) + MVT_MinVol_Allowded= PitGainLossZero+ MIN(0.,(DataDisplayConsole%MVTSetAlarmLowKnob-50))-0.1 + DataDisplayConsole%PitGainLossGauge= MVT_MinVol_Allowded - PitGainLossGaugeMalf*(MVT_MinVol_Allowded+50) ! - PitGainLossGaugeMalf*(MVT_MinVol_Allowded+50) : Malf effect !PitGainLose=(MVT_MinVol_Allowded) ! DrillWatch (incorrect) !RefrencePitVolume= ActiveTankVolume/42. !(bbl) ELSE !(MVTSetAlarmSwitch==1) - MVT_MaxVol_Allowded= PitGainLossZero+ MAX(0., (MVTSetAlarmHighKnob-50.))+0.1 - PitGainLossGauge= MVT_MaxVol_Allowded - PitGainLossGaugeMalf*(MVT_MaxVol_Allowded+50) + MVT_MaxVol_Allowded= PitGainLossZero+ MAX(0., (DataDisplayConsole%MVTSetAlarmHighKnob-50.))+0.1 + DataDisplayConsole%PitGainLossGauge= MVT_MaxVol_Allowded - PitGainLossGaugeMalf*(MVT_MaxVol_Allowded+50) ! - PitGainLossGaugeMalf*(MVT_MaxVol_Allowded+50) : Malf effect !PitGainLose=(MVT_MaxVol_Allowded) ! DrillWatch (incorrect) !RefrencePitVolume= ActiveTankVolume/42. !(bbl) @@ -2380,25 +2380,25 @@ module MudSystem IF ( ActiveTankVolume/42. < (RefrencePitVolume-ABS(MVT_MinVol_Allowded)) .OR. ActiveTankVolume/42. > (RefrencePitVolume+ABS(MVT_MaxVol_Allowded)) ) THEN - MVTAlarmLED = 1 !(blinking) - IF (MVTHornSwitch) THEN - Buzzer2= .TRUE. + DataDisplayConsole%MVTAlarmLED = 1 !(blinking) + IF (DataDisplayConsole%MVTHornSwitch) THEN + DataDisplayConsole%Buzzer2= .TRUE. ELSE - Buzzer2= .FALSE. + DataDisplayConsole%Buzzer2= .FALSE. ENDIF ELSE - MVTAlarmLED = 0 !(OFF) - Buzzer2= .false. + DataDisplayConsole%MVTAlarmLED = 0 !(OFF) + DataDisplayConsole%Buzzer2= .false. ENDIF - ELSEIF (MVTPowerSwitch==0) THEN + ELSEIF (DataDisplayConsole%MVTPowerSwitch==0) THEN !MudTanksVolumeGauge= 0. - PitGainLossGauge= -50 - MVTAlarmLED= 0 - Buzzer2= .false. + DataDisplayConsole%PitGainLossGauge= -50 + DataDisplayConsole%MVTAlarmLED= 0 + DataDisplayConsole%Buzzer2= .false. ENDIF @@ -2410,10 +2410,10 @@ module MudSystem - PercentFlow= (ReturnFlowRate/PedalMeter) *100. !(percent) ! for DrillWatch display - if (abs(PercentFlow - unityreturn) > 1.0) then + DrillingWatch%PercentFlow= (ReturnFlowRate/PedalMeter) *100. !(percent) ! for DrillWatch display + if (abs(DrillingWatch%PercentFlow - unityreturn) > 1.0) then - write(*,*) 'PercentFlow,ReturnFlowRate,PedalMeter=' , PercentFlow,ReturnFlowRate,PedalMeter + write(*,*) 'PercentFlow,ReturnFlowRate,PedalMeter=' , DrillingWatch%PercentFlow,ReturnFlowRate,PedalMeter write(*,*) 'unityreturn=' , unityreturn endif @@ -2428,27 +2428,27 @@ module MudSystem !! DRILL WATCH !!====================================================================== - PitGainLose= ((ActiveTankVolume/42.) - RefrencePitVolume_DrillWatch) ! DrillWatch + DrillingWatch%PitGainLose= ((ActiveTankVolume/42.) - RefrencePitVolume_DrillWatch) ! DrillWatch !write(*,*) 'PitGainLose galon' , PitGainLose*42. if (IsPortable) then - MVT_MinVol_Allowded= PitAlarmLow - MVT_MaxVol_Allowded= PitAlarmHigh + MVT_MinVol_Allowded= DataDisplayConsole%PitAlarmLow + MVT_MaxVol_Allowded= DataDisplayConsole%PitAlarmHigh IF ( ActiveTankVolume/42. < (RefrencePitVolume-ABS(MVT_MinVol_Allowded)) .OR. ActiveTankVolume/42. > (RefrencePitVolume+ABS(MVT_MaxVol_Allowded)) ) THEN - MVTAlarmLED = 1 !(blinking) - IF (MVTHornSwitch) THEN - Buzzer2= .TRUE. + DataDisplayConsole%MVTAlarmLED = 1 !(blinking) + IF (DataDisplayConsole%MVTHornSwitch) THEN + DataDisplayConsole%Buzzer2= .TRUE. ELSE - Buzzer2= .FALSE. + DataDisplayConsole%Buzzer2= .FALSE. ENDIF ELSE - MVTAlarmLED = 0 !(OFF) - Buzzer2= .false. + DataDisplayConsole%MVTAlarmLED = 0 !(OFF) + DataDisplayConsole%Buzzer2= .false. ENDIF endif @@ -2456,11 +2456,11 @@ module MudSystem if (PitGainLossReset) then - PitGainLose= 0.d0 !DrillWatch + DrillingWatch%PitGainLose= 0.d0 !DrillWatch RefrencePitVolume_DrillWatch= ActiveTankVolume/42. !(bbl) !DrillWatch !********************************************* - PitGainLossGauge= 0. !MFF Indicator + DataDisplayConsole%PitGainLossGauge= 0. !MFF Indicator RefrencePitVolume= ActiveTankVolume/42. !(bbl) !MFF Indicator endif @@ -2475,28 +2475,28 @@ module MudSystem !! MUD FLOW-FILL INDICATOR !!====================================================================== - IF (MFFIPowerSwitch==1 .and. IsPortable==.false.) THEN + IF (DataDisplayConsole%MFFIPowerSwitch==1 .and. IsPortable==.false.) THEN !====================TotalStrokes Reset and Calculate====================== - if (MFFIResetTotalStrokes == 1) then - IF (MFFIPumpSelectorSwitch == 1) THEN + if (DataDisplayConsole%MFFIResetTotalStrokes == 1) then + IF (DataDisplayConsole%MFFIPumpSelectorSwitch == 1) THEN TotalStrokes1MFFI =0. - elseif (MFFIPumpSelectorSwitch == 2) THEN + elseif (DataDisplayConsole%MFFIPumpSelectorSwitch == 2) THEN TotalStrokes2MFFI =0. else TotalStrokes1MFFI =0. TotalStrokes2MFFI =0. endif endif - TotalStrokes1MFFI= TotalStrokes1MFFI+((MP1SPMGauge)/60.)*DeltaT_Mudline - TotalStrokes2MFFI= TotalStrokes2MFFI+((MP2SPMGauge)/60.)*DeltaT_Mudline + TotalStrokes1MFFI= TotalStrokes1MFFI+((DataDisplayConsole%MP1SPMGauge)/60.)*DeltaT_Mudline + TotalStrokes2MFFI= TotalStrokes2MFFI+((DataDisplayConsole%MP2SPMGauge)/60.)*DeltaT_Mudline !==================FillStrokes Reset and Calculate========================= - if (MFFIResetFillCounter == 1) then - IF (MFFIPumpSelectorSwitch == 1) THEN + if (DataDisplayConsole%MFFIResetFillCounter == 1) then + IF (DataDisplayConsole%MFFIPumpSelectorSwitch == 1) THEN TotalFillStrokes1MFFI =0. - elseif (MFFIPumpSelectorSwitch == 2) THEN + elseif (DataDisplayConsole%MFFIPumpSelectorSwitch == 2) THEN TotalFillStrokes2MFFI =0. else TotalFillStrokes1MFFI =0. @@ -2505,37 +2505,37 @@ module MudSystem endif - TotalFillStrokes1MFFI= TotalFillStrokes1MFFI+((MP1SPMGauge)/60.)*DeltaT_Mudline - TotalFillStrokes2MFFI= TotalFillStrokes2MFFI+((MP2SPMGauge)/60.)*DeltaT_Mudline + TotalFillStrokes1MFFI= TotalFillStrokes1MFFI+((DataDisplayConsole%MP1SPMGauge)/60.)*DeltaT_Mudline + TotalFillStrokes2MFFI= TotalFillStrokes2MFFI+((DataDisplayConsole%MP2SPMGauge)/60.)*DeltaT_Mudline !=================================================================== - if (MFFIPumpSelectorSwitch == 1) then - MFFITotalStrokeCounter = real(nint(TotalStrokes1MFFI)) !TotalStroke LED - elseif (MFFIPumpSelectorSwitch == 2) then - MFFITotalStrokeCounter = real(nint(TotalStrokes2MFFI)) !TotalStroke LED - elseif (MFFIPumpSelectorSwitch == 3) then - MFFITotalStrokeCounter = real(nint(TotalStrokes1MFFI+TotalStrokes2MFFI)) !TotalStroke LED + if (DataDisplayConsole%MFFIPumpSelectorSwitch == 1) then + DataDisplayConsole%MFFITotalStrokeCounter = real(nint(TotalStrokes1MFFI)) !TotalStroke LED + elseif (DataDisplayConsole%MFFIPumpSelectorSwitch == 2) then + DataDisplayConsole%MFFITotalStrokeCounter = real(nint(TotalStrokes2MFFI)) !TotalStroke LED + elseif (DataDisplayConsole%MFFIPumpSelectorSwitch == 3) then + DataDisplayConsole%MFFITotalStrokeCounter = real(nint(TotalStrokes1MFFI+TotalStrokes2MFFI)) !TotalStroke LED endif - IF (MFFIFillSPMSelectorSwitch== .false.) THEN !(spm mode) - if (MFFIPumpSelectorSwitch == 1) then - FillStrokeCounter = real(nint(MP1SPMGauge)) !Fill or SPM LED - elseif (MFFIPumpSelectorSwitch == 2) then - FillStrokeCounter = real(nint(MP2SPMGauge)) !Fill or SPM LED - elseif (MFFIPumpSelectorSwitch == 3) then - FillStrokeCounter= real(nint(MP1SPMGauge+MP2SPMGauge)) !Fill or SPM LED + IF (DataDisplayConsole%MFFIFillSPMSelectorSwitch== .false.) THEN !(spm mode) + if (DataDisplayConsole%MFFIPumpSelectorSwitch == 1) then + DataDisplayConsole%FillStrokeCounter = real(nint(DataDisplayConsole%MP1SPMGauge)) !Fill or SPM LED + elseif (DataDisplayConsole%MFFIPumpSelectorSwitch == 2) then + DataDisplayConsole%FillStrokeCounter = real(nint(DataDisplayConsole%MP2SPMGauge)) !Fill or SPM LED + elseif (DataDisplayConsole%MFFIPumpSelectorSwitch == 3) then + DataDisplayConsole%FillStrokeCounter= real(nint(DataDisplayConsole%MP1SPMGauge+DataDisplayConsole%MP2SPMGauge)) !Fill or SPM LED endif ELSE ! (MFFIFillSPMSelectorSwitch== .true.) then !(fill mode) if (ReturnFlowRate== 0) then - if (MFFIPumpSelectorSwitch == 1) then - FillStrokeCounter = real(nint(TotalFillStrokes1MFFI)) !Fill or SPM LED - elseif (MFFIPumpSelectorSwitch == 2) then - FillStrokeCounter = real(nint(TotalFillStrokes2MFFI)) !Fill or SPM LED - elseif (MFFIPumpSelectorSwitch == 3) then - FillStrokeCounter= real(nint(TotalFillStrokes1MFFI+TotalFillStrokes2MFFI)) !Fill or SPM LED + if (DataDisplayConsole%MFFIPumpSelectorSwitch == 1) then + DataDisplayConsole%FillStrokeCounter = real(nint(TotalFillStrokes1MFFI)) !Fill or SPM LED + elseif (DataDisplayConsole%MFFIPumpSelectorSwitch == 2) then + DataDisplayConsole%FillStrokeCounter = real(nint(TotalFillStrokes2MFFI)) !Fill or SPM LED + elseif (DataDisplayConsole%MFFIPumpSelectorSwitch == 3) then + DataDisplayConsole%FillStrokeCounter= real(nint(TotalFillStrokes1MFFI+TotalFillStrokes2MFFI)) !Fill or SPM LED endif @@ -2548,12 +2548,12 @@ module MudSystem else !(ReturnFlowRate>0) ! these values=fix on LED after the well filled - if (MFFIPumpSelectorSwitch == 1) then - FillStrokeCounter = TotalFilledStrokesBy1MFFI !Fill or SPM LED - elseif (MFFIPumpSelectorSwitch == 2) then - FillStrokeCounter = TotalFilledStrokesBy2MFFI !Fill or SPM LED - elseif (MFFIPumpSelectorSwitch == 3) then - FillStrokeCounter= TotalFilledStrokesBy1and2MFFI !Fill or SPM LED + if (DataDisplayConsole%MFFIPumpSelectorSwitch == 1) then + DataDisplayConsole%FillStrokeCounter = TotalFilledStrokesBy1MFFI !Fill or SPM LED + elseif (DataDisplayConsole%MFFIPumpSelectorSwitch == 2) then + DataDisplayConsole%FillStrokeCounter = TotalFilledStrokesBy2MFFI !Fill or SPM LED + elseif (DataDisplayConsole%MFFIPumpSelectorSwitch == 3) then + DataDisplayConsole%FillStrokeCounter= TotalFilledStrokesBy1and2MFFI !Fill or SPM LED endif endif @@ -2568,69 +2568,69 @@ module MudSystem if (ReturnFlowRate>0) then - MFFIPumpLED=1 !(Returns Lamp) + DataDisplayConsole%MFFIPumpLED=1 !(Returns Lamp) else - MFFIPumpLED=0 !(Returns Lamp) + DataDisplayConsole%MFFIPumpLED=0 !(Returns Lamp) endif - IF (MFFISetAlarmSwitch==0) THEN + IF (DataDisplayConsole%MFFISetAlarmSwitch==0) THEN - ReturnMudFlowGauge= (1 - ReturnMudFlowGaugeMalf)*ReturnFlowPercent !(percent) + DataDisplayConsole%ReturnMudFlowGauge= (1 - ReturnMudFlowGaugeMalf)*ReturnFlowPercent !(percent) - ELSEIF (MFFISetAlarmSwitch==-1) THEN - MFFI_MinPercent_Allowded=MFFISetAlarmLowKnob - ReturnMudFlowGauge= (1 - ReturnMudFlowGaugeMalf)*MFFI_MinPercent_Allowded + ELSEIF (DataDisplayConsole%MFFISetAlarmSwitch==-1) THEN + MFFI_MinPercent_Allowded=DataDisplayConsole%MFFISetAlarmLowKnob + DataDisplayConsole%ReturnMudFlowGauge= (1 - ReturnMudFlowGaugeMalf)*MFFI_MinPercent_Allowded ELSE !(MFFISetAlarmSwitch==1) - MFFI_MaxPercent_Allowded=MFFISetAlarmHighKnob - ReturnMudFlowGauge= (1 - ReturnMudFlowGaugeMalf)*MFFI_MaxPercent_Allowded + MFFI_MaxPercent_Allowded=DataDisplayConsole%MFFISetAlarmHighKnob + DataDisplayConsole%ReturnMudFlowGauge= (1 - ReturnMudFlowGaugeMalf)*MFFI_MaxPercent_Allowded ENDIF IF (ReturnFlowPercentMFFI_MaxPercent_Allowded) THEN !write(*,*) 'alarm return:' , ReturnFlowRate - MFFIAlarmLED = 2 !(blinking) - IF (MFFIHornSwitch) THEN - Buzzer3= .true. + DataDisplayConsole%MFFIAlarmLED = 2 !(blinking) + IF (DataDisplayConsole%MFFIHornSwitch) THEN + DataDisplayConsole%Buzzer3= .true. ELSE - Buzzer3= .FALSE. + DataDisplayConsole%Buzzer3= .FALSE. ENDIF ELSE - MFFIAlarmLED = 0 !(OFF) - Buzzer3= .false. + DataDisplayConsole%MFFIAlarmLED = 0 !(OFF) + DataDisplayConsole%Buzzer3= .false. ENDIF !=================================================================================== - ELSEIF (MFFIPowerSwitch==0) THEN - ReturnMudFlowGauge= 0. - FillStrokeCounter= 0 - MFFITotalStrokeCounter= 0 - MFFIAlarmLED= 0 - Buzzer3= .false. + ELSEIF (DataDisplayConsole%MFFIPowerSwitch==0) THEN + DataDisplayConsole%ReturnMudFlowGauge= 0. + DataDisplayConsole%FillStrokeCounter= 0 + DataDisplayConsole%MFFITotalStrokeCounter= 0 + DataDisplayConsole%MFFIAlarmLED= 0 + DataDisplayConsole%Buzzer3= .false. ENDIF if ( IsPortable ) then - MFFI_MinPercent_Allowded=RetFlowAlarmLow - MFFI_MaxPercent_Allowded=RetFlowAlarmHigh + MFFI_MinPercent_Allowded=DataDisplayConsole%RetFlowAlarmLow + MFFI_MaxPercent_Allowded=DataDisplayConsole%RetFlowAlarmHigh IF (ReturnFlowPercentMFFI_MaxPercent_Allowded) THEN - MFFIAlarmLED = 1 !(blinking) - IF (MFFIHornSwitch) THEN - Buzzer3= .true. + DataDisplayConsole%MFFIAlarmLED = 1 !(blinking) + IF (DataDisplayConsole%MFFIHornSwitch) THEN + DataDisplayConsole%Buzzer3= .true. ELSE - Buzzer3= .FALSE. + DataDisplayConsole%Buzzer3= .FALSE. ENDIF ELSE - MFFIAlarmLED = 0 !(OFF) - Buzzer3= .false. + DataDisplayConsole%MFFIAlarmLED = 0 !(OFF) + DataDisplayConsole%Buzzer3= .false. ENDIF endif @@ -2644,62 +2644,62 @@ module MudSystem TripTankDensity2= TripTankDensityCalc !(display) - IF (TripTankPowerSwitch==1 .and. IsPortable==.false.) THEN + IF (DataDisplayConsole%TripTankPowerSwitch==1 .and. IsPortable==.false.) THEN - IF (TripTankSetAlarmSwitch==0) THEN + IF (DataDisplayConsole%TripTankSetAlarmSwitch==0) THEN - TripTankGauge= (1 - TripTankPressure_DataDisplayMalf) * TripTankVolumeCalc ! (gal) - ELSEIF (TripTankSetAlarmSwitch==-1) THEN + DataDisplayConsole%TripTankGauge= (1 - TripTankPressure_DataDisplayMalf) * TripTankVolumeCalc ! (gal) + ELSEIF (DataDisplayConsole%TripTankSetAlarmSwitch==-1) THEN - TripTank_MinVol_Allowded= TripTankSetAlarmLow/2. ! 2: because knob input is 0-100 but gauge is 0-50 - TripTankGauge= (1 - TripTankPressure_DataDisplayMalf) * TripTank_MinVol_Allowded + TripTank_MinVol_Allowded= DataDisplayConsole%TripTankSetAlarmLow/2. ! 2: because knob input is 0-100 but gauge is 0-50 + DataDisplayConsole%TripTankGauge= (1 - TripTankPressure_DataDisplayMalf) * TripTank_MinVol_Allowded ELSE !(TripTankSetAlarmSwitch==1) - TripTank_MaxVol_Allowded= TripTankSetAlarmHigh/2. ! 2: because knob input is 0-100 but gauge is 0-50 - TripTankGauge= (1 - TripTankPressure_DataDisplayMalf) * TripTank_MaxVol_Allowded + TripTank_MaxVol_Allowded= DataDisplayConsole%TripTankSetAlarmHigh/2. ! 2: because knob input is 0-100 but gauge is 0-50 + DataDisplayConsole%TripTankGauge= (1 - TripTankPressure_DataDisplayMalf) * TripTank_MaxVol_Allowded ENDIF IF ((TripTankVolumeCalc < TripTank_MinVol_Allowded) .OR. (TripTankVolumeCalc > TripTank_MaxVol_Allowded)) THEN - TripTankAlarmLED = 2 !(blinking) - IF (TripTankHornSwitch) THEN - Buzzer1= .true. + DataDisplayConsole%TripTankAlarmLED = 2 !(blinking) + IF (DataDisplayConsole%TripTankHornSwitch) THEN + DataDisplayConsole%Buzzer1= .true. ELSE - Buzzer1= .false. + DataDisplayConsole%Buzzer1= .false. ENDIF ELSE - TripTankAlarmLED = 0 !(OFF) - Buzzer1= .false. + DataDisplayConsole%TripTankAlarmLED = 0 !(OFF) + DataDisplayConsole%Buzzer1= .false. ENDIF - TripTankPumpLED= TripTankPumpSwitch + DataDisplayConsole%TripTankPumpLED= DataDisplayConsole%TripTankPumpSwitch - ELSEIF (TripTankPowerSwitch==0) THEN - TripTankGauge= 0. !(gal) - TripTankAlarmLED= 0 - TripTankPumpLED= 0 - Buzzer1= .false. + ELSEIF (DataDisplayConsole%TripTankPowerSwitch==0) THEN + DataDisplayConsole%TripTankGauge= 0. !(gal) + DataDisplayConsole%TripTankAlarmLED= 0 + DataDisplayConsole%TripTankPumpLED= 0 + DataDisplayConsole%Buzzer1= .false. ENDIF if ( IsPortable ) then - TripTank_MinVol_Allowded= TripAlarmLow - TripTank_MaxVol_Allowded= TripAlarmHigh + TripTank_MinVol_Allowded= DataDisplayConsole%TripAlarmLow + TripTank_MaxVol_Allowded= DataDisplayConsole%TripAlarmHigh IF ((TripTankVolumeCalc < TripTank_MinVol_Allowded) .OR. (TripTankVolumeCalc > TripTank_MaxVol_Allowded)) THEN - TripTankAlarmLED = 1 !(blinking) - IF (TripTankHornSwitch) THEN - Buzzer1= .true. + DataDisplayConsole%TripTankAlarmLED = 1 !(blinking) + IF (DataDisplayConsole%TripTankHornSwitch) THEN + DataDisplayConsole%Buzzer1= .true. ELSE - Buzzer1= .false. + DataDisplayConsole%Buzzer1= .false. ENDIF ELSE - TripTankAlarmLED = 0 !(OFF) - Buzzer1= .false. + DataDisplayConsole%TripTankAlarmLED = 0 !(OFF) + DataDisplayConsole%Buzzer1= .false. ENDIF endif @@ -2727,7 +2727,7 @@ module MudSystem implicit none real(8), intent (in) :: v !call Log_4('ActiveMudVolumeChanged=', v) - ActiveTankVolume= ActiveMudVolumeGal ! update from student input + ActiveTankVolume= MudProperties%ActiveMudVolumeGal ! update from student input end subroutine subroutine ActiveDensityChanged(v) @@ -2735,7 +2735,7 @@ module MudSystem implicit none real(8), intent (in) :: v !call Log_4('ActiveDensityChanged=', v) - ActiveTankDensity= ActiveDensity ! update from student input + ActiveTankDensity= MudProperties%ActiveDensity ! update from student input end subroutine subroutine ReserveMudVolumeChanged(v) @@ -2743,7 +2743,7 @@ module MudSystem implicit none real(8), intent (in) :: v !call Log_4('ReserveMudVolumeChanged=', v) - ReserveTankVolume= ReserveMudVolumeGal ! update from student input + ReserveTankVolume= MudProperties%ReserveMudVolumeGal ! update from student input end subroutine subroutine ReserveDensityChanged(v) @@ -2751,7 +2751,7 @@ module MudSystem implicit none real(8), intent (in) :: v !call Log_4('ReserveDensityChanged=', v) - ReserveTankDensity= ReserveDensity ! update from student input + ReserveTankDensity= MudProperties%ReserveDensity ! update from student input end subroutine subroutine SetupMudSystem() @@ -2926,7 +2926,7 @@ module MudSystem end subroutine subroutine WhenPathOpen(valves) - use Pump_VARIABLES + use Pumps_VARIABLES implicit none integer, allocatable, intent (in) :: valves(:) integer :: first, last @@ -3031,7 +3031,7 @@ module MudSystem !============BellNippleToPits-FullWell(MLnumber=3)============== - if ( Valve(41)%Status == .false. .and. Valve(42)%Status == .false. ) then + if ( Manifold%Valve(41)%Status == .false. .and. Manifold%Valve(42)%Status == .false. ) then call ChangeValve(60, .TRUE.) else call ChangeValve(60, .FALSE.) diff --git a/Equipments/MudSystem/MudSystemMain.f90 b/Equipments/MudSystem/MudSystemMain.f90 index 898626a..861528f 100644 --- a/Equipments/MudSystem/MudSystemMain.f90 +++ b/Equipments/MudSystem/MudSystemMain.f90 @@ -32,9 +32,9 @@ module MudSystemMain implicit none !print* , 'MudSystem_Step' !CALL main - if(IsTraverse) then + if(Manifold%IsTraverse) then call LineupAndPath() - IsTraverse = .false. + Manifold%IsTraverse = .false. endif call main() end subroutine MudSystem_Step diff --git a/Equipments/MudSystem/MudSystemStartup.f90 b/Equipments/MudSystem/MudSystemStartup.f90 index f48c2f0..b4bc7d3 100644 --- a/Equipments/MudSystem/MudSystemStartup.f90 +++ b/Equipments/MudSystem/MudSystemStartup.f90 @@ -7,7 +7,7 @@ Use KickVariables Use CUnityOutputs Use CShoeVariables - USE Pump_VARIABLES + USE Pumps_VARIABLES implicit none @@ -31,7 +31,7 @@ AnnCapOld=0. DeltaAnnCap=0. - Total_Stroke_Counter_For_Plot = 0.0 +total_pumps%Total_Stroke_Counter_For_Plot = 0.0 DeltaT_Mudline=0.1 !second @@ -46,7 +46,7 @@ FluidFlowCounter = 0 ! MUD CIRCULATION STARTUP !======================================================================== - FormationLostPressure= LeakOff * ShoeDepth + FormationLostPressure= Shoe%LeakOff * Shoe%ShoeDepth ShoeFractured= .false. UGBOSuccessionCounter = 0 ! also in starup @@ -74,7 +74,7 @@ FluidFlowCounter = 0 !KickMigration_2SideBit = .FALSE. - KickDx= (AutoMigrationRate/3600.)*DeltaT_Mudline !AutoMigrationRate (ft/h)= ft per DeltaT_Mudline + KickDx= (Reservoir%AutoMigrationRate/3600.)*DeltaT_Mudline !AutoMigrationRate (ft/h)= ft per DeltaT_Mudline NewInfluxElementCreated= 0 @@ -92,11 +92,11 @@ FluidFlowCounter = 0 imud=1 iLoc= 1 ! for Kick - Suction_Density_MudSystem= ActiveDensity - SuctionDensity_Old= ActiveDensity ! initial(ppg) - StringDensity_Old= ActiveDensity ! initial(ppg) - AnnulusSuctionDensity_Old= ActiveDensity ! initial(ppg) - ChokeLineDensity_Old= ActiveDensity ! initial(ppg) + Suction_Density_MudSystem= MudProperties%ActiveDensity + SuctionDensity_Old= MudProperties%ActiveDensity ! initial(ppg) + StringDensity_Old= MudProperties%ActiveDensity ! initial(ppg) + AnnulusSuctionDensity_Old= MudProperties%ActiveDensity ! initial(ppg) + ChokeLineDensity_Old= MudProperties%ActiveDensity ! initial(ppg) TotalAddedVolume= 0. @@ -118,7 +118,7 @@ FluidFlowCounter = 0 USE MudSystemVARIABLES USE CDataDisplayConsoleVariables USE CHOKEVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES USE CBopStackVariables USE CPumpsVariables use CTanksVariables @@ -131,7 +131,7 @@ FluidFlowCounter = 0 CALL MUDLINE_LOSS_INPUTS() -!Total_Pump_Gpm=10. ! Initial Value +!total_pumps%Total_Pump_GPM=10. ! Initial Value MUD%Q=0. ! Initial Value Q_flow32=0. @@ -168,14 +168,14 @@ PressureGauge76 = 0.0 TripTank_MaxVol_Allowded= 50. *42. !(bbl to gal, initial value) -ActiveTankFloorArea= (ActiveTotalTankCapacityGal) / (7.48051948*100./12.) ! (ft^2) - Tank Height= 100 inch , 12=inch to ft 7.48051948=gal to ft^3 +ActiveTankFloorArea= (MudProperties%ActiveTotalTankCapacityGal) / (7.48051948*100./12.) ! (ft^2) - Tank Height= 100 inch , 12=inch to ft 7.48051948=gal to ft^3 TripTankFloorArea= (50.*42.) / (7.48051948*100./12.) ! (ft^2) - 50.*42.=Trip Tank Capacity in BBl*42= Gal , Tank Height= 100 inch , 12=inch to ft 7.48051948=gal to ft^3 -TripTank_Vol= InitialTripTankMudVolumeGal !(gal) +TripTank_Vol= MudProperties%InitialTripTankMudVolumeGal !(gal) TripTank_Dens= 1. -TripTankGauge=0. +DataDisplayConsole%TripTankGauge=0. @@ -198,47 +198,47 @@ Mp2Density= 0.0 !(VALVE83) Mp3Density= 0.0 !(VALVE84) -ReserveTankVolume= ReserveMudVolumeGal ! initial volume (gal) -ReserveTankDensity= ReserveDensity ! initial +ReserveTankVolume= MudProperties%ReserveMudVolumeGal ! initial volume (gal) +ReserveTankDensity= MudProperties%ReserveDensity ! initial -CementTankVolumeCalc= CementTankVolume !movaghat--- initial volume (gal) -CementTankDensityCalc= CementTankDensity !movaghat--- initial +CementTankVolumeCalc= Tank%CementTankVolume !movaghat--- initial volume (gal) +CementTankDensityCalc= Tank%CementTankDensity !movaghat--- initial PumpsDumpVolume=0.0 PumpsDumpFlowRate= 0.0 -ActiveTankVolume= ActiveMudVolumeGal ! initial volume (gal) +ActiveTankVolume= MudProperties%ActiveMudVolumeGal ! initial volume (gal) RefrencePitVolume= ActiveTankVolume/42. !(bbl) RefrencePitVolume_DrillWatch= ActiveTankVolume/42. !(bbl) MVT_MinVol_Allowded= 0. MVT_MaxVol_Allowded= 0. -MudTank1_vol= ActiveMudVolumeGal/3. ! (gal) -MudTank2_vol= ActiveMudVolumeGal/3. ! (gal) -MudTank3_vol= ActiveMudVolumeGal/3. ! (gal) -ActiveTankSettled= ActiveSettledContentsGal ! (gal) -MudTank4_vol= InitialTripTankMudVolumeGal ! (gal) +MudTank1_vol= MudProperties%ActiveMudVolumeGal/3. ! (gal) +MudTank2_vol= MudProperties%ActiveMudVolumeGal/3. ! (gal) +MudTank3_vol= MudProperties%ActiveMudVolumeGal/3. ! (gal) +ActiveTankSettled= MudProperties%ActiveSettledContentsGal ! (gal) +MudTank4_vol= MudProperties%InitialTripTankMudVolumeGal ! (gal) -TripTankVolumeCalc= InitialTripTankMudVolumeGal ! initial volume (gal) -ActiveTankDensity= ActiveDensity ! initial(ppg) -TripTankDensityCalc= TripTankDensity ! initial(ppg) +TripTankVolumeCalc= MudProperties%InitialTripTankMudVolumeGal ! initial volume (gal) +ActiveTankDensity= MudProperties%ActiveDensity ! initial(ppg) +TripTankDensityCalc= Tank%TripTankDensity ! initial(ppg) ChokeManifoldDumpVolume= 0.0 PitGainLossZero= 0. PitGainLossZero_Old= PitGainLossZero -MVTCoarseKnob_Old= MVTCoarseKnob -MVTFineKnob_Old= MVTFineKnob +MVTCoarseKnob_Old= DataDisplayConsole%MVTCoarseKnob +MVTFineKnob_Old= DataDisplayConsole%MVTFineKnob FirstSet_Time= .true. -PedalMeter= PedalFlowMeter !1600. !(gpm) +PedalMeter= MudProperties%PedalFlowMeter !1600. !(gpm) ReturnFlowRate=0. @@ -289,12 +289,12 @@ NO_MudMinors=4 ALLOCATE (MudMinors(NO_MudMinors,4)) ! ID(INCH) LF CV NOTE(BAR) DESCRIPTION -MudMinors(1,1)= MudPump1Output +MudMinors(1,1)= PumpsSpecification%MudPump1Output MudMinors(1,2:4)= (/1.5*8., 0., 0./) !elbow (MLnumber=1,,PumpsToString) -MudMinors(2,1)= MudPump1Output +MudMinors(2,1)= PumpsSpecification%MudPump1Output MudMinors(2,2:4)= (/1.5*6., 0., 0./) !elbow (MLnumber=2,,STGaugeToString) MudMinors(3,1:4)= (/0., 0., 0., 0./) !elbow (MLnumber=3,,WellToPits) -MudMinors(4,1)= ChokeLineId +MudMinors(4,1)= BopStackSpecification%ChokeLineId MudMinors(4,2:4)= (/1.5*7., 0., 0./) !elbow (MLnumber=4,,WellToChokeManifold) @@ -322,17 +322,17 @@ NO_PIPINGSMUDLINE=4 ALLOCATE (PIPINGS_MUDLINE(NO_PIPINGSMUDLINE,3)) ! ID(INCH) L(FEET) ROUGHNESS(MM)=e DESCRIPTION -PIPINGS_MUDLINE(1,1)= MudPump1Output +PIPINGS_MUDLINE(1,1)= PumpsSpecification%MudPump1Output PIPINGS_MUDLINE(1,2:3)= (/265., 0.03/) !(MLnumber=1,,PumpsToString) -PIPINGS_MUDLINE(2,1)= MudPump1Output +PIPINGS_MUDLINE(2,1)= PumpsSpecification%MudPump1Output PIPINGS_MUDLINE(2,2:3)= (/100., 0.03/) !(MLnumber=2,,STGaugeToString) PIPINGS_MUDLINE(3,1:3)= (/0., 0., 0./) !(MLnumber=3,,WellToPits) -PIPINGS_MUDLINE(4,1)= ChokeLineId -PIPINGS_MUDLINE(4,2)= ChokeLineLength +PIPINGS_MUDLINE(4,1)= BopStackSpecification%ChokeLineId +PIPINGS_MUDLINE(4,2)= BopStackSpecification%ChokeLineLength PIPINGS_MUDLINE(4,3)= 0.03 !(MLnumber=4,,WellToChokeManifold) -Area_ChokeLineFt= PII*((ChokeLineId/12.)**2)/4. !D(in), AREA(ft^2) -ChokeLine_VolumeCapacity= Area_ChokeLineFt* ChokeLineLength* 7.48051948 ! (gal) +Area_ChokeLineFt= PII*((BopStackSpecification%ChokeLineId/12.)**2)/4. !D(in), AREA(ft^2) +ChokeLine_VolumeCapacity= Area_ChokeLineFt* BopStackSpecification%ChokeLineLength* 7.48051948 ! (gal) ALLOCATE (DIAM_MUDLINE_INCH(NO_PIPINGSMUDLINE), & AREA_MUDLINE(NO_PIPINGSMUDLINE),LENGT_MUDLINE(NO_PIPINGSMUDLINE),ROUGHNESS_MUDLINE(NO_PIPINGSMUDLINE),RELROUGH_MUDLINE(NO_PIPINGSMUDLINE)) @@ -361,7 +361,7 @@ Pumps_Height= 0. STpipeGauge_Height= 2. !(m) Pits_Height= 1. !(m) ChokeManifold_Height= 1.*0.3048 !(ft to meter) -WellChokeExit_Height= GroundLevel-KillHeight +WellChokeExit_Height= BopStackSpecification%GroundLevel-BopStackSpecification%KillHeight diff --git a/Equipments/MudSystem/Plot_Final_Mud_Elements.f90 b/Equipments/MudSystem/Plot_Final_Mud_Elements.f90 index 5f6422d..8ef9d4d 100644 --- a/Equipments/MudSystem/Plot_Final_Mud_Elements.f90 +++ b/Equipments/MudSystem/Plot_Final_Mud_Elements.f90 @@ -3,7 +3,7 @@ subroutine PlotFinalMudElements ! is called in subroutine CirculationCodeSel Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES Use TD_StringConnectionData !USE CHOKEVARIABLES !USE CDataDisplayConsoleVariables , StandPipePressureDataDisplay=>StandPipePressure @@ -11,7 +11,7 @@ subroutine PlotFinalMudElements ! is called in subroutine CirculationCodeSel use CDrillWatchVariables !use CHOKEVARIABLES !use CChokeManifoldVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables Use KickVariables @@ -30,7 +30,7 @@ subroutine PlotFinalMudElements ! is called in subroutine CirculationCodeSel - if (ChokePanelStrokeResetSwitch == 1) then + if (ChokeControlPanel%ChokePanelStrokeResetSwitch == 1) then write(*,*) 'well cap=' , sum(PipeSection_VolumeCapacity(F_StringIntervalCounts+1:NoPipeSections)) + sum(OpSection_VolumeCapacity(1:F_BottomHoleIntervalCounts)) DeltaWellCap= sum(PipeSection_VolumeCapacity(F_StringIntervalCounts+1:NoPipeSections)) + sum(OpSection_VolumeCapacity(1:F_BottomHoleIntervalCounts)) - WellCapOld WellCapOld= sum(PipeSection_VolumeCapacity(F_StringIntervalCounts+1:NoPipeSections)) + sum(OpSection_VolumeCapacity(1:F_BottomHoleIntervalCounts)) @@ -41,14 +41,14 @@ subroutine PlotFinalMudElements ! is called in subroutine CirculationCodeSel !========================ANNULUS END================= -if ((Ann_Mud_Forehead_X%Last() - AboveAnnularHeight) > 0.8 .or. Ann_Density%Last()==0.0) then ! for Line (BellNippleToWell-NonFullWell) +if ((Ann_Mud_Forehead_X%Last() - BopStackSpecification%AboveAnnularHeight) > 0.8 .or. Ann_Density%Last()==0.0) then ! for Line (BellNippleToWell-NonFullWell) WellisNOTFull= .true. else WellisNOTFull= .false. endif !WRITE(*,*) 'Ann_Mud_Forehead_X%Last() , KillHeight', Ann_Mud_Forehead_X%Last() , KillHeight -if ((Ann_Mud_Forehead_X%Last() - KillHeight)>0.8 .or. Ann_Density%Last()==0.0) then ! for Line j4 , WellToChokeManifold(Through 26) +if ((Ann_Mud_Forehead_X%Last() - BopStackSpecification%KillHeight)>0.8 .or. Ann_Density%Last()==0.0) then ! for Line j4 , WellToChokeManifold(Through 26) ChokeLineNOTFull= .true. else ChokeLineNOTFull= .false. diff --git a/Equipments/MudSystem/Pump_and_Trip_In.f90 b/Equipments/MudSystem/Pump_and_Trip_In.f90 index 7a2c79b..bc90517 100644 --- a/Equipments/MudSystem/Pump_and_Trip_In.f90 +++ b/Equipments/MudSystem/Pump_and_Trip_In.f90 @@ -3,14 +3,14 @@ subroutine Pump_and_TripIn ! is called in subroutine CirculationCodeSelect Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES !USE CHOKEVARIABLES !USE CDataDisplayConsoleVariables , StandPipePressureDataDisplay=>StandPipePressure !use CManifolds use CDrillWatchVariables !use CHOKEVARIABLES !use CChokeManifoldVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables Use KickVariables @@ -53,7 +53,7 @@ integer i,ii,AddLocation total_add = total_add + ((StringFlowRate/60.0d0)*DeltaT_Mudline) - if (ChokePanelStrokeResetSwitch == 1) then + if (ChokeControlPanel%ChokePanelStrokeResetSwitch == 1) then total_add= 0. endif @@ -895,7 +895,7 @@ IF (WellHeadIsOpen) MudVolume_InjectedFromAnn = Ann_Saved_MudDischarged_Vo total_injected = total_injected + MudVolume_InjectedFromAnn - if (ChokePanelStrokeResetSwitch == 1) then + if (ChokeControlPanel%ChokePanelStrokeResetSwitch == 1) then total_injected= 0. endif @@ -923,7 +923,7 @@ imud= 0 ! <<< Fracture Shoe Lost - IF ( ShoeLost .and. ShoeDepth < Ann_Mud_Backhead_X%Array(imud) .and. ShoeDepth >= Ann_Mud_Forehead_X%Array(imud) ) then + IF ( ShoeLost .and. Shoe%ShoeDepth < Ann_Mud_Backhead_X%Array(imud) .and. Shoe%ShoeDepth >= Ann_Mud_Forehead_X%Array(imud) ) then !write(*,*) 'ShoeLost imud,AnnVolume(imud), VolumeLost:' , imud,Ann_MudDischarged_Volume%Array(imud), (( Qlost/60.0d0)*DeltaT_Mudline) Ann_MudDischarged_Volume%Array(imud)= Ann_MudDischarged_Volume%Array(imud)-((Qlost/60.0d0)*DeltaT_Mudline) !(gal) if (Ann_MudDischarged_Volume%Array(imud) < 0.0) then @@ -1172,14 +1172,14 @@ imud=0 Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES !USE CHOKEVARIABLES !USE CDataDisplayConsoleVariables , StandPipePressureDataDisplay=>StandPipePressure !use CManifolds use CDrillWatchVariables !use CHOKEVARIABLES !use CChokeManifoldVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables Use KickVariables @@ -1480,7 +1480,7 @@ imud=0 ! +1 for string , -1 for annulus - ChokeLine_EmptyVolume_inBackheadLocation%Array(imud)= (ChokeLineLength- ChokeLine_Mud_Backhead_X%Array(imud))* Area_ChokeLineFt !(ft^3) + ChokeLine_EmptyVolume_inBackheadLocation%Array(imud)= (BopStackSpecification%ChokeLineLength- ChokeLine_Mud_Backhead_X%Array(imud))* Area_ChokeLineFt !(ft^3) ChokeLine_EmptyVolume_inBackheadLocation%Array(imud)= ChokeLine_EmptyVolume_inBackheadLocation%Array(imud)* 7.48051948d0 ! ft^3 to gal @@ -1497,7 +1497,7 @@ imud=0 do if (isection > 1) then ! last pipe section(Chokeline exit) ChokeLine_MudDischarged_Volume%Array(imud)= ChokeLine_MudDischarged_Volume%Array(imud)- ChokeLine_RemainedVolume_in_LastSection%Array(imud) - ChokeLine_Mud_Forehead_X%Array(imud)= ChokeLineLength + ChokeLine_Mud_Forehead_X%Array(imud)= BopStackSpecification%ChokeLineLength ChokeLine_Mud_Forehead_section%Array(imud)= 1 if (ChokeLine_MudDischarged_Volume%Array(imud)<= 0.0d0) then ! imud is completely exited form the string call ChokeLine_MudDischarged_Volume%Remove (imud) @@ -1518,7 +1518,7 @@ imud=0 if (xx<= 1.0) then ChokeLine_Mud_Forehead_section%Array(imud)= isection - ChokeLine_Mud_Forehead_X%Array(imud)= xx * ChokeLineLength + ChokeLine_Mud_Forehead_X%Array(imud)= xx * BopStackSpecification%ChokeLineLength exit else ChokeLine_RemainedVolume_in_LastSection%Array(imud)= ChokeLine_RemainedVolume_in_LastSection%Array(imud)- ChokeLine_VolumeCapacity @@ -1586,7 +1586,7 @@ use CSounds !Use GeoElements_FluidModule !USE CMudPropertiesVariables USE MudSystemVARIABLES - !USE Pump_VARIABLES + !USE Pumps_VARIABLES !!USE CHOKEVARIABLES !!USE CDataDisplayConsoleVariables , StandPipePressureDataDisplay=>StandPipePressure !!use CManifolds diff --git a/Equipments/MudSystem/Trip_Out_andPump.f90 b/Equipments/MudSystem/Trip_Out_andPump.f90 index 18921d2..5e94864 100644 --- a/Equipments/MudSystem/Trip_Out_andPump.f90 +++ b/Equipments/MudSystem/Trip_Out_andPump.f90 @@ -3,14 +3,14 @@ subroutine TripOut_and_Pump ! is called in subroutine CirculationCodeSelect Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES !USE CHOKEVARIABLES !USE CDataDisplayConsoleVariables , StandPipePressureDataDisplay=>StandPipePressure !use CManifolds use CDrillWatchVariables !use CHOKEVARIABLES !use CChokeManifoldVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables Use KickVariables @@ -70,7 +70,7 @@ Real(8) ExcessMudVolume_Remained,SavedDensityForOp total_add = total_add + ((StringFlowRate/60.0d0)*DeltaT_Mudline) - if (ChokePanelStrokeResetSwitch == 1) then + if (ChokeControlPanel%ChokePanelStrokeResetSwitch == 1) then total_add= 0. endif @@ -1134,7 +1134,7 @@ imud= Ann_Mud_Forehead_X%Length() + 1 ! <<< Fracture Shoe Lost - IF ( ShoeLost .and. ShoeDepth < Ann_Mud_Backhead_X%Array(imud) .and. ShoeDepth >= Ann_Mud_Forehead_X%Array(imud) ) then + IF ( ShoeLost .and. Shoe%ShoeDepth < Ann_Mud_Backhead_X%Array(imud) .and. Shoe%ShoeDepth >= Ann_Mud_Forehead_X%Array(imud) ) then !write(*,*) 'ShoeLost imud,AnnVolume(imud), VolumeLost:' , imud,Ann_MudDischarged_Volume%Array(imud), (( Qlost/60.0d0)*DeltaT_Mudline) Ann_MudDischarged_Volume%Array(imud)= Ann_MudDischarged_Volume%Array(imud)-((Qlost/60.0d0)*DeltaT_Mudline) !(gal) if (Ann_MudDischarged_Volume%Array(imud) < 0.0) then @@ -1346,7 +1346,7 @@ imud=0 total_injected = total_injected + MudVolume_InjectedFromAnn - if (ChokePanelStrokeResetSwitch == 1) then + if (ChokeControlPanel%ChokePanelStrokeResetSwitch == 1) then total_injected= 0. endif !write(*,*) ' MudVolume_InjectedFromAnn =' , MudVolume_InjectedFromAnn diff --git a/Equipments/MudSystem/Utube1_and_Trip_In.f90 b/Equipments/MudSystem/Utube1_and_Trip_In.f90 index f01639d..c2e91cd 100644 --- a/Equipments/MudSystem/Utube1_and_Trip_In.f90 +++ b/Equipments/MudSystem/Utube1_and_Trip_In.f90 @@ -4,10 +4,10 @@ SUBROUTINE Utube1_and_TripIn ! is called in subroutine CirculationCodeSelect Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES USE sROP_Variables use CDrillWatchVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity Use CShoeVariables Use CUnityOutputs @@ -449,7 +449,7 @@ imud= 0 ! <<< Fracture Shoe Lost - IF ( ShoeLost .and. LostInTripOutIsDone== .false. .and. ShoeDepth < Ann_Mud_Backhead_X%Array(imud) .and. ShoeDepth >= Ann_Mud_Forehead_X%Array(imud) ) then + IF ( ShoeLost .and. LostInTripOutIsDone== .false. .and. Shoe%ShoeDepth < Ann_Mud_Backhead_X%Array(imud) .and. Shoe%ShoeDepth >= Ann_Mud_Forehead_X%Array(imud) ) then !write(*,*) 'ShoeLost imud,AnnVolume(imud), VolumeLost:' , imud,Ann_MudDischarged_Volume%Array(imud), (( Qlost/60.0d0)*DeltaT_Mudline) Ann_MudDischarged_Volume%Array(imud)= Ann_MudDischarged_Volume%Array(imud)-((Qlost/60.0d0)*DeltaT_Mudline) !(gal) if (Ann_MudDischarged_Volume%Array(imud) < 0.0) then diff --git a/Equipments/MudSystem/Utube2_and_Trip_In.f90 b/Equipments/MudSystem/Utube2_and_Trip_In.f90 index 2ad45a3..2360003 100644 --- a/Equipments/MudSystem/Utube2_and_Trip_In.f90 +++ b/Equipments/MudSystem/Utube2_and_Trip_In.f90 @@ -4,9 +4,9 @@ SUBROUTINE Utube2_and_TripIn ! is called in subroutine CirculationCodeSelect Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES - USE Pump_VARIABLES + USE Pumps_VARIABLES use CDrillWatchVariables - use CTanksVariables, TripTankVolume2 => TripTankVolume, TripTankDensity2 => TripTankDensity + !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity Use CShoeVariables implicit none @@ -184,7 +184,7 @@ imud= Ann_Mud_Forehead_X%Length() + 1 endif ! <<< Fracture Shoe Lost - IF ( ShoeLost .and. LostInTripOutIsDone== .false. .and. ShoeDepth < Ann_Mud_Backhead_X%Array(imud) .and. ShoeDepth >= Ann_Mud_Forehead_X%Array(imud) ) then + IF ( ShoeLost .and. LostInTripOutIsDone== .false. .and. Shoe%ShoeDepth < Ann_Mud_Backhead_X%Array(imud) .and. Shoe%ShoeDepth >= Ann_Mud_Forehead_X%Array(imud) ) then !write(*,*) 'ShoeLost imud,AnnVolume(imud), VolumeLost:' , imud,Ann_MudDischarged_Volume%Array(imud), (( Qlost/60.0d0)*DeltaT_Mudline) Ann_MudDischarged_Volume%Array(imud)= Ann_MudDischarged_Volume%Array(imud)-((Qlost/60.0d0)*DeltaT_Mudline) !(gal) if (Ann_MudDischarged_Volume%Array(imud) < 0.0) then diff --git a/Equipments/PowerLimits.f90 b/Equipments/PowerLimits.f90 index ef3d414..c657ba5 100644 --- a/Equipments/PowerLimits.f90 +++ b/Equipments/PowerLimits.f90 @@ -1,10 +1,10 @@ subroutine PowerLimits !subroutine PowerLimits(Power_sigma) - USE Pump_VARIABLES, only: PUMP + USE Pumps_VARIABLES, only: PUMP USE Drawworks_VARIABLES, only: Drawworks USE RTable_VARIABLES, only: RTable - USE CPowerVariables, only: NumberOfgenerators, GeneratorPowerRating + USE CPowerVariables, only: Power%NumberOfgenerators, Power%GeneratorPowerRating USE CDrillingConsoleVariables USE equipments_PowerLimit @@ -12,16 +12,16 @@ subroutine PowerLimits !integer :: ii - Power_sigma=2.d0*(PUMP(1)%Vt*PUMP(1)%ia_new)+2.d0*(PUMP(2)%Vt*PUMP(2)%ia_new)+2.d0*(PUMP(3)%Vt*PUMP(3)%ia_new)+(RTable%Vt*RTable%ia_new)+2.d0*(Drawworks%Vt*Drawworks%ia_new) + !Power_sigma=2.d0*(PUMP(1)%Vt*PUMP(1)%ia_new)+2.d0*(PUMP(2)%Vt*PUMP(2)%ia_new)+2.d0*(PUMP(3)%Vt*PUMP(3)%ia_new)+(RTable%Vt*RTable%ia_new)+2.d0*(Drawworks%Vt*Drawworks%ia_new) !write(*,*) 'Power_sigma=', Power_sigma - power_num_of_Jenerators=sngl(NumberOfgenerators) - Jenerator_power=GeneratorPowerRating - drilling_console_Jenerators(1)=GEN1BTNLED - drilling_console_Jenerators(2)=GEN2BTNLED - drilling_console_Jenerators(3)=GEN3BTNLED - drilling_console_Jenerators(4)=GEN4BTNLED + power_num_of_Jenerators=sngl(Power%NumberOfgenerators) + Jenerator_power=Power%GeneratorPowerRating + drilling_console_Jenerators(1)=DrillingConsole%GEN1BTNLED + drilling_console_Jenerators(2)=DrillingConsole%GEN2BTNLED + drilling_console_Jenerators(3)=DrillingConsole%GEN3BTNLED + drilling_console_Jenerators(4)=DrillingConsole%GEN4BTNLED drilling_num_of_Jenerators=0.d0 !do ii=1,4 diff --git a/Equipments/Pumps.old/ON_mode_simulation.f90 b/Equipments/Pumps.old/ON_mode_simulation.f90 deleted file mode 100644 index b6efbd0..0000000 --- a/Equipments/Pumps.old/ON_mode_simulation.f90 +++ /dev/null @@ -1,80 +0,0 @@ -subroutine ON_mode_simulation(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use equipments_PowerLimit - - IMPLICIT NONE - INTEGER :: Pump_No - - Call Pump_INPUTS - - ! Torque unit = (in.lbf) - PUMP(Pump_No)%Torque = (63025./132000.)*(1./PUMP(Pump_No)%Trans_Ratio)*(PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*PUMP(Pump_No)%StandPipe_Pressure/PUMP(Pump_No)%Mech_Efficiency/PUMP(Pump_No)%Vol_Efficiency) - - !call PowerLimits - - Call Pump_Traction_Motor(Pump_No) - - if (PUMP(Pump_No)%N_ref<=0.) then - PUMP(Pump_No)%w_ref = 0. - PUMP(Pump_No)%w_old = 0. - PUMP(Pump_No)%w = 0. - PUMP(Pump_No)%w_new = 0. - PUMP(Pump_No)%ia_old = 0. - PUMP(Pump_No)%ia = 0. - PUMP(Pump_No)%ia_new = 0. - PUMP(Pump_No)%x_old = 0. - PUMP(Pump_No)%x = 0. - PUMP(Pump_No)%x_new = 0. - end if - - if (Power_sigma>max_Power_sigma) then - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%Vt_old - else - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - IF (PUMP(Pump_No)%Vt_old>810.) THEN - PUMP(Pump_No)%Vt_old = 810. - ELSE IF (PUMP(Pump_No)%Vt_old<0.) THEN - PUMP(Pump_No)%Vt_old = 0. - END IF - - end if - - !PUMP(Pump_No)%Vt=PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - !IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt=810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt=0. - !END IF - - PUMP(Pump_No)%Speed = 30.*PUMP(Pump_No)%w_new/pi !Speed [RPM] - - Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - Call Set_MP2SPMGauge( sngl(1-PUMP(2)%SPMGaugeMalf)*real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - SPM2 = MP2SPMGauge - - Call Pump_Solver(Pump_No) - Call Pump_Total_Counts - !print*, 'PUMP(1)%Flow_Rate=' , PUMP(1)%Flow_Rate - IF (PUMP(1)%Flow_Rate>0.) Then - Call OpenPump1() - !print*, 'open pump 1' - Else - Call ClosePump1() - !print*, 'close pump 1' - End if - - IF (PUMP(2)%Flow_Rate>0.) Then - Call OpenPump2() - Else - Call ClosePump2() - End if - - -end subroutine ON_mode_simulation \ No newline at end of file diff --git a/Equipments/Pumps.old/Off_mode_Simulation.f90 b/Equipments/Pumps.old/Off_mode_Simulation.f90 deleted file mode 100644 index 529ebf4..0000000 --- a/Equipments/Pumps.old/Off_mode_Simulation.f90 +++ /dev/null @@ -1,51 +0,0 @@ -subroutine Off_mode_Simulation(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - - IMPLICIT NONE - INTEGER :: Pump_No - - CALL Pump_INPUTS - - !================================================================== - ! Rate limit for off Mode - - Do while (((PUMP(Pump_No)%N_old-0.0d0)/PUMP(Pump_No)%time_step)>386.) - PUMP(Pump_No)%N_ref = (-386.*PUMP(Pump_No)%time_step)+PUMP(Pump_No)%N_old - !else - ! PUMP(1)%N_ref=0.0d0 - !end if - - Call ON_mode_simulation(Pump_No) - - PUMP(Pump_No)%N_old = PUMP(Pump_No)%N_ref - Call sleepqq (80) !????????????????? - End Do - !================================================================== - - PUMP(Pump_No)%Speed = 0.0d0 - Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - Call Set_MP2SPMGauge( sngl(1-PUMP(2)%SPMGaugeMalf)*real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - SPM2 = MP2SPMGauge - PUMP(Pump_No)%w = 0. - PUMP(Pump_No)%w_old = 0.0d0 - PUMP(Pump_No)%w_new = 0.0d0 - PUMP(Pump_No)%ia = 0.0d0 - PUMP(Pump_No)%ia_old = 0.0d0 - PUMP(Pump_No)%ia_new = 0.0d0 - PUMP(Pump_No)%x = 0.0d0 - PUMP(Pump_No)%x_old = 0.0d0 - PUMP(Pump_No)%x_new = 0.0d0 - - Call Pump_Solver(Pump_No) - - Call Pump_Total_Counts - - -end subroutine off_mode_simulation \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump1_OffMode_Solver.f90 b/Equipments/Pumps.old/Pump1_OffMode_Solver.f90 deleted file mode 100644 index 16d4013..0000000 --- a/Equipments/Pumps.old/Pump1_OffMode_Solver.f90 +++ /dev/null @@ -1,68 +0,0 @@ -subroutine Pump1_OffMode_Solver(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use CSounds - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - CALL Pump_INPUTS - - - - !================================================================== - ! Rate limit for off Mode - - Do while (((PUMP(Pump_No)%N_old-0.0d0)/PUMP(Pump_No)%time_step)>386.0d0) - PUMP(Pump_No)%N_ref = (-386.0d0*PUMP(Pump_No)%time_step)+PUMP(Pump_No)%N_old - !else - ! PUMP(1)%N_ref=0.0d0 - !end if - - Call Pump1_OnMode_Solver(Pump_No) - - PUMP(Pump_No)%N_old = PUMP(Pump_No)%N_ref - Call sleepqq (80) !????????????????? - End Do - !================================================================== - - - - PUMP(Pump_No)%Speed = 0.0d0 - PUMP(Pump_No)%w = 0.0d0 - PUMP(Pump_No)%w_old = 0.0d0 - PUMP(Pump_No)%w_new = 0.0d0 - PUMP(Pump_No)%ia = 0.0d0 - PUMP(Pump_No)%ia_old = 0.0d0 - PUMP(Pump_No)%ia_new = 0.0d0 - PUMP(Pump_No)%x = 0.0d0 - PUMP(Pump_No)%x_old = 0.0d0 - PUMP(Pump_No)%x_new = 0.0d0 - - - Call Pump_Solver(Pump_No) - - Call Pump_Total_Counts - - - - Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - PUMP(1)%SoundSPM = INT(PUMP(1)%Speed/PUMP(1)%Trans_Ratio) - Call SetSoundMP1( PUMP(1)%SoundSPM ) - !Call Set_MP2SPMGauge( real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - !SPM2 = MP2SPMGauge - !print*, 'PUMP(1)%Speed2=', PUMP(1)%Speed - !print*, 'PUMP(Pump_No)%N_ref2=', PUMP(Pump_No)%N_ref - - - -end subroutine Pump1_OffMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump1_OnMode_Solver.f90 b/Equipments/Pumps.old/Pump1_OnMode_Solver.f90 deleted file mode 100644 index 358ba54..0000000 --- a/Equipments/Pumps.old/Pump1_OnMode_Solver.f90 +++ /dev/null @@ -1,120 +0,0 @@ -subroutine Pump1_OnMode_Solver(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use equipments_PowerLimit - use CSounds - use CWarningsVariables - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - Call Pump_INPUTS - - - ! Torque unit = [in.lbf] - PUMP(Pump_No)%Torque = (63025./132000.)*(1./PUMP(Pump_No)%Trans_Ratio)*(PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*PUMP(Pump_No)%StandPipe_Pressure/PUMP(Pump_No)%Mech_Efficiency/PUMP(Pump_No)%Vol_Efficiency) - - !call PowerLimits - - !print*, 'PUMP(1)%Torque=', PUMP(1)%Torque - Call Pump_Traction_Motor(Pump_No) - - !print*, 'PUMP(1)%w_new=', PUMP(1)%w_new - - if (PUMP(Pump_No)%N_ref<=0.) then - PUMP(Pump_No)%w_ref = 0. - PUMP(Pump_No)%w_old = 0. - PUMP(Pump_No)%w = 0. - PUMP(Pump_No)%w_new = 0. - PUMP(Pump_No)%ia_old = 0. - PUMP(Pump_No)%ia = 0. - PUMP(Pump_No)%ia_new = 0. - PUMP(Pump_No)%x_old = 0. - PUMP(Pump_No)%x = 0. - PUMP(Pump_No)%x_new = 0. - end if - - - - - if (Power_sigma>max_Power_sigma) then - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%Vt_old - else - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - IF (PUMP(Pump_No)%Vt_old>810.) THEN - PUMP(Pump_No)%Vt_old = 810. - ELSE IF (PUMP(Pump_No)%Vt_old<0.) THEN - PUMP(Pump_No)%Vt_old = 0. - END IF - end if - - - - - !PUMP(Pump_No)%Vt=PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - !IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt=810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt=0. - !END IF - - - - PUMP(Pump_No)%Speed = 30.d0*PUMP(Pump_No)%w_new/pi !Speed [RPM] - - if ( Pump1Failure == .true. ) then - PUMP(1)%Speed = 0.d0 - PUMP(1)%w = 0.d0 - PUMP(1)%w_new = 0.d0 - PUMP(1)%w_old = 0.d0 - end if - - - - Call Pump_Solver(Pump_No) - Call Pump_Total_Counts - - - - Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - PUMP(1)%SoundSPM = INT(PUMP(1)%Speed/PUMP(1)%Trans_Ratio) - Call SetSoundMP1( PUMP(1)%SoundSPM ) - !Call Set_MP2SPMGauge( real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - !SPM2 = MP2SPMGauge - - - - IF (PUMP(1)%Flow_Rate>0.) Then - Call OpenPump1() - Else - Call ClosePump1() - End if - - - !IF (PUMP(2)%Flow_Rate>0.) Then - ! Call OpenPump2() - !Else - ! Call ClosePump2() - !End if - - !print*, 'PUMP(1)%Speed=', PUMP(1)%Speed - !print*, 'PUMP(1)%Torque=', PUMP(1)%Torque - !print*, 'Power_sigma=', Power_sigma - !print*, 'power_num_of_Jenerators=', power_num_of_Jenerators - !print*, 'drilling_num_of_Jenerators=', drilling_num_of_Jenerators - !print*, 'max_Power_sigma=', max_Power_sigma - !print*, 'PUMP(1)%Vt=', PUMP(1)%Vt - !print*, 'PUMP(1)%SoundSPM=', PUMP(1)%SoundSPM - !print*, 'PUMP(1)%ia_new=', PUMP(1)%ia_new - - -end subroutine Pump1_OnMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump2_OffMode_Solver.f90 b/Equipments/Pumps.old/Pump2_OffMode_Solver.f90 deleted file mode 100644 index f74658c..0000000 --- a/Equipments/Pumps.old/Pump2_OffMode_Solver.f90 +++ /dev/null @@ -1,69 +0,0 @@ -subroutine Pump2_OffMode_Solver(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use CSounds - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - CALL Pump_INPUTS - - - - !================================================================== - ! Rate limit for off Mode - - Do while (((PUMP(Pump_No)%N_old-0.0d0)/PUMP(Pump_No)%time_step)>386.) - PUMP(Pump_No)%N_ref = (-386.*PUMP(Pump_No)%time_step)+PUMP(Pump_No)%N_old - !else - ! PUMP(1)%N_ref=0.0d0 - !end if - - Call Pump2_OnMode_Solver(Pump_No) - - PUMP(Pump_No)%N_old = PUMP(Pump_No)%N_ref - Call sleepqq (80) !????????????????? - End Do - !================================================================== - - - - - PUMP(Pump_No)%Speed = 0.0d0 - PUMP(Pump_No)%w = 0.0d0 - PUMP(Pump_No)%w_old = 0.0d0 - PUMP(Pump_No)%w_new = 0.0d0 - PUMP(Pump_No)%ia = 0.0d0 - PUMP(Pump_No)%ia_old = 0.0d0 - PUMP(Pump_No)%ia_new = 0.0d0 - PUMP(Pump_No)%x = 0.0d0 - PUMP(Pump_No)%x_old = 0.0d0 - PUMP(Pump_No)%x_new = 0.0d0 - - - - Call Pump_Solver(Pump_No) - - Call Pump_Total_Counts - - - - !Call Set_MP1SPMGauge( real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - !SPM1 = MP1SPMGauge - Call Set_MP2SPMGauge( sngl(1-PUMP(2)%SPMGaugeMalf)*real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - SPM2 = MP2SPMGauge - PUMP(2)%SoundSPM = INT(PUMP(2)%Speed/PUMP(2)%Trans_Ratio) - Call SetSoundMP2( PUMP(2)%SoundSPM ) - - - - -end subroutine Pump2_OffMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump2_OnMode_Solver.f90 b/Equipments/Pumps.old/Pump2_OnMode_Solver.f90 deleted file mode 100644 index eba9e2f..0000000 --- a/Equipments/Pumps.old/Pump2_OnMode_Solver.f90 +++ /dev/null @@ -1,108 +0,0 @@ -subroutine Pump2_OnMode_Solver(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use equipments_PowerLimit - use CSounds - use CWarningsVariables - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - - Call Pump_INPUTS - - ! Torque unit = [in.lbf] - PUMP(Pump_No)%Torque = (63025./132000.)*(1./PUMP(Pump_No)%Trans_Ratio)*(PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*PUMP(Pump_No)%StandPipe_Pressure/PUMP(Pump_No)%Mech_Efficiency/PUMP(Pump_No)%Vol_Efficiency) - - - !call PowerLimits - - - - Call Pump_Traction_Motor(Pump_No) - - if (PUMP(Pump_No)%N_ref<=0.) then - PUMP(Pump_No)%w_ref = 0. - PUMP(Pump_No)%w_old = 0. - PUMP(Pump_No)%w = 0. - PUMP(Pump_No)%w_new = 0. - PUMP(Pump_No)%ia_old = 0. - PUMP(Pump_No)%ia = 0. - PUMP(Pump_No)%ia_new = 0. - PUMP(Pump_No)%x_old = 0. - PUMP(Pump_No)%x = 0. - PUMP(Pump_No)%x_new = 0. - end if - - - - if (Power_sigma>max_Power_sigma) then - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%Vt_old - else - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - IF (PUMP(Pump_No)%Vt_old>810.) THEN - PUMP(Pump_No)%Vt_old = 810. - ELSE IF (PUMP(Pump_No)%Vt_old<0.) THEN - PUMP(Pump_No)%Vt_old = 0. - END IF - end if - - - - - !PUMP(Pump_No)%Vt=PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - !IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt=810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt=0. - !END IF - - PUMP(Pump_No)%Speed = 30.*PUMP(Pump_No)%w_new/pi !Speed [RPM] - - if ( Pump2Failure == .true. ) then - PUMP(2)%Speed = 0.d0 - PUMP(2)%w = 0.d0 - PUMP(2)%w_new = 0.d0 - PUMP(2)%w_old = 0.d0 - end if - - - Call Pump_Solver(Pump_No) - Call Pump_Total_Counts - - - - !Call Set_MP1SPMGauge( real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - !SPM1 = MP1SPMGauge - Call Set_MP2SPMGauge( sngl(1-PUMP(2)%SPMGaugeMalf)*real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - SPM2 = MP2SPMGauge - PUMP(2)%SoundSPM = INT(PUMP(2)%Speed/PUMP(2)%Trans_Ratio) - Call SetSoundMP2( PUMP(2)%SoundSPM ) - - - - - !IF (PUMP(1)%Flow_Rate>0.) Then - ! Call OpenPump1() - !Else - ! Call ClosePump1() - !End if - - IF (PUMP(2)%Flow_Rate>0.) Then - Call OpenPump2() - Else - Call ClosePump2() - End if - - - - -end subroutine Pump2_OnMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump3_OffMode_Solver.f90 b/Equipments/Pumps.old/Pump3_OffMode_Solver.f90 deleted file mode 100644 index 38c1370..0000000 --- a/Equipments/Pumps.old/Pump3_OffMode_Solver.f90 +++ /dev/null @@ -1,55 +0,0 @@ -subroutine Pump3_OffMode_Solver - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use CSounds - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - CALL Pump_INPUTS - - - - !================================================================== - ! Rate limit for off Mode - - Do while (((PUMP(3)%N_old-0.0d0)/PUMP(3)%time_step)>386.) - PUMP(3)%N_ref = (-386.*PUMP(3)%time_step)+PUMP(3)%N_old - !else - ! PUMP(1)%N_ref=0.0d0 - !end if - - Call Pump3_OnMode_Solver - - PUMP(3)%N_old = PUMP(3)%N_ref - Call sleepqq (80) !????????????????? - End Do - !================================================================== - - - - - PUMP(3)%Speed = 0.0 - - Call Pump_Solver(3) - - Call Pump_Total_Counts - - - Call Set_MP1SPMGauge( real((PUMP(3)%Speed/PUMP(3)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - PUMP(3)%SoundSPM = INT(PUMP(3)%Speed/PUMP(3)%Trans_Ratio) - Call SetSoundMP3( PUMP(3)%SoundSPM ) - - - - -end subroutine Pump3_OffMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump3_OnMode_Solver.f90 b/Equipments/Pumps.old/Pump3_OnMode_Solver.f90 deleted file mode 100644 index 98f1975..0000000 --- a/Equipments/Pumps.old/Pump3_OnMode_Solver.f90 +++ /dev/null @@ -1,57 +0,0 @@ -subroutine Pump3_OnMode_Solver - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use equipments_PowerLimit - use CSounds - use CWarningsVariables - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - Call Pump_INPUTS - - !! Torque unit = (in.lbf) - !PUMP(Pump_No)%Torque = (63025./132000.)*(1./PUMP(Pump_No)%Trans_Ratio)*(PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*PUMP(Pump_No)%StandPipe_Pressure/PUMP(Pump_No)%Mech_Efficiency/PUMP(Pump_No)%Vol_Efficiency) - - - - - - PUMP(3)%Speed = PUMP(3)%N_ref !Speed [RPM] - - if ( Pump3Failure == .true. ) then - PUMP(3)%Speed = 0.d0 - PUMP(3)%w = 0.d0 - PUMP(3)%w_new = 0.d0 - PUMP(3)%w_old = 0.d0 - end if - - Call Pump_Solver(3) - Call Pump_Total_Counts - - Call Set_MP1SPMGauge( real((PUMP(3)%Speed/PUMP(3)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - PUMP(3)%SoundSPM = INT(PUMP(3)%Speed/PUMP(3)%Trans_Ratio) - Call SetSoundMP3( PUMP(3)%SoundSPM ) - - - - IF (PUMP(3)%Flow_Rate>0.) Then - Call OpenCementPump() - Else - Call CloseCementPump() - End if - - - - - -end subroutine Pump3_OnMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump_INPUTS.f90 b/Equipments/Pumps.old/Pump_INPUTS.f90 deleted file mode 100644 index 2d018eb..0000000 --- a/Equipments/Pumps.old/Pump_INPUTS.f90 +++ /dev/null @@ -1,59 +0,0 @@ -subroutine Pump_INPUTS - - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use Pump_VARIABLES - use MudSystem - - IMPLICIT NONE - - - -!>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<< - - if ( PUMP(1)%BlowPopOffMalf==1 ) then ! Pump1 Malfunction ----> Blow Pop-offs (Relief Valves) - PUMP(1)%StandPipe_Pressure = 0.d0 - else - PUMP(1)%StandPipe_Pressure = PumpPressure1 ![psi] - if ( PUMP(1)%StandPipe_Pressure<=14. ) then - PUMP(1)%StandPipe_Pressure = 14. - end if - end if - - - - - -!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<< - - if ( PUMP(2)%BlowPopOffMalf==1 ) then ! Pump2 Malfunction ----> Blow Pop-offs (Relief Valves) - PUMP(2)%StandPipe_Pressure = 0.d0 - else - PUMP(2)%StandPipe_Pressure = PumpPressure2 ![psi] - if ( PUMP(2)%StandPipe_Pressure<=14. ) then - PUMP(2)%StandPipe_Pressure = 14. - end if - end if - - - - - -!>>>>>>>>>>>>>>>>>>>>>>> PUMP 3 <<<<<<<<<<<<<<<<<<<<<<<<<<< - - if ( PUMP(3)%BlowPopOffMalf==1 ) then ! Pump3 Malfunction ----> Blow Pop-offs (Relief Valves) - PUMP(3)%StandPipe_Pressure = 0.d0 - else - PUMP(3)%StandPipe_Pressure = PumpPressure3 ![psi] - if ( PUMP(3)%StandPipe_Pressure<=14. ) then - PUMP(3)%StandPipe_Pressure = 14. - end if - end if - - - - - -end subroutine Pump_INPUTS \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump_Solver.f90 b/Equipments/Pumps.old/Pump_Solver.f90 deleted file mode 100644 index 2adb3f4..0000000 --- a/Equipments/Pumps.old/Pump_Solver.f90 +++ /dev/null @@ -1,29 +0,0 @@ -subroutine Pump_Solver(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - PUMP(Pump_No)%Flow_Rate = PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio)*PUMP(Pump_No)%Vol_Efficiency/77.d0 ![gpm] - PUMP(Pump_No)%Hydraulic_HorsePower = PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio)*PUMP(Pump_No)%StandPipe_Pressure/132000.d0 ![HHP] - PUMP(Pump_No)%TracMotor_Horsepower = PUMP(Pump_No)%Hydraulic_HorsePower/PUMP(Pump_No)%Mech_Efficiency/PUMP(Pump_No)%Vol_Efficiency ![HHP] - !PUMP(Pump_No)%Max_Pressure = (PUMP(Pump_No)%Max_Horsepower*1714.)/PUMP(Pump_No)%Flow_Rate ![psi] - - - if ( (PUMP(Pump_No)%StandPipe_Pressure*PUMP(Pump_No)%Flow_Rate)>(1714.d0*PUMP(Pump_No)%Max_Horsepower*PUMP(Pump_No)%Mech_Efficiency*PUMP(Pump_No)%Vol_Efficiency) ) then - PUMP(Pump_No)%Flow_Rate = (1714.d0*PUMP(Pump_No)%Max_Horsepower*PUMP(Pump_No)%Mech_Efficiency*PUMP(Pump_No)%Vol_Efficiency)/PUMP(Pump_No)%StandPipe_Pressure ![gpm] - PUMP(Pump_No)%Speed = ( (PUMP(Pump_No)%Flow_Rate*77.d0)/(PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length) )*PUMP(Pump_No)%Trans_Ratio ![rpm] - end if - - - - -end subroutine Pump_Solver \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump_StartUp.f90 b/Equipments/Pumps.old/Pump_StartUp.f90 deleted file mode 100644 index 98b9d2e..0000000 --- a/Equipments/Pumps.old/Pump_StartUp.f90 +++ /dev/null @@ -1,52 +0,0 @@ -subroutine Pump_StartUp - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CPowerVariables - use Pump_VARIABLES - - IMPLICIT NONE - - !>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<< - PUMP(1)%Stroke_Length = MudPump1Stroke - PUMP(1)%Piston_Diameter = MudPump1LinerDiameter - PUMP(1)%Piston_Area = pi*PUMP(1)%Piston_Diameter*PUMP(1)%Piston_Diameter/4. - PUMP(1)%Mech_Efficiency = MudPump1MechanicalEfficiency - PUMP(1)%Vol_Efficiency = MudPump1VolumetricEfficiency - PUMP(1)%Max_Horsepower = MudPump1 - PUMP(1)%Inertia_Moment = 23.261341 ! 23.261341 [kg.m^2] = 552 [lb.ft^2] - PUMP(1)%J_coef = PUMP(1)%Inertia_Moment+(4.*(PUMP(1)%Inertia_Moment)) - PUMP(1)%Trans_Ratio = 965.0/MudPump1Maximum - PUMP(1)%time_step = .10 - PUMP(1)%Flow_Rate = 0. - Call Pump1_OffMode_Solver(1) - -!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<< - PUMP(2)%Stroke_Length = MudPump2Stroke - PUMP(2)%Piston_Diameter = MudPump2LinerDiameter - PUMP(2)%Piston_Area = pi*PUMP(2)%Piston_Diameter*PUMP(2)%Piston_Diameter/4. - PUMP(2)%Mech_Efficiency = MudPump2MechanicalEfficiency - PUMP(2)%Vol_Efficiency = MudPump2VolumetricEfficiency - PUMP(2)%Max_Horsepower = MudPump2 - PUMP(2)%Inertia_Moment = 23.261341 ! 23.261341 [kg.m^2] = 552 [lb.ft^2] - PUMP(2)%J_coef = PUMP(2)%Inertia_Moment+(4.*(PUMP(2)%Inertia_Moment)) - PUMP(2)%Trans_Ratio = 965.0/MudPump2Maximum - PUMP(2)%time_step = .10 - PUMP(2)%Flow_Rate = 0. - Call Pump2_OffMode_Solver(2) - -!>>>>>>>>>>>>>>>>>>>>>>> PUMP 3 <<<<<<<<<<<<<<<<<<<<<<<<<<< - PUMP(3)%Stroke_Length = CementPumpStroke - PUMP(3)%Piston_Diameter = CementPumpLinerDiameter - PUMP(3)%Piston_Area = pi*PUMP(3)%Piston_Diameter*PUMP(3)%Piston_Diameter/4. - PUMP(3)%Mech_Efficiency = CementPumpMechanicalEfficiency - PUMP(3)%Vol_Efficiency = CementPumpVolumetricEfficiency - PUMP(3)%Max_Horsepower = CementPump - PUMP(3)%Inertia_Moment = 23.261341 ! 23.261341 [kg.m^2] = 552 [lb.ft^2] - PUMP(3)%Trans_Ratio = 965.0/CementPumpMaximum - PUMP(3)%time_step = .10 - PUMP(3)%Flow_Rate = 0. - Call Pump3_OffMode_Solver - -end subroutine Pump_StartUp \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump_Total_Counts.f90 b/Equipments/Pumps.old/Pump_Total_Counts.f90 deleted file mode 100644 index e140c45..0000000 --- a/Equipments/Pumps.old/Pump_Total_Counts.f90 +++ /dev/null @@ -1,11 +0,0 @@ -subroutine Pump_Total_Counts - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - - IMPLICIT NONE - Total_Pump_GPM = PUMP(1)%Flow_Rate+PUMP(2)%Flow_Rate+PUMP(3)%Flow_Rate - Total_Pump_SPM = (PUMP(1)%Speed/PUMP(1)%Trans_Ratio)+(PUMP(2)%Speed/PUMP(2)%Trans_Ratio)+(PUMP(3)%Speed/PUMP(3)%Trans_Ratio) -end subroutine \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump_Traction_Motor.f90 b/Equipments/Pumps.old/Pump_Traction_Motor.f90 deleted file mode 100644 index c050d8e..0000000 --- a/Equipments/Pumps.old/Pump_Traction_Motor.f90 +++ /dev/null @@ -1,124 +0,0 @@ -subroutine Pump_Traction_Motor(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - - - IMPLICIT NONE - INTEGER :: Pump_No - - - -!>>>>>>>>>>>>>>>>>>>>>>> DATA <<<<<<<<<<<<<<<<<<<<<<<<<<< - PUMP(Pump_No)%TL = 0.112985*PUMP(Pump_No)%Torque/2.d0 - - La = 1700.*1d-6 !170.*1d-6 !1700.*1d-6 - !Lf = 260.*1d-6 - Lf = 0.d0 - Ra = 9.5*1d-3 !0.1d0 !9.5*1d-3 - !Rf = 5.4*1d-3 - Rf = 0.d0 - - !******** controller ******* - Kpn = 11. !3. !=11. - !Kin = 50. - Kpi = 100. - Kii = 900. - - - PUMP(Pump_No)%time = PUMP(Pump_No)%time_step - PUMP(Pump_No)%dt = 1.d-5 - PUMP(Pump_No)%error = .001 - -!>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - - PUMP(Pump_No)%n = PUMP(Pump_No)%time/PUMP(Pump_No)%dt - !PUMP(Pump_No)%w_ref = (pi*(PUMP(Pump_No)%N_ref+102.d0)/30.d0) - PUMP(Pump_No)%w_ref = (pi*(PUMP(Pump_No)%N_ref)/30.d0) - - !if (PUMP(Pump_No)%N_ref<=0.) then - ! PUMP(Pump_No)%w_ref = 0. - !end if - - - !if (PUMP(Pump_No)%N_ref<=0.) then - ! PUMP(Pump_No)%w_ref = 0. - ! PUMP(Pump_No)%w_old = 0. - ! PUMP(Pump_No)%w = 0. - !end if - - - PUMP(Pump_No)%ia_er = 1. - PUMP(Pump_No)%w_er = 1. - PUMP(Pump_No)%x_er = 1. - - - PUMP(Pump_No)%i = 1 - -!>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - DO WHILE (PUMP(Pump_No)%i<=PUMP(Pump_No)%n) - -!>>>>>>>>>>>> Runge-Kutta Method (4th order) <<<<<<<<<<<<<< - - call Pump_dx((PUMP(Pump_No)%i*PUMP(Pump_No)%dt),PUMP(Pump_No)%ia,PUMP(Pump_No)%w,PUMP(Pump_No)%x,Pump_No) - call Pump_dia((PUMP(Pump_No)%i*PUMP(Pump_No)%dt),PUMP(Pump_No)%ia,PUMP(Pump_No)%w,PUMP(Pump_No)%fii,PUMP(Pump_No)%x,Pump_No) - call Pump_dw((PUMP(Pump_No)%i*PUMP(Pump_No)%dt),PUMP(Pump_No)%ia,PUMP(Pump_No)%w,PUMP(Pump_No)%fii,PUMP(Pump_No)%TL,Pump_No) - PUMP(Pump_No)%K1x=PUMP(Pump_No)%dt*PUMP(Pump_No)%dx - PUMP(Pump_No)%K1ia=PUMP(Pump_No)%dt*PUMP(Pump_No)%dia - PUMP(Pump_No)%K1w=PUMP(Pump_No)%dt*PUMP(Pump_No)%dw - - call Pump_dx((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K1ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K1w/2.),PUMP(Pump_No)%x+(PUMP(Pump_No)%K1x/2.),Pump_No) - call Pump_dia((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K1ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K1w/2.),PUMP(Pump_No)%fii,PUMP(Pump_No)%x+(PUMP(Pump_No)%K1x/2.),Pump_No) - call Pump_dw((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K1ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K1w/2.),PUMP(Pump_No)%fii,PUMP(Pump_No)%TL,Pump_No) - PUMP(Pump_No)%K2x=PUMP(Pump_No)%dt*PUMP(Pump_No)%dx - PUMP(Pump_No)%K2ia=PUMP(Pump_No)%dt*PUMP(Pump_No)%dia - PUMP(Pump_No)%K2w=PUMP(Pump_No)%dt*PUMP(Pump_No)%dw - - call Pump_dx((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K2ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K2w/2.),PUMP(Pump_No)%x+(PUMP(Pump_No)%K2x/2.),Pump_No) - call Pump_dia((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K2ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K2w/2.),PUMP(Pump_No)%fii,PUMP(Pump_No)%x+(PUMP(Pump_No)%K2x/2.),Pump_No) - call Pump_dw((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K2ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K2w/2.),PUMP(Pump_No)%fii,PUMP(Pump_No)%TL,Pump_No) - PUMP(Pump_No)%K3x=PUMP(Pump_No)%dt*PUMP(Pump_No)%dx - PUMP(Pump_No)%K3ia=PUMP(Pump_No)%dt*PUMP(Pump_No)%dia - PUMP(Pump_No)%K3w=PUMP(Pump_No)%dt*PUMP(Pump_No)%dw - - call Pump_dx((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+PUMP(Pump_No)%dt,PUMP(Pump_No)%ia+PUMP(Pump_No)%K3ia,PUMP(Pump_No)%w+PUMP(Pump_No)%K3w,PUMP(Pump_No)%x+PUMP(Pump_No)%K3x,Pump_No) - call Pump_dia((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+PUMP(Pump_No)%dt,PUMP(Pump_No)%ia+PUMP(Pump_No)%K3ia,PUMP(Pump_No)%w+PUMP(Pump_No)%K3w,PUMP(Pump_No)%fii,PUMP(Pump_No)%x+PUMP(Pump_No)%K3x,Pump_No) - call Pump_dw((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+PUMP(Pump_No)%dt,PUMP(Pump_No)%ia+PUMP(Pump_No)%K3ia,PUMP(Pump_No)%w+PUMP(Pump_No)%K3w,PUMP(Pump_No)%fii,PUMP(Pump_No)%TL,Pump_No) - PUMP(Pump_No)%K4x=PUMP(Pump_No)%dt*PUMP(Pump_No)%dx - PUMP(Pump_No)%K4ia=PUMP(Pump_No)%dt*PUMP(Pump_No)%dia - PUMP(Pump_No)%K4w=PUMP(Pump_No)%dt*PUMP(Pump_No)%dw - - PUMP(Pump_No)%x_new = PUMP(Pump_No)%x_old+((PUMP(Pump_No)%K1x+(2.*PUMP(Pump_No)%K2x)+(2.*PUMP(Pump_No)%K3x)+PUMP(Pump_No)%K4x)/6.) - PUMP(Pump_No)%ia_new = PUMP(Pump_No)%ia_old+((PUMP(Pump_No)%K1ia+(2.*PUMP(Pump_No)%K2ia)+(2.*PUMP(Pump_No)%K3ia)+PUMP(Pump_No)%K4ia)/6.) - PUMP(Pump_No)%w_new = PUMP(Pump_No)%w_old+((PUMP(Pump_No)%K1w+(2.*PUMP(Pump_No)%K2w)+(2.*PUMP(Pump_No)%K3w)+PUMP(Pump_No)%K4w)/6.) - -!>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - - - PUMP(Pump_No)%x_old = PUMP(Pump_No)%x_new - PUMP(Pump_No)%ia_old = PUMP(Pump_No)%ia_new - PUMP(Pump_No)%w_old = PUMP(Pump_No)%w_new - PUMP(Pump_No)%x = PUMP(Pump_No)%x_new - PUMP(Pump_No)%ia = PUMP(Pump_No)%ia_new - PUMP(Pump_No)%w = PUMP(Pump_No)%w_new - PUMP(Pump_No)%Te = PUMP(Pump_No)%fii*PUMP(Pump_No)%ia_new - - !PUMP(Pump_No)%Vt = PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - !IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt = 810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt = 0. - !END IF - - PUMP(Pump_No)%i = PUMP(Pump_No)%i+1 - - END DO -!>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - - - - -end subroutine Pump_Traction_Motor \ No newline at end of file diff --git a/Equipments/Pumps.old/Pump_VARIABLES.f90 b/Equipments/Pumps.old/Pump_VARIABLES.f90 deleted file mode 100644 index 41141ba..0000000 --- a/Equipments/Pumps.old/Pump_VARIABLES.f90 +++ /dev/null @@ -1,61 +0,0 @@ -MODULE Pump_VARIABLES - - - IMPLICIT NONE - PUBLIC - - - REAL , PARAMETER :: pi=3.14159265 - REAL :: La, Lf, Ra, Rf - REAL :: Kpn, Kin, Kpi, Kii - REAL :: Total_Pump_GPM, Total_Pump_SPM, Total_Stroke_Counter_For_Plot - -!**************************************************************************************************** -!**************** Define PUMP Array ************************************************************ - TYPE, PUBLIC :: Pump_Var - -!***** Pump_VARIABLES *************************** - INTEGER :: j , AssignmentSwitchh - INTEGER :: PowerFailMalf , BlowPopOffMalf , SPMGaugeMalf - - REAL :: Stroke_Length, Piston_Area, Piston_Diameter, Inertia_Moment - REAL :: Mech_Efficiency, Vol_Efficiency, Trans_Ratio - REAL :: StandPipe_Pressure , Max_Pressure - REAL :: Torque, Speed - REAL :: Flow_Rate, Hydraulic_HorsePower, TracMotor_Horsepower , Max_Horsepower - REAL :: simulation_time, time_step - - REAL(8) :: START_TIME, END_TIME - INTEGER :: INT_CPU_TIME, Dt_ref - -!***** Traction Motor_VARIABLES ***************** - INTEGER :: i, n - - REAL :: TL, Vt, J_coef, Ea, fii, Te - REAL :: time, dt, zaman - REAL :: ia, w, ia_old, w_old, ia_new, w_new - REAL :: error, ia_er, w_er ,x_er, y_er - REAL :: K1ia, K1w, K2ia, K2w, K3ia, K3w, K4ia, K4w - REAL :: K1x, K1y, K2x, K2y, K3x, K3y, K4x, K4y - REAL :: ia_ref, w_ref, N_ref ! N(rpm) , w(rad/s) - REAL :: x, y, x_old, y_old, x_new, y_new - REAL :: dia, dw, dx - REAL :: N_new, N_old - REAL :: Vt_old - - -!************* Sound_VARIABLES ********************** - INTEGER :: SoundSPM - Logical :: SoundBlower - - - END TYPE Pump_Var - - TYPE(Pump_Var), DIMENSION(1:3) :: PUMP -!*********************************************************************************************** -!**************************************************************************************************** - - - - -END MODULE Pump_VARIABLES \ No newline at end of file diff --git a/Equipments/Pumps.old/PumpsMain.f90 b/Equipments/Pumps.old/PumpsMain.f90 deleted file mode 100644 index 3582d4b..0000000 --- a/Equipments/Pumps.old/PumpsMain.f90 +++ /dev/null @@ -1,719 +0,0 @@ -module PumpsMain - - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use Pump_VARIABLES - use CSounds - - implicit none - public - - contains - - - -! **************************************** -! ***** subroutine Pump1MainBody ***** -! **************************** - - subroutine Pump1_Setup() - use CSimulationVariables - implicit none - call OnSimulationInitialization%Add(Pump1_Init) - call OnSimulationStop%Add(Pump1_Init) - call OnPump1Step%Add(Pump1_Step) - call OnPump1Output%Add(Pump1_Output) - call OnPump1Main%Add(Pump1MainBody) - end subroutine - - subroutine Pump1_Init - implicit none - end subroutine Pump1_Init - - !!Extracted from pump1MainBody - subroutine Pump1_Step - use CWarningsVariables - integer,dimension(8) :: MP_START_TIME, MP_END_TIME - INTEGER :: MP_SolDuration - - if (PUMP(1)%PowerFailMalf==1) then - !MP1BLWR=0 - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - end if - ! Pump1 Warning ----> Failure - if (Pump1Failure==1) then - !MP1BLWR=0 - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - end if - - ! Pump3 Malfunction ----> Power Failure - if (PUMP(3)%PowerFailMalf==1) then - Call Pump3_OffMode_Solver - !Call ClosePump3() - end if - ! Pump3 Warning ----> Failure - if (Pump3Failure==1) then - Call Pump3_OffMode_Solver - !Call ClosePump3() - end if - - - !print*, 'MP1Throttle=', MP1Throttle - if (IsPortable) then - PUMP(1)%AssignmentSwitchh = 1 - else - PUMP(1)%AssignmentSwitchh = AssignmentSwitch - end if - if((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (MP1CPSwitch==-1) .and. (MP1Throttle==0.) .and. (PUMP(1)%PowerFailMalf==0)) then - !print*, 'pumps on' - !print*, 'PUMP(1)%AssignmentSwitchh=' , PUMP(1)%AssignmentSwitchh - PUMP(1)%SoundBlower = .true. - Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) - MP1BLWR = 1 - - loop2: do - Call DrillingConsole_ScrLEDs - Call Pump_Total_Counts - - Call DATE_AND_TIME(values=MP_START_TIME) - - ! Pump1 Malfunction ----> Power Failure - if (PUMP(1)%PowerFailMalf==1) then - !MP1BLWR=0 - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - exit loop2 - end if - - - ! Pump1 Warning ----> Failure - if (Pump1Failure==1) then - !MP1BLWR=0 - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - exit loop2 - end if - - - PUMP(1)%N_new = MP1Throttle - if (((PUMP(1)%N_new-PUMP(1)%N_old)/PUMP(1)%time_step)>193.) then - PUMP(1)%N_ref =(193.*PUMP(1)%time_step)+PUMP(1)%N_old - else if (((PUMP(1)%N_old-PUMP(1)%N_new)/PUMP(1)%time_step)>193.) then - PUMP(1)%N_ref = (-193.*PUMP(1)%time_step)+PUMP(1)%N_old - else - PUMP(1)%N_ref = PUMP(1)%N_new - end if - !print*, 'PUMP(1)%N_ref=' , PUMP(1)%N_ref , MP1Throttle - Call Pump1_OnMode_Solver(1) - - !IF (PUMP(1)%Flow_Rate>0.) Then - ! Call OpenPump1() - !Else - ! Call ClosePump1() - !End if - - PUMP(1)%N_old = PUMP(1)%N_ref - - Call DATE_AND_TIME(values=MP_END_TIME) - MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) - !print*, 'MPtime=', MP_SolDuration - if(MP_SolDuration > 0.0) then - Call sleepqq(MP_SolDuration) - end if - - if (IsPortable) then - PUMP(1)%AssignmentSwitchh = 1 - else - PUMP(1)%AssignmentSwitchh = AssignmentSwitch - end if - if ((any(PUMP(1)%AssignmentSwitchh==(/5,6,7,8,11,12/))) .or. (MP1CPSwitch/=-1) .or. (IsStopped == .true.)) then - PUMP(1)%SoundBlower = .false. - Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) - MP1BLWR = 0 - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - exit loop2 - end if - end do loop2 - - else if( (MP1CPSwitch==1) .and. (MP1Throttle==0.) .and. (PUMP(3)%PowerFailMalf==0) ) then - - loop3: do - Call DATE_AND_TIME(values=MP_START_TIME) - !print*, 'PUMP(3) is on' - - ! Pump3 Malfunction ----> Power Failure - if (PUMP(3)%PowerFailMalf==1) then - Call Pump3_OffMode_Solver - !Call ClosePump3() - exit loop3 - end if - - - ! Pump3 Warning ----> Failure - if (Pump3Failure==1) then - !MP1BLWR=0 - Call Pump3_OffMode_Solver - !Call ClosePump3() !????????????? - exit loop3 - end if - - - PUMP(3)%N_new = MP1Throttle - if (((PUMP(3)%N_new-PUMP(3)%N_old)/PUMP(3)%time_step)>193.) then - PUMP(3)%N_ref =(193.*PUMP(3)%time_step)+PUMP(3)%N_old - else if (((PUMP(3)%N_old-PUMP(3)%N_new)/PUMP(3)%time_step)>193.) then - PUMP(3)%N_ref = (-193.*PUMP(3)%time_step)+PUMP(3)%N_old - else - PUMP(3)%N_ref = PUMP(3)%N_new - end if - - Call Pump3_OnMode_Solver - - IF (PUMP(3)%Flow_Rate>0.) Then - Call OpenCementPump() - Else - Call CloseCementPump() - End if - - PUMP(3)%N_old = PUMP(3)%N_ref - - Call DATE_AND_TIME(values=MP_END_TIME) - MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) - !print*, 'MPtime=', MP_SolDuration - if(MP_SolDuration > 0.0) then - Call sleepqq(MP_SolDuration) - end if - - if ((MP1CPSwitch/=1) .or. (IsStopped == .true.)) then - Call Pump3_OffMode_Solver - Call CloseCementPump() - exit loop3 - end if - end do loop3 - else - !print*, 'pumps off' - if (IsPortable) then - PUMP(1)%AssignmentSwitchh = 1 - !print*, 'PUMP(1)%AssignmentSwitchh2=' , PUMP(1)%AssignmentSwitchh - else - PUMP(1)%AssignmentSwitchh = AssignmentSwitch - !print*, 'PUMP(1)%AssignmentSwitchh22=' , PUMP(1)%AssignmentSwitchh , AssignmentSwitch - end if - if ((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (MP1CPSwitch==-1)) then - PUMP(1)%SoundBlower = .true. - Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) - MP1BLWR = 1 - else - PUMP(1)%SoundBlower = .false. - Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) - MP1BLWR = 0 - end if - - - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - Call Pump3_OffMode_Solver - Call CloseCementPump() - !print*, 'PUMP(1)%off=', PUMP(1)%dt , PUMP(1)%ia , PUMP(1)%w , PUMP(1)%n , PUMP(1)%x - end if - end subroutine Pump1_Step - - subroutine Pump1_Output - implicit none - end subroutine Pump1_Output - - subroutine Pump1MainBody - use ifport - use ifmt - use CWarningsVariables - !use equipments_PowerLimit - implicit none - - integer,dimension(8) :: MP_START_TIME, MP_END_TIME - INTEGER :: MP_SolDuration - - Call Pump_StartUp - loop1 : do - Call sleepqq(10) - Call DrillingConsole_ScrLEDs - !Call Pump_Total_Counts - ! Pump1 Malfunction ----> Power Failure - if (PUMP(1)%PowerFailMalf==1) then - !MP1BLWR=0 - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - end if - ! Pump1 Warning ----> Failure - if (Pump1Failure==1) then - !MP1BLWR=0 - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - end if - - - ! Pump3 Malfunction ----> Power Failure - if (PUMP(3)%PowerFailMalf==1) then - Call Pump3_OffMode_Solver - !Call ClosePump3() - end if - ! Pump3 Warning ----> Failure - if (Pump3Failure==1) then - Call Pump3_OffMode_Solver - !Call ClosePump3() - end if - - - !print*, 'MP1Throttle=', MP1Throttle - if (IsPortable) then - PUMP(1)%AssignmentSwitchh = 1 - else - PUMP(1)%AssignmentSwitchh = AssignmentSwitch - end if - if((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (MP1CPSwitch==-1) .and. (MP1Throttle==0.) .and. (PUMP(1)%PowerFailMalf==0)) then - !print*, 'pumps on' - !print*, 'PUMP(1)%AssignmentSwitchh=' , PUMP(1)%AssignmentSwitchh - PUMP(1)%SoundBlower = .true. - Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) - MP1BLWR = 1 - - loop2: do - Call DrillingConsole_ScrLEDs - Call Pump_Total_Counts - - Call DATE_AND_TIME(values=MP_START_TIME) - - ! Pump1 Malfunction ----> Power Failure - if (PUMP(1)%PowerFailMalf==1) then - !MP1BLWR=0 - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - exit loop2 - end if - - - ! Pump1 Warning ----> Failure - if (Pump1Failure==1) then - !MP1BLWR=0 - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - exit loop2 - end if - - - PUMP(1)%N_new = MP1Throttle - if (((PUMP(1)%N_new-PUMP(1)%N_old)/PUMP(1)%time_step)>193.) then - PUMP(1)%N_ref =(193.*PUMP(1)%time_step)+PUMP(1)%N_old - else if (((PUMP(1)%N_old-PUMP(1)%N_new)/PUMP(1)%time_step)>193.) then - PUMP(1)%N_ref = (-193.*PUMP(1)%time_step)+PUMP(1)%N_old - else - PUMP(1)%N_ref = PUMP(1)%N_new - end if - !print*, 'PUMP(1)%N_ref=' , PUMP(1)%N_ref , MP1Throttle - Call Pump1_OnMode_Solver(1) - - !IF (PUMP(1)%Flow_Rate>0.) Then - ! Call OpenPump1() - !Else - ! Call ClosePump1() - !End if - - PUMP(1)%N_old = PUMP(1)%N_ref - - Call DATE_AND_TIME(values=MP_END_TIME) - MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) - !print*, 'MPtime=', MP_SolDuration - if(MP_SolDuration > 0.0) then - Call sleepqq(MP_SolDuration) - end if - - if (IsPortable) then - PUMP(1)%AssignmentSwitchh = 1 - else - PUMP(1)%AssignmentSwitchh = AssignmentSwitch - end if - if ((any(PUMP(1)%AssignmentSwitchh==(/5,6,7,8,11,12/))) .or. (MP1CPSwitch/=-1) .or. (IsStopped == .true.)) then - PUMP(1)%SoundBlower = .false. - Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) - MP1BLWR = 0 - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - exit loop2 - end if - end do loop2 - - else if( (MP1CPSwitch==1) .and. (MP1Throttle==0.) .and. (PUMP(3)%PowerFailMalf==0) ) then - - loop3: do - Call DATE_AND_TIME(values=MP_START_TIME) - !print*, 'PUMP(3) is on' - - ! Pump3 Malfunction ----> Power Failure - if (PUMP(3)%PowerFailMalf==1) then - Call Pump3_OffMode_Solver - !Call ClosePump3() - exit loop3 - end if - - - ! Pump3 Warning ----> Failure - if (Pump3Failure==1) then - !MP1BLWR=0 - Call Pump3_OffMode_Solver - !Call ClosePump3() !????????????? - exit loop3 - end if - - - PUMP(3)%N_new = MP1Throttle - if (((PUMP(3)%N_new-PUMP(3)%N_old)/PUMP(3)%time_step)>193.) then - PUMP(3)%N_ref =(193.*PUMP(3)%time_step)+PUMP(3)%N_old - else if (((PUMP(3)%N_old-PUMP(3)%N_new)/PUMP(3)%time_step)>193.) then - PUMP(3)%N_ref = (-193.*PUMP(3)%time_step)+PUMP(3)%N_old - else - PUMP(3)%N_ref = PUMP(3)%N_new - end if - - Call Pump3_OnMode_Solver - - IF (PUMP(3)%Flow_Rate>0.) Then - Call OpenCementPump() - Else - Call CloseCementPump() - End if - - PUMP(3)%N_old = PUMP(3)%N_ref - - Call DATE_AND_TIME(values=MP_END_TIME) - MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) - !print*, 'MPtime=', MP_SolDuration - if(MP_SolDuration > 0.0) then - Call sleepqq(MP_SolDuration) - end if - - if ((MP1CPSwitch/=1) .or. (IsStopped == .true.)) then - Call Pump3_OffMode_Solver - Call CloseCementPump() - exit loop3 - end if - end do loop3 - - else - !print*, 'pumps off' - if (IsPortable) then - PUMP(1)%AssignmentSwitchh = 1 - !print*, 'PUMP(1)%AssignmentSwitchh2=' , PUMP(1)%AssignmentSwitchh - else - PUMP(1)%AssignmentSwitchh = AssignmentSwitch - !print*, 'PUMP(1)%AssignmentSwitchh22=' , PUMP(1)%AssignmentSwitchh , AssignmentSwitch - end if - if ((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (MP1CPSwitch==-1)) then - PUMP(1)%SoundBlower = .true. - Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) - MP1BLWR = 1 - else - PUMP(1)%SoundBlower = .false. - Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) - MP1BLWR = 0 - end if - - - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - Call Pump3_OffMode_Solver - Call CloseCementPump() - !print*, 'PUMP(1)%off=', PUMP(1)%dt , PUMP(1)%ia , PUMP(1)%w , PUMP(1)%n , PUMP(1)%x - - end if - - if (IsStopped == .true.) then - exit loop1 - end if - - end do loop1 - - - end subroutine Pump1MainBody - - - - - -! **************************************** -! ***** subroutine Pump2MainBody ***** -! **************************** - subroutine Pump2_Setup() - use CSimulationVariables - implicit none - call OnSimulationInitialization%Add(Pump2_Init) - call OnSimulationStop%Add(Pump2_Init) - call OnPump2Step%Add(Pump2_Step) - call OnPump2Output%Add(Pump2_Output) - call OnPump2Main%Add(Pump2MainBody) - end subroutine - - subroutine Pump2_Init - implicit none - end subroutine Pump2_Init - - subroutine Pump2_Step - implicit none - end subroutine Pump2_Step - - subroutine Pump2_Output - implicit none - end subroutine Pump2_Output - - subroutine Pump2MainBody - use ifport - use ifmt - use CWarningsVariables - implicit none - - integer,dimension(8) :: MP_START_TIME, MP_END_TIME - INTEGER :: MP_SolDuration - - Call Pump_StartUp - loop1 : do - - Call sleepqq(10) - - ! Pump2 Malfunction ----> Power Failure - if (PUMP(2)%PowerFailMalf==1) then - Call ClosePump2() - !MP2BLWR=0 - Call Pump2_OffMode_Solver(2) - end if - - - ! Pump2 Warning ----> Failure - if (Pump2Failure==1) then - !MP1BLWR=0 - Call Pump2_OffMode_Solver(2) - Call ClosePump2() - end if - - - if (IsPortable) then - PUMP(2)%AssignmentSwitchh = 1 - else - PUMP(2)%AssignmentSwitchh = AssignmentSwitch - end if - if((any(PUMP(2)%AssignmentSwitchh==(/1,2,3,4,5,7,8,11/))) .and. (MP2Switch==1) .and. (MP2Throttle==0.).and. (PUMP(2)%PowerFailMalf==0)) then - - PUMP(2)%SoundBlower = .true. - Call SetSoundBlowerMP2(PUMP(2)%SoundBlower) - MP2BLWR = 1 - - loop2: do - CALL DATE_AND_TIME(values=MP_START_TIME) - - ! Pump2 Malfunction ----> Power Failure - if (PUMP(2)%PowerFailMalf==1) then - Call ClosePump2() - !MP2BLWR=0 - Call Pump2_OffMode_Solver(2) - exit loop2 - end if - - - ! Pump2 Warning ----> Failure - if (Pump2Failure==1) then - Call ClosePump2() - !MP2BLWR=0 - Call Pump2_OffMode_Solver(2) - exit loop2 - end if - - - PUMP(2)%N_new = MP2Throttle - if (((PUMP(2)%N_new-PUMP(2)%N_old)/PUMP(2)%time_step)>193.) then - PUMP(2)%N_ref = (193.*PUMP(2)%time_step)+PUMP(2)%N_old - else if (((PUMP(2)%N_old-PUMP(2)%N_new)/PUMP(2)%time_step)>193.) then - PUMP(2)%N_ref = (-193.*PUMP(2)%time_step)+PUMP(2)%N_old - else - PUMP(2)%N_ref = PUMP(2)%N_new - end if - - Call Pump2_OnMode_Solver(2) - - !IF (PUMP(2)%Flow_Rate>0.) Then - ! Call OpenPump2() - !Else - ! Call ClosePump2() - !End if - - PUMP(2)%N_old=PUMP(2)%N_ref - - Call DATE_AND_TIME(values=MP_END_TIME) - MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) - !print*, 'MPtime=', MP_SolDuration - if(MP_SolDuration > 0.0d0) then - CALL sleepqq(MP_SolDuration) - end if - - if (IsPortable) then - PUMP(2)%AssignmentSwitchh = 1 - else - PUMP(2)%AssignmentSwitchh = AssignmentSwitch - end if - if ((any(PUMP(2)%AssignmentSwitchh==(/6,9,10,12/))) .or. (MP2Switch==0) .or. (IsStopped == .true.)) then - Call ClosePump2() - PUMP(2)%SoundBlower = .false. - Call SetSoundBlowerMP2(PUMP(2)%SoundBlower) - MP2BLWR = 0 - Call Pump2_OffMode_Solver(2) - exit loop2 - end if - - end do loop2 - - else - - if (IsPortable) then - PUMP(2)%AssignmentSwitchh = 1 - else - PUMP(2)%AssignmentSwitchh = AssignmentSwitch - end if - if((any(PUMP(2)%AssignmentSwitchh==(/1,2,3,4,5,7,8,11/))) .and. (MP2Switch==1)) then - PUMP(2)%SoundBlower = .true. - Call SetSoundBlowerMP2(PUMP(2)%SoundBlower) - MP2BLWR = 1 - else - PUMP(2)%SoundBlower = .false. - Call SetSoundBlowerMP2(PUMP(2)%SoundBlower) - MP2BLWR = 0 - end if - - PUMP(2)%N_ref = MP2Throttle - Call ClosePump2() - Call Pump2_OffMode_Solver(2) - - end if - - if (IsStopped == .true.) then - exit loop1 - end if - - end do loop1 - - - end subroutine Pump2MainBody - - - - -! **************************************** -! ***** subroutine Pump3MainBody ***** -! **************************** - subroutine Pump3_Setup() - use CSimulationVariables - implicit none - call OnSimulationInitialization%Add(Pump3_Init) - call OnSimulationStop%Add(Pump3_Init) - call OnPump3Step%Add(Pump3_Step) - call OnPump3Output%Add(Pump3_Output) - call OnPump3Main%Add(Pump3MainBody) - end subroutine - - subroutine Pump3_Init - implicit none - end subroutine Pump3_Init - - subroutine Pump3_Step - implicit none - end subroutine Pump3_Step - - subroutine Pump3_Output - implicit none - end subroutine Pump3_Output - - subroutine Pump3MainBody - use ifport - use ifmt - implicit none - - - integer,dimension(8) :: MP_START_TIME, MP_END_TIME - INTEGER :: MP_SolDuration - - !Call Pump_StartUp - !loop1 : do - ! - ! Call sleepqq(10) - ! - ! !!! Pump3 Malfunction ----> Power Failure - ! !!if (PUMP(1)%PowerFailMalf==1) then - ! !! !MP1BLWR=0 - ! !! Call Pump3_OffMode_Solver - ! !! Call ClosePump1() - ! !!end if - ! - ! !if( (MP1CPSwitch==1) .and. (MP1Throttle==0.) .and. (PUMP(3)%PowerFailMalf==0) ) then - !! - !! loop2: do - !! - !! Call DATE_AND_TIME(values=MP_START_TIME) - !! - !!!! ! Pump3 Malfunction ----> Power Failure - !!!! if (PUMP(1)%PowerFailMalf==1) then - !!!! !MP1BLWR=0 - !!!! Pump3_OffMode_Solver - !!!! Call ClosePump1() - !!!! exit loop2 - !!!! end if - !! - !! PUMP(3)%N_new = MP1Throttle - !! if (((PUMP(3)%N_new-PUMP(3)%N_old)/PUMP(3)%time_step)>193.) then - !! PUMP(3)%N_ref =(193.*PUMP(3)%time_step)+PUMP(3)%N_old - !! else if (((PUMP(3)%N_old-PUMP(3)%N_new)/PUMP(3)%time_step)>193.) then - !! PUMP(3)%N_ref = (-193.*PUMP(3)%time_step)+PUMP(3)%N_old - !! else - !! PUMP(3)%N_ref = PUMP(3)%N_new - !! end if - !! - !! Call Pump3_OnMode_Solver - !! - !! IF (PUMP(3)%Flow_Rate>0.) Then - !! Call OpenCementPump() - !! Else - !! Call CloseCementPump() - !! End if - !! - !! PUMP(3)%N_old = PUMP(3)%N_ref - !! - !! Call DATE_AND_TIME(values=MP_END_TIME) - !! MP_SolDuration = 100-(MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) - !! !print*, 'MPtime=', MP_SolDuration - !! if(MP_SolDuration > 0.0) then - !! Call sleepqq(MP_SolDuration) - !! end if - !! - !! if ((MP1CPSwitch==0) .or. (IsStopped == .true.)) then - !! Call Pump3_OffMode_Solver - !! Call CloseCementPump() - !! exit loop2 - !! end if - !! end do loop2 - ! - ! else - ! - ! !Call Pump3_OffMode_Solver - ! !Call CloseCementPump() - ! - ! end if - ! - ! if (IsStopped == .true.) then - ! exit loop1 - ! end if - ! - !end do loop1 - - - end subroutine Pump3MainBody - -end module PumpsMain \ No newline at end of file diff --git a/Equipments/Pumps.old/pump_diff_eqs.f90 b/Equipments/Pumps.old/pump_diff_eqs.f90 deleted file mode 100644 index 091a1f3..0000000 --- a/Equipments/Pumps.old/pump_diff_eqs.f90 +++ /dev/null @@ -1,105 +0,0 @@ -subroutine Pump_dia(x1,x2,x3,x5,x6,Pump_No) - - use Pump_VARIABLES - use equipments_PowerLimit - - - IMPLICIT NONE - INTEGER :: Pump_No - REAL :: x1,x2,x3,x4,x5,x6 - - !Power_sigma=2.*(PUMP(1)%Vt*PUMP(1)%ia_new)+2.*(PUMP(2)%Vt*PUMP(2)%ia_new)+2.*(PUMP(3)%Vt*PUMP(3)%ia_new)+(RTable%Vt*RTable%ia_new)+2.*(Drawworks%Vt*Drawworks%ia_new) - - PUMP(Pump_No)%Vt = PUMP(Pump_No)%x_new+Kpi*((Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi)))+20.d0-PUMP(Pump_No)%ia_new) - IF (PUMP(Pump_No)%Vt>810.) THEN - PUMP(Pump_No)%Vt = 810.0 - ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - PUMP(Pump_No)%Vt = 0.0d0 - END IF - - !call PowerLimits - ! - !if (Power_sigma>max_Power_sigma) then - ! PUMP(Pump_No)%Vt=PUMP(Pump_No)%Vt_old - !else - ! PUMP(Pump_No)%Vt=x6+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*x3/pi))-x2) - ! IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt=810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt=0. - !END IF - - - ! PUMP(Pump_No)%Vt_old=PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - ! IF (PUMP(Pump_No)%Vt_old>810.) THEN - ! PUMP(Pump_No)%Vt_old=810. - !ELSE IF (PUMP(Pump_No)%Vt_old<0.) THEN - ! PUMP(Pump_No)%Vt_old=0. - !END IF - - - !end if - - !IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt=810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt=0. - !END IF - - !PUMP(Pump_No)%Vt_old=PUMP(Pump_No)%Vt - - - !IF (x2<=1150.) THEN - ! x5 = 6.3304d-3*x2 - !ELSE IF (x2>1150.) THEN - ! x5 = 2.8571d-7*(x2-1150.)+7.28 - !END IF - x5 = 6.3304d-3*1150.0 - - PUMP(Pump_No)%Ea = x5*x3 - PUMP(Pump_No)%dia = (PUMP(Pump_No)%Vt-(Ra+Rf)*x2-PUMP(Pump_No)%Ea)/(La+Lf) - -end subroutine - - - - - - -!------------------------------------------------------------ -subroutine Pump_dw(x1,x2,x3,x4,x5,Pump_No) - - use Pump_VARIABLES - - IMPLICIT NONE - INTEGER :: Pump_No - REAL :: x1,x2,x3,x4,x5 - - !IF (x2<=1150.) THEN - ! x4 = 6.3304d-3*x2 - !ELSE IF (x2>1150.) THEN - ! x4 = 2.8571d-7*(x2-1150.)+7.28 - !END IF - x4 = 6.3304d-3*1150.0 - - PUMP(Pump_No)%Te = x4*x2 - PUMP(Pump_No)%dw = (PUMP(Pump_No)%Te-x5)/PUMP(Pump_No)%J_coef - -end subroutine - - - - - -!------------------------------------------------------------ -subroutine Pump_dx(x1,x2,x3,x4,Pump_No) - - use Pump_VARIABLES - - IMPLICIT NONE - INTEGER :: Pump_No - REAL :: x1,x2,x3,x4 - - PUMP(Pump_No)%dx = Kii*((Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*x3/pi)))+20.d0-x2) - -end subroutine \ No newline at end of file diff --git a/Equipments/Pumps/ON_mode_simulation.f90 b/Equipments/Pumps/ON_mode_simulation.f90 deleted file mode 100644 index b6efbd0..0000000 --- a/Equipments/Pumps/ON_mode_simulation.f90 +++ /dev/null @@ -1,80 +0,0 @@ -subroutine ON_mode_simulation(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use equipments_PowerLimit - - IMPLICIT NONE - INTEGER :: Pump_No - - Call Pump_INPUTS - - ! Torque unit = (in.lbf) - PUMP(Pump_No)%Torque = (63025./132000.)*(1./PUMP(Pump_No)%Trans_Ratio)*(PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*PUMP(Pump_No)%StandPipe_Pressure/PUMP(Pump_No)%Mech_Efficiency/PUMP(Pump_No)%Vol_Efficiency) - - !call PowerLimits - - Call Pump_Traction_Motor(Pump_No) - - if (PUMP(Pump_No)%N_ref<=0.) then - PUMP(Pump_No)%w_ref = 0. - PUMP(Pump_No)%w_old = 0. - PUMP(Pump_No)%w = 0. - PUMP(Pump_No)%w_new = 0. - PUMP(Pump_No)%ia_old = 0. - PUMP(Pump_No)%ia = 0. - PUMP(Pump_No)%ia_new = 0. - PUMP(Pump_No)%x_old = 0. - PUMP(Pump_No)%x = 0. - PUMP(Pump_No)%x_new = 0. - end if - - if (Power_sigma>max_Power_sigma) then - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%Vt_old - else - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - IF (PUMP(Pump_No)%Vt_old>810.) THEN - PUMP(Pump_No)%Vt_old = 810. - ELSE IF (PUMP(Pump_No)%Vt_old<0.) THEN - PUMP(Pump_No)%Vt_old = 0. - END IF - - end if - - !PUMP(Pump_No)%Vt=PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - !IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt=810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt=0. - !END IF - - PUMP(Pump_No)%Speed = 30.*PUMP(Pump_No)%w_new/pi !Speed [RPM] - - Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - Call Set_MP2SPMGauge( sngl(1-PUMP(2)%SPMGaugeMalf)*real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - SPM2 = MP2SPMGauge - - Call Pump_Solver(Pump_No) - Call Pump_Total_Counts - !print*, 'PUMP(1)%Flow_Rate=' , PUMP(1)%Flow_Rate - IF (PUMP(1)%Flow_Rate>0.) Then - Call OpenPump1() - !print*, 'open pump 1' - Else - Call ClosePump1() - !print*, 'close pump 1' - End if - - IF (PUMP(2)%Flow_Rate>0.) Then - Call OpenPump2() - Else - Call ClosePump2() - End if - - -end subroutine ON_mode_simulation \ No newline at end of file diff --git a/Equipments/Pumps/Off_mode_Simulation.f90 b/Equipments/Pumps/Off_mode_Simulation.f90 deleted file mode 100644 index 529ebf4..0000000 --- a/Equipments/Pumps/Off_mode_Simulation.f90 +++ /dev/null @@ -1,51 +0,0 @@ -subroutine Off_mode_Simulation(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - - IMPLICIT NONE - INTEGER :: Pump_No - - CALL Pump_INPUTS - - !================================================================== - ! Rate limit for off Mode - - Do while (((PUMP(Pump_No)%N_old-0.0d0)/PUMP(Pump_No)%time_step)>386.) - PUMP(Pump_No)%N_ref = (-386.*PUMP(Pump_No)%time_step)+PUMP(Pump_No)%N_old - !else - ! PUMP(1)%N_ref=0.0d0 - !end if - - Call ON_mode_simulation(Pump_No) - - PUMP(Pump_No)%N_old = PUMP(Pump_No)%N_ref - Call sleepqq (80) !????????????????? - End Do - !================================================================== - - PUMP(Pump_No)%Speed = 0.0d0 - Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - Call Set_MP2SPMGauge( sngl(1-PUMP(2)%SPMGaugeMalf)*real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - SPM2 = MP2SPMGauge - PUMP(Pump_No)%w = 0. - PUMP(Pump_No)%w_old = 0.0d0 - PUMP(Pump_No)%w_new = 0.0d0 - PUMP(Pump_No)%ia = 0.0d0 - PUMP(Pump_No)%ia_old = 0.0d0 - PUMP(Pump_No)%ia_new = 0.0d0 - PUMP(Pump_No)%x = 0.0d0 - PUMP(Pump_No)%x_old = 0.0d0 - PUMP(Pump_No)%x_new = 0.0d0 - - Call Pump_Solver(Pump_No) - - Call Pump_Total_Counts - - -end subroutine off_mode_simulation \ No newline at end of file diff --git a/Equipments/Pumps/Pump1_MainSolver.f90 b/Equipments/Pumps/Pump1_MainSolver.f90 index 3bb1ffb..3ad7e9c 100644 --- a/Equipments/Pumps/Pump1_MainSolver.f90 +++ b/Equipments/Pumps/Pump1_MainSolver.f90 @@ -1,109 +1,66 @@ subroutine Pump1_MainSolver - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use equipments_PowerLimit - use CSounds - use CWarningsVariables + use Pumps_VARIABLES + implicit none - IMPLICIT NONE - - Call DrillingConsole_ScrLEDs - Call Pump_Total_Counts + !Call DrillingConsole_ScrLEDs + Call Pumps_Inputs - if (MP1Throttle<=0.e0) then - PUMP(1)%K_throttle = 1 - end if - if (IsPortable) then - PUMP(1)%AssignmentSwitchh = 1 - else - PUMP(1)%AssignmentSwitchh = AssignmentSwitch - end if + if (PUMP(1)%Throttle<=0.e0) then + PUMP(1)%K_throttle = 1 + end if - if((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (MP1CPSwitch==-1) .and. (PUMP(1)%K_throttle==1) .and. (PUMP(1)%PowerFailMalf==0) .and. (Pump1Failure==0) .and. (IsStopped == .false.)) then - - PUMP(1)%SoundBlower = .true. - Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) - MP1BLWR = 1 - - !Call DrillingConsole_ScrLEDs - !Call Pump_Total_Counts - - - PUMP(1)%N_new = MP1Throttle - if (((PUMP(1)%N_new-PUMP(1)%N_old)/PUMP(1)%time_step)>193.) then - PUMP(1)%N_ref =(193.*PUMP(1)%time_step)+PUMP(1)%N_old - else if (((PUMP(1)%N_old-PUMP(1)%N_new)/PUMP(1)%time_step)>193.) then - PUMP(1)%N_ref = (-193.*PUMP(1)%time_step)+PUMP(1)%N_old - else - PUMP(1)%N_ref = PUMP(1)%N_new - end if - - Call Pump1_OnMode_Solver(1) - - !IF (PUMP(1)%Flow_Rate>0.) Then - ! Call OpenPump1() - !Else - ! Call ClosePump1() - !End if - - PUMP(1)%N_old = PUMP(1)%N_ref - - - - else if( (MP1CPSwitch==1) .and. (PUMP(1)%K_throttle==1) .and. (PUMP(3)%PowerFailMalf==0) .and. (Pump3Failure==0) .and. (IsStopped == .false.)) then + + if((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (PUMP(1)%Switch==-1) .and. (PUMP(1)%K_throttle==1) .and. (PUMP(1)%PowerFailMalf==0) .and. (PUMP(1)%Failure==0) .and. (Pumps_IsStopped == .false.)) then + !!print*, 'pumps on' + PUMP(1)%SoundBlower = .true. + !Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) + !MP1BLWR = 1 - - PUMP(3)%N_new = MP1Throttle - if (((PUMP(3)%N_new-PUMP(3)%N_old)/PUMP(3)%time_step)>193.) then - PUMP(3)%N_ref =(193.*PUMP(3)%time_step)+PUMP(3)%N_old - else if (((PUMP(3)%N_old-PUMP(3)%N_new)/PUMP(3)%time_step)>193.) then - PUMP(3)%N_ref = (-193.*PUMP(3)%time_step)+PUMP(3)%N_old - else - PUMP(3)%N_ref = PUMP(3)%N_new - end if - - Call Pump3_OnMode_Solver - - IF (PUMP(3)%Flow_Rate>0.) Then - Call OpenCementPump() - Else - Call CloseCementPump() - End if - - PUMP(3)%N_old = PUMP(3)%N_ref + !========================== Pump 1 Rate limit ========================== + if (((PUMP(1)%N_new-PUMP(1)%N_old)/PUMP(1)%time_step)>PUMP(1)%RateChange) then + PUMP(1)%Speed =(PUMP(1)%RateChange*PUMP(1)%time_step)+PUMP(1)%N_old + else if (((PUMP(1)%N_old-PUMP(1)%N_new)/PUMP(1)%time_step)>PUMP(1)%RateChange) then + PUMP(1)%Speed = (-PUMP(1)%RateChange*PUMP(1)%time_step)+PUMP(1)%N_old + else + PUMP(1)%Speed = PUMP(1)%N_new + end if + !======================================================================= - - - else - - if ((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (MP1CPSwitch==-1) .and. (IsStopped == .false.)) then - PUMP(1)%SoundBlower = .true. - Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) - MP1BLWR = 1 - else - PUMP(1)%SoundBlower = .false. - Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) - MP1BLWR = 0 - end if - - - Call Pump1_OffMode_Solver(1) - Call ClosePump1() - Call Pump3_OffMode_Solver - Call CloseCementPump() - - PUMP(1)%K_throttle = 0 - - - end if - + Call Pump_OnMode_Solver(1) + + + else + if ((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (PUMP(1)%Switch==-1) .and. (Pumps_IsStopped == .false.)) then + PUMP(1)%SoundBlower = .true. + !Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) + else + PUMP(1)%SoundBlower = .false. + !Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) + end if + + if ((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (PUMP(1)%Switch==-1) .and. (Pumps_IsStopped == .false.) .and. (PUMP(1)%PowerFailMalf==0) .and. (PUMP(1)%Failure==0)) then + !MP1BLWR = 1 + else + !MP1BLWR = 0 + end if + + Call Pump_OffMode_Solver(1) + !Call ClosePump1() + PUMP(1)%K_throttle = 0 + + end if + + PUMP(1)%N_old = PUMP(1)%Speed + + + print*, 'Q , P , Hp , N=' + print*, PUMP(1)%Flow_Rate , PUMP(1)%StandPipe_Pressure , PUMP(1)%Hydraulic_HorsePower , PUMP(1)%Speed + pause + + end subroutine Pump1_MainSolver \ No newline at end of file diff --git a/Equipments/Pumps/Pump1_OffMode_Solver.f90 b/Equipments/Pumps/Pump1_OffMode_Solver.f90 deleted file mode 100644 index 87d4b1d..0000000 --- a/Equipments/Pumps/Pump1_OffMode_Solver.f90 +++ /dev/null @@ -1,66 +0,0 @@ -subroutine Pump1_OffMode_Solver(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use CSounds - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - CALL Pump_INPUTS - - - - !================================================================== - ! Rate limit for off Mode - - if (((PUMP(Pump_No)%N_old-0.0d0)/PUMP(Pump_No)%time_step)>386.0d0) then - PUMP(Pump_No)%N_ref = (-386.0d0*PUMP(Pump_No)%time_step)+PUMP(Pump_No)%N_old - !else - ! PUMP(1)%N_ref=0.0d0 - !end if - - Call Pump1_OnMode_Solver(Pump_No) - - PUMP(Pump_No)%N_old = PUMP(Pump_No)%N_ref - - !================================================================== - else - - - PUMP(Pump_No)%Speed = 0.0d0 - PUMP(Pump_No)%w = 0.0d0 - PUMP(Pump_No)%w_old = 0.0d0 - PUMP(Pump_No)%w_new = 0.0d0 - PUMP(Pump_No)%ia = 0.0d0 - PUMP(Pump_No)%ia_old = 0.0d0 - PUMP(Pump_No)%ia_new = 0.0d0 - PUMP(Pump_No)%x = 0.0d0 - PUMP(Pump_No)%x_old = 0.0d0 - PUMP(Pump_No)%x_new = 0.0d0 - - - Call Pump_Solver(Pump_No) - - Call Pump_Total_Counts - - - - Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - PUMP(1)%SoundSPM = INT(PUMP(1)%Speed/PUMP(1)%Trans_Ratio) - Call SetSoundMP1( PUMP(1)%SoundSPM ) - !Call Set_MP2SPMGauge( real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - !SPM2 = MP2SPMGauge - - - End if - -end subroutine Pump1_OffMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps/Pump1_OnMode_Solver.f90 b/Equipments/Pumps/Pump1_OnMode_Solver.f90 deleted file mode 100644 index 358ba54..0000000 --- a/Equipments/Pumps/Pump1_OnMode_Solver.f90 +++ /dev/null @@ -1,120 +0,0 @@ -subroutine Pump1_OnMode_Solver(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use equipments_PowerLimit - use CSounds - use CWarningsVariables - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - Call Pump_INPUTS - - - ! Torque unit = [in.lbf] - PUMP(Pump_No)%Torque = (63025./132000.)*(1./PUMP(Pump_No)%Trans_Ratio)*(PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*PUMP(Pump_No)%StandPipe_Pressure/PUMP(Pump_No)%Mech_Efficiency/PUMP(Pump_No)%Vol_Efficiency) - - !call PowerLimits - - !print*, 'PUMP(1)%Torque=', PUMP(1)%Torque - Call Pump_Traction_Motor(Pump_No) - - !print*, 'PUMP(1)%w_new=', PUMP(1)%w_new - - if (PUMP(Pump_No)%N_ref<=0.) then - PUMP(Pump_No)%w_ref = 0. - PUMP(Pump_No)%w_old = 0. - PUMP(Pump_No)%w = 0. - PUMP(Pump_No)%w_new = 0. - PUMP(Pump_No)%ia_old = 0. - PUMP(Pump_No)%ia = 0. - PUMP(Pump_No)%ia_new = 0. - PUMP(Pump_No)%x_old = 0. - PUMP(Pump_No)%x = 0. - PUMP(Pump_No)%x_new = 0. - end if - - - - - if (Power_sigma>max_Power_sigma) then - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%Vt_old - else - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - IF (PUMP(Pump_No)%Vt_old>810.) THEN - PUMP(Pump_No)%Vt_old = 810. - ELSE IF (PUMP(Pump_No)%Vt_old<0.) THEN - PUMP(Pump_No)%Vt_old = 0. - END IF - end if - - - - - !PUMP(Pump_No)%Vt=PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - !IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt=810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt=0. - !END IF - - - - PUMP(Pump_No)%Speed = 30.d0*PUMP(Pump_No)%w_new/pi !Speed [RPM] - - if ( Pump1Failure == .true. ) then - PUMP(1)%Speed = 0.d0 - PUMP(1)%w = 0.d0 - PUMP(1)%w_new = 0.d0 - PUMP(1)%w_old = 0.d0 - end if - - - - Call Pump_Solver(Pump_No) - Call Pump_Total_Counts - - - - Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - PUMP(1)%SoundSPM = INT(PUMP(1)%Speed/PUMP(1)%Trans_Ratio) - Call SetSoundMP1( PUMP(1)%SoundSPM ) - !Call Set_MP2SPMGauge( real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - !SPM2 = MP2SPMGauge - - - - IF (PUMP(1)%Flow_Rate>0.) Then - Call OpenPump1() - Else - Call ClosePump1() - End if - - - !IF (PUMP(2)%Flow_Rate>0.) Then - ! Call OpenPump2() - !Else - ! Call ClosePump2() - !End if - - !print*, 'PUMP(1)%Speed=', PUMP(1)%Speed - !print*, 'PUMP(1)%Torque=', PUMP(1)%Torque - !print*, 'Power_sigma=', Power_sigma - !print*, 'power_num_of_Jenerators=', power_num_of_Jenerators - !print*, 'drilling_num_of_Jenerators=', drilling_num_of_Jenerators - !print*, 'max_Power_sigma=', max_Power_sigma - !print*, 'PUMP(1)%Vt=', PUMP(1)%Vt - !print*, 'PUMP(1)%SoundSPM=', PUMP(1)%SoundSPM - !print*, 'PUMP(1)%ia_new=', PUMP(1)%ia_new - - -end subroutine Pump1_OnMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps/Pump2_MainSolver.f90 b/Equipments/Pumps/Pump2_MainSolver.f90 deleted file mode 100644 index e0976e1..0000000 --- a/Equipments/Pumps/Pump2_MainSolver.f90 +++ /dev/null @@ -1,76 +0,0 @@ -subroutine Pump2_MainSolver - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use equipments_PowerLimit - use CSounds - use CWarningsVariables - - - IMPLICIT NONE - - - if (MP2Throttle<=0.e0) then - PUMP(2)%K_throttle = 1 - end if - - if (IsPortable) then - PUMP(2)%AssignmentSwitchh = 1 - else - PUMP(2)%AssignmentSwitchh = AssignmentSwitch - end if - - if((any(PUMP(2)%AssignmentSwitchh==(/1,2,3,4,5,7,8,11/))) .and. (MP2Switch==1) .and. (PUMP(2)%K_throttle==1) .and. (PUMP(2)%PowerFailMalf==0) .and. (Pump2Failure==0) .and. (IsStopped == .false.)) then - - PUMP(2)%SoundBlower = .true. - Call SetSoundBlowerMP2(PUMP(2)%SoundBlower) - MP2BLWR = 1 - - - PUMP(2)%N_new = MP2Throttle - if (((PUMP(2)%N_new-PUMP(2)%N_old)/PUMP(2)%time_step)>193.) then - PUMP(2)%N_ref = (193.*PUMP(2)%time_step)+PUMP(2)%N_old - else if (((PUMP(2)%N_old-PUMP(2)%N_new)/PUMP(2)%time_step)>193.) then - PUMP(2)%N_ref = (-193.*PUMP(2)%time_step)+PUMP(2)%N_old - else - PUMP(2)%N_ref = PUMP(2)%N_new - end if - - Call Pump2_OnMode_Solver(2) - - !IF (PUMP(2)%Flow_Rate>0.) Then - ! Call OpenPump2() - !Else - ! Call ClosePump2() - !End if - - PUMP(2)%N_old=PUMP(2)%N_ref - - - else - - - if((any(PUMP(2)%AssignmentSwitchh==(/1,2,3,4,5,7,8,11/))) .and. (MP2Switch==1) .and. (IsStopped == .false.)) then - PUMP(2)%SoundBlower = .true. - Call SetSoundBlowerMP2(PUMP(2)%SoundBlower) - MP2BLWR = 1 - else - PUMP(2)%SoundBlower = .false. - Call SetSoundBlowerMP2(PUMP(2)%SoundBlower) - MP2BLWR = 0 - end if - - !PUMP(2)%N_ref = MP2Throttle - Call Pump2_OffMode_Solver(2) - Call ClosePump2() - - PUMP(2)%K_throttle = 0 - - end if - - -end subroutine Pump2_MainSolver \ No newline at end of file diff --git a/Equipments/Pumps/Pump2_OffMode_Solver.f90 b/Equipments/Pumps/Pump2_OffMode_Solver.f90 deleted file mode 100644 index 88c5e2c..0000000 --- a/Equipments/Pumps/Pump2_OffMode_Solver.f90 +++ /dev/null @@ -1,67 +0,0 @@ -subroutine Pump2_OffMode_Solver(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use CSounds - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - CALL Pump_INPUTS - - - - !================================================================== - ! Rate limit for off Mode - - if (((PUMP(Pump_No)%N_old-0.0d0)/PUMP(Pump_No)%time_step)>386.) then - PUMP(Pump_No)%N_ref = (-386.*PUMP(Pump_No)%time_step)+PUMP(Pump_No)%N_old - !else - ! PUMP(1)%N_ref=0.0d0 - !end if - - Call Pump2_OnMode_Solver(Pump_No) - - PUMP(Pump_No)%N_old = PUMP(Pump_No)%N_ref - - !================================================================== - else - - - PUMP(Pump_No)%Speed = 0.0d0 - PUMP(Pump_No)%w = 0.0d0 - PUMP(Pump_No)%w_old = 0.0d0 - PUMP(Pump_No)%w_new = 0.0d0 - PUMP(Pump_No)%ia = 0.0d0 - PUMP(Pump_No)%ia_old = 0.0d0 - PUMP(Pump_No)%ia_new = 0.0d0 - PUMP(Pump_No)%x = 0.0d0 - PUMP(Pump_No)%x_old = 0.0d0 - PUMP(Pump_No)%x_new = 0.0d0 - - - - Call Pump_Solver(Pump_No) - - Call Pump_Total_Counts - - - - !Call Set_MP1SPMGauge( real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - !SPM1 = MP1SPMGauge - Call Set_MP2SPMGauge( sngl(1-PUMP(2)%SPMGaugeMalf)*real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - SPM2 = MP2SPMGauge - PUMP(2)%SoundSPM = INT(PUMP(2)%Speed/PUMP(2)%Trans_Ratio) - Call SetSoundMP2( PUMP(2)%SoundSPM ) - - - end if - -end subroutine Pump2_OffMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps/Pump2_OnMode_Solver.f90 b/Equipments/Pumps/Pump2_OnMode_Solver.f90 deleted file mode 100644 index eba9e2f..0000000 --- a/Equipments/Pumps/Pump2_OnMode_Solver.f90 +++ /dev/null @@ -1,108 +0,0 @@ -subroutine Pump2_OnMode_Solver(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use equipments_PowerLimit - use CSounds - use CWarningsVariables - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - - Call Pump_INPUTS - - ! Torque unit = [in.lbf] - PUMP(Pump_No)%Torque = (63025./132000.)*(1./PUMP(Pump_No)%Trans_Ratio)*(PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*PUMP(Pump_No)%StandPipe_Pressure/PUMP(Pump_No)%Mech_Efficiency/PUMP(Pump_No)%Vol_Efficiency) - - - !call PowerLimits - - - - Call Pump_Traction_Motor(Pump_No) - - if (PUMP(Pump_No)%N_ref<=0.) then - PUMP(Pump_No)%w_ref = 0. - PUMP(Pump_No)%w_old = 0. - PUMP(Pump_No)%w = 0. - PUMP(Pump_No)%w_new = 0. - PUMP(Pump_No)%ia_old = 0. - PUMP(Pump_No)%ia = 0. - PUMP(Pump_No)%ia_new = 0. - PUMP(Pump_No)%x_old = 0. - PUMP(Pump_No)%x = 0. - PUMP(Pump_No)%x_new = 0. - end if - - - - if (Power_sigma>max_Power_sigma) then - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%Vt_old - else - PUMP(Pump_No)%Vt_old = PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - IF (PUMP(Pump_No)%Vt_old>810.) THEN - PUMP(Pump_No)%Vt_old = 810. - ELSE IF (PUMP(Pump_No)%Vt_old<0.) THEN - PUMP(Pump_No)%Vt_old = 0. - END IF - end if - - - - - !PUMP(Pump_No)%Vt=PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - !IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt=810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt=0. - !END IF - - PUMP(Pump_No)%Speed = 30.*PUMP(Pump_No)%w_new/pi !Speed [RPM] - - if ( Pump2Failure == .true. ) then - PUMP(2)%Speed = 0.d0 - PUMP(2)%w = 0.d0 - PUMP(2)%w_new = 0.d0 - PUMP(2)%w_old = 0.d0 - end if - - - Call Pump_Solver(Pump_No) - Call Pump_Total_Counts - - - - !Call Set_MP1SPMGauge( real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) - !SPM1 = MP1SPMGauge - Call Set_MP2SPMGauge( sngl(1-PUMP(2)%SPMGaugeMalf)*real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) ) - SPM2 = MP2SPMGauge - PUMP(2)%SoundSPM = INT(PUMP(2)%Speed/PUMP(2)%Trans_Ratio) - Call SetSoundMP2( PUMP(2)%SoundSPM ) - - - - - !IF (PUMP(1)%Flow_Rate>0.) Then - ! Call OpenPump1() - !Else - ! Call ClosePump1() - !End if - - IF (PUMP(2)%Flow_Rate>0.) Then - Call OpenPump2() - Else - Call ClosePump2() - End if - - - - -end subroutine Pump2_OnMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps/Pump3_OffMode_Solver.f90 b/Equipments/Pumps/Pump3_OffMode_Solver.f90 deleted file mode 100644 index 4a09826..0000000 --- a/Equipments/Pumps/Pump3_OffMode_Solver.f90 +++ /dev/null @@ -1,54 +0,0 @@ -subroutine Pump3_OffMode_Solver - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use CSounds - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - CALL Pump_INPUTS - - - - !================================================================== - ! Rate limit for off Mode - - if (((PUMP(3)%N_old-0.0d0)/PUMP(3)%time_step)>386.) then - PUMP(3)%N_ref = (-386.*PUMP(3)%time_step)+PUMP(3)%N_old - !else - ! PUMP(1)%N_ref=0.0d0 - !end if - - Call Pump3_OnMode_Solver - - PUMP(3)%N_old = PUMP(3)%N_ref - - !================================================================== - else - - - PUMP(3)%Speed = 0.0 - - Call Pump_Solver(3) - - Call Pump_Total_Counts - - - Call Set_MP1SPMGauge( real((PUMP(3)%Speed/PUMP(3)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - PUMP(3)%SoundSPM = INT(PUMP(3)%Speed/PUMP(3)%Trans_Ratio) - Call SetSoundMP3( PUMP(3)%SoundSPM ) - - - end if - - -end subroutine Pump3_OffMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps/Pump3_OnMode_Solver.f90 b/Equipments/Pumps/Pump3_OnMode_Solver.f90 deleted file mode 100644 index 98f1975..0000000 --- a/Equipments/Pumps/Pump3_OnMode_Solver.f90 +++ /dev/null @@ -1,57 +0,0 @@ -subroutine Pump3_OnMode_Solver - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CDrillWatchVariables - use equipments_PowerLimit - use CSounds - use CWarningsVariables - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - Call Pump_INPUTS - - !! Torque unit = (in.lbf) - !PUMP(Pump_No)%Torque = (63025./132000.)*(1./PUMP(Pump_No)%Trans_Ratio)*(PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*PUMP(Pump_No)%StandPipe_Pressure/PUMP(Pump_No)%Mech_Efficiency/PUMP(Pump_No)%Vol_Efficiency) - - - - - - PUMP(3)%Speed = PUMP(3)%N_ref !Speed [RPM] - - if ( Pump3Failure == .true. ) then - PUMP(3)%Speed = 0.d0 - PUMP(3)%w = 0.d0 - PUMP(3)%w_new = 0.d0 - PUMP(3)%w_old = 0.d0 - end if - - Call Pump_Solver(3) - Call Pump_Total_Counts - - Call Set_MP1SPMGauge( real((PUMP(3)%Speed/PUMP(3)%Trans_Ratio),8) ) - SPM1 = MP1SPMGauge - PUMP(3)%SoundSPM = INT(PUMP(3)%Speed/PUMP(3)%Trans_Ratio) - Call SetSoundMP3( PUMP(3)%SoundSPM ) - - - - IF (PUMP(3)%Flow_Rate>0.) Then - Call OpenCementPump() - Else - Call CloseCementPump() - End if - - - - - -end subroutine Pump3_OnMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps/Pump_INPUTS.f90 b/Equipments/Pumps/Pump_INPUTS.f90 deleted file mode 100644 index 2d018eb..0000000 --- a/Equipments/Pumps/Pump_INPUTS.f90 +++ /dev/null @@ -1,59 +0,0 @@ -subroutine Pump_INPUTS - - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use Pump_VARIABLES - use MudSystem - - IMPLICIT NONE - - - -!>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<< - - if ( PUMP(1)%BlowPopOffMalf==1 ) then ! Pump1 Malfunction ----> Blow Pop-offs (Relief Valves) - PUMP(1)%StandPipe_Pressure = 0.d0 - else - PUMP(1)%StandPipe_Pressure = PumpPressure1 ![psi] - if ( PUMP(1)%StandPipe_Pressure<=14. ) then - PUMP(1)%StandPipe_Pressure = 14. - end if - end if - - - - - -!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<< - - if ( PUMP(2)%BlowPopOffMalf==1 ) then ! Pump2 Malfunction ----> Blow Pop-offs (Relief Valves) - PUMP(2)%StandPipe_Pressure = 0.d0 - else - PUMP(2)%StandPipe_Pressure = PumpPressure2 ![psi] - if ( PUMP(2)%StandPipe_Pressure<=14. ) then - PUMP(2)%StandPipe_Pressure = 14. - end if - end if - - - - - -!>>>>>>>>>>>>>>>>>>>>>>> PUMP 3 <<<<<<<<<<<<<<<<<<<<<<<<<<< - - if ( PUMP(3)%BlowPopOffMalf==1 ) then ! Pump3 Malfunction ----> Blow Pop-offs (Relief Valves) - PUMP(3)%StandPipe_Pressure = 0.d0 - else - PUMP(3)%StandPipe_Pressure = PumpPressure3 ![psi] - if ( PUMP(3)%StandPipe_Pressure<=14. ) then - PUMP(3)%StandPipe_Pressure = 14. - end if - end if - - - - - -end subroutine Pump_INPUTS \ No newline at end of file diff --git a/Equipments/Pumps/Pump_OffMode_Solver.f90 b/Equipments/Pumps/Pump_OffMode_Solver.f90 new file mode 100644 index 0000000..43c9923 --- /dev/null +++ b/Equipments/Pumps/Pump_OffMode_Solver.f90 @@ -0,0 +1,52 @@ +subroutine Pump_OffMode_Solver(Pump_No) + + use Pumps_VARIABLES + !use CPumpsVariables + !use CDrillingConsoleVariables + !use CDataDisplayConsoleVariables + !use CSimulationVariables + !use CDrillWatchVariables + !use CSounds + + + IMPLICIT NONE + INTEGER :: Pump_No + + + PUMP(1)%N_new = 0.e0 + + !========================== Pump 1 Rate limit ========================== + if (((PUMP(1)%N_new-PUMP(1)%N_old)/PUMP(1)%time_step)>PUMP(1)%RateChange) then + PUMP(1)%Speed =(PUMP(1)%RateChange*PUMP(1)%time_step)+PUMP(1)%N_old + else if (((PUMP(1)%N_old-PUMP(1)%N_new)/PUMP(1)%time_step)>PUMP(1)%RateChange) then + PUMP(1)%Speed = (-PUMP(1)%RateChange*PUMP(1)%time_step)+PUMP(1)%N_old + else + PUMP(1)%Speed = PUMP(1)%N_new + end if + !======================================================================= + + + + PUMP(Pump_No)%Flow_Rate = PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0*(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio) ![gpm] + PUMP(Pump_No)%Hydraulic_HorsePower = ( (PUMP(Pump_No)%Flow_Rate/0.01e0)*PUMP(Pump_No)%Max_Pressure)/(168067.e0*PUMP(Pump_No)%Mech_Efficiency) ![HHP] + if ( PUMP(Pump_No)%StandPipe_Pressure>=PUMP(Pump_No)%Max_Pressure ) then + !print*, 'pumps critical' + PUMP(Pump_No)%Flow_Rate = (1714.e0*PUMP(Pump_No)%Hydraulic_HorsePower)/PUMP(Pump_No)%Max_Pressure ![gpm] + PUMP(Pump_No)%Speed = ( PUMP(Pump_No)%Flow_Rate/(PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0) )*PUMP(Pump_No)%Trans_Ratio ![rpm] + end if + + total_pumps%Total_Pump_GPM = PUMP(1)%Flow_Rate+PUMP(2)%Flow_Rate+PUMP(3)%Flow_Rate + total_pumps%Total_Pump_SPM = (PUMP(1)%Speed/PUMP(1)%Trans_Ratio)+(PUMP(2)%Speed/PUMP(2)%Trans_Ratio)+(PUMP(3)%Speed/PUMP(3)%Trans_Ratio) + + + + !Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) + !SPM1 = MP1SPMGauge + !PUMP(1)%SoundSPM = INT(PUMP(1)%Speed/PUMP(1)%Trans_Ratio) + !Call SetSoundMP1( PUMP(1)%SoundSPM ) + + + + + +end subroutine Pump_OffMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps/Pump_OnMode_Solver.f90 b/Equipments/Pumps/Pump_OnMode_Solver.f90 new file mode 100644 index 0000000..28159a7 --- /dev/null +++ b/Equipments/Pumps/Pump_OnMode_Solver.f90 @@ -0,0 +1,56 @@ +subroutine Pump_OnMode_Solver(Pump_No) + + use Pumps_VARIABLES + !use CPumpsVariables + !use CDrillingConsoleVariables + !use CDataDisplayConsoleVariables + !use CSimulationVariables + !use CDrillWatchVariables + !use equipments_PowerLimit + !use CSounds + !use CWarningsVariables + + + IMPLICIT NONE + INTEGER :: Pump_No + + + + PUMP(Pump_No)%Flow_Rate = PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0*(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio) ![gpm] + PUMP(Pump_No)%Max_FlowRate = PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0*PUMP(1)%MaxSPM ![gpm] + PUMP(Pump_No)%Hydraulic_HorsePower = ( (PUMP(Pump_No)%Flow_Rate/0.01e0)*PUMP(Pump_No)%Max_Pressure)/(168067.e0*PUMP(Pump_No)%Mech_Efficiency) ![HHP] + if ( PUMP(Pump_No)%StandPipe_Pressure>=PUMP(Pump_No)%Max_Pressure ) then ! in shart check shavad + !print*, 'pumps critical' + PUMP(Pump_No)%Flow_Rate = (1714.e0*PUMP(Pump_No)%Hydraulic_HorsePower)/PUMP(Pump_No)%Max_Pressure ![gpm] + PUMP(Pump_No)%Speed = ( PUMP(Pump_No)%Flow_Rate/(PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0) )*PUMP(Pump_No)%Trans_Ratio ![rpm] + end if + + total_pumps%Total_Pump_GPM = PUMP(1)%Flow_Rate+PUMP(2)%Flow_Rate+PUMP(3)%Flow_Rate + total_pumps%Total_Pump_SPM = (PUMP(1)%Speed/PUMP(1)%Trans_Ratio)+(PUMP(2)%Speed/PUMP(2)%Trans_Ratio)+(PUMP(3)%Speed/PUMP(3)%Trans_Ratio) + + + + + !Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) + !SPM1 = MP1SPMGauge + !PUMP(1)%SoundSPM = INT(PUMP(1)%Speed/PUMP(1)%Trans_Ratio) + !Call SetSoundMP1( PUMP(1)%SoundSPM ) + ! + ! + ! + !IF (PUMP(1)%Flow_Rate>0.) Then + ! Call OpenPump1() + !Else + ! Call ClosePump1() + !End if + + + !IF (PUMP(2)%Flow_Rate>0.) Then + ! Call OpenPump2() + !Else + ! Call ClosePump2() + !End if + + + +end subroutine Pump_OnMode_Solver \ No newline at end of file diff --git a/Equipments/Pumps/Pump_Solver.f90 b/Equipments/Pumps/Pump_Solver.f90 deleted file mode 100644 index 2adb3f4..0000000 --- a/Equipments/Pumps/Pump_Solver.f90 +++ /dev/null @@ -1,29 +0,0 @@ -subroutine Pump_Solver(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - - - IMPLICIT NONE - INTEGER :: Pump_No - - - - PUMP(Pump_No)%Flow_Rate = PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio)*PUMP(Pump_No)%Vol_Efficiency/77.d0 ![gpm] - PUMP(Pump_No)%Hydraulic_HorsePower = PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length*(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio)*PUMP(Pump_No)%StandPipe_Pressure/132000.d0 ![HHP] - PUMP(Pump_No)%TracMotor_Horsepower = PUMP(Pump_No)%Hydraulic_HorsePower/PUMP(Pump_No)%Mech_Efficiency/PUMP(Pump_No)%Vol_Efficiency ![HHP] - !PUMP(Pump_No)%Max_Pressure = (PUMP(Pump_No)%Max_Horsepower*1714.)/PUMP(Pump_No)%Flow_Rate ![psi] - - - if ( (PUMP(Pump_No)%StandPipe_Pressure*PUMP(Pump_No)%Flow_Rate)>(1714.d0*PUMP(Pump_No)%Max_Horsepower*PUMP(Pump_No)%Mech_Efficiency*PUMP(Pump_No)%Vol_Efficiency) ) then - PUMP(Pump_No)%Flow_Rate = (1714.d0*PUMP(Pump_No)%Max_Horsepower*PUMP(Pump_No)%Mech_Efficiency*PUMP(Pump_No)%Vol_Efficiency)/PUMP(Pump_No)%StandPipe_Pressure ![gpm] - PUMP(Pump_No)%Speed = ( (PUMP(Pump_No)%Flow_Rate*77.d0)/(PUMP(Pump_No)%Piston_Area*PUMP(Pump_No)%Stroke_Length) )*PUMP(Pump_No)%Trans_Ratio ![rpm] - end if - - - - -end subroutine Pump_Solver \ No newline at end of file diff --git a/Equipments/Pumps/Pump_StartUp.f90 b/Equipments/Pumps/Pump_StartUp.f90 deleted file mode 100644 index 3625200..0000000 --- a/Equipments/Pumps/Pump_StartUp.f90 +++ /dev/null @@ -1,73 +0,0 @@ -subroutine Pump_StartUp - - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - use CPowerVariables - use Pump_VARIABLES - - - IMPLICIT NONE - - - - -!>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<< - PUMP(1)%Stroke_Length = MudPump1Stroke - PUMP(1)%Piston_Diameter = MudPump1LinerDiameter - PUMP(1)%Piston_Area = pi*PUMP(1)%Piston_Diameter*PUMP(1)%Piston_Diameter/4. - PUMP(1)%Mech_Efficiency = MudPump1MechanicalEfficiency - PUMP(1)%Vol_Efficiency = MudPump1VolumetricEfficiency - PUMP(1)%Max_Horsepower = MudPump1 - PUMP(1)%Inertia_Moment = 23.261341 ! 23.261341 [kg.m^2] = 552 [lb.ft^2] - PUMP(1)%J_coef = PUMP(1)%Inertia_Moment+(4.*(PUMP(1)%Inertia_Moment)) - PUMP(1)%Trans_Ratio = 965.0/MudPump1Maximum - PUMP(1)%time_step = .10 - - PUMP(1)%K_throttle = 0 - PUMP(1)%Flow_Rate = 0. - Call Pump1_OffMode_Solver(1) - - - - -!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<< - PUMP(2)%Stroke_Length = MudPump2Stroke - PUMP(2)%Piston_Diameter = MudPump2LinerDiameter - PUMP(2)%Piston_Area = pi*PUMP(2)%Piston_Diameter*PUMP(2)%Piston_Diameter/4. - PUMP(2)%Mech_Efficiency = MudPump2MechanicalEfficiency - PUMP(2)%Vol_Efficiency = MudPump2VolumetricEfficiency - PUMP(2)%Max_Horsepower = MudPump2 - PUMP(2)%Inertia_Moment = 23.261341 ! 23.261341 [kg.m^2] = 552 [lb.ft^2] - PUMP(2)%J_coef = PUMP(2)%Inertia_Moment+(4.*(PUMP(2)%Inertia_Moment)) - PUMP(2)%Trans_Ratio = 965.0/MudPump2Maximum - PUMP(2)%time_step = .10 - - PUMP(2)%K_throttle = 0 - PUMP(2)%Flow_Rate = 0. - Call Pump2_OffMode_Solver(2) - - - - - -!>>>>>>>>>>>>>>>>>>>>>>> PUMP 3 <<<<<<<<<<<<<<<<<<<<<<<<<<< - PUMP(3)%Stroke_Length = CementPumpStroke - PUMP(3)%Piston_Diameter = CementPumpLinerDiameter - PUMP(3)%Piston_Area = pi*PUMP(3)%Piston_Diameter*PUMP(3)%Piston_Diameter/4. - PUMP(3)%Mech_Efficiency = CementPumpMechanicalEfficiency - PUMP(3)%Vol_Efficiency = CementPumpVolumetricEfficiency - PUMP(3)%Max_Horsepower = CementPump - PUMP(3)%Inertia_Moment = 23.261341 ! 23.261341 [kg.m^2] = 552 [lb.ft^2] - PUMP(3)%Trans_Ratio = 965.0/CementPumpMaximum - PUMP(3)%time_step = .10 - - PUMP(3)%Flow_Rate = 0. - Call Pump3_OffMode_Solver - - - - - -end subroutine Pump_StartUp \ No newline at end of file diff --git a/Equipments/Pumps/Pump_Total_Counts.f90 b/Equipments/Pumps/Pump_Total_Counts.f90 deleted file mode 100644 index c6efa9e..0000000 --- a/Equipments/Pumps/Pump_Total_Counts.f90 +++ /dev/null @@ -1,17 +0,0 @@ -subroutine Pump_Total_Counts - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - - IMPLICIT NONE - - - Total_Pump_GPM = PUMP(1)%Flow_Rate+PUMP(2)%Flow_Rate+PUMP(3)%Flow_Rate - Total_Pump_SPM = (PUMP(1)%Speed/PUMP(1)%Trans_Ratio)+(PUMP(2)%Speed/PUMP(2)%Trans_Ratio)+(PUMP(3)%Speed/PUMP(3)%Trans_Ratio) - - - -end subroutine \ No newline at end of file diff --git a/Equipments/Pumps/Pump_Traction_Motor.f90 b/Equipments/Pumps/Pump_Traction_Motor.f90 deleted file mode 100644 index c050d8e..0000000 --- a/Equipments/Pumps/Pump_Traction_Motor.f90 +++ /dev/null @@ -1,124 +0,0 @@ -subroutine Pump_Traction_Motor(Pump_No) - - use Pump_VARIABLES - use CPumpsVariables - use CDrillingConsoleVariables - use CDataDisplayConsoleVariables - use CSimulationVariables - - - IMPLICIT NONE - INTEGER :: Pump_No - - - -!>>>>>>>>>>>>>>>>>>>>>>> DATA <<<<<<<<<<<<<<<<<<<<<<<<<<< - PUMP(Pump_No)%TL = 0.112985*PUMP(Pump_No)%Torque/2.d0 - - La = 1700.*1d-6 !170.*1d-6 !1700.*1d-6 - !Lf = 260.*1d-6 - Lf = 0.d0 - Ra = 9.5*1d-3 !0.1d0 !9.5*1d-3 - !Rf = 5.4*1d-3 - Rf = 0.d0 - - !******** controller ******* - Kpn = 11. !3. !=11. - !Kin = 50. - Kpi = 100. - Kii = 900. - - - PUMP(Pump_No)%time = PUMP(Pump_No)%time_step - PUMP(Pump_No)%dt = 1.d-5 - PUMP(Pump_No)%error = .001 - -!>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - - PUMP(Pump_No)%n = PUMP(Pump_No)%time/PUMP(Pump_No)%dt - !PUMP(Pump_No)%w_ref = (pi*(PUMP(Pump_No)%N_ref+102.d0)/30.d0) - PUMP(Pump_No)%w_ref = (pi*(PUMP(Pump_No)%N_ref)/30.d0) - - !if (PUMP(Pump_No)%N_ref<=0.) then - ! PUMP(Pump_No)%w_ref = 0. - !end if - - - !if (PUMP(Pump_No)%N_ref<=0.) then - ! PUMP(Pump_No)%w_ref = 0. - ! PUMP(Pump_No)%w_old = 0. - ! PUMP(Pump_No)%w = 0. - !end if - - - PUMP(Pump_No)%ia_er = 1. - PUMP(Pump_No)%w_er = 1. - PUMP(Pump_No)%x_er = 1. - - - PUMP(Pump_No)%i = 1 - -!>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - DO WHILE (PUMP(Pump_No)%i<=PUMP(Pump_No)%n) - -!>>>>>>>>>>>> Runge-Kutta Method (4th order) <<<<<<<<<<<<<< - - call Pump_dx((PUMP(Pump_No)%i*PUMP(Pump_No)%dt),PUMP(Pump_No)%ia,PUMP(Pump_No)%w,PUMP(Pump_No)%x,Pump_No) - call Pump_dia((PUMP(Pump_No)%i*PUMP(Pump_No)%dt),PUMP(Pump_No)%ia,PUMP(Pump_No)%w,PUMP(Pump_No)%fii,PUMP(Pump_No)%x,Pump_No) - call Pump_dw((PUMP(Pump_No)%i*PUMP(Pump_No)%dt),PUMP(Pump_No)%ia,PUMP(Pump_No)%w,PUMP(Pump_No)%fii,PUMP(Pump_No)%TL,Pump_No) - PUMP(Pump_No)%K1x=PUMP(Pump_No)%dt*PUMP(Pump_No)%dx - PUMP(Pump_No)%K1ia=PUMP(Pump_No)%dt*PUMP(Pump_No)%dia - PUMP(Pump_No)%K1w=PUMP(Pump_No)%dt*PUMP(Pump_No)%dw - - call Pump_dx((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K1ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K1w/2.),PUMP(Pump_No)%x+(PUMP(Pump_No)%K1x/2.),Pump_No) - call Pump_dia((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K1ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K1w/2.),PUMP(Pump_No)%fii,PUMP(Pump_No)%x+(PUMP(Pump_No)%K1x/2.),Pump_No) - call Pump_dw((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K1ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K1w/2.),PUMP(Pump_No)%fii,PUMP(Pump_No)%TL,Pump_No) - PUMP(Pump_No)%K2x=PUMP(Pump_No)%dt*PUMP(Pump_No)%dx - PUMP(Pump_No)%K2ia=PUMP(Pump_No)%dt*PUMP(Pump_No)%dia - PUMP(Pump_No)%K2w=PUMP(Pump_No)%dt*PUMP(Pump_No)%dw - - call Pump_dx((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K2ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K2w/2.),PUMP(Pump_No)%x+(PUMP(Pump_No)%K2x/2.),Pump_No) - call Pump_dia((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K2ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K2w/2.),PUMP(Pump_No)%fii,PUMP(Pump_No)%x+(PUMP(Pump_No)%K2x/2.),Pump_No) - call Pump_dw((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+(PUMP(Pump_No)%dt/2.),PUMP(Pump_No)%ia+(PUMP(Pump_No)%K2ia/2.),PUMP(Pump_No)%w+(PUMP(Pump_No)%K2w/2.),PUMP(Pump_No)%fii,PUMP(Pump_No)%TL,Pump_No) - PUMP(Pump_No)%K3x=PUMP(Pump_No)%dt*PUMP(Pump_No)%dx - PUMP(Pump_No)%K3ia=PUMP(Pump_No)%dt*PUMP(Pump_No)%dia - PUMP(Pump_No)%K3w=PUMP(Pump_No)%dt*PUMP(Pump_No)%dw - - call Pump_dx((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+PUMP(Pump_No)%dt,PUMP(Pump_No)%ia+PUMP(Pump_No)%K3ia,PUMP(Pump_No)%w+PUMP(Pump_No)%K3w,PUMP(Pump_No)%x+PUMP(Pump_No)%K3x,Pump_No) - call Pump_dia((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+PUMP(Pump_No)%dt,PUMP(Pump_No)%ia+PUMP(Pump_No)%K3ia,PUMP(Pump_No)%w+PUMP(Pump_No)%K3w,PUMP(Pump_No)%fii,PUMP(Pump_No)%x+PUMP(Pump_No)%K3x,Pump_No) - call Pump_dw((PUMP(Pump_No)%i*PUMP(Pump_No)%dt)+PUMP(Pump_No)%dt,PUMP(Pump_No)%ia+PUMP(Pump_No)%K3ia,PUMP(Pump_No)%w+PUMP(Pump_No)%K3w,PUMP(Pump_No)%fii,PUMP(Pump_No)%TL,Pump_No) - PUMP(Pump_No)%K4x=PUMP(Pump_No)%dt*PUMP(Pump_No)%dx - PUMP(Pump_No)%K4ia=PUMP(Pump_No)%dt*PUMP(Pump_No)%dia - PUMP(Pump_No)%K4w=PUMP(Pump_No)%dt*PUMP(Pump_No)%dw - - PUMP(Pump_No)%x_new = PUMP(Pump_No)%x_old+((PUMP(Pump_No)%K1x+(2.*PUMP(Pump_No)%K2x)+(2.*PUMP(Pump_No)%K3x)+PUMP(Pump_No)%K4x)/6.) - PUMP(Pump_No)%ia_new = PUMP(Pump_No)%ia_old+((PUMP(Pump_No)%K1ia+(2.*PUMP(Pump_No)%K2ia)+(2.*PUMP(Pump_No)%K3ia)+PUMP(Pump_No)%K4ia)/6.) - PUMP(Pump_No)%w_new = PUMP(Pump_No)%w_old+((PUMP(Pump_No)%K1w+(2.*PUMP(Pump_No)%K2w)+(2.*PUMP(Pump_No)%K3w)+PUMP(Pump_No)%K4w)/6.) - -!>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - - - PUMP(Pump_No)%x_old = PUMP(Pump_No)%x_new - PUMP(Pump_No)%ia_old = PUMP(Pump_No)%ia_new - PUMP(Pump_No)%w_old = PUMP(Pump_No)%w_new - PUMP(Pump_No)%x = PUMP(Pump_No)%x_new - PUMP(Pump_No)%ia = PUMP(Pump_No)%ia_new - PUMP(Pump_No)%w = PUMP(Pump_No)%w_new - PUMP(Pump_No)%Te = PUMP(Pump_No)%fii*PUMP(Pump_No)%ia_new - - !PUMP(Pump_No)%Vt = PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - !IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt = 810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt = 0. - !END IF - - PUMP(Pump_No)%i = PUMP(Pump_No)%i+1 - - END DO -!>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - - - - -end subroutine Pump_Traction_Motor \ No newline at end of file diff --git a/Equipments/Pumps/Pump_VARIABLES.f90 b/Equipments/Pumps/Pump_VARIABLES.f90 deleted file mode 100644 index 25d8b14..0000000 --- a/Equipments/Pumps/Pump_VARIABLES.f90 +++ /dev/null @@ -1,64 +0,0 @@ -MODULE Pump_VARIABLES - - - IMPLICIT NONE - PUBLIC - - - REAL , PARAMETER :: pi=3.14159265 - REAL :: La, Lf, Ra, Rf - REAL :: Kpn, Kin, Kpi, Kii - REAL :: Total_Pump_GPM, Total_Pump_SPM, Total_Stroke_Counter_For_Plot - - - - -!**************************************************************************************************** -!**************** Define PUMP Array ************************************************************ - TYPE, PUBLIC :: Pump_Var - -!***** Pump_VARIABLES *************************** - INTEGER :: j , AssignmentSwitchh - INTEGER :: PowerFailMalf , BlowPopOffMalf , SPMGaugeMalf , K_throttle - - REAL :: Stroke_Length, Piston_Area, Piston_Diameter, Inertia_Moment - REAL :: Mech_Efficiency, Vol_Efficiency, Trans_Ratio - REAL :: StandPipe_Pressure , Max_Pressure - REAL :: Torque, Speed - REAL :: Flow_Rate, Hydraulic_HorsePower, TracMotor_Horsepower , Max_Horsepower - REAL :: simulation_time, time_step - - REAL(8) :: START_TIME, END_TIME - INTEGER :: INT_CPU_TIME, Dt_ref - -!***** Traction Motor_VARIABLES ***************** - INTEGER :: i, n - - REAL :: TL, Vt, J_coef, Ea, fii, Te - REAL :: time, dt, zaman - REAL :: ia, w, ia_old, w_old, ia_new, w_new - REAL :: error, ia_er, w_er ,x_er, y_er - REAL :: K1ia, K1w, K2ia, K2w, K3ia, K3w, K4ia, K4w - REAL :: K1x, K1y, K2x, K2y, K3x, K3y, K4x, K4y - REAL :: ia_ref, w_ref, N_ref ! N(rpm) , w(rad/s) - REAL :: x, y, x_old, y_old, x_new, y_new - REAL :: dia, dw, dx - REAL :: N_new, N_old - REAL :: Vt_old - - -!************* Sound_VARIABLES ********************** - INTEGER :: SoundSPM - Logical :: SoundBlower - - - END TYPE Pump_Var - - TYPE(Pump_Var), DIMENSION(1:3) :: PUMP -!*********************************************************************************************** -!**************************************************************************************************** - - - - -END MODULE Pump_VARIABLES \ No newline at end of file diff --git a/Equipments/Pumps/PumpsMain.f90 b/Equipments/Pumps/PumpsMain.f90 index c9be5fb..8bd88a7 100644 --- a/Equipments/Pumps/PumpsMain.f90 +++ b/Equipments/Pumps/PumpsMain.f90 @@ -4,7 +4,7 @@ module PumpsMain use CDrillingConsoleVariables use CDataDisplayConsoleVariables use CSimulationVariables - use Pump_VARIABLES + use Pumps_VARIABLES use CSounds implicit none @@ -29,7 +29,7 @@ module PumpsMain end subroutine subroutine Pump1_Init - Call Pump_StartUp + Call Pumps_StartUp end subroutine Pump1_Init subroutine Pump1_Step @@ -52,22 +52,22 @@ module PumpsMain INTEGER :: MP_SolDuration + Call Pumps_StartUp loop1 : do - - Call DATE_AND_TIME(values=MP_START_TIME) + !!Call sleepqq(10) + !!Call DATE_AND_TIME(values=MP_START_TIME) Call Pump1_MainSolver - - Call DATE_AND_TIME(values=MP_END_TIME) - MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) - if(MP_SolDuration > 0.0) then - Call sleepqq(MP_SolDuration) - end if - - if (IsStopped == .true.) then + + if (Pumps_IsStopped == .true.) then exit loop1 - end if - + end if + + !!Call DATE_AND_TIME(values=MP_END_TIME) + !!MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) + !!if(MP_SolDuration > 0.0) then + !! Call sleepqq(MP_SolDuration) + !!end if end do loop1 end subroutine Pump1MainBody @@ -79,170 +79,170 @@ module PumpsMain ! **************************************** ! ***** subroutine Pump2MainBody ***** ! **************************** - subroutine Pump2_Setup() - use CSimulationVariables - implicit none - call OnSimulationInitialization%Add(Pump2_Init) - call OnSimulationStop%Add(Pump2_Init) - call OnPump2Step%Add(Pump2_Step) - call OnPump2Output%Add(Pump2_Output) - call OnPump2Main%Add(Pump2MainBody) - end subroutine - - subroutine Pump2_Init - implicit none - end subroutine Pump2_Init - - subroutine Pump2_Step - call Pump2_MainSolver - end subroutine Pump2_Step - - subroutine Pump2_Output - implicit none - end subroutine Pump2_Output - - subroutine Pump2MainBody - use ifport - use ifmt - use CWarningsVariables - implicit none - - integer,dimension(8) :: MP_START_TIME, MP_END_TIME - INTEGER :: MP_SolDuration - - Call Pump_StartUp - - loop1 : do - - Call DATE_AND_TIME(values=MP_START_TIME) - - Call Pump2_MainSolver - - Call DATE_AND_TIME(values=MP_END_TIME) - MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) - if(MP_SolDuration > 0.0) then - Call sleepqq(MP_SolDuration) - end if - - if (IsStopped == .true.) then - exit loop1 - end if - - end do loop1 - - - end subroutine Pump2MainBody - - - - -! **************************************** -! ***** subroutine Pump3MainBody ***** -! **************************** - subroutine Pump3_Setup() - use CSimulationVariables - implicit none - call OnSimulationInitialization%Add(Pump3_Init) - call OnSimulationStop%Add(Pump3_Init) - call OnPump3Step%Add(Pump3_Step) - call OnPump3Output%Add(Pump3_Output) - call OnPump3Main%Add(Pump3MainBody) - end subroutine - - subroutine Pump3_Init - implicit none - end subroutine Pump3_Init - - subroutine Pump3_Step - implicit none - end subroutine Pump3_Step - - subroutine Pump3_Output - implicit none - end subroutine Pump3_Output - - subroutine Pump3MainBody - use ifport - use ifmt - implicit none - - - integer,dimension(8) :: MP_START_TIME, MP_END_TIME - INTEGER :: MP_SolDuration - - !Call Pump_StartUp - !loop1 : do - ! - ! Call sleepqq(10) - ! - ! !!! Pump3 Malfunction ----> Power Failure - ! !!if (PUMP(1)%PowerFailMalf==1) then - ! !! !MP1BLWR=0 - ! !! Call Pump3_OffMode_Solver - ! !! Call ClosePump1() - ! !!end if - ! - ! !if( (MP1CPSwitch==1) .and. (MP1Throttle==0.) .and. (PUMP(3)%PowerFailMalf==0) ) then - !! - !! loop2: do - !! - !! Call DATE_AND_TIME(values=MP_START_TIME) - !! - !!!! ! Pump3 Malfunction ----> Power Failure - !!!! if (PUMP(1)%PowerFailMalf==1) then - !!!! !MP1BLWR=0 - !!!! Pump3_OffMode_Solver - !!!! Call ClosePump1() - !!!! exit loop2 - !!!! end if - !! - !! PUMP(3)%N_new = MP1Throttle - !! if (((PUMP(3)%N_new-PUMP(3)%N_old)/PUMP(3)%time_step)>193.) then - !! PUMP(3)%N_ref =(193.*PUMP(3)%time_step)+PUMP(3)%N_old - !! else if (((PUMP(3)%N_old-PUMP(3)%N_new)/PUMP(3)%time_step)>193.) then - !! PUMP(3)%N_ref = (-193.*PUMP(3)%time_step)+PUMP(3)%N_old - !! else - !! PUMP(3)%N_ref = PUMP(3)%N_new - !! end if - !! - !! Call Pump3_OnMode_Solver - !! - !! IF (PUMP(3)%Flow_Rate>0.) Then - !! Call OpenCementPump() - !! Else - !! Call CloseCementPump() - !! End if - !! - !! PUMP(3)%N_old = PUMP(3)%N_ref - !! - !! Call DATE_AND_TIME(values=MP_END_TIME) - !! MP_SolDuration = 100-(MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) - !! !print*, 'MPtime=', MP_SolDuration - !! if(MP_SolDuration > 0.0) then - !! Call sleepqq(MP_SolDuration) - !! end if - !! - !! if ((MP1CPSwitch==0) .or. (IsStopped == .true.)) then - !! Call Pump3_OffMode_Solver - !! Call CloseCementPump() - !! exit loop2 - !! end if - !! end do loop2 - ! - ! else - ! - ! !Call Pump3_OffMode_Solver - ! !Call CloseCementPump() - ! - ! end if - ! - ! if (IsStopped == .true.) then - ! exit loop1 - ! end if - ! - !end do loop1 - - - end subroutine Pump3MainBody +! subroutine Pump2_Setup() +! use CSimulationVariables +! implicit none +! call OnSimulationInitialization%Add(Pump2_Init) +! call OnSimulationStop%Add(Pump2_Init) +! call OnPump2Step%Add(Pump2_Step) +! call OnPump2Output%Add(Pump2_Output) +! call OnPump2Main%Add(Pump2MainBody) +! end subroutine +! +! subroutine Pump2_Init +! implicit none +! end subroutine Pump2_Init +! +! subroutine Pump2_Step +! call Pump2_MainSolver +! end subroutine Pump2_Step +! +! subroutine Pump2_Output +! implicit none +! end subroutine Pump2_Output +! +! subroutine Pump2MainBody +! use ifport +! use ifmt +! use CWarningsVariables +! implicit none +! +! integer,dimension(8) :: MP_START_TIME, MP_END_TIME +! INTEGER :: MP_SolDuration +! +! Call Pump_StartUp +! +! loop1 : do +! +! Call DATE_AND_TIME(values=MP_START_TIME) +! +! Call Pump2_MainSolver +! +! Call DATE_AND_TIME(values=MP_END_TIME) +! MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) +! if(MP_SolDuration > 0.0) then +! Call sleepqq(MP_SolDuration) +! end if +! +! if (IsStopped == .true.) then +! exit loop1 +! end if +! +! end do loop1 +! +! +! end subroutine Pump2MainBody +! +! +! +! +!! **************************************** +!! ***** subroutine Pump3MainBody ***** +!! **************************** +! subroutine Pump3_Setup() +! use CSimulationVariables +! implicit none +! call OnSimulationInitialization%Add(Pump3_Init) +! call OnSimulationStop%Add(Pump3_Init) +! call OnPump3Step%Add(Pump3_Step) +! call OnPump3Output%Add(Pump3_Output) +! call OnPump3Main%Add(Pump3MainBody) +! end subroutine +! +! subroutine Pump3_Init +! implicit none +! end subroutine Pump3_Init +! +! subroutine Pump3_Step +! implicit none +! end subroutine Pump3_Step +! +! subroutine Pump3_Output +! implicit none +! end subroutine Pump3_Output +! +! subroutine Pump3MainBody +! use ifport +! use ifmt +! implicit none +! +! +! integer,dimension(8) :: MP_START_TIME, MP_END_TIME +! INTEGER :: MP_SolDuration +! +! !Call Pump_StartUp +! !loop1 : do +! ! +! ! Call sleepqq(10) +! ! +! ! !!! Pump3 Malfunction ----> Power Failure +! ! !!if (PUMP(1)%PowerFailMalf==1) then +! ! !! !MP1BLWR=0 +! ! !! Call Pump3_OffMode_Solver +! ! !! Call ClosePump1() +! ! !!end if +! ! +! ! !if( (MP1CPSwitch==1) .and. (MP1Throttle==0.) .and. (PUMP(3)%PowerFailMalf==0) ) then +! !! +! !! loop2: do +! !! +! !! Call DATE_AND_TIME(values=MP_START_TIME) +! !! +! !!!! ! Pump3 Malfunction ----> Power Failure +! !!!! if (PUMP(1)%PowerFailMalf==1) then +! !!!! !MP1BLWR=0 +! !!!! Pump3_OffMode_Solver +! !!!! Call ClosePump1() +! !!!! exit loop2 +! !!!! end if +! !! +! !! PUMP(3)%N_new = MP1Throttle +! !! if (((PUMP(3)%N_new-PUMP(3)%N_old)/PUMP(3)%time_step)>193.) then +! !! PUMP(3)%N_ref =(193.*PUMP(3)%time_step)+PUMP(3)%N_old +! !! else if (((PUMP(3)%N_old-PUMP(3)%N_new)/PUMP(3)%time_step)>193.) then +! !! PUMP(3)%N_ref = (-193.*PUMP(3)%time_step)+PUMP(3)%N_old +! !! else +! !! PUMP(3)%N_ref = PUMP(3)%N_new +! !! end if +! !! +! !! Call Pump3_OnMode_Solver +! !! +! !! IF (PUMP(3)%Flow_Rate>0.) Then +! !! Call OpenCementPump() +! !! Else +! !! Call CloseCementPump() +! !! End if +! !! +! !! PUMP(3)%N_old = PUMP(3)%N_ref +! !! +! !! Call DATE_AND_TIME(values=MP_END_TIME) +! !! MP_SolDuration = 100-(MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8)) +! !! !print*, 'MPtime=', MP_SolDuration +! !! if(MP_SolDuration > 0.0) then +! !! Call sleepqq(MP_SolDuration) +! !! end if +! !! +! !! if ((MP1CPSwitch==0) .or. (IsStopped == .true.)) then +! !! Call Pump3_OffMode_Solver +! !! Call CloseCementPump() +! !! exit loop2 +! !! end if +! !! end do loop2 +! ! +! ! else +! ! +! ! !Call Pump3_OffMode_Solver +! ! !Call CloseCementPump() +! ! +! ! end if +! ! +! ! if (IsStopped == .true.) then +! ! exit loop1 +! ! end if +! ! +! !end do loop1 +! +! +! end subroutine Pump3MainBody end module PumpsMain \ No newline at end of file diff --git a/Equipments/Pumps/Pumps_Inputs.f90 b/Equipments/Pumps/Pumps_Inputs.f90 new file mode 100644 index 0000000..8f24405 --- /dev/null +++ b/Equipments/Pumps/Pumps_Inputs.f90 @@ -0,0 +1,55 @@ +subroutine Pumps_Inputs + + !use CPumpsVariables + !use CDrillingConsoleVariables + !use CDataDisplayConsoleVariables + !use CSimulationVariables + use Pumps_VARIABLES + !use MudSystem + + IMPLICIT NONE + + + !>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<< + + PUMP(1)%StandPipe_Pressure = 25.e0!PumpPressure1 ![psi] + + PUMP(1)%AssignmentSwitchh = 1!AssignmentSwitch + + PUMP(1)%Switch = -1!MP1CPSwitch + + PUMP(1)%Throttle = 0.e0!MP1Throttle ![RPM] + + PUMP(1)%PowerFailMalf = 1 !??????? motaghayere voroudi (Pump1 Malfunction ----> Power Failure) + + PUMP(1)%Failure = 0!Pump1Failure (Pump1 Warning ----> Failure) + + Pumps_IsStopped = .false.!IsStopped + + PUMP(1)%N_new = PUMP(1)%Throttle + + + + + + + + + +!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<< +! +! PUMP(2)%StandPipe_Pressure = PumpPressure2 ![psi] +! +! +! +! +! +!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 3 <<<<<<<<<<<<<<<<<<<<<<<<<<< +! +! PUMP(3)%StandPipe_Pressure = PumpPressure3 ![psi] + + + + + +end subroutine Pumps_Inputs \ No newline at end of file diff --git a/Equipments/Pumps/Pumps_Outputs.f90 b/Equipments/Pumps/Pumps_Outputs.f90 new file mode 100644 index 0000000..3894bf6 --- /dev/null +++ b/Equipments/Pumps/Pumps_Outputs.f90 @@ -0,0 +1,51 @@ +subroutine Pumps_Outputs + + use CPumpsVariables + use CDrillingConsoleVariables + use CDataDisplayConsoleVariables + use CSimulationVariables + use Pumps_VARIABLES + use MudSystem + + IMPLICIT NONE + + + !>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<< + + !Call SetSoundBlowerMP1(PUMP(1)%SoundBlower) + ! DrillingConsole%MP1BLWR = 1 + ! Call OpenPump1() + ! Call ClosePump1() + ! total_pumps%Total_Pump_GPM = 100 + ! total_pumps%Total_Pump_SPM = + ! Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) + ! DrillingWatch%SPM1 = MP1SPMGauge + ! Call SetSoundMP1( PUMP(1)%SoundSPM ) + ! SCR1LED=1 + ! SCR2LED=1 + ! SCR3LED=1 + ! SCR4LED=1 + + + + + + + + + +!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<< +! +! +! +! +! +! +!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 3 <<<<<<<<<<<<<<<<<<<<<<<<<<< +! + + + + + +end subroutine Pumps_Outputs \ No newline at end of file diff --git a/Equipments/Pumps/Pumps_StartUp.f90 b/Equipments/Pumps/Pumps_StartUp.f90 new file mode 100644 index 0000000..30cebc6 --- /dev/null +++ b/Equipments/Pumps/Pumps_StartUp.f90 @@ -0,0 +1,77 @@ +subroutine Pumps_StartUp + + !use CPumpsVariables + !use CDrillingConsoleVariables + !use CDataDisplayConsoleVariables + !use CSimulationVariables + !use CPowerVariables + use Pumps_VARIABLES + + + IMPLICIT NONE + + + + +!>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<< + PUMP(1)%FlowRatePerSTK = 7000.e0 ![bbl] !??????? motaghayere voroudi + !PUMP(1)%FlowRatePerSTK = PUMP(1)%FlowRatePerSTK*0.0292e0 ![gpm] + PUMP(1)%RateChange = 4.e0 ! [stk/min2] !??????? motaghayere voroudi + PUMP(1)%Stroke_Length = 12.e0!MudPump1Stroke ! bayad hazf beshe ? + PUMP(1)%Piston_Diameter = 4.e0!MudPump1LinerDiameter ! bayad hazf beshe ? + PUMP(1)%Piston_Area = (pi*(PUMP(1)%Piston_Diameter**2.e0))/4.e0 ! bayad hazf beshe ? + PUMP(1)%Mech_Efficiency = 0.95e0!MudPump1MechanicalEfficiency [dimensionless] + !PUMP(1)%Vol_Efficiency = MudPump1VolumetricEfficiency ! bayad hazf beshe ? + !PUMP(1)%Max_Horsepower = MudPump1 ! bayad hazf beshe ? + PUMP(1)%Max_Pressure = 600.e0 ! [psi] !??????? motaghayere voroudi + PUMP(1)%MaxSPM = 275.e0!MudPump1Maximum [spm] + PUMP(1)%Trans_Ratio = 965.e0/PUMP(1)%MaxSPM + PUMP(1)%time_step = 0.1e0 !?????? niaz hast ya na?? + + PUMP(1)%RateChange = PUMP(1)%RateChange*PUMP(1)%Trans_Ratio ! [rpm/min2] + PUMP(1)%K_throttle = 0 + Pumps_IsStopped = .false. + PUMP(1)%N_old = 0.e0 + Call Pump_OffMode_Solver(1) + + + + +!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<< + !PUMP(2)%Stroke_Length = MudPump2Stroke + !PUMP(2)%Piston_Diameter = MudPump2LinerDiameter + !PUMP(2)%Piston_Area = pi*PUMP(2)%Piston_Diameter*PUMP(2)%Piston_Diameter/4. + !PUMP(2)%Mech_Efficiency = MudPump2MechanicalEfficiency + !PUMP(2)%Vol_Efficiency = MudPump2VolumetricEfficiency + !PUMP(2)%Max_Horsepower = MudPump2 + !PUMP(2)%Inertia_Moment = 23.261341 ! 23.261341 [kg.m^2] = 552 [lb.ft^2] + !PUMP(2)%J_coef = PUMP(2)%Inertia_Moment+(4.*(PUMP(2)%Inertia_Moment)) + !PUMP(2)%Trans_Ratio = 965.0/MudPump2Maximum + !PUMP(2)%time_step = .10 + ! + !PUMP(2)%Flow_Rate = 0. + !Call Pump2_OffMode_Solver(2) + + + + + +!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 3 <<<<<<<<<<<<<<<<<<<<<<<<<<< + !PUMP(3)%Stroke_Length = CementPumpStroke + !PUMP(3)%Piston_Diameter = CementPumpLinerDiameter + !PUMP(3)%Piston_Area = pi*PUMP(3)%Piston_Diameter*PUMP(3)%Piston_Diameter/4. + !PUMP(3)%Mech_Efficiency = CementPumpMechanicalEfficiency + !PUMP(3)%Vol_Efficiency = CementPumpVolumetricEfficiency + !PUMP(3)%Max_Horsepower = CementPump + !PUMP(3)%Inertia_Moment = 23.261341 ! 23.261341 [kg.m^2] = 552 [lb.ft^2] + !PUMP(3)%Trans_Ratio = 965.0/CementPumpMaximum + !PUMP(3)%time_step = .10 + ! + !PUMP(3)%Flow_Rate = 0. + !Call Pump3_OffMode_Solver + + + + + +end subroutine Pumps_StartUp \ No newline at end of file diff --git a/Equipments/Pumps/Pumps_VARIABLES.f90 b/Equipments/Pumps/Pumps_VARIABLES.f90 new file mode 100644 index 0000000..65123c0 --- /dev/null +++ b/Equipments/Pumps/Pumps_VARIABLES.f90 @@ -0,0 +1,43 @@ +MODULE Pumps_VARIABLES + + IMPLICIT NONE + PUBLIC + REAL , PARAMETER :: pi=3.14159265e0 + Logical :: Pumps_IsStopped + Type, public:: Pumps_Type + REAL :: Total_Pump_GPM, Total_Pump_SPM, Total_Stroke_Counter_For_Plot + end Type Pumps_Type + Type(Pumps_Type)::total_pumps + + + +!**************************************************************************************************** +!**************** Define PUMP Array ************************************************************ + TYPE, PUBLIC :: Pump_Var + +!***** Pump_VARIABLES *************************** + INTEGER :: AssignmentSwitchh, Switch, K_throttle + INTEGER :: PowerFailMalf , BlowPopOffMalf , SPMGaugeMalf , Failure + + REAL :: Throttle, RateChange + REAL :: Stroke_Length, Piston_Area, Piston_Diameter, Inertia_Moment + REAL :: Mech_Efficiency, Vol_Efficiency, Trans_Ratio + REAL :: StandPipe_Pressure , Max_Pressure + REAL :: Torque, Speed, N_new, N_old, MaxSPM + REAL :: Flow_Rate, Hydraulic_HorsePower, Max_Horsepower, FlowRatePerSTK, Max_FlowRate + REAL :: simulation_time, time_step + + REAL(8) :: START_TIME, END_TIME + INTEGER :: INT_CPU_TIME, Dt_ref + +!************* Sound_VARIABLES ********************** + INTEGER :: SoundSPM + Logical :: SoundBlower + + END TYPE Pump_Var + + TYPE(Pump_Var), DIMENSION(1:3) :: PUMP +!*********************************************************************************************** +!*********************************************************************************************** + +END MODULE Pumps_VARIABLES \ No newline at end of file diff --git a/Equipments/Pumps/pump_diff_eqs.f90 b/Equipments/Pumps/pump_diff_eqs.f90 deleted file mode 100644 index 091a1f3..0000000 --- a/Equipments/Pumps/pump_diff_eqs.f90 +++ /dev/null @@ -1,105 +0,0 @@ -subroutine Pump_dia(x1,x2,x3,x5,x6,Pump_No) - - use Pump_VARIABLES - use equipments_PowerLimit - - - IMPLICIT NONE - INTEGER :: Pump_No - REAL :: x1,x2,x3,x4,x5,x6 - - !Power_sigma=2.*(PUMP(1)%Vt*PUMP(1)%ia_new)+2.*(PUMP(2)%Vt*PUMP(2)%ia_new)+2.*(PUMP(3)%Vt*PUMP(3)%ia_new)+(RTable%Vt*RTable%ia_new)+2.*(Drawworks%Vt*Drawworks%ia_new) - - PUMP(Pump_No)%Vt = PUMP(Pump_No)%x_new+Kpi*((Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi)))+20.d0-PUMP(Pump_No)%ia_new) - IF (PUMP(Pump_No)%Vt>810.) THEN - PUMP(Pump_No)%Vt = 810.0 - ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - PUMP(Pump_No)%Vt = 0.0d0 - END IF - - !call PowerLimits - ! - !if (Power_sigma>max_Power_sigma) then - ! PUMP(Pump_No)%Vt=PUMP(Pump_No)%Vt_old - !else - ! PUMP(Pump_No)%Vt=x6+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*x3/pi))-x2) - ! IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt=810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt=0. - !END IF - - - ! PUMP(Pump_No)%Vt_old=PUMP(Pump_No)%x_new+Kpi*(Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*PUMP(Pump_No)%w_new/pi))-PUMP(Pump_No)%ia_new) - ! IF (PUMP(Pump_No)%Vt_old>810.) THEN - ! PUMP(Pump_No)%Vt_old=810. - !ELSE IF (PUMP(Pump_No)%Vt_old<0.) THEN - ! PUMP(Pump_No)%Vt_old=0. - !END IF - - - !end if - - !IF (PUMP(Pump_No)%Vt>810.) THEN - ! PUMP(Pump_No)%Vt=810. - !ELSE IF (PUMP(Pump_No)%Vt<0.) THEN - ! PUMP(Pump_No)%Vt=0. - !END IF - - !PUMP(Pump_No)%Vt_old=PUMP(Pump_No)%Vt - - - !IF (x2<=1150.) THEN - ! x5 = 6.3304d-3*x2 - !ELSE IF (x2>1150.) THEN - ! x5 = 2.8571d-7*(x2-1150.)+7.28 - !END IF - x5 = 6.3304d-3*1150.0 - - PUMP(Pump_No)%Ea = x5*x3 - PUMP(Pump_No)%dia = (PUMP(Pump_No)%Vt-(Ra+Rf)*x2-PUMP(Pump_No)%Ea)/(La+Lf) - -end subroutine - - - - - - -!------------------------------------------------------------ -subroutine Pump_dw(x1,x2,x3,x4,x5,Pump_No) - - use Pump_VARIABLES - - IMPLICIT NONE - INTEGER :: Pump_No - REAL :: x1,x2,x3,x4,x5 - - !IF (x2<=1150.) THEN - ! x4 = 6.3304d-3*x2 - !ELSE IF (x2>1150.) THEN - ! x4 = 2.8571d-7*(x2-1150.)+7.28 - !END IF - x4 = 6.3304d-3*1150.0 - - PUMP(Pump_No)%Te = x4*x2 - PUMP(Pump_No)%dw = (PUMP(Pump_No)%Te-x5)/PUMP(Pump_No)%J_coef - -end subroutine - - - - - -!------------------------------------------------------------ -subroutine Pump_dx(x1,x2,x3,x4,Pump_No) - - use Pump_VARIABLES - - IMPLICIT NONE - INTEGER :: Pump_No - REAL :: x1,x2,x3,x4 - - PUMP(Pump_No)%dx = Kii*((Kpn*((30.*PUMP(Pump_No)%w_ref/pi)-(30.*x3/pi)))+20.d0-x2) - -end subroutine \ No newline at end of file diff --git a/Equipments/RotaryTable/RTable_INPUTS.f90 b/Equipments/RotaryTable/RTable_INPUTS.f90 index 2f1dbc4..51faa0b 100644 --- a/Equipments/RotaryTable/RTable_INPUTS.f90 +++ b/Equipments/RotaryTable/RTable_INPUTS.f90 @@ -27,7 +27,7 @@ subroutine RTable_INPUTS !===> String_JCoef Calculation - if ( DriveType==0 ) then + if ( Hoisting%DriveType==0 ) then if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_NOTHING ) then RT_RotaryMode = 1 RTable%String_JCoef = 0.0 @@ -44,7 +44,7 @@ subroutine RTable_INPUTS RTable%String_JCoef = 0.0 RTable%String_Torque = 0.0 end if - else if ( DriveType==1 ) then + else if ( Hoisting%DriveType==1 ) then if ( Get_IsKellyBushingSetInTable() .or. Get_Slips() == SLIPS_SET_END ) then !if rotary connected to string RT_RotaryMode = 4 RTable%String_JCoef = 0.0 @@ -75,11 +75,11 @@ subroutine RTable_INPUTS !===> Transmission Mode - if (RTTransmissionLever==1) then ! in high mode + if (DrillingConsole%RTTransmissionLever==1) then ! in high mode RTable%Conv_Ratio = RTable%High_Conv_Ratio - else if (RTTransmissionLever==-1) then ! in low mode + else if (DrillingConsole%RTTransmissionLever==-1) then ! in low mode RTable%Conv_Ratio = RTable%Low_Conv_Ratio - else if (RTTransmissionLever==0) then ! in low mode + else if (DrillingConsole%RTTransmissionLever==0) then ! in low mode RTable%Conv_Ratio = RTable%Low_Conv_Ratio end if diff --git a/Equipments/RotaryTable/RTable_OffMode.f90 b/Equipments/RotaryTable/RTable_OffMode.f90 index f14cc46..f3ad1e8 100644 --- a/Equipments/RotaryTable/RTable_OffMode.f90 +++ b/Equipments/RotaryTable/RTable_OffMode.f90 @@ -22,7 +22,7 @@ subroutine RTable_OffMode CALL RTable_INPUTS CALL RTable_Solver RTable%N_old = RTable%N_ref - if ( RT_OldTransMode==0 .and. RTTransmissionLever/=0 .and. RTable%w_new/=0.d0 ) then + if ( RT_OldTransMode==0 .and. DrillingConsole%RTTransmissionLever/=0 .and. RTable%w_new/=0.d0 ) then Call Activate_RotaryGearsAbuse() RTable%SoundGearCrash = .true. Call SetSoundRtGearCrash(RTable%SoundGearCrash) @@ -30,7 +30,7 @@ subroutine RTable_OffMode RTable%SoundGearCrash = .false. Call SetSoundRtGearCrash(RTable%SoundGearCrash) end if - RT_OldTransMode = RTTransmissionLever + RT_OldTransMode = DrillingConsole%RTTransmissionLever !================================================================== else @@ -61,7 +61,7 @@ subroutine RTable_OffMode !RotaryRPMGauge=RTable%Speed !RPM=RotaryRPMGauge RTable%Output_Current = 0. - RotaryTorqueGauge = ( ((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] + DataDisplayConsole%RotaryTorqueGauge = ( ((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] RTable%Torque = ( ((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] Call Set_RotaryTorque(sngl(1-RTable%TorqueGaugeMalf)*real(RTable%Torque,8)) !RotaryTorqueGauge=(RTable%String_Torque)/12. diff --git a/Equipments/RotaryTable/RTable_Solver.f90 b/Equipments/RotaryTable/RTable_Solver.f90 index 66b99f7..8f9f8e3 100644 --- a/Equipments/RotaryTable/RTable_Solver.f90 +++ b/Equipments/RotaryTable/RTable_Solver.f90 @@ -47,10 +47,10 @@ subroutine RTable_Solver Call SetSoundRT( RTable%SoundRPM ) !RotaryRPMGauge = RTable%Speed !RPM = RotaryRPMGauge - RotaryTorqueGauge = ( ((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] + DataDisplayConsole%RotaryTorqueGauge = ( ((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] RTable%Torque = ( ((RTable%J_coef+RTable%String_JCoef)*(((RTable%w_new/RTable%Conv_Ratio)-RT_wOld)/RTable%time_step))+(RTable%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] Call Set_RotaryTorque(sngl(1-RTable%TorqueGaugeMalf)*real(RTable%Torque,8)) - Torque = RotaryTorqueGauge + DrillingWatch%Torque = DataDisplayConsole%RotaryTorqueGauge !print*, 'RTable%Speed=', RTable%Speed !print*, 'RTable%String_JCoef=', RTable%String_JCoef !print*, 'RTable%String_Torque=', RTable%String_Torque diff --git a/Equipments/RotaryTable/RTable_StartUp.f90 b/Equipments/RotaryTable/RTable_StartUp.f90 index 7a02998..d3fd801 100644 --- a/Equipments/RotaryTable/RTable_StartUp.f90 +++ b/Equipments/RotaryTable/RTable_StartUp.f90 @@ -31,7 +31,7 @@ subroutine RTable_StartUp - RT_OldTransMode = RTTransmissionLever + RT_OldTransMode = DrillingConsole%RTTransmissionLever diff --git a/Equipments/RotaryTable/RTable_Traction_Motor.f90 b/Equipments/RotaryTable/RTable_Traction_Motor.f90 index 518d6d0..7ea61ae 100644 --- a/Equipments/RotaryTable/RTable_Traction_Motor.f90 +++ b/Equipments/RotaryTable/RTable_Traction_Motor.f90 @@ -36,7 +36,7 @@ subroutine RTable_Traction_Motor RTable%n = RTable%time/RTable%dt RTable%w_ref = (pi*(RTable%N_ref)/30.d0) - RTable%ia_ref_limit = RTTorqueLimitKnob*100.d0 + RTable%ia_ref_limit = DrillingConsole%RTTorqueLimitKnob*100.d0 !print* , 'N_ref=' , RTThrottle , RTable%w_ref , RTable%N_ref RTable%ia_er = 1. diff --git a/Equipments/RotaryTable/Rtable_MainSolver.f90 b/Equipments/RotaryTable/Rtable_MainSolver.f90 index 523c4b7..a679289 100644 --- a/Equipments/RotaryTable/Rtable_MainSolver.f90 +++ b/Equipments/RotaryTable/Rtable_MainSolver.f90 @@ -14,22 +14,22 @@ subroutine Rtable_MainSolver if (IsPortable) then RTable%AssignmentSwitch = 1 else - RTable%AssignmentSwitch = AssignmentSwitch + RTable%AssignmentSwitch = DrillingConsole%AssignmentSwitch end if - if (RTThrottle<=0.e0) then + if (DrillingConsole%RTThrottle<=0.e0) then RTable%K_throttle = 1 end if - if ( (any(RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (RTSwitch == -1) .and. (IsStopped == .false.) ) then + if ( (any(RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (DrillingConsole%RTSwitch == -1) .and. (IsStopped == .false.) ) then RTable%SoundBlower = .true. Call SetSoundBlowerRT(RTable%SoundBlower) - RTBLWR = 1 + DrillingConsole%RTBLWR = 1 - IF ( RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ?????? - RTable%N_new = RTThrottle + IF ( DrillingConsole%RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ?????? + RTable%N_new = DrillingConsole%RTThrottle !===> Rotary Table Malfunction ----> Drive Motor Failure call RTMalfunction_MotorFailure @@ -43,24 +43,24 @@ subroutine Rtable_MainSolver end if CALL RTable_INPUTS CALL RTable_Solver - RT_RPMUnityOutput = RotaryRPMGauge + RT_RPMUnityOutput = DataDisplayConsole%RotaryRPMGauge RTable%N_old = RTable%N_ref - Else IF ( RTTransmissionLever==0) THEN !be in brake mode ?????? + Else IF ( DrillingConsole%RTTransmissionLever==0) THEN !be in brake mode ?????? Call RTable_OffMode - RT_RPMUnityOutput = RotaryRPMGauge + RT_RPMUnityOutput = DataDisplayConsole%RotaryRPMGauge End IF - RT_OldTransMode = RTTransmissionLever + RT_OldTransMode = DrillingConsole%RTTransmissionLever - else if ( (any(RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (RTSwitch == 1) .and. (RTable%K_throttle==1) .and. (IsStopped == .false.) ) then + else if ( (any(RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (DrillingConsole%RTSwitch == 1) .and. (RTable%K_throttle==1) .and. (IsStopped == .false.) ) then RTable%SoundBlower = .true. Call SetSoundBlowerRT(RTable%SoundBlower) - RTBLWR = 1 + DrillingConsole%RTBLWR = 1 - IF ( RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ?????? - RTable%N_new = RTThrottle + IF ( DrillingConsole%RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ?????? + RTable%N_new = DrillingConsole%RTThrottle !===> Rotary Table Malfunction ----> Drive Motor Failure call RTMalfunction_MotorFailure @@ -74,31 +74,31 @@ subroutine Rtable_MainSolver end if CALL RTable_INPUTS CALL RTable_Solver - RT_RPMUnityOutput = -RotaryRPMGauge + RT_RPMUnityOutput = -DataDisplayConsole%RotaryRPMGauge RTable%N_old = RTable%N_ref - Else IF ( RTTransmissionLever==0) THEN !be in brake mode ?????? + Else IF ( DrillingConsole%RTTransmissionLever==0) THEN !be in brake mode ?????? Call RTable_OffMode - RT_RPMUnityOutput = -RotaryRPMGauge + RT_RPMUnityOutput = -DataDisplayConsole%RotaryRPMGauge End IF - RT_OldTransMode = RTTransmissionLever + RT_OldTransMode = DrillingConsole%RTTransmissionLever else - if((any(RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (RTSwitch /= 0) .and. (IsStopped == .false.) ) then + if((any(RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (DrillingConsole%RTSwitch /= 0) .and. (IsStopped == .false.) ) then RTable%SoundBlower = .true. Call SetSoundBlowerRT(RTable%SoundBlower) - RTBLWR = 1 + DrillingConsole%RTBLWR = 1 else RTable%SoundBlower = .false. Call SetSoundBlowerRT(RTable%SoundBlower) - RTBLWR = 0 + DrillingConsole%RTBLWR = 0 end if Call RTable_OffMode - RT_RPMUnityOutput = RotaryRPMGauge - RT_OldTransMode = RTTransmissionLever + RT_RPMUnityOutput = DataDisplayConsole%RotaryRPMGauge + RT_OldTransMode = DrillingConsole%RTTransmissionLever RTable%K_throttle = 0 diff --git a/Equipments/TopDrive/TopDrive_INPUTS.f90 b/Equipments/TopDrive/TopDrive_INPUTS.f90 index 5510f0e..1e23aa9 100644 --- a/Equipments/TopDrive/TopDrive_INPUTS.f90 +++ b/Equipments/TopDrive/TopDrive_INPUTS.f90 @@ -25,7 +25,7 @@ subroutine TopDrive_INPUTS !===> TDS%String_JCoef Calculation - if ( (TopDriveDrillTorqueState==-1) .and. ((Get_TdsConnectionModes()==TDS_CONNECTION_STRING).or.(Get_TdsConnectionModes()==TDS_CONNECTION_SPINE)) ) then !if TopDrive connected to string + if ( (TopDrivePanel%TopDriveDrillTorqueState==-1) .and. ((Get_TdsConnectionModes()==TDS_CONNECTION_STRING).or.(Get_TdsConnectionModes()==TDS_CONNECTION_SPINE)) ) then !if TopDrive connected to string TDS%String_JCoef = 0.0 Do i = 1,TD_StringConfigurationCount TDS%String_JCoef = TDS%String_JCoef+( (TD_DrillStem(i)%TotalWeight*((TD_DrillStem(i)%Id**2)+(TD_DrillStem(i)%Od**2)))/8.0 ) ![lb.ft^2] , Jz=(1/2)*m*(r1^2+r2^2) diff --git a/Equipments/TopDrive/TopDrive_MainSolver.f90 b/Equipments/TopDrive/TopDrive_MainSolver.f90 index e196ec0..905c21e 100644 --- a/Equipments/TopDrive/TopDrive_MainSolver.f90 +++ b/Equipments/TopDrive/TopDrive_MainSolver.f90 @@ -18,11 +18,11 @@ subroutine TopDrive_MainSolver TDS%SoundBlower = .true. !Call SetSoundBlowerRT(TDS%SoundBlower) - TopDriveTdsPowerLed = 1 + TopDrivePanel%TopDriveTdsPowerLed = 1 !IF ( RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ???? - TDS%N_new = (RpmKnob/250.d0)*965.d0 ! 0 Top Drive Malfunction ----> Drive Motor Failure call TopDrive_Malfunction_MotorFailure @@ -45,10 +45,10 @@ subroutine TopDrive_MainSolver TDS%SoundBlower = .true. !Call SetSoundBlowerRT(TDS%SoundBlower) - TopDriveTdsPowerLed = 1 + TopDrivePanel%TopDriveTdsPowerLed = 1 - TDS%N_new = (RpmKnob/250.d0)*965.d0 + TDS%N_new = (TopDrivePanel%RpmKnob/250.d0)*965.d0 !===> Top Drive Malfunction ----> Drive Motor Failure call TopDrive_Malfunction_MotorFailure @@ -71,11 +71,11 @@ subroutine TopDrive_MainSolver if( (TopDriveTdsPowerState /= 0) .and. (IsStopped == .false.) ) then TDS%SoundBlower = .true. !Call SetSoundBlowerRT(TDS%SoundBlower) - TopDriveTdsPowerLed = 1 + TopDrivePanel%TopDriveTdsPowerLed = 1 else TDS%SoundBlower = .false. !Call SetSoundBlowerRT(TDS%SoundBlower) - TopDriveTdsPowerLed = 0 + TopDrivePanel%TopDriveTdsPowerLed = 0 end if Call TopDrive_OffMode diff --git a/Equipments/TopDrive/TopDrive_OffMode.f90 b/Equipments/TopDrive/TopDrive_OffMode.f90 index 5887bee..4e8c5f1 100644 --- a/Equipments/TopDrive/TopDrive_OffMode.f90 +++ b/Equipments/TopDrive/TopDrive_OffMode.f90 @@ -57,14 +57,14 @@ subroutine TopDrive_OffMode TDS_wOld = 0. - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = -TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = -TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = 1 TDS_OldPowerMode = 0 diff --git a/Equipments/TopDrive/TopDrive_Solver.f90 b/Equipments/TopDrive/TopDrive_Solver.f90 index eab9716..811c549 100644 --- a/Equipments/TopDrive/TopDrive_Solver.f90 +++ b/Equipments/TopDrive/TopDrive_Solver.f90 @@ -44,241 +44,241 @@ subroutine TopDrive_Solver if ( TopDriveTdsPowerState==-1 .or. TDS_OldPowerMode==-1 ) then !FWD - if ( TopDriveDrillTorqueState==0 .and. Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING ) then ! TdsMu_SPINE - TopDriveOperationFaultLed = 0 + if ( TopDrivePanel%TopDriveDrillTorqueState==0 .and. Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING ) then ! TdsMu_SPINE + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = 30.d0 - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = 30.d0 + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 30 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 + TopDrivePanel%TopDriveTorqueGauge = 0.d0 TDS_OldPowerMode = -1 - else if ( TopDriveDrillTorqueState==0 .and. Get_TdsConnectionModes()==TDS_CONNECTION_SPINE ) then ! TdsMu_SPINE - TopDriveOperationFaultLed = 0 + else if ( TopDrivePanel%TopDriveDrillTorqueState==0 .and. Get_TdsConnectionModes()==TDS_CONNECTION_SPINE ) then ! TdsMu_SPINE + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 1000.d0 + TopDrivePanel%TopDriveTorqueGauge = 1000.d0 TDS_OldPowerMode = -1 - else if ( TopDriveDrillTorqueState==1 ) then ! TdsMu_Torque - if ( RpmKnob>0. ) then - TopDriveOperationFaultLed = 1 + else if ( TopDrivePanel%TopDriveDrillTorqueState==1 ) then ! TdsMu_Torque + if ( TopDrivePanel%RpmKnob>0. ) then + TopDrivePanel%TopDriveOperationFaultLed = 1 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = -1 else - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 if ( Get_TdsConnectionModes()==TDS_CONNECTION_STRING ) then TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = max( 1000.d0,((TopDriveTorqueLimitKnob/10.d0)*60000.d0) ) ![ft.lbf] ???? + TopDrivePanel%TopDriveTorqueGauge = max( 1000.d0,((TopDrivePanel%TopDriveTorqueLimitKnob/10.d0)*60000.d0) ) ![ft.lbf] ???? TDS_OldPowerMode = -1 else if ( Get_TdsConnectionModes()==Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING ) then TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = -1 else if ( Get_TdsConnectionModes()==TDS_CONNECTION_SPINE ) then TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 1000.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 1000.d0 ![ft.lbf] TDS_OldPowerMode = -1 end if end if - else if ( TopDriveDrillTorqueState==-1 ) then ! TdsMu_DRILL + else if ( TopDrivePanel%TopDriveDrillTorqueState==-1 ) then ! TdsMu_DRILL if ( Get_TdsConnectionModes()==TDS_CONNECTION_STRING ) then - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = (30.d0*TDS%w_new/pi)/TDS%Conv_Ratio !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = INT(TDS%Speed) !Call SetSound( TDS%SoundRPM ) TDS%Torque = ( ((TDS%J_coef+TDS%String_JCoef)*(((TDS%w_new/TDS%Conv_Ratio)-TDS_wOld)/TDS%time_step))+(TDS%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] - TopDriveTorqueGauge= TDS%Torque + TopDrivePanel%TopDriveTorqueGauge= TDS%Torque TDS_OldPowerMode = -1 else if ( Get_TdsConnectionModes()==Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING ) then - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = 0.0d0 - TopDriveRpmGauge = ((30.d0*TDS%w_new/pi)/TDS%Conv_Ratio) !Speed [RPM] - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = ((30.d0*TDS%w_new/pi)/TDS%Conv_Ratio) !Speed [RPM] + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = INT((30.d0*TDS%w_new/pi)/TDS%Conv_Ratio) !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.0d0 - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = -1 else if ( Get_TdsConnectionModes()==TDS_CONNECTION_SPINE ) then - if ( RpmKnob>0. ) then - TopDriveOperationFaultLed = 1 + if ( TopDrivePanel%RpmKnob>0. ) then + TopDrivePanel%TopDriveOperationFaultLed = 1 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = -1 else - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = -1 end if end if else - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = -1 end if else if ( TopDriveTdsPowerState==1 .or. TDS_OldPowerMode==1 ) then !REV - if ( TopDriveDrillTorqueState==0 .and. Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING ) then ! TdsMu_SPINE - TopDriveOperationFaultLed = 0 + if ( TopDrivePanel%TopDriveDrillTorqueState==0 .and. Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING ) then ! TdsMu_SPINE + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = 30.d0 - TD_RPMUnityOutput = -TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = 30.d0 + TD_RPMUnityOutput = -TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 30 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 + TopDrivePanel%TopDriveTorqueGauge = 0.d0 TDS_OldPowerMode = 1 - else if ( TopDriveDrillTorqueState==0 .and. Get_TdsConnectionModes()==TDS_CONNECTION_SPINE ) then ! TdsMu_SPINE - TopDriveOperationFaultLed = 0 + else if ( TopDrivePanel%TopDriveDrillTorqueState==0 .and. Get_TdsConnectionModes()==TDS_CONNECTION_SPINE ) then ! TdsMu_SPINE + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = 30.d0 - TD_RPMUnityOutput = -TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = 30.d0 + TD_RPMUnityOutput = -TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 1000.d0 + TopDrivePanel%TopDriveTorqueGauge = 1000.d0 TDS_OldPowerMode = 1 - else if ( TopDriveDrillTorqueState==1 ) then ! TdsMu_Torque - if ( RpmKnob>0. ) then - TopDriveOperationFaultLed = 1 + else if ( TopDrivePanel%TopDriveDrillTorqueState==1 ) then ! TdsMu_Torque + if ( TopDrivePanel%RpmKnob>0. ) then + TopDrivePanel%TopDriveOperationFaultLed = 1 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = -TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = -TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = 1 else - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 if ( Get_TdsConnectionModes()==TDS_CONNECTION_STRING ) then TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = -TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = -TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 2000.d0 + TopDrivePanel%TopDriveTorqueGauge = 2000.d0 TDS_OldPowerMode = 1 else if ( Get_TdsConnectionModes()==Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING ) then TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = -TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = -TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = 1 else if ( Get_TdsConnectionModes()==TDS_CONNECTION_SPINE ) then TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 1000.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 1000.d0 ![ft.lbf] TDS_OldPowerMode = -1 end if end if - else if ( TopDriveDrillTorqueState==-1 ) then ! TdsMu_DRILL + else if ( TopDrivePanel%TopDriveDrillTorqueState==-1 ) then ! TdsMu_DRILL if ( Get_TdsConnectionModes()==TDS_CONNECTION_STRING ) then - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = (30.d0*TDS%w_new/pi)/TDS%Conv_Ratio !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = -TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = -TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = INT(TDS%Speed) !Call SetSound( TDS%SoundRPM ) TDS%Torque = ( ((TDS%J_coef+TDS%String_JCoef)*(((TDS%w_new/TDS%Conv_Ratio)-TDS_wOld)/TDS%time_step))+(TDS%String_Torque) )*0.73756215 ![N.m]*0.73756215 = [ft.lbf] - TopDriveTorqueGauge= TDS%Torque + TopDrivePanel%TopDriveTorqueGauge= TDS%Torque TDS_OldPowerMode = 1 else if ( Get_TdsConnectionModes()==Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING ) then - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = 0.0d0 - TopDriveRpmGauge = ((30.d0*TDS%w_new/pi)/TDS%Conv_Ratio) !Speed [RPM] - TD_RPMUnityOutput = -TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = ((30.d0*TDS%w_new/pi)/TDS%Conv_Ratio) !Speed [RPM] + TD_RPMUnityOutput = -TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = INT((30.d0*TDS%w_new/pi)/TDS%Conv_Ratio) !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.0d0 - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = 1 else if ( Get_TdsConnectionModes()==TDS_CONNECTION_SPINE ) then - if ( RpmKnob>0. ) then - TopDriveOperationFaultLed = 1 + if ( TopDrivePanel%RpmKnob>0. ) then + TopDrivePanel%TopDriveOperationFaultLed = 1 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = -TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = -TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = 1 else - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = -TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = -TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = 1 end if end if else - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS%Speed = 0.d0 !Speed [RPM] - TopDriveRpmGauge = TDS%Speed - TD_RPMUnityOutput = -TopDriveRpmGauge + TopDrivePanel%TopDriveRpmGauge = TDS%Speed + TD_RPMUnityOutput = -TopDrivePanel%TopDriveRpmGauge TDS%SoundRPM = 0 !Call SetSound( TDS%SoundRPM ) TDS%Torque = 0.d0 ![ft.lbf] - TopDriveTorqueGauge = 0.d0 ![ft.lbf] + TopDrivePanel%TopDriveTorqueGauge = 0.d0 ![ft.lbf] TDS_OldPowerMode = 1 end if diff --git a/Equipments/TopDrive/TopDrive_StartUp.f90 b/Equipments/TopDrive/TopDrive_StartUp.f90 index 0a2b45a..8332e0c 100644 --- a/Equipments/TopDrive/TopDrive_StartUp.f90 +++ b/Equipments/TopDrive/TopDrive_StartUp.f90 @@ -6,7 +6,7 @@ subroutine TopDrive_StartUp IMPLICIT NONE - TopDriveOperationFaultLed = 0 + TopDrivePanel%TopDriveOperationFaultLed = 0 TDS_OldPowerMode = 0 diff --git a/Equipments/TopDrive/TopDrive_Traction_Motor.f90 b/Equipments/TopDrive/TopDrive_Traction_Motor.f90 index df23c94..7245e5d 100644 --- a/Equipments/TopDrive/TopDrive_Traction_Motor.f90 +++ b/Equipments/TopDrive/TopDrive_Traction_Motor.f90 @@ -35,7 +35,7 @@ subroutine TopDrive_Traction_Motor TDS%n = TDS%time/TDS%dt TDS%w_ref = (pi*(TDS%N_ref)/30.) - TDS%ia_ref_limit = TopDriveTorqueLimitKnob/60.d0 + TDS%ia_ref_limit = TopDrivePanel%TopDriveTorqueLimitKnob/60.d0 TDS%ia_er = 1. TDS%w_er = 1. diff --git a/Equipments/equipments_PowerLimit.f90 b/Equipments/equipments_PowerLimit.f90 index d1c3db9..a92bb9a 100644 --- a/Equipments/equipments_PowerLimit.f90 +++ b/Equipments/equipments_PowerLimit.f90 @@ -15,7 +15,7 @@ MODULE equipments_PowerLimit ! subroutine PowerLimits ! !subroutine PowerLimits(Power_sigma) ! - ! USE Pump_VARIABLES + ! USE Pumps_VARIABLES ! USE Drawworks_VARIABLES ! USE RTable_VARIABLES ! USE CPowerVariables diff --git a/FluidFlow/Annulus_and_Openhole_Pressure_Distribution.f90 b/FluidFlow/Annulus_and_Openhole_Pressure_Distribution.f90 index be2d8f1..ed6cb57 100644 --- a/FluidFlow/Annulus_and_Openhole_Pressure_Distribution.f90 +++ b/FluidFlow/Annulus_and_Openhole_Pressure_Distribution.f90 @@ -77,17 +77,17 @@ IF (WellHeadOpen .OR. NoGasPocket == 0) THEN !! (mud circulation is normal we WRITE (*,*) ' PressureGauges(2) , Kchoke' , PressureGauges(2) , Kchoke WRITE (*,*) 'Initial guess after opening choke =', GasPocketFlowInduced%Array(1) - WRITE (*,*) ' valve 49 ', Valve(49)%Status - WRITE (*,*) ' valve 47 ', Valve(47)%Status - WRITE (*,*) ' valve 26 ', Valve(26)%Status - WRITE (*,*) ' valve 30 ', Valve(30)%Status - WRITE (*,*) ' valve 34 ', Valve(34)%Status - WRITE (*,*) ' valve 63 ', Valve(63)%Status - WRITE (*,*) ' valve 28 ', Valve(28)%Status - WRITE (*,*) ' valve 33 ', Valve(33)%Status - WRITE (*,*) ' valve 62 ', Valve(62)%Status - WRITE (*,*) ' valve 36 ', Valve(36)%Status - WRITE (*,*) ' valve 38 ', Valve(38)%Status + WRITE (*,*) ' valve 49 ', Manifold%Valve(49)%Status + WRITE (*,*) ' valve 47 ', Manifold%Valve(47)%Status + WRITE (*,*) ' valve 26 ', Manifold%Valve(26)%Status + WRITE (*,*) ' valve 30 ', Manifold%Valve(30)%Status + WRITE (*,*) ' valve 34 ', Manifold%Valve(34)%Status + WRITE (*,*) ' valve 63 ', Manifold%Valve(63)%Status + WRITE (*,*) ' valve 28 ', Manifold%Valve(28)%Status + WRITE (*,*) ' valve 33 ', Manifold%Valve(33)%Status + WRITE (*,*) ' valve 62 ', Manifold%Valve(62)%Status + WRITE (*,*) ' valve 36 ', Manifold%Valve(36)%Status + WRITE (*,*) ' valve 38 ', Manifold%Valve(38)%Status ELSE ! flow through bell nipple k = NoHorizontalEl + NoStringEl + NoAnnulusEl diff --git a/FluidFlow/Flow_Startup.f90 b/FluidFlow/Flow_Startup.f90 index a514684..ad12fe2 100644 --- a/FluidFlow/Flow_Startup.f90 +++ b/FluidFlow/Flow_Startup.f90 @@ -21,7 +21,7 @@ SUBROUTINE FlowStartup PressureGauges(:) = 0.0 - KickSinglePocket = MakeKickSinglePacket + KickSinglePocket = Reservoir%MakeKickSinglePacket IF (KickSinglePocket) THEN MaxGasPocket = 1 ELSE @@ -30,7 +30,7 @@ SUBROUTINE FlowStartup MaxChokeDensityChange = 25.0 ! [ppg/min] ChokeMinDensity = 2.0 - ChokeDensity = ActiveDensity + ChokeDensity = MudProperties%ActiveDensity MinKickVol = 0.5 ! USGal @@ -54,7 +54,7 @@ SUBROUTINE FlowStartup FloatValveOpen = .TRUE. ChokeAreaFullyOpen = 123.0 / 64.0 ! fully open area is 123/64 in^2 = 0.01334635 ft^2 - ChokeBypassArea = PI / 4.0 * ChokeLineID**2 + ChokeBypassArea = PI / 4.0 * BopStackSpecification%ChokeLineId**2 BHPSafetyMargin = 150.0 AChBHPTol = 15.0 @@ -68,9 +68,9 @@ SUBROUTINE FlowStartup CasingPressure_DataDisplayMalF = 0 SoundSpeed = 1530.0 / Convfttom - PressureTimeStepDelay(1) = INT(2.0 * SUM(StringConfigurations(2:)%ComponentLength) / SoundSpeed / dt) - PressureTimeStepDelay(2) = INT(PathGenerations(SIZE(PathGenerations))%MeasuredDepth / SoundSpeed / dt) - PressureTimeStepDelay(3) = INT(ShoeDepth / SoundSpeed / dt) + PressureTimeStepDelay(1) = INT(2.0 * SUM(StringConfiguration%StringConfigurations(2:)%ComponentLength) / SoundSpeed / dt) + PressureTimeStepDelay(2) = INT(PathGeneration%Items(SIZE(PathGeneration%Items))%MeasuredDepth / SoundSpeed / dt) + PressureTimeStepDelay(3) = INT(Shoe%ShoeDepth / SoundSpeed / dt) !WRITE (*,*) SUM(StringConfigurations(2:)%ComponentLength), PathGenerations(SIZE(PathGenerations))%TotalVerticalDepth!, WellSurveyData(SIZE(WellSurveyData))%TotalVerticalDepth !WRITE (*,*) PathGenerations(SIZE(PathGenerations))%MeasuredDepth!, WellSurveyData(SIZE(WellSurveyData))%MeasuredDepth @@ -81,11 +81,11 @@ SUBROUTINE FlowStartup END DO DO i = 1 , PressureTimeStepDelay(2) - CALL BottomHolePressureDelay%AddToFirst(REAL(0.052 * ActiveDensity * PathGenerations(SIZE(PathGenerations))%TotalVerticalDepth)) + CALL BottomHolePressureDelay%AddToFirst(REAL(0.052 * MudProperties%ActiveDensity * PathGeneration%Items(SIZE(PathGeneration%Items))%TotalVerticalDepth)) END DO DO i = 1 , PressureTimeStepDelay(3) - CALL ShoePressureDelay%AddToFirst(REAL(0.052 * ActiveDensity * ShoeDepth)) + CALL ShoePressureDelay%AddToFirst(REAL(0.052 * MudProperties%ActiveDensity * Shoe%ShoeDepth)) END DO @@ -111,8 +111,8 @@ SUBROUTINE FlowStartup GasType(3)%GasConstant = RUniversal / GasType(2)%MolarWt !!!!!!!! Mud density and viscosity - Theta600Refrence = ActiveThetaSixHundred - Theta300Refrence = ActiveThetaThreeHundred - DensityRefrence = ActiveDensity + Theta600Refrence = MudProperties%ActiveThetaSixHundred + Theta300Refrence = MudProperties%ActiveThetaThreeHundred + DensityRefrence = MudProperties%ActiveDensity END SUBROUTINE \ No newline at end of file diff --git a/FluidFlow/Flow_Startup_VARIABLES.f90 b/FluidFlow/Flow_Startup_VARIABLES.f90 index 79b8b63..f47a842 100644 --- a/FluidFlow/Flow_Startup_VARIABLES.f90 +++ b/FluidFlow/Flow_Startup_VARIABLES.f90 @@ -35,6 +35,7 @@ MODULE Fluid_Flow_Startup_Vars !!!!!!!!!!!!!!!!! !!!!!!! Bit data !!!!!! + ! Type :: BitDataType LOGICAL :: BitTrue ! bit may be present (.TRUE.) or may be absent(.FALSE.) REAL :: BitNozzleArea ! area of a nozzle INTEGER :: BitNozzleNum ! Number of bit nozzles @@ -46,7 +47,8 @@ MODULE Fluid_Flow_Startup_Vars REAL :: Theta600Refrence , Theta300Refrence ! Fann data (Theta600 and Theta300) of active tank (input from panel) REAL :: DensityRefrence ! Density of active tank mud (input from panel) [gpm] - + ! End Type BitDataType + ! Type(BitDataType)::BitData TYPE, PUBLIC :: GasData REAL :: CritPress ! critical pressure [psia] diff --git a/FluidFlow/Frictional_Press_Drop_Calc.f90 b/FluidFlow/Frictional_Press_Drop_Calc.f90 index 228b18a..87586e4 100644 --- a/FluidFlow/Frictional_Press_Drop_Calc.f90 +++ b/FluidFlow/Frictional_Press_Drop_Calc.f90 @@ -45,9 +45,9 @@ SUBROUTINE FricPressDrop(iloc) FlowEl(iloc)%YieldP = 2.0 * FlowEl(iloc)%Theta300 - FlowEl(iloc)%Theta600 ! lbf/100ft**2 FlowEl(iloc)%nIndex = 3.32 * log10(FlowEl(iloc)%Theta600 / FlowEl(iloc)%Theta300) FlowEl(iloc)%kIndex = 510.0 * FlowEl(iloc)%Theta300 / (511.0**FlowEl(iloc)%nIndex) ! rabete fv2 - IF (ActiveRheologyModel == Herschel_Bulkley_RheologyModel .AND. FlowEl(iloc)%alpha == 0) THEN + IF (MudProperties%ActiveRheologyModel == Herschel_Bulkley_RheologyModel .AND. FlowEl(iloc)%alpha == 0) THEN FlowEl(iloc)%kIndex = 1.066 * FlowEl(iloc)%Theta300 / (511.0**FlowEl(iloc)%nIndex) - ELSE IF (ActiveRheologyModel == Herschel_Bulkley_RheologyModel .AND. FlowEl(iloc)%alpha == 1) THEN + ELSE IF (MudProperties%ActiveRheologyModel == Herschel_Bulkley_RheologyModel .AND. FlowEl(iloc)%alpha == 1) THEN FlowEl(iloc)%nIndex = 3.32 * log10((FlowEl(iloc)%Theta600 - TauZero) / (FlowEl(iloc)%Theta300 - TauZero)) FlowEl(iloc)%kIndex = 1.066 * (FlowEl(iloc)%Theta300 - TauZero) / (511.0**FlowEl(iloc)%nIndex) END IF @@ -75,10 +75,10 @@ SUBROUTINE FricPressDrop(iloc) !END IF ! Calculating effective or apparent viscosity - IF (ActiveRheologyModel == Bingham_RheologyModel) THEN ! Bingham Plastic + IF (MudProperties%ActiveRheologyModel == Bingham_RheologyModel) THEN ! Bingham Plastic FlowEl(iloc)%mueff = FlowEl(iloc)%muPlastic + 5. * FlowEl(iloc)%YieldP * FlowEl(iloc)%Dhyd / FlowEl(iloc)%vel !write(*,*) 'pointer1' , FlowEl(iloc)%muPlastic , FlowEl(iloc)%YieldP , FlowEl(iloc)%Dhyd , FlowEl(iloc)%vel - ELSE IF (ActiveRheologyModel == PowerLaw_RheologyModel .OR. ActiveRheologyModel == Herschel_Bulkley_RheologyModel) THEN ! Power Law + ELSE IF (MudProperties%ActiveRheologyModel == PowerLaw_RheologyModel .OR. MudProperties%ActiveRheologyModel == Herschel_Bulkley_RheologyModel) THEN ! Power Law FlowEl(iloc)%Gf = ((3. - FlowEl(iloc)%alpha) * FlowEl(iloc)%nIndex + 1.0) / FlowEl(iloc)%nIndex / (4.0 - FlowEl(iloc)%alpha) * (2.0 + FlowEl(iloc)%alpha) / 2.0 FlowEl(iloc)%mueff = (FlowEl(iloc)%kIndex) / (1. + FlowEl(iloc)%alpha / 2.) * ((96. * FlowEl(iloc)%vel / FlowEl(iloc)%Dhyd)**(FlowEl(iloc)%nIndex - 1)) * FlowEl(iloc)%Gf**FlowEl(iloc)%nIndex !write(*,*) 'pointer2' , FlowEl(iloc)%kIndex ,FlowEl(iloc)%alpha , FlowEl(iloc)%vel ,FlowEl(iloc)%Dhyd,FlowEl(iloc)%nIndex ,FlowEl(iloc)%Gf ,FlowEl(iloc)%nIndex @@ -99,7 +99,7 @@ SUBROUTINE FricPressDrop(iloc) !FlowEl(iloc)%GenRe = 2997 * FlowEl(iloc)%density * FlowEl(iloc)%vel**2 / 19.36 / FlowEl(iloc)%tauW ! Calculating friction factor - IF (ActiveRheologyModel == Bingham_RheologyModel) THEN ! Bingham Plastic + IF (MudProperties%ActiveRheologyModel == Bingham_RheologyModel) THEN ! Bingham Plastic IF (FlowEl(iloc)%GenRe <= 2000.0) THEN ! laminar regime FlowEl(iloc)%f = 16.0 / FlowEl(iloc)%GenRe ELSE IF (FlowEl(iloc)%GenRe >= 4000.0) THEN ! turbulent regime @@ -113,7 +113,7 @@ SUBROUTINE FricPressDrop(iloc) + (FlowEl(iloc)%GenRe - 2000.0) / 2000.0 * FlowEl(iloc)%a / FlowEl(iloc)%GenRe**FlowEl(iloc)%b END IF - ELSE IF (ActiveRheologyModel == PowerLaw_RheologyModel) THEN ! Power law + ELSE IF (MudProperties%ActiveRheologyModel == PowerLaw_RheologyModel) THEN ! Power law FlowEl(iloc)%ReCritLam = 3470. - 1370. * FlowEl(iloc)%nIndex FlowEl(iloc)%ReCritTurb = 4270. - 1370. * FlowEl(iloc)%nIndex @@ -186,7 +186,7 @@ SUBROUTINE PartialDerivativeFricToFlowRate(iloc) .AND. (ABS(FlowEl(iloc)%Length) >= PressLengthTolerance) & .AND. (FlowEl(iloc)%MaterialType /= 4)) THEN ! not air - IF (ActiveRheologyModel == PowerLaw_RheologyModel) THEN ! Power law + IF (MudProperties%ActiveRheologyModel == PowerLaw_RheologyModel) THEN ! Power law !IF (FlowEl(iloc)%Flowrate == 0.0) THEN ! FlowEl(iloc)%Flowrate = 10.0 ! CALL FricPressDrop(iloc) @@ -204,7 +204,7 @@ SUBROUTINE PartialDerivativeFricToFlowRate(iloc) * ((FlowEl(iloc)%a * FlowEl(iloc)%GenRe**(1. - FlowEl(iloc)%b) - 16.) / 800. / FlowEl(iloc)%f - 1.)) END IF - ELSE IF (ActiveRheologyModel == Bingham_RheologyModel) THEN ! Bingham Plastic + ELSE IF (MudProperties%ActiveRheologyModel == Bingham_RheologyModel) THEN ! Bingham Plastic IF (FlowEl(iloc)%GenRe <= 2000.0 .OR. FlowEl(iloc)%f == 0.0) THEN ! laminar flow if f = 0.0, we have no flow in first time flowing FlowEl(iloc)%FricToQPartialDiff = (16. * FlowEl(iloc)%muPlastic * REAL(FlowEl(iloc)%Length) * 2.224 * (10.)**(-3)) & / (25.81 * 928. * (1 - 0.184 * FlowEl(iloc)%alpha) * FlowEl(iloc)%Dhyd**2 * FlowEl(iloc)%Area) diff --git a/FluidFlow/Horizontal_and_String_Pressure_Distribution.f90 b/FluidFlow/Horizontal_and_String_Pressure_Distribution.f90 index 5853c96..8d80e2d 100644 --- a/FluidFlow/Horizontal_and_String_Pressure_Distribution.f90 +++ b/FluidFlow/Horizontal_and_String_Pressure_Distribution.f90 @@ -14,8 +14,8 @@ SUBROUTINE PressureHorizAndStringDistribution USE Fluid_Flow_Startup_Vars USE KickVariables USE CMudPropertiesVariables - USE CDataDisplayConsoleVariables , StandPipePressureDataDisplay=> StandPipePressure - USE CDataDisplayConsoleVariables , CasingPressureDataDisplay=> CasingPressure + USE CDataDisplayConsoleVariables !, StandPipePressureDataDisplay=> ChokeControlPanel%StandPipePressure + USE CDataDisplayConsoleVariables !, CasingPressureDataDisplay=> CasingPressure USE CDrillWatchVariables USE CShoeVariables USE CDownHoleVariables , CasingPressureDownhole => CasingPressure @@ -25,7 +25,7 @@ SUBROUTINE PressureHorizAndStringDistribution USE CError USE UTUBEVARS USE CKellyConnectionEnumVariables - USE Pump_VARIABLES + USE Pumps_VARIABLES USE , INTRINSIC :: IEEE_ARITHMETIC Use TD_DrillStemComponents Use sROP_Variables @@ -500,12 +500,12 @@ SUBROUTINE PressureHorizAndStringDistribution !IF (ShoeDepth <= FlowEl(NoHorizontalEl + NoStringEl + 1)%StartX) THEN DO ShoeFlowElNo = AnnulusFirstEl , NumbEl - IF (FlowEl(ShoeFlowElNo)%StartX >= ShoeDepth .AND. FlowEl(ShoeFlowElNo)%EndX < ShoeDepth) EXIT + IF (FlowEl(ShoeFlowElNo)%StartX >= Shoe%ShoeDepth .AND. FlowEl(ShoeFlowElNo)%EndX < Shoe%ShoeDepth) EXIT END DO - CALL TVD_Calculator(ShoeDepth , ShoeTVD) + CALL TVD_Calculator(Shoe%ShoeDepth , ShoeTVD) IF (ShoeFlowElNo > NumbEl) THEN - WRITE (*,*) 'ShoeDepth =', ShoeDepth + WRITE (*,*) 'ShoeDepth =', Shoe%ShoeDepth DO i = AnnulusFirstEl , NumbEl WRITE (*,*) 'i, StartX, EndX', i, FlowEl(i)%StartX, FlowEl(i)%EndX END DO @@ -518,7 +518,7 @@ SUBROUTINE PressureHorizAndStringDistribution !END IF CALL ShoePressureDelay%AddToFirst(REAL(FlowEl(ShoeFlowElNo)%StartPress & - - (FlowEl(ShoeFlowElNo)%StartX - ShoeDepth) * FlowEl(ShoeFlowElNo)%dPdLfric & + - (FlowEl(ShoeFlowElNo)%StartX - Shoe%ShoeDepth) * FlowEl(ShoeFlowElNo)%dPdLfric & - (FlowEl(ShoeFlowElNo)%StartTVD - ShoeTVD) * FlowEl(ShoeFlowElNo)%dPdLGrav)) CALL ShoePressureDelay%Remove(PressureTimeStepDelay(3) + 1) @@ -606,7 +606,7 @@ SUBROUTINE PressureHorizAndStringDistribution !WRITE (*,*) 'Horiz 1' - KickInFluxConditions = (FormationTop < TD_WellTotalVerticalLength) .AND. (NOT(InactiveInflux)) .AND. (FormPressure > BottomHolePress + 5.0) + KickInFluxConditions = (Reservoir%FormationTop < TD_WellTotalVerticalLength) .AND. (NOT(Reservoir%InactiveInflux)) .AND. (FormPressure > BottomHolePress + 5.0) IF (KickInFluxConditions) THEN KickFlux = .TRUE. diff --git a/FluidFlow/Well_Pressure_Data_Transfer.f90 b/FluidFlow/Well_Pressure_Data_Transfer.f90 index d091c1c..9e4ae6f 100644 --- a/FluidFlow/Well_Pressure_Data_Transfer.f90 +++ b/FluidFlow/Well_Pressure_Data_Transfer.f90 @@ -29,8 +29,7 @@ SUBROUTINE WellPressureDataTransfer USE CChokeProblemsVariables USE CStringConfigurationVariables USE CDrillWatchVariables - USE CDataDisplayConsoleVariables , MudWeightOutDataDisplay => MudWeightOut - + USE CDataDisplayConsoleVariables IMPLICIT NONE @@ -44,11 +43,11 @@ SUBROUTINE WellPressureDataTransfer !!!!!!!!!!!!!!!! bit is present - BitTrue = StringConfigurations(1)%ComponentType == Bit_ComponentType ! Bit_ComponentType = 0 + BitTrue = StringConfiguration%StringConfigurations(1)%ComponentType == Bit_ComponentType ! Bit_ComponentType = 0 BitCd = 0.98 - BitNozzDia = 32.0 * BitDefinition%BitNozzleSize ! nozzle diameter in 1/32 in + BitNozzDia = 32.0 * StringConfiguration%BitDefinition%BitNozzleSize ! nozzle diameter in 1/32 in BitNozzleArea = 7.6699E-4 * BitNozzDia**2 - BitNozzleNum = BitDefinition%BitNozzleNo - BitJetsPlugged * PlugJetsCount + BitNozzleNum = StringConfiguration%BitDefinition%BitNozzleNo - BitJetsPlugged * PlugJetsCount BitTotNozzArea = BitNozzleNum * BitNozzleArea + 0.5 * BitJetsWashedOut * JetWashoutCount * BitNozzleArea IF (BitNozzleNum == 0) THEN BitTotallyPluged = .TRUE. @@ -56,7 +55,7 @@ SUBROUTINE WellPressureDataTransfer BitTotallyPluged = .FALSE. END IF - FloatValveIn = BitDefinition%FloatValve + FloatValveIn = StringConfiguration%BitDefinition%FloatValve !FloatValveOpen = .TRUE. !IF (JetWashoutCount > 0 .OR. PlugJetsCount > 0) THEN ! WRITE (*,*) 'PlugJetsCount' , PlugJetsCount @@ -236,7 +235,7 @@ SUBROUTINE WellPressureDataTransfer FlowEl(i)%StartTVD = 0.d0 FlowEl(i)%EndTVD = 0.d0 FlowEl(i)%Id = 0.0 - FlowEl(i)%Od = ChokeLineID + FlowEl(i)%Od = BopStackSpecification%ChokeLineId FlowEl(i)%density = ChokeLine_Density%Array(j) FlowEl(i)%Dhyd = FlowEl(i)%Od @@ -342,10 +341,10 @@ SUBROUTINE WellPressureDataTransfer !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - OpenArea32 = ((LeftManualChoke * (1.0 - ManChoke1Plug * REAL(ManualChoke1PluggedPercent)) / 100.0) + 0.5 * ManChoke1Washout) * ChokeAreaFullyOpen + OpenArea32 = ((ChokeManifold%LeftManualChoke * (1.0 - ManChoke1Plug * REAL(ManualChoke1PluggedPercent)) / 100.0) + 0.5 * ManChoke1Washout) * ChokeAreaFullyOpen OpenArea33 = CHOOKE(1)%AreaChokeFinal * Convfttoinch**2 ! (1.d0 - CHOOKE(1)%PercentClose) * ChokeAreaFullyOpen OpenArea34 = CHOOKE(2)%AreaChokeFinal * Convfttoinch**2 ! (1.d0 - CHOOKE(2)%PercentClose) * ChokeAreaFullyOpen - OpenArea35 = ((RightManualChoke * (1.0 - ManChoke2Plug * REAL(ManualChoke2PluggedPercent)) / 100.0) + 0.5 * ManChoke2Washout) * ChokeAreaFullyOpen + OpenArea35 = ((ChokeManifold%RightManualChoke * (1.0 - ManChoke2Plug * REAL(ManualChoke2PluggedPercent)) / 100.0) + 0.5 * ManChoke2Washout) * ChokeAreaFullyOpen !write(*,*) 'OpenArea32=' , OpenArea32, active32, ManChoke1Plug, ManualChoke1PluggedPercent, ManChoke1Washout !write(*,*) 'OpenArea33=' , OpenArea33, active33 !write(*,*) 'OpenArea34=' , OpenArea34, active34, !HydraulicChoke2PluggedPercent diff --git a/FluidFlow/kick/Formation_Information.f90 b/FluidFlow/kick/Formation_Information.f90 index d9fa05b..81f3bb7 100644 --- a/FluidFlow/kick/Formation_Information.f90 +++ b/FluidFlow/kick/Formation_Information.f90 @@ -26,21 +26,21 @@ SUBROUTINE FormationInformationCalculator KickFormDownMD = 0. !===> Top Measured Depth of Formation Do i = 1 , TD_WellIntervalsCount - if ( FormationTop >= TD_WellGeo(i)%VerticalDepth ) then + if ( Reservoir%FormationTop >= TD_WellGeo(i)%VerticalDepth ) then KickFormTopMD = KickFormTopMD + TD_WellGeo(i)%IntervalLength !WRITE (*,*) ' here 11' , TD_WellGeo(i)%IntervalLength !WRITE (*,*) ' here v11' , TD_WellGeo(i)%VerticalDepth WellGeoTopTVD = TD_WellGeo(i)%VerticalDepth - else if ( FormationTop < TD_WellGeo(i)%VerticalDepth ) then + else if ( Reservoir%FormationTop < TD_WellGeo(i)%VerticalDepth ) then if ( TD_WellGeo(i)%HoleType == 0 ) then - KickFormTopMD = KickFormTopMD + ((FormationTop - WellGeoTopTVD)& + KickFormTopMD = KickFormTopMD + ((Reservoir%FormationTop - WellGeoTopTVD)& / cos(TD_WellGeo(i)%StartAngle)) !WRITE (*,*) ' here 12' , (FormationTop - WellGeoTopTVD) / cos(TD_WellGeo(i)%StartAngle) else KickFormTopMD = KickFormTopMD + (TD_WellGeo(i)%RCurvature & - * Asin((FormationTop - WellGeoTopTVD) / TD_WellGeo(i)%RCurvature)) + * Asin((Reservoir%FormationTop - WellGeoTopTVD) / TD_WellGeo(i)%RCurvature)) !WRITE (*,*) ' here 13' , TD_WellGeo(i)%RCurvature * Asin((FormationTop - WellGeoTopTVD) / TD_WellGeo(i)%RCurvature) end if @@ -51,25 +51,25 @@ SUBROUTINE FormationInformationCalculator !!===> Down Measured Depth of Formation WellGeoTopTVD = 0. Do i = 1 , TD_WellIntervalsCount - if ( (FormationTop + Formations(FormationNo)%Thickness)>=TD_WellGeo(i)%VerticalDepth ) then + if ( (Reservoir%FormationTop + Formation%Formations(Reservoir%FormationNo)%Thickness)>=TD_WellGeo(i)%VerticalDepth ) then KickFormDownMD = KickFormDownMD + TD_WellGeo(i)%IntervalLength WellGeoTopTVD = TD_WellGeo(i)%VerticalDepth - else if ( (FormationTop+Formations(FormationNo)%Thickness) Determination of Formation Length for Kick Modeling - if (TD_WellTotalVerticalLength >= FormationTop .AND. TD_WellTotalVerticalLength < (FormationTop+Formations(FormationNo)%Thickness)) then + if (TD_WellTotalVerticalLength >= Reservoir%FormationTop .AND. TD_WellTotalVerticalLength < (Reservoir%FormationTop+Formation%Formations(Reservoir%FormationNo)%Thickness)) then KickFormLength = TD_WellTotalLength - KickFormTopMD ![ft] - else if ( TD_WellTotalVerticalLength >= (FormationTop + Formations(FormationNo)%Thickness) ) then + else if ( TD_WellTotalVerticalLength >= (Reservoir%FormationTop + Formation%Formations(Reservoir%FormationNo)%Thickness) ) then KickFormLength = KickFormDownMD - KickFormTopMD ![ft] else KickFormLength = 0. @@ -80,9 +80,9 @@ SUBROUTINE FormationInformationCalculator !==================================================== ! Reservoir Data !==================================================== - FormPermeability = FormationPermeability ! [mD] + FormPermeability = Reservoir%FormationPermeability ! [mD] - FormPressure = TD_WellTotalVerticalLength * Formations(FormationNo)%PorePressureGradient ![psia] + FormPressure = TD_WellTotalVerticalLength * Formation%Formations(Reservoir%FormationNo)%PorePressureGradient ![psia] FormationPressure = INT(FormPressure) !CALL Log_2('FormPressure =' , FormPressure) !print*, 'Formations(FormationNo)%PorePressureGradient=', Formations(FormationNo)%PorePressureGradient diff --git a/FluidFlow/utubevars.mod b/FluidFlow/utubevars.mod deleted file mode 100644 index 389ee956287a5e99a8d3286785af86b1aad6b3df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmV-E0m1$siwFP!000001I^M+Z-Ouw2k?78#d9kjT{nXE?htK4GMdnsEompi6Z4W;DL@|D_AU90z1L?u$@Mp z;2&%&i)a;CPDI%$NcSp>Ww~L-1&bD$N|Qy#PvuHh6iTr5JT0V1H>z5*UKze+yx3;& zw0kB<(|Yh96E#H-mE{lD5b)vRiSrx-R#I))F&0HxV;F#@H8NPzH|oCAzC}ZmhS%u% z?hIW5SdM2~Gb`)|#>xZ&qa1g>{3EHkUom$N>e1xiNma|Y8=k MaximumWellDepthExceeded Warning - if ( Drilling_verticalDepth>=(Formations(FormationCount)%Top+Formations(FormationCount)%Thickness) ) then + if ( Drilling_verticalDepth>=(Formation%Formations(FormationCount)%Top+Formation%Formations(FormationCount)%Thickness) ) then Rate_of_Penetration = 0.0d0 Call Set_ROP(Rate_of_Penetration) Call Activate_MaximumWellDepthExceeded() @@ -44,11 +44,11 @@ subroutine ROP_MainCalculation - if ( FormationNumber/=0 .and. HideDrillingBrake==1 ) then ! Hide Drilling Brake Mode + if ( FormationNumber/=0 .and. DrillingConsole%HideDrillingBrake==1 ) then ! Hide Drilling Brake Mode FormationNumber = FormationNumber else do i= 1,No_of_Formations - FormationTopDepth = Formations(i)%Top + FormationTopDepth = Formation%Formations(i)%Top if (Drilling_verticalDepth>=FormationTopDepth) then FormationNumber = i end if @@ -74,14 +74,14 @@ subroutine ROP_MainCalculation ! $$$$$**$$$$$**$$$$$**$$$$$**$$$$$** Variables Initialization: *$$$$$**$$$$$**$$$$$**$$$$$**$$$$$ - Diameter_of_Bit = BitDefinition%BitSize ! unit : [in.] (Typical Range: 3.0 to 30.0) - Number_of_Bit_Nozzles = BitDefinition%BitNozzleNo ! (Typical Values: 1 to 10) - Diameter_of_Bit_Nozzle = BitDefinition%BitNozzleSize ! unit : [inch] *** basic input: [1/32 in.] (Typical Range: 8.0 to 32.0) - Critical_Mud_Density = Formations(FormationNumber)%PorePressureGradient/.465d0*9.d0 ! ????????? delete ,unit : [ppg] or [lb/gal] (Typical Range: 0 to 10.0) - FormationMud_Density = Formations(FormationNumber)%PorePressureGradient/0.052d0 + Diameter_of_Bit = StringConfiguration%BitDefinition%BitSize ! unit : [in.] (Typical Range: 3.0 to 30.0) + Number_of_Bit_Nozzles = StringConfiguration%BitDefinition%BitNozzleNo ! (Typical Values: 1 to 10) + Diameter_of_Bit_Nozzle = StringConfiguration%BitDefinition%BitNozzleSize ! unit : [inch] *** basic input: [1/32 in.] (Typical Range: 8.0 to 32.0) + Critical_Mud_Density = Formation%Formations(FormationNumber)%PorePressureGradient/.465d0*9.d0 ! ????????? delete ,unit : [ppg] or [lb/gal] (Typical Range: 0 to 10.0) + FormationMud_Density = Formation%Formations(FormationNumber)%PorePressureGradient/0.052d0 BottomHole_Pressure = PressureGauges(3) !5200 [psi] ECD = BottomHole_Pressure/(0.052*Drilling_verticalDepth) - Critical_Weight_on_Bit = (Formations(FormationNumber)%ThresholdWeight/5.d0)-(.06d0*(Formations(FormationNumber)%ThresholdWeight-10.d0)) ! unit : [klb/in] (Typical Range: 0 to 10 ----> 0.6 to 2) + Critical_Weight_on_Bit = (Formation%Formations(FormationNumber)%ThresholdWeight/5.d0)-(.06d0*(Formation%Formations(FormationNumber)%ThresholdWeight-10.d0)) ! unit : [klb/in] (Typical Range: 0 to 10 ----> 0.6 to 2) !IF (ALLOCATED(FlowEl)) THEN ! Mud_Viscosity = FlowEl(NoHorizontalEl + NoStringEl)%mueff !13.5 [cP] Mud_Density = BitMudDensity ! [ppg] @@ -98,7 +98,7 @@ subroutine ROP_MainCalculation ! -----**-----**-----**-----**-----* Rate_of_Penetration Model Coefficients: *-----**-----**-----**-----**----- - a1 = log(Formations(FormationNumber)%Drillablity) + a1 = log(Formation%Formations(FormationNumber)%Drillablity) a2 = 1.2799d-04 a3 = 1.7952d-04 a4 = 4.0656d-05 @@ -107,7 +107,7 @@ subroutine ROP_MainCalculation a7 = 2.1837d-01 a8 = 4.4915d-01 dt = 0.1d0 ![s] - Tou_H = Formations(FormationNumber)%Abrasiveness*3600.d0 ! [hr]--->[s] ( Typical Range: 1[s] ( Typical Range: 10.d0) then + if (Hoisting%DriveType==1 .and. RTable%Speed>0.d0) then Rotary_Speed = RTable%Speed ![rpm] - else if (DriveType==0 .and. (TDS%Speed>0. .or. RTable%Speed>0.)) then + else if (Hoisting%DriveType==0 .and. (TDS%Speed>0. .or. RTable%Speed>0.)) then Rotary_Speed = TDS%Speed+RTable%Speed ![rpm] else Rotary_Speed = 0.0d0 @@ -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==PathGenerations(PathGenerationCount)%MeasuredDepth) ) then + if ( (TD_WellTotalLength==PathGeneration%Items(PathGenerationCount)%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 82264fc..39ad91a 100644 --- a/Rop/sROP_Module.f90 +++ b/Rop/sROP_Module.f90 @@ -35,7 +35,7 @@ subroutine Calculate_ROP do i= 1,No_of_Formations !??????????????????????????????????????? - FormationTopDepth = Formations(i)%Top !??????????????????????????????????????? + FormationTopDepth = Formation%Formations(i)%Top !??????????????????????????????????????? if (Drilling_Depth>=FormationTopDepth) then !??????????????????????????????????????? FormationNumber = i !??????????????????????????????????????? end if !??????????????????????????????????????? @@ -51,13 +51,13 @@ subroutine Calculate_ROP ! $$$$$**$$$$$**$$$$$**$$$$$**$$$$$** Variables Initialization: *$$$$$**$$$$$**$$$$$**$$$$$**$$$$$ - Diameter_of_Bit = BitDefinition%BitSize ! unit : [in.] (Typical Range: 3.0 to 30.0) - Number_of_Bit_Nozzles = BitDefinition%BitNozzleNo ! (Typical Values: 1 to 10) - Diameter_of_Bit_Nozzle = BitDefinition%BitNozzleSize ! unit : [1/32 in.] (Typical Range: 8.0 to 32.0) - Critical_Mud_Density = Formations(FormationNumber)%PorePressureGradient/.465*9. ! unit : [ppg] or [lb/gal] (Typical Range: 0 to 10.0) - Critical_Weight_on_Bit = (Formations(FormationNumber)%ThresholdWeight/5.)-(.06*(Formations(FormationNumber)%ThresholdWeight-10.)) ! unit : [klb/in] (Typical Range: 0 to 10 ----> 0.6 to 2) - Mud_Viscosity = ActivePlasticViscosity !????????????????????????????????? - Mud_Density = ActiveDensity !????????????????????????????????? + Diameter_of_Bit = StringConfiguration%BitDefinition%BitSize ! unit : [in.] (Typical Range: 3.0 to 30.0) + Number_of_Bit_Nozzles = StringConfiguration%BitDefinition%BitNozzleNo ! (Typical Values: 1 to 10) + Diameter_of_Bit_Nozzle = StringConfiguration%BitDefinition%BitNozzleSize ! unit : [1/32 in.] (Typical Range: 8.0 to 32.0) + Critical_Mud_Density = Formation%Formations(FormationNumber)%PorePressureGradient/.465*9. ! unit : [ppg] or [lb/gal] (Typical Range: 0 to 10.0) + Critical_Weight_on_Bit = (Formation%Formations(FormationNumber)%ThresholdWeight/5.)-(.06*(Formation%Formations(FormationNumber)%ThresholdWeight-10.)) ! unit : [klb/in] (Typical Range: 0 to 10 ----> 0.6 to 2) + Mud_Viscosity = MudProperties%ActivePlasticViscosity !????????????????????????????????? + Mud_Density = MudProperties%ActiveDensity !????????????????????????????????? Mud_Flowrate = 10. ![ppg]??????????????????????????????????????????????? from fluid module Reynolds_Number = Mud_Flowrate*Mud_Density/(Mud_Viscosity*Number_of_Bit_Nozzles*Diameter_of_Bit_Nozzle) ! unit : [dimensionless] (Typical Range: 0.1 to 1000.0) ! $$$$$**$$$$$**$$$$$**$$$$$**$$$$ End of Variable Initialization $$$$$**$$$$$**$$$$$**$$$$$**$$$$$ @@ -90,7 +90,7 @@ subroutine Calculate_ROP x7 = -Bit_Wearing x8 = Reynolds_Number ! -----**-----**-----**-----**-----** Rate_of_Penetration Model Coefficients: *-----**-----**-----**-----**----- - a1 = log(Formations(FormationNumber)%Drillablity) !3.0643e+00 + a1 = log(Formation%Formations(FormationNumber)%Drillablity) !3.0643e+00 a2 = 1.2799e-04 a3 = 1.7952e-04 a4 = 4.0656e-05 @@ -99,7 +99,7 @@ subroutine Calculate_ROP a7 = 2.1837e-01 a8 = 4.4915e-01 dt = 0.1 ![s] - Tou_H = Formations(FormationNumber)%Abrasiveness ! hr + Tou_H = Formation%Formations(FormationNumber)%Abrasiveness ! hr ! -----**-----**-----**-----**--- End of Rate_of_Penetration Model Coefficients: ---**-----**-----**-----**----- !if ( Weight_on_Bit>0. .and. Rotary_Speed>0. .and. TD_DrillStems(1)%ComponentType==0 ) then !??????????????????????????????????????? diff --git a/SimulationCore2.f90 b/SimulationCore2.f90 index 485dbf9..84b5dfb 100644 --- a/SimulationCore2.f90 +++ b/SimulationCore2.f90 @@ -23,8 +23,8 @@ program SimulationCore2 ! Body of SimulationCore2 ! print *, 'Hello World' call read_variables() - + call simulate() ! Initialise the json_file object. - !pause + pause end program SimulationCore2 diff --git a/SimulationCore2.vfproj b/SimulationCore2.vfproj index 8037d5e..2dc139c 100644 --- a/SimulationCore2.vfproj +++ b/SimulationCore2.vfproj @@ -375,23 +375,13 @@ - - - - - - - - - - - - - - - - + + + + + + @@ -418,8 +408,7 @@ - - + @@ -508,6 +497,7 @@ + diff --git a/Simulator.f90 b/Simulator.f90 index 6b8ee92..5a235b9 100644 --- a/Simulator.f90 +++ b/Simulator.f90 @@ -50,7 +50,7 @@ contains !! Why we have a infinite loop (loop2) in step? Must be rewritten !! Tarmigh, now is rewritten call Pump1_Step() - call Pump2_Step() + !call Pump2_Step() !! Location ./Equipment/Rotarytable !! Variables: diff --git a/TorqueDrag/TD_DrillingSubs/MeshGeneration_FluidModule.f90 b/TorqueDrag/TD_DrillingSubs/MeshGeneration_FluidModule.f90 index 2669f0e..5864dbc 100644 --- a/TorqueDrag/TD_DrillingSubs/MeshGeneration_FluidModule.f90 +++ b/TorqueDrag/TD_DrillingSubs/MeshGeneration_FluidModule.f90 @@ -22,7 +22,7 @@ subroutine MeshGeneration_FluidModule A = 0.d0 - A(1) = AboveAnnularHeight ! WellHead[ft] + A(1) = BopStackSpecification%AboveAnnularHeight ! WellHead[ft] jj = 1 @@ -249,7 +249,7 @@ subroutine MeshGeneration_FluidModule F_Interval(ii)%EndDepth = F_String(StringConfigCount)%TopDepth F_Interval(ii)%StartDepth = F_String(StringConfigCount)%TopDepth-265.d0 F_Interval(ii)%ID = 0.0d0 - F_Interval(ii)%OD = dmax1(MudPump1Output,MudPump2Output) !??????????? + F_Interval(ii)%OD = dmax1(PumpsSpecification%MudPump1Output,PumpsSpecification%MudPump2Output) !??????????? F_Interval(ii)%HydDiameter = F_Interval(ii)%OD ![inch] F_Interval(ii)%Volume = ((pi*((F_Interval(ii)%OD/12.d0)**2))/4.d0) & *(F_Interval(ii)%EndDepth-F_Interval(ii)%StartDepth)*7.48051948d0 ![gal-us] @@ -392,7 +392,7 @@ subroutine MeshGeneration_FluidModule Allocate (Angle(jj)) TVD(1) = TD_WellTotalVerticalLength !????? !print*, 'TD_WellTotalVerticalLength=' ,TD_WellTotalVerticalLength - TVD(jj) = AboveAnnularHeight ! WellHead[ft] !0.d0 ???????????????? + TVD(jj) = BopStackSpecification%AboveAnnularHeight ! WellHead[ft] !0.d0 ???????????????? k = 1 mm = 0.d0 diff --git a/TorqueDrag/TD_DrillingSubs/TD_AddComponents.f90 b/TorqueDrag/TD_DrillingSubs/TD_AddComponents.f90 index 5246b34..251b58e 100644 --- a/TorqueDrag/TD_DrillingSubs/TD_AddComponents.f90 +++ b/TorqueDrag/TD_DrillingSubs/TD_AddComponents.f90 @@ -198,14 +198,14 @@ subroutine TD_AddComponents ! Add Safety Valve & Kelly (OPERATION_DRILL) !==================================================== - if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() == KELLY_CONNECTION_STRING ) then + if ( Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() == KELLY_CONNECTION_STRING ) then TD_KellyNewAdd = 1 else TD_KellyNewAdd = 0 TD_KellyOldAdd = 0 end if - if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() == KELLY_CONNECTION_STRING .and. TD_KellyNewAdd/=TD_KellyOldAdd ) then + if ( Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() == KELLY_CONNECTION_STRING .and. TD_KellyNewAdd/=TD_KellyOldAdd ) then ! DrillStems Array: TD_NumOfAddedComponents = 1 Do i= (TD_DrillStemComponentsNumbs+1) , (TD_DrillStemComponentsNumbs+TD_NumOfAddedComponents) diff --git a/TorqueDrag/TD_DrillingSubs/TD_BOPDiamCalculation.f90 b/TorqueDrag/TD_DrillingSubs/TD_BOPDiamCalculation.f90 index 695ee38..7a3d5c9 100644 --- a/TorqueDrag/TD_DrillingSubs/TD_BOPDiamCalculation.f90 +++ b/TorqueDrag/TD_DrillingSubs/TD_BOPDiamCalculation.f90 @@ -23,12 +23,12 @@ subroutine TD_BOPDiamCalculation ! Read BOP Data !==================================================== - TD_BOPHeight(5) = AboveAnnularHeight - TD_BOPHeight(1) = AnnularPreventerHeight - TD_BOPHeight(2) = UpperRamHeight - TD_BOPHeight(3) = BlindRamHeight - TD_BOPHeight(6) = KillHeight - TD_BOPHeight(4) = LowerRamHeight + TD_BOPHeight(5) = BopStackSpecification%AboveAnnularHeight + TD_BOPHeight(1) = BopStackSpecification%AnnularPreventerHeight + TD_BOPHeight(2) = BopStackSpecification%UpperRamHeight + TD_BOPHeight(3) = BopStackSpecification%BlindRamHeight + TD_BOPHeight(6) = BopStackSpecification%KillHeight + TD_BOPHeight(4) = BopStackSpecification%LowerRamHeight TD_BOPRamDiam(1) = IDAnnularfinal diff --git a/TorqueDrag/TD_DrillingSubs/TD_DrillStemConfiguration.f90 b/TorqueDrag/TD_DrillingSubs/TD_DrillStemConfiguration.f90 index 9671d53..e3aadfe 100644 --- a/TorqueDrag/TD_DrillingSubs/TD_DrillStemConfiguration.f90 +++ b/TorqueDrag/TD_DrillingSubs/TD_DrillStemConfiguration.f90 @@ -266,9 +266,9 @@ subroutine TD_DrillStemConfiguration if(TD_DrillStems(1)%DownDepth<0.d0) then - BitPosition = TD_DrillStems(1)%DownDepth + DrillingWatch%BitPosition = TD_DrillStems(1)%DownDepth else - BitPosition = G_StringElement(kk)%DownDepth !??????????? + DrillingWatch%BitPosition = G_StringElement(kk)%DownDepth !??????????? !if ( G_StringElement(kk)%DownDepth>TD_WellTotalLength ) then ! BitPosition = TD_WellTotalLength !??????????? !end if diff --git a/TorqueDrag/TD_DrillingSubs/TD_RemoveComponents.f90 b/TorqueDrag/TD_DrillingSubs/TD_RemoveComponents.f90 index 6487c5b..da4be3b 100644 --- a/TorqueDrag/TD_DrillingSubs/TD_RemoveComponents.f90 +++ b/TorqueDrag/TD_DrillingSubs/TD_RemoveComponents.f90 @@ -27,13 +27,13 @@ subroutine TD_RemoveComponents ! Remove Safety Valve & Kelly (OPERATION_DRILL) !==================================================== - if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() /= KELLY_CONNECTION_STRING ) then + if ( Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() /= KELLY_CONNECTION_STRING ) then TD_KellyNewRemove = 1 else TD_KellyNewRemove = 0 TD_KellyOldRemove = 0 end if - if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() /= KELLY_CONNECTION_STRING .and. TD_KellyNewRemove/=TD_KellyOldRemove ) then + if ( Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() /= KELLY_CONNECTION_STRING .and. TD_KellyNewRemove/=TD_KellyOldRemove ) then !print* , 'Remove Safety Valve & Kelly=' TD_NumOfRemovedComponents = 1 Do i= TD_DrillStemComponentsNumbs , (TD_DrillStemComponentsNumbs-TD_NumOfRemovedComponents+1) , -1 diff --git a/TorqueDrag/TD_DrillingSubs/TD_StringConnectionModes.f90 b/TorqueDrag/TD_DrillingSubs/TD_StringConnectionModes.f90 index 762aa4b..6e34b0d 100644 --- a/TorqueDrag/TD_DrillingSubs/TD_StringConnectionModes.f90 +++ b/TorqueDrag/TD_DrillingSubs/TD_StringConnectionModes.f90 @@ -57,11 +57,11 @@ subroutine TD_StringConnectionModes ! = 1 Trip Mode (Elevator) ! = 2 TopDrive Mode - if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL ) then + if ( Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL ) then TD_KellyDriveTypeMode = 0 - else if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_TRIP ) then + else if ( Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_TRIP ) then TD_KellyDriveTypeMode = 1 - else if ( DriveType==0 ) then + else if ( Hoisting%DriveType==0 ) then TD_KellyDriveTypeMode = 2 end if @@ -75,10 +75,10 @@ subroutine TD_StringConnectionModes TD_TDSElevatorLength = 26.837d0 !?????? ! TDS with Elevator Length [ft] TD_TDSElevatorToolLength= 0.859d0 !??????????????????? ! [ft] TD_TDSElevatorECG = 2.454 ! [ft] - TD_NumOfCables = NumberOfLine - TD_WeightTB = TravelingBlockWeight ! [lb] - TD_WeightTD = TopDriveWeight ! [lb] - TD_KellyWeight = KellyWeight ! [lb] + TD_NumOfCables = Hoisting%NumberOfLine + TD_WeightTB = Hoisting%TravelingBlockWeight ! [lb] + TD_WeightTD = Hoisting%TopDriveWeight ! [lb] + TD_KellyWeight = Hoisting%KellyWeight ! [lb] @@ -795,7 +795,7 @@ subroutine TD_StringConnectionModes - if ( (any(TD_StringConnectionMode==(/1,9,10/))) .or. CloseSafetyValve==.true. ) then !for fluid module + if ( (any(TD_StringConnectionMode==(/1,9,10/))) .or. DrillingConsole%CloseSafetyValve==.true. ) then !for fluid module TD_FluidStringConnectionMode = 1 !string is connected !else if ( (any(TD_StringConnectionMode==(/1,9,10/))) .or. CloseSafetyValve==.true. ) then ! diff --git a/TorqueDrag/TD_Forces/TD_HookLoadCalculation.f90 b/TorqueDrag/TD_Forces/TD_HookLoadCalculation.f90 index 5aebbf9..715ebed 100644 --- a/TorqueDrag/TD_Forces/TD_HookLoadCalculation.f90 +++ b/TorqueDrag/TD_Forces/TD_HookLoadCalculation.f90 @@ -32,29 +32,29 @@ subroutine TD_HookLoadCalculation if ( Drawworks%motion==1 ) then if ( PipeRam1_Situation_forTD==1 ) then !Upper Ram - TD_HookLoad = TD_HookLoad+RamStringDrag + TD_HookLoad = TD_HookLoad+BopStackSpecification%RamStringDrag end if if ( PipeRam2_Situation_forTD==1 ) then !Lower Ram - TD_HookLoad = TD_HookLoad+RamStringDrag + TD_HookLoad = TD_HookLoad+BopStackSpecification%RamStringDrag end if if ( ShearBop_Situation_forTD==1 ) then !Blind Ram - TD_HookLoad = TD_HookLoad+RamStringDrag !???????????????????? + TD_HookLoad = TD_HookLoad+BopStackSpecification%RamStringDrag !???????????????????? end if if ( Annular_Situation_forTD==1 ) then !Annular Preventer - TD_HookLoad = TD_HookLoad+(p_annular*AnnularStringDrag) + TD_HookLoad = TD_HookLoad+(p_annular*BopStackSpecification%AnnularStringDrag) end if else if ( Drawworks%motion==-1 ) then if ( PipeRam1_Situation_forTD==1 ) then !Upper Ram - TD_HookLoad = TD_HookLoad-RamStringDrag + TD_HookLoad = TD_HookLoad-BopStackSpecification%RamStringDrag end if if ( PipeRam2_Situation_forTD==1 ) then !Lower Ram - TD_HookLoad = TD_HookLoad-RamStringDrag + TD_HookLoad = TD_HookLoad-BopStackSpecification%RamStringDrag end if if ( ShearBop_Situation_forTD==1 ) then !Blind Ram - TD_HookLoad = TD_HookLoad-RamStringDrag !???????????????????? + TD_HookLoad = TD_HookLoad-BopStackSpecification%RamStringDrag !???????????????????? end if if ( Annular_Situation_forTD==1 ) then !Annular Preventer - TD_HookLoad = TD_HookLoad-(p_annular*AnnularStringDrag) + TD_HookLoad = TD_HookLoad-(p_annular*BopStackSpecification%AnnularStringDrag) end if end if diff --git a/TorqueDrag/TD_Forces/TD_TorqueCalculation.f90 b/TorqueDrag/TD_Forces/TD_TorqueCalculation.f90 index 7412fd4..d31530b 100644 --- a/TorqueDrag/TD_Forces/TD_TorqueCalculation.f90 +++ b/TorqueDrag/TD_Forces/TD_TorqueCalculation.f90 @@ -16,9 +16,9 @@ subroutine TD_TorqueCalculation(i) - if ( DriveType==1 .and. RTable%Speed==0.d0 ) then + if ( Hoisting%DriveType==1 .and. RTable%Speed==0.d0 ) then TD_DrillStems(i)%Torque = 0.d0 - else if ( DriveType==0 .and. TDS%Speed==0.d0 .and. RTable%Speed==0.d0 ) then + else if ( Hoisting%DriveType==0 .and. TDS%Speed==0.d0 .and. RTable%Speed==0.d0 ) then TD_DrillStems(i)%Torque = 0.d0 end if diff --git a/TorqueDrag/TD_ReadDataSubroutines/TD_DrillStemReadData.f90 b/TorqueDrag/TD_ReadDataSubroutines/TD_DrillStemReadData.f90 index fae9879..8d66003 100644 --- a/TorqueDrag/TD_ReadDataSubroutines/TD_DrillStemReadData.f90 +++ b/TorqueDrag/TD_ReadDataSubroutines/TD_DrillStemReadData.f90 @@ -22,7 +22,7 @@ subroutine TD_DrillStemReadData !==================================================== ! Set Drill Stem Components Data !==================================================== - TD_StringConfigurationCount = StringConfigurationCount + TD_StringConfigurationCount = StringConfiguration%StringConfigurationCount TD_DrillStemComponentsNumbs = 0 @@ -42,16 +42,16 @@ subroutine TD_DrillStemReadData Do i=1, TD_StringConfigurationCount - TD_DrillStem(i)%ComponentType = StringConfigurations(i)%ComponentType - TD_DrillStem(i)%Numbs = StringConfigurations(i)%NumberOfJoint - TD_DrillStem(i)%Id = StringConfigurations(i)%NominalId/12.d0 ![ft] - TD_DrillStem(i)%Od = StringConfigurations(i)%NominalOd/12.d0 ![ft] - TD_DrillStem(i)%Length = StringConfigurations(i)%LengthPerJoint ![ft] - TD_DrillStem(i)%WeightperLength = StringConfigurations(i)%WeightPerLength ![lb/ft] - TD_DrillStem(i)%TotalLength = StringConfigurations(i)%ComponentLength + TD_DrillStem(i)%ComponentType = StringConfiguration%StringConfigurations(i)%ComponentType + TD_DrillStem(i)%Numbs = StringConfiguration%StringConfigurations(i)%NumberOfJoint + TD_DrillStem(i)%Id = StringConfiguration%StringConfigurations(i)%NominalId/12.d0 ![ft] + TD_DrillStem(i)%Od = StringConfiguration%StringConfigurations(i)%NominalOd/12.d0 ![ft] + TD_DrillStem(i)%Length = StringConfiguration%StringConfigurations(i)%LengthPerJoint ![ft] + TD_DrillStem(i)%WeightperLength = StringConfiguration%StringConfigurations(i)%WeightPerLength ![lb/ft] + TD_DrillStem(i)%TotalLength = StringConfiguration%StringConfigurations(i)%ComponentLength TD_DrillStem(i)%TotalWeight = TD_DrillStem(i)%TotalLength*TD_DrillStem(i)%WeightperLength - TD_DrillStemComponentsNumbs = TD_DrillStemComponentsNumbs+StringConfigurations(i)%NumberOfJoint + TD_DrillStemComponentsNumbs = TD_DrillStemComponentsNumbs+StringConfiguration%StringConfigurations(i)%NumberOfJoint !!=========> Set Separated Drill Stem Components Data ! TD_LastIndex = TD_LastIndex+StringConfigurations(i)%NumberOfJoint @@ -98,7 +98,7 @@ subroutine TD_DrillStemReadData Do i=1, TD_StringConfigurationCount - TD_LastIndex = TD_LastIndex+StringConfigurations(i)%NumberOfJoint + TD_LastIndex = TD_LastIndex+StringConfiguration%StringConfigurations(i)%NumberOfJoint TD_DrillStems(TD_FirstIndex:TD_LastIndex)%ComponentType = TD_DrillStem(i)%ComponentType TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Id = TD_DrillStem(i)%Id diff --git a/TorqueDrag/TD_ReadDataSubroutines/TD_ForceReadData.f90 b/TorqueDrag/TD_ReadDataSubroutines/TD_ForceReadData.f90 index 8da3dfd..f32c11f 100644 --- a/TorqueDrag/TD_ReadDataSubroutines/TD_ForceReadData.f90 +++ b/TorqueDrag/TD_ReadDataSubroutines/TD_ForceReadData.f90 @@ -20,9 +20,9 @@ subroutine TD_ForceReadData TD_DrillStemAxialVelocity = TD_StringVelocity Do i = 1 , TD_DrillStemComponentsNumbs - if ( DriveType==1) then + if ( Hoisting%DriveType==1) then TD_DrillStemRotVelocity = (2.d0*pi*TD_DrillStems(i)%RtoolJoint)*(RTable%Speed)/60.d0 ! RTable%Speed[RPM] ---> TD_DrillStemRotVelocity[ft/s] - else if ( DriveType==0) then + else if ( Hoisting%DriveType==0) then TD_DrillStemRotVelocity = (2.d0*pi*TD_DrillStems(i)%RtoolJoint)*(TDS%Speed+RTable%Speed)/60.d0 ! TDS%Speed[RPM] ---> TD_DrillStemRotVelocity[ft/s] end if End Do diff --git a/TorqueDrag/TD_ReadDataSubroutines/TD_WellElementsReadData.f90 b/TorqueDrag/TD_ReadDataSubroutines/TD_WellElementsReadData.f90 index 4c242a7..6c39af2 100644 --- a/TorqueDrag/TD_ReadDataSubroutines/TD_WellElementsReadData.f90 +++ b/TorqueDrag/TD_ReadDataSubroutines/TD_WellElementsReadData.f90 @@ -23,14 +23,14 @@ subroutine TD_WellElementsReadData Allocate (TD_Casing(TD_CasingNumbs)) Do i=1, TD_CasingNumbs - TD_Casing(i)%Length = CasingDepth ! unit: [ft] + TD_Casing(i)%Length = CasingLinerChoke%CasingDepth ! unit: [ft] TD_Casing(i)%TopDepth = 0.d0 TD_Casing(i)%DownDepth = TD_Casing(i)%Length - TD_Casing(i)%Od = CasingOd/12.d0 ! unit: [ft] - TD_Casing(i)%Id = CasingId/12.d0 ! unit: [ft] - TD_Casing(i)%Weight = CasingWeight - TD_Casing(i)%CollapsePressure = CasingCollapsePressure - TD_Casing(i)%TensileStrength = CasingTensileStrength + TD_Casing(i)%Od = CasingLinerChoke%CasingOd/12.d0 ! unit: [ft] + TD_Casing(i)%Id = CasingLinerChoke%CasingId/12.d0 ! unit: [ft] + TD_Casing(i)%Weight = CasingLinerChoke%CasingWeight + TD_Casing(i)%CollapsePressure = CasingLinerChoke%CasingCollapsePressure + TD_Casing(i)%TensileStrength = CasingLinerChoke%CasingTensileStrength End Do @@ -41,7 +41,7 @@ subroutine TD_WellElementsReadData ! Set Liner Data !==================================================== TD_LinerNumbs = 0 - if(LinerLength > 0.d0) then + if(CasingLinerChoke%LinerLength > 0.d0) then TD_LinerNumbs = 1 !if (TD_LinerNumbs>0) then @@ -49,17 +49,17 @@ subroutine TD_WellElementsReadData Allocate (TD_Liner(TD_LinerNumbs)) Do i=1, TD_LinerNumbs - TD_Liner(i)%TopDepth = LinerTopDepth ! unit: [ft] + TD_Liner(i)%TopDepth = CasingLinerChoke%LinerTopDepth ! unit: [ft] if (TD_Liner(i)%TopDepth Radius Of Curvature Calculation if (TD_WellGeo(i)%HoleType/=0) then diff --git a/TorqueDrag/TD_StartUp/TD_StartUp.f90 b/TorqueDrag/TD_StartUp/TD_StartUp.f90 index abbbfba..02e7774 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 = PathGenerations(PathGenerationCount)%MeasuredDepth + Old_ROPDepth = PathGeneration%Items(PathGenerationCount)%MeasuredDepth Old_ROPValue = 0.d0 Set_ROPGauge = 0.d0 @@ -81,15 +81,15 @@ subroutine TD_StartUp TD_TDSElevatorLength = 26.837d0 !?????? ! TDS with Elevator Length [ft] TD_TDSElevatorToolLength= 0.859d0 !??????????????????? ! [ft] TD_TDSElevatorECG = 2.454 ! [ft] - TD_NumOfCables = NumberOfLine - TD_WeightTB = TravelingBlockWeight ! [lb] - TD_WeightTD = TopDriveWeight ! [lb] - TD_KellyWeight = KellyWeight ! [lb] + TD_NumOfCables = Hoisting%NumberOfLine + TD_WeightTB = Hoisting%TravelingBlockWeight ! [lb] + TD_WeightTD = Hoisting%TopDriveWeight ! [lb] + TD_KellyWeight = Hoisting%KellyWeight ! [lb] TD_SafetyValveLength = 1.54d0 ! [ft] TD_IBOPLength = 1.54d0 ! [ft] TD_KellyElementID = 3.0d0/12.d0 ! [ft] TD_KellyElementOD = 5.90d0/12.d0 ! [ft] - TD_DrawworksLoadInput = TravelingBlockWeight/NumberOfLine + TD_DrawworksLoadInput = Hoisting%TravelingBlockWeight/Hoisting%NumberOfLine TD_IBOPNewAdd = 0 TD_IBOPOldAdd = 0 !Remove diff --git a/TorqueDrag/TorqueDragMain.f90 b/TorqueDrag/TorqueDragMain.f90 index 60c4318..e19161a 100644 --- a/TorqueDrag/TorqueDragMain.f90 +++ b/TorqueDrag/TorqueDragMain.f90 @@ -3,7 +3,7 @@ MODULE TorqueDragMain USE CDrillingConsoleVariables USE CDataDisplayConsoleVariables USE CSimulationVariables - USE Pump_VARIABLES + USE Pumps_VARIABLES IMPLICIT NONE PUBLIC CONTAINS diff --git a/helper.ipynb b/helper.ipynb new file mode 100644 index 0000000..e268f4b --- /dev/null +++ b/helper.ipynb @@ -0,0 +1,350 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\tGeo/GeoMain.f90 \\\n", + "\n" + ] + } + ], + "source": [ + "##Replace space with _ in filenames and list them for put them in makefile\n", + "import os\n", + "dir = 'Geo'\n", + "files = os.listdir(dir)\n", + "fstring = ''\n", + "for f in files:\n", + " if f.endswith('90'):\n", + " newf = f.replace(' ','_')\n", + " os.rename(os.path.join(dir,f),os.path.join(dir,newf))\n", + " if newf.lower().endswith('variables.f90'):\n", + " fstring = '\\t'+os.path.join(dir,newf).replace('\\\\','/') +' \\\\\\n' + fstring\n", + " else:\n", + " fstring = fstring + '\\t'+os.path.join(dir,newf).replace('\\\\','/') +' \\\\\\n'\n", + "\n", + "print(fstring)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Extract variable names from definition lines" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# %pwd\n", + "lines = input(\"Enter lines:\").split(\" \")\n", + "lines = [l.strip() for l in lines if len(l.strip())>0]\n", + "vars = []\n", + "for l in lines:\n", + " if '::' in l:\n", + " vars.append(l.split('::')[1].strip())" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import string\n", + "string.ascii_letters" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "var: AnnularRegulatorSetControl\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AirMasterValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: ByePassValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AnnularValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: UpperRamsValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: MiddleRamsValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: KillLineValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: ChokeLineValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: LowerRamsValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: ManifoldPressureGauge\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AirSupplyPressureGauge\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AccumulatorPressureGauge\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AnnularPressureGauge\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AnnularOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AnnularCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: UpperRamsOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: UpperRamsCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: MiddleRamsOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: MiddleRamsCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: KillLineOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: KillLineCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: ChokeLineOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: ChokeLineCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: LowerRamsOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: LowerRamsCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AnnularStatus\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: UpperRamsStatus\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: MiddleRamsStatus\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: LowerRamsStatus\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n" + ] + } + ], + "source": [ + "import os\n", + "import sys\n", + "import re\n", + "dir = '.'\n", + "varNameChars = string.ascii_letters + '_'\n", + "log = open(os.path.join(dir,'ReplaceVars.log',),'a')\n", + "end=False\n", + "for dir,subdirs,files in os.walk(dir):\n", + " for filename in files:\n", + " if filename.lower().endswith('.f90'):\n", + " # print(filename)\n", + " file = open(os.path.join(dir,filename))\n", + " code = file.read()\n", + " for var in vars:\n", + " if var not in code:\n", + " continue\n", + " occurs = [m.start() for m in re.finditer(var, code)]\n", + " for occurance in occurs:\n", + " if code[occurs[0]-1] in varNameChars or code[occurs[0]+len(var)] in varNameChars:\n", + " continue\n", + " print(f\"var: {var}\")\n", + " print(f\"file = {os.path.join(dir,filename)}\")\n", + " print(f\"Char before: {code[occurs[0]-1]}\")\n", + " print(f\"Char after: {code[occurs[0]+len(var)]}\")\n", + " end = True\n", + " if end:\n", + " break" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('.',\n", + " ['.git',\n", + " '.vs',\n", + " 'Common',\n", + " 'CSharp',\n", + " 'Equipments',\n", + " 'FluidFlow',\n", + " 'Geo',\n", + " 'lib',\n", + " 'Rop',\n", + " 'TorqueDrag',\n", + " 'x64'])" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dir,subdirs" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "for fn in modules:\n", + " f = open(fn)\n", + " lines = f.readlines()\n", + " module_filenames = {}\n", + " used_modules = []\n", + " mod_count = 0\n", + " for l in lines:\n", + " l = l.strip().lower()\n", + " if l.startswith('module ') and not l.startswith('module procedure '):\n", + " mod_name = l.split(' ')[1]\n", + " module_filenames[mod_name] = fn\n", + " mod_count +=1\n", + " if l.startswith('use'):\n", + " used_modules.append(l.split(' ')[1])\n", + " if mod_count !=1:\n", + " print(f\"{fn} has {mod_count} modules\")\n", + " module_filenames,used_modules" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "base", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.12" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "1ef4a26de7183d96d6da1045a38581e0a15b2215d0c1b98c7b273c6e514c6c7e" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}