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.
 
 
 
 
 
 

108 lines
3.8 KiB

  1. module CRotaryProblemsVariables
  2. use CProblemDifinition
  3. implicit none
  4. public
  5. ! Input vars
  6. type::RotaryProblemsType
  7. type(CProblem) :: MotorFail
  8. type(CProblem) :: OverideTorqueLimit
  9. end type RotaryProblemsType
  10. type(RotaryProblemsType)::RotaryProblems
  11. ! procedure (ActionInteger), pointer :: MotorFailPtr
  12. ! procedure (ActionInteger), pointer :: OverideTorqueLimitPtr
  13. contains
  14. subroutine ProcessRotaryProblemsDueTime(time)
  15. implicit none
  16. integer :: time
  17. if(RotaryProblems%MotorFail%ProblemType == Time_ProblemType) call ProcessDueTime(RotaryProblems%MotorFail, ChangeMotorFail, time)
  18. if(RotaryProblems%OverideTorqueLimit%ProblemType == Time_ProblemType) call ProcessDueTime(RotaryProblems%OverideTorqueLimit, ChangeOverideTorqueLimit, time)
  19. end subroutine
  20. subroutine ProcessRotaryProblemsDuePumpStrokes(strokes)
  21. implicit none
  22. integer :: strokes
  23. if(RotaryProblems%MotorFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(RotaryProblems%MotorFail, ChangeMotorFail, strokes)
  24. if(RotaryProblems%OverideTorqueLimit%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(RotaryProblems%OverideTorqueLimit, ChangeOverideTorqueLimit, strokes)
  25. end subroutine
  26. subroutine ProcessRotaryProblemsDueVolumePumped(volume)
  27. implicit none
  28. real(8) :: volume
  29. if(RotaryProblems%MotorFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(RotaryProblems%MotorFail, ChangeMotorFail, volume)
  30. if(RotaryProblems%OverideTorqueLimit%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(RotaryProblems%OverideTorqueLimit, ChangeOverideTorqueLimit, volume)
  31. end subroutine
  32. subroutine ProcessRotaryProblemsDueDistanceDrilled(distance)
  33. implicit none
  34. real(8) :: distance
  35. if(RotaryProblems%MotorFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(RotaryProblems%MotorFail, ChangeMotorFail, distance)
  36. if(RotaryProblems%OverideTorqueLimit%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(RotaryProblems%OverideTorqueLimit, ChangeOverideTorqueLimit, distance)
  37. end subroutine
  38. subroutine ChangeMotorFail(status)
  39. use RTable_VARIABLES
  40. implicit none
  41. integer, intent (in) :: status
  42. !if(associated(MotorFailPtr)) call MotorFailPtr(status)
  43. if(status == Clear_StatusType) RTable%MotorFaileMalf=0
  44. if(status == Executed_StatusType) RTable%MotorFaileMalf=1
  45. endsubroutine
  46. subroutine ChangeOverideTorqueLimit(status)
  47. use RTable_VARIABLES
  48. implicit none
  49. integer, intent (in) :: status
  50. !if(associated(OverideTorqueLimitPtr)) call OverideTorqueLimitPtr(status)
  51. if(status == Clear_StatusType) RTable%OverideTorqueLimitMalf=0
  52. if(status == Executed_StatusType) RTable%OverideTorqueLimitMalf=1
  53. endsubroutine
  54. ! subroutine SubscribeMotorFail2(v)
  55. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeMotorFail2
  56. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeMotorFail2' :: SubscribeMotorFail2
  57. ! implicit none
  58. ! procedure (ActionInteger) :: v
  59. ! MotorFailPtr => v
  60. ! end subroutine
  61. ! subroutine SubscribeOverideTorqueLimit(v)
  62. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeOverideTorqueLimit
  63. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeOverideTorqueLimit' :: SubscribeOverideTorqueLimit
  64. ! implicit none
  65. ! procedure (ActionInteger) :: v
  66. ! OverideTorqueLimitPtr => v
  67. ! end subroutine
  68. end module CRotaryProblemsVariables