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.
 
 
 
 
 
 

113 lines
5.0 KiB

  1. module CDrillStemProblemsVariables
  2. use CProblemDifinition
  3. implicit none
  4. public
  5. ! Input vars
  6. type(CProblem) :: StringDragIncrease
  7. type(CProblem) :: StringTorqueIncrease
  8. type(CProblem) :: StringTorqueFluctuation
  9. real(8) :: StringDragIncreaseTime
  10. real(8) :: StringTorqueIncreaseTime
  11. procedure (ActionInteger), pointer :: StringDragIncreasePtr
  12. procedure (ActionInteger), pointer :: StringTorqueIncreasePtr
  13. procedure (ActionInteger), pointer :: StringTorqueFluctuationPtr
  14. contains
  15. subroutine ProcessDrillStemProblemsDueTime(time)
  16. implicit none
  17. integer :: time
  18. if(StringDragIncrease%ProblemType == Time_ProblemType) call ProcessDueTime(StringDragIncrease, ChangeStringDragIncrease, time)
  19. if(StringTorqueIncrease%ProblemType == Time_ProblemType) call ProcessDueTime(StringTorqueIncrease, ChangeStringTorqueIncrease, time)
  20. if(StringTorqueFluctuation%ProblemType == Time_ProblemType) call ProcessDueTime(StringTorqueFluctuation, ChangeStringTorqueFluctuation, time)
  21. end subroutine
  22. subroutine ProcessDrillStemProblemsDuePumpStrokes(strokes)
  23. implicit none
  24. integer :: strokes
  25. if(StringDragIncrease%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(StringDragIncrease, ChangeStringDragIncrease, strokes)
  26. if(StringTorqueIncrease%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(StringTorqueIncrease, ChangeStringTorqueIncrease, strokes)
  27. if(StringTorqueFluctuation%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(StringTorqueFluctuation, ChangeStringTorqueFluctuation, strokes)
  28. end subroutine
  29. subroutine ProcessDrillStemProblemsDueVolumePumped(volume)
  30. implicit none
  31. real(8) :: volume
  32. if(StringDragIncrease%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(StringDragIncrease, ChangeStringDragIncrease, volume)
  33. if(StringTorqueIncrease%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(StringTorqueIncrease, ChangeStringTorqueIncrease, volume)
  34. if(StringTorqueFluctuation%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(StringTorqueFluctuation, ChangeStringTorqueFluctuation, volume)
  35. end subroutine
  36. subroutine ProcessDrillStemProblemsDueDistanceDrilled(distance)
  37. implicit none
  38. real(8) :: distance
  39. if(StringDragIncrease%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(StringDragIncrease, ChangeStringDragIncrease, distance)
  40. if(StringTorqueIncrease%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(StringTorqueIncrease, ChangeStringTorqueIncrease, distance)
  41. if(StringTorqueFluctuation%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(StringTorqueFluctuation, ChangeStringTorqueFluctuation, distance)
  42. end subroutine
  43. subroutine ChangeStringDragIncrease(status)
  44. implicit none
  45. integer, intent (in) :: status
  46. if(associated(StringDragIncreasePtr)) call StringDragIncreasePtr(status)
  47. !if(status == Clear_StatusType) print*,'On_StringDragIncrease_Clear'
  48. !if(status == Executed_StatusType) print*,'On_StringDragIncrease_Execute'
  49. endsubroutine
  50. subroutine ChangeStringTorqueIncrease(status)
  51. implicit none
  52. integer, intent (in) :: status
  53. if(associated(StringTorqueIncreasePtr)) call StringTorqueIncreasePtr(status)
  54. !if(status == Clear_StatusType) print*,'On_StringTorqueIncrease_Clear'
  55. !if(status == Executed_StatusType) print*,'On_StringTorqueIncrease_Execute'
  56. endsubroutine
  57. subroutine ChangeStringTorqueFluctuation(status)
  58. implicit none
  59. integer, intent (in) :: status
  60. if(associated(StringTorqueFluctuationPtr)) call StringTorqueFluctuationPtr(status)
  61. !if(status == Clear_StatusType) print*,'On_StringTorqueFluctuation_Clear'
  62. !if(status == Executed_StatusType) print*,'On_StringTorqueFluctuation_Execute'
  63. endsubroutine
  64. subroutine SubscribeStringDragIncrease(v)
  65. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringDragIncrease
  66. !DEC$ ATTRIBUTES ALIAS: 'SubscribeStringDragIncrease' :: SubscribeStringDragIncrease
  67. implicit none
  68. procedure (ActionInteger) :: v
  69. StringDragIncreasePtr => v
  70. end subroutine
  71. subroutine SubscribeStringTorqueIncrease(v)
  72. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringTorqueIncrease
  73. !DEC$ ATTRIBUTES ALIAS: 'SubscribeStringTorqueIncrease' :: SubscribeStringTorqueIncrease
  74. implicit none
  75. procedure (ActionInteger) :: v
  76. StringTorqueIncreasePtr => v
  77. end subroutine
  78. subroutine SubscribeStringTorqueFluctuation(v)
  79. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringTorqueFluctuation
  80. !DEC$ ATTRIBUTES ALIAS: 'SubscribeStringTorqueFluctuation' :: SubscribeStringTorqueFluctuation
  81. implicit none
  82. procedure (ActionInteger) :: v
  83. StringTorqueFluctuationPtr => v
  84. end subroutine
  85. end module CDrillStemProblemsVariables