Simulation Core
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

CHoistingProblems.f90 4.8 KiB

hace 1 año
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. module CHoistingProblems
  2. use SimulationVariables
  3. implicit none
  4. public
  5. contains
  6. subroutine HoistingProblemsToJson(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,'HoistingProblems')
  12. ! 2. add member of data type to new node
  13. call ProblemToJson(p,"MotorFail",data%problems%HoistingProblems%MotorFail)
  14. call ProblemToJson(p,"ClutchEngage",data%problems%HoistingProblems%ClutchEngage)
  15. call ProblemToJson(p,"ClutchDisengage",data%problems%HoistingProblems%ClutchDisengage)
  16. ! 3. add new node to parent
  17. call json%add(parent,p)
  18. end subroutine
  19. subroutine ProcessHoistingProblemsDueTime(time)
  20. implicit none
  21. integer :: time
  22. if(data%problems%HoistingProblems%MotorFail%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%HoistingProblems%MotorFail, ChangeMotorFail, time)
  23. if(data%problems%HoistingProblems%ClutchEngage%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%HoistingProblems%ClutchEngage, ChangeClutchEngage, time)
  24. if(data%problems%HoistingProblems%ClutchDisengage%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%HoistingProblems%ClutchDisengage, ChangeClutchDisengage, time)
  25. end subroutine
  26. subroutine ProcessHoistingProblemsDuePumpStrokes(strokes)
  27. implicit none
  28. integer :: strokes
  29. if(data%problems%HoistingProblems%MotorFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%HoistingProblems%MotorFail, ChangeMotorFail, strokes)
  30. if(data%problems%HoistingProblems%ClutchEngage%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%HoistingProblems%ClutchEngage, ChangeClutchEngage, strokes)
  31. if(data%problems%HoistingProblems%ClutchDisengage%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%HoistingProblems%ClutchDisengage, ChangeClutchDisengage, strokes)
  32. end subroutine
  33. subroutine ProcessHoistingProblemsDueVolumePumped(volume)
  34. implicit none
  35. real(8) :: volume
  36. if(data%problems%HoistingProblems%MotorFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%HoistingProblems%MotorFail, ChangeMotorFail, volume)
  37. if(data%problems%HoistingProblems%ClutchEngage%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%HoistingProblems%ClutchEngage, ChangeClutchEngage, volume)
  38. if(data%problems%HoistingProblems%ClutchDisengage%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%HoistingProblems%ClutchDisengage, ChangeClutchDisengage, volume)
  39. end subroutine
  40. subroutine ProcessHoistingProblemsDueDistanceDrilled(distance)
  41. implicit none
  42. real(8) :: distance
  43. if(data%problems%HoistingProblems%MotorFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%HoistingProblems%MotorFail, ChangeMotorFail, distance)
  44. if(data%problems%HoistingProblems%ClutchEngage%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%HoistingProblems%ClutchEngage, ChangeClutchEngage, distance)
  45. if(data%problems%HoistingProblems%ClutchDisengage%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%HoistingProblems%ClutchDisengage, ChangeClutchDisengage, distance)
  46. end subroutine
  47. subroutine ChangeMotorFail(status)
  48. use SimulationVariables !@
  49. implicit none
  50. integer, intent (in) :: status
  51. ! if(associated(MotorFailPtr)) call MotorFailPtr(status)
  52. if(status == Clear_StatusType) data%State%Drawworks%MotorFaileMalf=0
  53. if(status == Executed_StatusType) data%State%Drawworks%MotorFaileMalf=1
  54. endsubroutine
  55. subroutine ChangeClutchEngage(status)
  56. use SimulationVariables !@
  57. implicit none
  58. integer, intent (in) :: status
  59. ! if(associated(ClutchEngagePtr)) call ClutchEngagePtr(status)
  60. if(status == Clear_StatusType) data%State%Drawworks%ClutchEngageMalf=0
  61. if(status == Executed_StatusType) data%State%Drawworks%ClutchEngageMalf=1
  62. endsubroutine
  63. subroutine ChangeClutchDisengage(status)
  64. use SimulationVariables !@
  65. implicit none
  66. integer, intent (in) :: status
  67. ! if(associated(ClutchDisengagePtr)) call ClutchDisengagePtr(status)
  68. if(status == Clear_StatusType) data%State%Drawworks%ClutchDisengageMalf=0
  69. if(status == Executed_StatusType) data%State%Drawworks%ClutchDisengageMalf=1
  70. endsubroutine
  71. end module CHoistingProblems