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.
 
 
 
 
 
 

70 lines
3.2 KiB

  1. module CReservoir
  2. use SimulationVariables
  3. use json_module
  4. implicit none
  5. contains
  6. subroutine ReservoirFromJson(parent)
  7. type(json_value),pointer :: parent
  8. type(json_core) :: json
  9. type(json_value),pointer :: p,pval
  10. call json%get(parent,'Reservoir',p)
  11. call json%get(p,'FormationNo',pval)
  12. call json%get(pval,data%Configuration%Reservoir%FormationNo)
  13. call json%get(p,'FormationTop',pval)
  14. call json%get(pval,data%Configuration%Reservoir%FormationTop)
  15. call json%get(p,'PressureGradient',pval)
  16. call json%get(pval,data%Configuration%Reservoir%PressureGradient)
  17. call json%get(p,'FormationPermeability',pval)
  18. call json%get(pval,data%Configuration%Reservoir%FormationPermeability)
  19. call json%get(p,'GeothermalGradient',pval)
  20. call json%get(pval,data%Configuration%Reservoir%GeothermalGradient)
  21. call json%get(p,'FluidType',pval)
  22. call json%get(pval,data%Configuration%Reservoir%FluidType)
  23. call json%get(p,'FluidGradient',pval)
  24. call json%get(pval,data%Configuration%Reservoir%FluidGradient)
  25. call json%get(p,'FluidViscosity',pval)
  26. call json%get(pval,data%Configuration%Reservoir%FluidViscosity)
  27. call json%get(p,'InactiveInflux',pval)
  28. call json%get(pval,data%Configuration%Reservoir%InactiveInflux)
  29. call json%get(p,'IsAutoMigrationRateSelected',pval)
  30. call json%get(pval,data%Configuration%Reservoir%IsAutoMigrationRateSelected)
  31. call json%get(p,'AutoMigrationRate',pval)
  32. call json%get(pval,data%Configuration%Reservoir%AutoMigrationRate)
  33. call json%get(p,'MakeKickSinglePacket',pval)
  34. call json%get(pval,data%Configuration%Reservoir%MakeKickSinglePacket)
  35. end subroutine
  36. subroutine ReservoirToJson(parent)
  37. type(json_value),pointer :: parent
  38. type(json_core) :: json
  39. type(json_value),pointer :: p
  40. ! 1. create new node
  41. call json%create_object(p,'Reservoir')
  42. ! 2. add member of data type to new node
  43. ! call StringConfigurationToJson(p)
  44. ! call FormationToJson(p)
  45. call json%add(p,"AutoMigrationRate",data%Configuration%Reservoir%AutoMigrationRate)
  46. call json%add(p,"FluidGradient",data%Configuration%Reservoir%FluidGradient)
  47. call json%add(p,"FluidType",data%Configuration%Reservoir%FluidType)
  48. call json%add(p,"FluidViscosity",data%Configuration%Reservoir%FluidViscosity)
  49. call json%add(p,"FormationNo",data%Configuration%Reservoir%FormationNo)
  50. call json%add(p,"FormationPermeability",data%Configuration%Reservoir%FormationPermeability)
  51. call json%add(p,"FormationTop",data%Configuration%Reservoir%FormationTop)
  52. call json%add(p,"GeothermalGradient",data%Configuration%Reservoir%GeothermalGradient)
  53. call json%add(p,"InactiveInflux",data%Configuration%Reservoir%InactiveInflux)
  54. call json%add(p,"IsAutoMigrationRateSelected",data%Configuration%Reservoir%IsAutoMigrationRateSelected)
  55. call json%add(p,"MakeKickSinglePacket",data%Configuration%Reservoir%MakeKickSinglePacket)
  56. call json%add(p,"PressureGradient",data%Configuration%Reservoir%PressureGradient)
  57. ! 3. add new node to parent
  58. call json%add(parent,p)
  59. end subroutine
  60. end module CReservoir