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.
 
 
 
 
 
 

28 lines
1.1 KiB

  1. program RedisInterface
  2. use json_module
  3. use CStringConfigurationVariables
  4. type(json_file) :: jsonfile
  5. type(json_value),pointer :: jsonvalue,jsonvalue2,child,child2,jsonvalue3
  6. type(json_core) :: jsoncore
  7. logical :: is_found
  8. integer ::n_children,i,j
  9. type(CStringItem), allocatable :: StringConfigurations(:)
  10. call jsonfile%initialize()
  11. call jsonfile%load_file('data-witharray.json'); if (jsonfile%failed()) stop
  12. call jsonfile%json_file_get_root(jsonvalue)
  13. call jsoncore%get(jsonvalue,'Configuration',jsonvalue2)
  14. call jsoncore%get(jsonvalue2,'StringConfiguration',jsonvalue)
  15. call jsoncore%get(jsonvalue,'StringConfigurationItems',jsonvalue2)
  16. call jsoncore%info(jsonvalue2, n_children=n_children)
  17. do i=1,n_children
  18. call jsoncore%get_child(jsonvalue2, i, child, found=is_found)
  19. if (.not. is_found) print *,"not found"
  20. call jsoncore%get(child,"BitCodeHundreds",child2)
  21. call jsoncore%get(child2,j)
  22. print *,"BitCodeHundreds=",j
  23. end do
  24. print *,"n_children=",n_children
  25. call jsonfile%destroy()
  26. end program