Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CIrSafetyValvePermission.f90 2.3 KiB

1 year ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. module CIrSafetyValvePermission
  2. use OperationScenariosModule
  3. implicit none
  4. contains
  5. subroutine Evaluate_IrSafetyValvePermission()
  6. use TD_DrillStemComponents
  7. use CStudentStationVariables!!, only: data%State%StudentStation%FillupHeadInstallation
  8. implicit none
  9. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  10. !TOPDRIVE-CODE=55
  11. if (GetRotaryRpm() == 0.0d0 .and.&
  12. (Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 10.0) .and.&
  13. Get_JointConnectionPossible() == .false. .and.&
  14. Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.&
  15. data%State%StudentStation%FillupHeadInstallation == .false.) then
  16. call Set_IrSafetyValvePermission(.true.)
  17. return
  18. end if
  19. endif
  20. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  21. !OPERATION-CODE=57
  22. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  23. GetRotaryRpm() == 0.0d0 .and.&
  24. !(Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .or. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.&
  25. !Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 10.0 .and.&
  26. data%State%TD_String%TopJointHeight >= 3.0 .and. data%State%TD_String%TopJointHeight <= 10.0 .and.&
  27. !Get_SafetyValveHeight() >= 22.0 .and. Get_SafetyValveHeight() <= 35.0 .and.&
  28. Get_JointConnectionPossible() == .false. .and.&
  29. Get_FillupHead() == FILLUP_HEAD_REMOVE .and.&
  30. Get_Swing() == SWING_WELL_END) then
  31. call Set_IrSafetyValvePermission(.true.)
  32. return
  33. end if
  34. call Set_IrSafetyValvePermission(.false.)
  35. endif
  36. end subroutine
  37. subroutine Subscribe_IrSafetyValvePermission()
  38. implicit none
  39. ! imp me...
  40. end subroutine
  41. end module CIrSafetyValvePermission