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.

CAccumulator.i90 3.2 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/RigSpecifications/CAccumulator.f90"
  2. module CAccumulator
  3. use SimulationVariables
  4. ! use CAccumulatorVariables
  5. use json_module
  6. implicit none
  7. public
  8. contains
  9. subroutine AccumulatorFromJson(parent)
  10. use json_module,IK =>json_ik
  11. type(json_value),pointer :: parent
  12. type(json_core) :: json
  13. type(json_value),pointer :: p,pitem,pval
  14. logical::is_found
  15. integer::i,n_children
  16. CHARACTER(KIND=JSON_CK, LEN=:), ALLOCATABLE :: val
  17. call json%get(parent,'Accumulator',p)
  18. call json%get(p,'NumberOfBottels',pval)
  19. call json%get(pval,data%Configuration%Accumulator%NumberOfBottels)
  20. call json%get(p,'AccumulatorSystemSize',pval)
  21. call json%get(pval,data%Configuration%Accumulator%AccumulatorSystemSize)
  22. call json%get(p,'OilTankVolume',pval)
  23. call json%get(pval,data%Configuration%Accumulator%OilTankVolume)
  24. call json%get(p,'PrechargePressure',pval)
  25. call json%get(pval,data%Configuration%Accumulator%PrechargePressure)
  26. call json%get(p,'AccumulatorMinimumOperatingPressure',pval)
  27. call json%get(pval,data%Configuration%Accumulator%AccumulatorMinimumOperatingPressure)
  28. call json%get(p,'ElectricPumpOutput',pval)
  29. call json%get(pval,data%Configuration%Accumulator%ElectricPumpOutput)
  30. call json%get(p,'StartPressure',pval)
  31. call json%get(pval,data%Configuration%Accumulator%StartPressure)
  32. call json%get(p,'StopPressure',pval)
  33. call json%get(pval,data%Configuration%Accumulator%StopPressure)
  34. call json%get(p,'AirPlungerPumpOutput',pval)
  35. call json%get(pval,data%Configuration%Accumulator%AirPlungerPumpOutput)
  36. call json%get(p,'StartPressure2',pval)
  37. call json%get(pval,data%Configuration%Accumulator%StartPressure2)
  38. call json%get(p,'StopPressure2',pval)
  39. call json%get(pval,data%Configuration%Accumulator%StopPressure2)
  40. end subroutine
  41. subroutine AccumulatorToJson(parent)
  42. type(json_value),pointer :: parent
  43. type(json_core) :: json
  44. type(json_value),pointer :: p
  45. call json%create_object(p,'Accumulator')
  46. call json%add(p,'AccumulatorMinimumOperatingPressure',data%Configuration%Accumulator%AccumulatorMinimumOperatingPressure)
  47. call json%add(p,'AccumulatorSystemSize',data%Configuration%Accumulator%AccumulatorSystemSize)
  48. call json%add(p,'AirPlungerPumpOutput',data%Configuration%Accumulator%AirPlungerPumpOutput)
  49. call json%add(p,'ElectricPumpOutput',data%Configuration%Accumulator%ElectricPumpOutput)
  50. call json%add(p,'NumberOfBottels',data%Configuration%Accumulator%NumberOfBottels)
  51. call json%add(p,'OilTankVolume',data%Configuration%Accumulator%OilTankVolume)
  52. call json%add(p,'PrechargePressure',data%Configuration%Accumulator%PrechargePressure)
  53. call json%add(p,'StartPressure',data%Configuration%Accumulator%StartPressure)
  54. call json%add(p,'StartPressure2',data%Configuration%Accumulator%StartPressure2)
  55. call json%add(p,'StopPressure',data%Configuration%Accumulator%StopPressure)
  56. call json%add(p,'StopPressure2',data%Configuration%Accumulator%StopPressure2)
  57. call json%add(parent,p)
  58. end subroutine
  59. end module CAccumulator