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.
 
 
 
 
 
 

56 lines
1.9 KiB

  1. module CShoe
  2. use SimulationVariables
  3. use json_module
  4. implicit none
  5. public
  6. contains
  7. subroutine ShoeFromJson(parent)
  8. use json_module,IK =>json_ik
  9. type(json_value),pointer :: parent
  10. type(json_core) :: json
  11. type(json_value),pointer :: p,pitem,pval
  12. logical::is_found
  13. integer::i,n_children
  14. CHARACTER(KIND=JSON_CK, LEN=:), ALLOCATABLE :: val
  15. call json%get(parent,'Shoe',p)
  16. call json%get(p,'FormationNo',pval)
  17. call json%get(pval,data%Configuration%Shoe%FormationNo)
  18. call json%get(p,'ShoeDepth',pval)
  19. call json%get(pval,data%Configuration%Shoe%ShoeDepth)
  20. call json%get(p,'LeakOff',pval)
  21. call json%get(pval,data%Configuration%Shoe%LeakOff)
  22. call json%get(p,'Breakdown',pval)
  23. call json%get(pval,data%Configuration%Shoe%Breakdown)
  24. call json%get(p,'FracturePropagation',pval)
  25. call json%get(pval,data%Configuration%Shoe%FracturePropagation)
  26. call json%get(p,'InactiveFracture',pval)
  27. call json%get(pval,data%Configuration%Shoe%InactiveFracture)
  28. end subroutine
  29. subroutine ShoeToJson(parent)
  30. type(json_value),pointer :: parent
  31. type(json_core) :: json
  32. type(json_value),pointer :: p
  33. ! 1. create new node
  34. call json%create_object(p,'Shoe')
  35. ! 2. add member of data type to new node
  36. call json%add(p,"Breakdown",data%Configuration%Shoe%Breakdown)
  37. call json%add(p,"FormationNo",data%Configuration%Shoe%FormationNo)
  38. call json%add(p,"FracturePropagation",data%Configuration%Shoe%FracturePropagation)
  39. call json%add(p,"InactiveFracture",data%Configuration%Shoe%InactiveFracture)
  40. call json%add(p,"LeakOff",data%Configuration%Shoe%LeakOff)
  41. call json%add(p,"ShoeDepth",data%Configuration%Shoe%ShoeDepth)
  42. ! 3. add new node to parent
  43. call json%add(parent,p)
  44. end subroutine
  45. end module CShoe