Simulation Core
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

CRotaryProblems.f90 3.7 KiB

vor 1 Jahr
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. module CRotaryProblems
  2. use SimulationVariables
  3. implicit none
  4. public
  5. contains
  6. subroutine RotaryProblemsToJson(parent)
  7. type(json_value),pointer :: parent
  8. type(json_core) :: json
  9. type(json_value),pointer :: p
  10. ! 1. create new node
  11. call json%create_object(p,'RotaryProblems')
  12. ! 2. add member of data type to new node
  13. call ProblemToJson(p,"MotorFail",data%problems%RotaryProblems%MotorFail)
  14. call ProblemToJson(p,"OverideTorqueLimit",data%problems%RotaryProblems%OverideTorqueLimit)
  15. ! 3. add new node to parent
  16. call json%add(parent,p)
  17. end subroutine
  18. subroutine ProcessRotaryProblemsDueTime(time)
  19. implicit none
  20. integer :: time
  21. if(data%problems%RotaryProblems%MotorFail%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%RotaryProblems%MotorFail, ChangeMotorFail, time)
  22. if(data%problems%RotaryProblems%OverideTorqueLimit%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%RotaryProblems%OverideTorqueLimit, ChangeOverideTorqueLimit, time)
  23. end subroutine
  24. subroutine ProcessRotaryProblemsDuePumpStrokes(strokes)
  25. implicit none
  26. integer :: strokes
  27. if(data%problems%RotaryProblems%MotorFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%RotaryProblems%MotorFail, ChangeMotorFail, strokes)
  28. if(data%problems%RotaryProblems%OverideTorqueLimit%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%RotaryProblems%OverideTorqueLimit, ChangeOverideTorqueLimit, strokes)
  29. end subroutine
  30. subroutine ProcessRotaryProblemsDueVolumePumped(volume)
  31. implicit none
  32. real(8) :: volume
  33. if(data%problems%RotaryProblems%MotorFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%RotaryProblems%MotorFail, ChangeMotorFail, volume)
  34. if(data%problems%RotaryProblems%OverideTorqueLimit%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%RotaryProblems%OverideTorqueLimit, ChangeOverideTorqueLimit, volume)
  35. end subroutine
  36. subroutine ProcessRotaryProblemsDueDistanceDrilled(distance)
  37. implicit none
  38. real(8) :: distance
  39. if(data%problems%RotaryProblems%MotorFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%RotaryProblems%MotorFail, ChangeMotorFail, distance)
  40. if(data%problems%RotaryProblems%OverideTorqueLimit%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%RotaryProblems%OverideTorqueLimit, ChangeOverideTorqueLimit, distance)
  41. end subroutine
  42. subroutine ChangeMotorFail(status)
  43. use SimulationVariables !@
  44. implicit none
  45. integer, intent (in) :: status
  46. !if(associated(MotorFailPtr)) call MotorFailPtr(status)
  47. if(status == Clear_StatusType) data%State%RTable%MotorFaileMalf=0
  48. if(status == Executed_StatusType) data%State%RTable%MotorFaileMalf=1
  49. endsubroutine
  50. subroutine ChangeOverideTorqueLimit(status)
  51. use SimulationVariables !@
  52. implicit none
  53. integer, intent (in) :: status
  54. !if(associated(OverideTorqueLimitPtr)) call OverideTorqueLimitPtr(status)
  55. if(status == Clear_StatusType) data%State%RTable%OverideTorqueLimitMalf=0
  56. if(status == Executed_StatusType) data%State%RTable%OverideTorqueLimitMalf=1
  57. endsubroutine
  58. end module CRotaryProblems