Load the JSON data from a file.
program main
use json_module
implicit none
type(json_file) :: f
call f%load('my_file.json')
!...
call f%destroy()
end program main
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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) |
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%load(file=filename, p=me%p, unit=unit)
end subroutine json_file_load