Simulation Core
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

CKickProblems.i90 3.5 KiB

1 ano atrás
1 ano atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Problems/CKickProblems.f90"
  2. module CKickProblems
  3. use SimulationVariables
  4. implicit none
  5. public
  6. !constants
  7. ! integer :: Gas_FluidType = 0
  8. ! integer :: Oil_FluidType = 1
  9. ! integer :: Water_FluidType = 2
  10. contains
  11. subroutine KickProblemsFromJson(parent)
  12. type(json_value),pointer :: parent
  13. type(json_core) :: json
  14. type(json_value),pointer :: p,pval
  15. call json%get(parent,'KickProblems',p)
  16. call ProblemFromJson(p,"Kick",data%problems%KickProblems%Kick)
  17. call json%get(p,'FluidType',pval)
  18. call json%get(pval,data%problems%KickProblems%FluidType)
  19. call json%get(p,'FlowRate',pval)
  20. call json%get(pval,data%problems%KickProblems%FlowRate)
  21. call json%get(p,'OverBalancePressure',pval)
  22. call json%get(pval,data%problems%KickProblems%OverBalancePressure)
  23. call json%get(p,'IsAutoMigrationRateSelected',pval)
  24. call json%get(pval,data%problems%KickProblems%IsAutoMigrationRateSelected)
  25. call json%get(p,'AutoMigrationRate',pval)
  26. call json%get(pval,data%problems%KickProblems%AutoMigrationRate)
  27. end subroutine
  28. subroutine KickProblemsToJson(parent)
  29. type(json_value),pointer :: parent
  30. type(json_core) :: json
  31. type(json_value),pointer :: p
  32. ! 1. create new node
  33. call json%create_object(p,'KickProblems')
  34. call ProblemToJson(p,"Kick",data%problems%KickProblems%Kick)
  35. call json%add(p,"FluidType",data%problems%KickProblems%FluidType)
  36. call json%add(p,"FlowRate",data%problems%KickProblems%FlowRate)
  37. call json%add(p,"OverBalancePressure",data%problems%KickProblems%OverBalancePressure)
  38. call json%add(p,"IsAutoMigrationRateSelected",data%problems%KickProblems%IsAutoMigrationRateSelected)
  39. call json%add(p,"AutoMigrationRate",data%problems%KickProblems%AutoMigrationRate) ! 2. add member of data type to new node
  40. ! 3. add new node to parent
  41. call json%add(parent,p)
  42. end subroutine
  43. subroutine ProcessKickProblemsDueTime(time)
  44. implicit none
  45. integer :: time
  46. if(data%problems%KickProblems%Kick%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%KickProblems%Kick, ChangeKick, time)
  47. end subroutine
  48. subroutine ProcessKickProblemsDuePumpStrokes(strokes)
  49. implicit none
  50. integer :: strokes
  51. if(data%problems%KickProblems%Kick%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%KickProblems%Kick, ChangeKick, strokes)
  52. end subroutine
  53. subroutine ProcessKickProblemsDueVolumePumped(volume)
  54. implicit none
  55. real(8) :: volume
  56. if(data%problems%KickProblems%Kick%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%KickProblems%Kick, ChangeKick, volume)
  57. end subroutine
  58. subroutine ProcessKickProblemsDueDistanceDrilled(distance)
  59. implicit none
  60. real(8) :: distance
  61. if(data%problems%KickProblems%Kick%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%KickProblems%Kick, ChangeKick, distance)
  62. end subroutine
  63. subroutine ChangeKick(status)
  64. implicit none
  65. integer, intent (in) :: status
  66. ! if(associated(data%problems%KickProblems%KickPtr)) call data%problems%KickProblems%KickPtr(status)
  67. !if(status == Clear_StatusType) if(print_log) print*,'On_Kick_Clear'
  68. !if(status == Executed_StatusType) if(print_log) print*,'On_Kick_Execute'
  69. endsubroutine
  70. end module CKickProblems