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.f90 3.1 KiB

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