Skip to content
Jacob Williams edited this page Jul 11, 2019 · 3 revisions

To set various options for parsing, file format, and data access, use the optional arguments to the various initialize() routines. See the documentation for json_initialize() for details.

Example

program main

  use json_module
  implicit none

  type(json_file) :: json

  ! to parse a JSON file with "#" comments, and if 
  ! there are any errors, then stop immediately:
  call json%initialize(stop_on_error = .true., &
                       comment_char = '#')

  call json%load(filename='myfile.json') ! load the file
  call json%print()   ! print to the console
  call json%destroy() ! free memory

end program main