@@ -1018,8 +1018,15 @@ end subroutine json_file_move_pointer
1018
1018
! # Example
1019
1019
!
1020
1020
! ```fortran
1021
- ! type(json_file) :: f
1022
- ! call f%load_file('my_file.json')
1021
+ ! program main
1022
+ ! use json_module
1023
+ ! implicit none
1024
+ ! type(json_file) :: f
1025
+ ! call json_initialize()
1026
+ ! call f%load_file('my_file.json')
1027
+ ! !...
1028
+ ! call f%destroy()
1029
+ ! end program main
1023
1030
! ```
1024
1031
1025
1032
subroutine json_file_load (me , filename , unit )
@@ -1028,7 +1035,7 @@ subroutine json_file_load(me, filename, unit)
1028
1035
1029
1036
class(json_file),intent (inout ) :: me
1030
1037
character (kind= CDK,len=* ),intent (in ) :: filename ! ! the filename to open
1031
- integer (IK),intent (in ),optional :: unit ! ! the unit number to use
1038
+ integer (IK),intent (in ),optional :: unit ! ! the unit number to use (if not present, a newunit is used)
1032
1039
1033
1040
call json_parse(file= filename, p= me% p, unit= unit)
1034
1041
@@ -1770,7 +1777,7 @@ subroutine json_throw_exception(msg)
1770
1777
! call backtrace() ! gfortran (use -fbacktrace -fall-intrinsics flags)
1771
1778
! call tracebackqq(-1) ! intel (requires "use ifcore" in this routine)
1772
1779
write (* ,' (A)' ) ' ***********************'
1773
- end if
1780
+ end if
1774
1781
1775
1782
end subroutine json_throw_exception
1776
1783
! *****************************************************************************************
0 commit comments