json_file_load Subroutine

private subroutine json_file_load(me, filename, unit)

Load the JSON data from a file.

Example

     program main
      use json_module
      implicit none
      type(json_file) :: f
      call f%load_file('my_file.json')
      !...
      call f%destroy()
     end program main

Arguments

Type IntentOptional AttributesName
class(json_file), intent(inout) :: me
character(kind=CDK,len=*), intent(in) :: filename

the filename to open

integer(kind=IK), intent(in), optional :: unit

the unit number to use (if not present, a newunit is used)


Contents

Source Code


Source Code

    subroutine json_file_load(me, filename, unit)

    implicit none

    class(json_file),intent(inout)       :: me
    character(kind=CDK,len=*),intent(in) :: filename  !! the filename to open
    integer(IK),intent(in),optional      :: unit      !! the unit number to use
                                                      !! (if not present, a newunit
                                                      !! is used)

    call me%core%parse(file=filename, p=me%p, unit=unit)

    end subroutine json_file_load