You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,12 @@
1
1
json-fortran
2
2
============
3
3
4
-
Project Name
5
-
---------------
6
-
7
-
Fortran 2003/2008 JSON API
4
+
A Fortran 2003/2008 JSON API
8
5
9
6
Brief Description
10
7
---------------
11
8
12
-
A mostlycomplete API for reading and writing JSON files, written in modern Fortran. The code requires a Fortran compiler that supports various Fortran 2003 and Fortran 2008 features such as: allocatable strings, associate, newunit, generic, class, and abstract interface. I am using the Intel Fortran compiler 13.1.0 on Linux (the Mac and PC versions should also work fine). It does not currently compile with the gnu gfortran compiler.
9
+
A mostly-complete API for reading and writing JSON files, written in modern Fortran. The code requires a Fortran compiler that supports various Fortran 2003 and Fortran 2008 features such as: allocatable strings, associate, newunit, generic, class, and abstract interface. I am using the Intel Fortran compiler 13.1.0 on Linux (the Mac and PC versions should also work fine). It does not currently compile with the gnu gfortran compiler.
13
10
14
11
Reading a JSON file
15
12
---------------
@@ -22,7 +19,7 @@ Reading a JSON file and getting data from it is fairly straightforward. Here is
22
19
23
20
type(json_file) :: json
24
21
logical :: found
25
-
integer :: ival
22
+
integer :: i,j,k
26
23
27
24
! initialize the module
28
25
call json_initialize()
@@ -35,8 +32,9 @@ Reading a JSON file and getting data from it is fairly straightforward. Here is
35
32
36
33
! extract data from the parsed value
37
34
! [found can be used to check if the data was really there]
38
-
call json%get('version.major', ival, found)
39
-
call json%get('version.minor', ival, found)
35
+
call json%get('version.major', i, found)
36
+
call json%get('version.minor', j, found)
37
+
call json%get('data(1).number', k, found)
40
38
41
39
! clean up
42
40
call json%destroy()
@@ -93,7 +91,7 @@ Writing a json file is slightly more complicated and involves the use of pointer
93
91
Other Comments
94
92
---------------
95
93
96
-
This code is a fork and extensive upgrade of the FSON code that can be found at: https://github.com/josephalevin/fson
94
+
This code is a fork and extensive upgrade of the FSON code that can be found at: <https://github.com/josephalevin/fson>. It includes many features that the original code did not have, and fixes many of that codes bugs.
0 commit comments