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.6 KiB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. #ifdef OST
  11. if(print_log) print*, 'Evaluate_IrSafetyValvePermission=TopDrive'
  12. #endif
  13. !TOPDRIVE-CODE=55
  14. if (GetRotaryRpm() == 0.0d0 .and.&
  15. (Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 10.0) .and.&
  16. Get_JointConnectionPossible() == .false. .and.&
  17. Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.&
  18. data%State%StudentStation%FillupHeadInstallation == .false.) then
  19. call Set_IrSafetyValvePermission(.true.)
  20. return
  21. end if
  22. endif
  23. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  24. if(print_log) print*, 'Evaluate_IrSafetyValvePermission=Kelly'
  25. !OPERATION-CODE=57
  26. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  27. GetRotaryRpm() == 0.0d0 .and.&
  28. !(Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .or. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.&
  29. !Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 10.0 .and.&
  30. data%State%TD_String%TopJointHeight >= 3.0 .and. data%State%TD_String%TopJointHeight <= 10.0 .and.&
  31. !Get_SafetyValveHeight() >= 22.0 .and. Get_SafetyValveHeight() <= 35.0 .and.&
  32. Get_JointConnectionPossible() == .false. .and.&
  33. Get_FillupHead() == FILLUP_HEAD_REMOVE .and.&
  34. Get_Swing() == SWING_WELL_END) then
  35. call Set_IrSafetyValvePermission(.true.)
  36. return
  37. end if
  38. call Set_IrSafetyValvePermission(.false.)
  39. endif
  40. end subroutine
  41. subroutine Subscribe_IrSafetyValvePermission()
  42. implicit none
  43. ! imp me...
  44. end subroutine
  45. end module CIrSafetyValvePermission