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.

CHoisting.f90 2.2 KiB

1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. module CHoisting
  2. use SimulationVariables
  3. use json_module
  4. implicit none
  5. public
  6. contains
  7. subroutine HoistingFromJson(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,'Hoisting',p)
  16. call json%get(p,'DriveType',pval)
  17. call json%get(pval,data%Configuration%Hoisting%DriveType)
  18. call json%get(p,'TravelingBlockWeight',pval)
  19. call json%get(pval,data%Configuration%Hoisting%TravelingBlockWeight)
  20. call json%get(p,'TopDriveWeight',pval)
  21. call json%get(pval,data%Configuration%Hoisting%TopDriveWeight)
  22. call json%get(p,'KellyWeight',pval)
  23. call json%get(pval,data%Configuration%Hoisting%KellyWeight)
  24. call json%get(p,'NumberOfLine',pval)
  25. call json%get(pval,data%Configuration%Hoisting%NumberOfLine)
  26. call json%get(p,'DrillingLineBreakingLoad',pval)
  27. call json%get(pval,data%Configuration%Hoisting%DrillingLineBreakingLoad)
  28. !@@@
  29. data%Configuration%Hoisting%NumberOfLine = 10
  30. end subroutine
  31. subroutine HoistingToJson(parent)
  32. type(json_value),pointer :: parent
  33. type(json_core) :: json
  34. type(json_value),pointer :: p
  35. ! 1. create new node
  36. call json%create_object(p,'Hoisting')
  37. ! 2. add member of data type to new node
  38. ! call StringConfigurationToJson(p)
  39. ! call FormationToJson(p)
  40. call json%add(p,"DrillingLineBreakingLoad",data%Configuration%Hoisting%DrillingLineBreakingLoad)
  41. call json%add(p,"DriveType",data%Configuration%Hoisting%DriveType)
  42. call json%add(p,"KellyWeight",data%Configuration%Hoisting%KellyWeight)
  43. call json%add(p,"NumberOfLine",data%Configuration%Hoisting%NumberOfLine)
  44. call json%add(p,"TopDriveWeight",data%Configuration%Hoisting%TopDriveWeight)
  45. call json%add(p,"TravelingBlockWeight",data%Configuration%Hoisting%TravelingBlockWeight)
  46. ! 3. add new node to parent
  47. call json%add(parent,p)
  48. end subroutine
  49. end module CHoisting