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.

CHoistingProblemsVariables.f90 4.5 KiB

1 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. module CHoistingProblemsVariables
  2. use CProblemDifinition
  3. implicit none
  4. public
  5. ! Input vars
  6. type(CProblem) :: MotorFail
  7. type(CProblem) :: ClutchEngage
  8. type(CProblem) :: ClutchDisengage
  9. procedure (ActionInteger), pointer :: MotorFailPtr
  10. procedure (ActionInteger), pointer :: ClutchEngagePtr
  11. procedure (ActionInteger), pointer :: ClutchDisengagePtr
  12. contains
  13. subroutine ProcessHoistingProblemsDueTime(time)
  14. implicit none
  15. integer :: time
  16. if(MotorFail%ProblemType == Time_ProblemType) call ProcessDueTime(MotorFail, ChangeMotorFail, time)
  17. if(ClutchEngage%ProblemType == Time_ProblemType) call ProcessDueTime(ClutchEngage, ChangeClutchEngage, time)
  18. if(ClutchDisengage%ProblemType == Time_ProblemType) call ProcessDueTime(ClutchDisengage, ChangeClutchDisengage, time)
  19. end subroutine
  20. subroutine ProcessHoistingProblemsDuePumpStrokes(strokes)
  21. implicit none
  22. integer :: strokes
  23. if(MotorFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(MotorFail, ChangeMotorFail, strokes)
  24. if(ClutchEngage%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(ClutchEngage, ChangeClutchEngage, strokes)
  25. if(ClutchDisengage%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(ClutchDisengage, ChangeClutchDisengage, strokes)
  26. end subroutine
  27. subroutine ProcessHoistingProblemsDueVolumePumped(volume)
  28. implicit none
  29. real(8) :: volume
  30. if(MotorFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(MotorFail, ChangeMotorFail, volume)
  31. if(ClutchEngage%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(ClutchEngage, ChangeClutchEngage, volume)
  32. if(ClutchDisengage%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(ClutchDisengage, ChangeClutchDisengage, volume)
  33. end subroutine
  34. subroutine ProcessHoistingProblemsDueDistanceDrilled(distance)
  35. implicit none
  36. real(8) :: distance
  37. if(MotorFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(MotorFail, ChangeMotorFail, distance)
  38. if(ClutchEngage%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(ClutchEngage, ChangeClutchEngage, distance)
  39. if(ClutchDisengage%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(ClutchDisengage, ChangeClutchDisengage, distance)
  40. end subroutine
  41. subroutine ChangeMotorFail(status)
  42. use Drawworks_VARIABLES
  43. implicit none
  44. integer, intent (in) :: status
  45. if(associated(MotorFailPtr)) call MotorFailPtr(status)
  46. if(status == Clear_StatusType) Drawworks%MotorFaileMalf=0
  47. if(status == Executed_StatusType) Drawworks%MotorFaileMalf=1
  48. endsubroutine
  49. subroutine ChangeClutchEngage(status)
  50. use Drawworks_VARIABLES
  51. implicit none
  52. integer, intent (in) :: status
  53. if(associated(ClutchEngagePtr)) call ClutchEngagePtr(status)
  54. if(status == Clear_StatusType) Drawworks%ClutchEngageMalf=0
  55. if(status == Executed_StatusType) Drawworks%ClutchEngageMalf=1
  56. endsubroutine
  57. subroutine ChangeClutchDisengage(status)
  58. use Drawworks_VARIABLES
  59. implicit none
  60. integer, intent (in) :: status
  61. if(associated(ClutchDisengagePtr)) call ClutchDisengagePtr(status)
  62. if(status == Clear_StatusType) Drawworks%ClutchDisengageMalf=0
  63. if(status == Executed_StatusType) Drawworks%ClutchDisengageMalf=1
  64. endsubroutine
  65. subroutine SubscribeMotorFail(v)
  66. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeMotorFail
  67. !DEC$ ATTRIBUTES ALIAS: 'SubscribeMotorFail' :: SubscribeMotorFail
  68. implicit none
  69. procedure (ActionInteger) :: v
  70. MotorFailPtr => v
  71. end subroutine
  72. subroutine SubscribeClutchEngage(v)
  73. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeClutchEngage
  74. !DEC$ ATTRIBUTES ALIAS: 'SubscribeClutchEngage' :: SubscribeClutchEngage
  75. implicit none
  76. procedure (ActionInteger) :: v
  77. ClutchEngagePtr => v
  78. end subroutine
  79. subroutine SubscribeClutchDisengage(v)
  80. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeClutchDisengage
  81. !DEC$ ATTRIBUTES ALIAS: 'SubscribeClutchDisengage' :: SubscribeClutchDisengage
  82. implicit none
  83. procedure (ActionInteger) :: v
  84. ClutchDisengagePtr => v
  85. end subroutine
  86. end module CHoistingProblemsVariables