Skip to content

Commit db67dc9

Browse files
committed
Renamed all the internal routines to use the more generic term "real" instead of "double".
The only two public uses of "double" (create_double and json_double) are still there for backward compatibility.
1 parent c4d4409 commit db67dc9

File tree

7 files changed

+215
-199
lines changed

7 files changed

+215
-199
lines changed

src/json_file_module.F90

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ module json_file_module
116116
#ifndef REAL32
117117
MAYBEWRAP(json_file_get_real32), &
118118
#endif
119-
MAYBEWRAP(json_file_get_double), &
119+
MAYBEWRAP(json_file_get_real), &
120120
#ifdef REAL128
121121
MAYBEWRAP(json_file_get_real64), &
122122
#endif
@@ -126,7 +126,7 @@ module json_file_module
126126
#ifndef REAL32
127127
MAYBEWRAP(json_file_get_real32_vec), &
128128
#endif
129-
MAYBEWRAP(json_file_get_double_vec), &
129+
MAYBEWRAP(json_file_get_real_vec), &
130130
#ifdef REAL128
131131
MAYBEWRAP(json_file_get_real64_vec), &
132132
#endif
@@ -157,7 +157,7 @@ module json_file_module
157157
#ifndef REAL32
158158
MAYBEWRAP(json_file_add_real32), &
159159
#endif
160-
MAYBEWRAP(json_file_add_double), &
160+
MAYBEWRAP(json_file_add_real), &
161161
#ifdef REAL128
162162
MAYBEWRAP(json_file_add_real64), &
163163
#endif
@@ -167,7 +167,7 @@ module json_file_module
167167
#ifndef REAL32
168168
MAYBEWRAP(json_file_add_real32_vec), &
169169
#endif
170-
MAYBEWRAP(json_file_add_double_vec), &
170+
MAYBEWRAP(json_file_add_real_vec), &
171171
#ifdef REAL128
172172
MAYBEWRAP(json_file_add_real64_vec), &
173173
#endif
@@ -248,7 +248,7 @@ module json_file_module
248248
#ifndef REAL32
249249
procedure :: MAYBEWRAP(json_file_get_real32)
250250
#endif
251-
procedure :: MAYBEWRAP(json_file_get_double)
251+
procedure :: MAYBEWRAP(json_file_get_real)
252252
#ifdef REAL128
253253
procedure :: MAYBEWRAP(json_file_get_real64)
254254
#endif
@@ -258,7 +258,7 @@ module json_file_module
258258
#ifndef REAL32
259259
procedure :: MAYBEWRAP(json_file_get_real32_vec)
260260
#endif
261-
procedure :: MAYBEWRAP(json_file_get_double_vec)
261+
procedure :: MAYBEWRAP(json_file_get_real_vec)
262262
#ifdef REAL128
263263
procedure :: MAYBEWRAP(json_file_get_real64_vec)
264264
#endif
@@ -273,7 +273,7 @@ module json_file_module
273273
#ifndef REAL32
274274
procedure :: MAYBEWRAP(json_file_add_real32)
275275
#endif
276-
procedure :: MAYBEWRAP(json_file_add_double)
276+
procedure :: MAYBEWRAP(json_file_add_real)
277277
#ifdef REAL128
278278
procedure :: MAYBEWRAP(json_file_add_real64)
279279
#endif
@@ -283,7 +283,7 @@ module json_file_module
283283
#ifndef REAL32
284284
procedure :: MAYBEWRAP(json_file_add_real32_vec)
285285
#endif
286-
procedure :: MAYBEWRAP(json_file_add_double_vec)
286+
procedure :: MAYBEWRAP(json_file_add_real_vec)
287287
#ifdef REAL128
288288
procedure :: MAYBEWRAP(json_file_add_real64_vec)
289289
#endif
@@ -1404,7 +1404,7 @@ end subroutine wrap_json_file_get_integer_vec
14041404
!
14051405
! Get a real(RK) variable value from a JSON file.
14061406

1407-
subroutine json_file_get_double (me, path, val, found)
1407+
subroutine json_file_get_real (me, path, val, found)
14081408

14091409
implicit none
14101410

@@ -1415,14 +1415,14 @@ subroutine json_file_get_double (me, path, val, found)
14151415

14161416
call me%core%get(me%p, path=path, value=val, found=found)
14171417

1418-
end subroutine json_file_get_double
1418+
end subroutine json_file_get_real
14191419
!*****************************************************************************************
14201420

14211421
!*****************************************************************************************
14221422
!>
1423-
! Alternate version of [[json_file_get_double]], where "path" is kind=CDK.
1423+
! Alternate version of [[json_file_get_real]], where "path" is kind=CDK.
14241424

1425-
subroutine wrap_json_file_get_double (me, path, val, found)
1425+
subroutine wrap_json_file_get_real (me, path, val, found)
14261426

14271427
implicit none
14281428

@@ -1433,7 +1433,7 @@ subroutine wrap_json_file_get_double (me, path, val, found)
14331433

14341434
call me%get(to_unicode(path), val, found)
14351435

1436-
end subroutine wrap_json_file_get_double
1436+
end subroutine wrap_json_file_get_real
14371437
!*****************************************************************************************
14381438

14391439
!*****************************************************************************************
@@ -1442,7 +1442,7 @@ end subroutine wrap_json_file_get_double
14421442
!
14431443
! Get a real(RK) vector from a JSON file.
14441444

1445-
subroutine json_file_get_double_vec(me, path, vec, found)
1445+
subroutine json_file_get_real_vec(me, path, vec, found)
14461446

14471447
implicit none
14481448

@@ -1453,14 +1453,14 @@ subroutine json_file_get_double_vec(me, path, vec, found)
14531453

14541454
call me%core%get(me%p, path, vec, found)
14551455

1456-
end subroutine json_file_get_double_vec
1456+
end subroutine json_file_get_real_vec
14571457
!*****************************************************************************************
14581458

14591459
!*****************************************************************************************
14601460
!>
1461-
! Alternate version of [[json_file_get_double_vec]], where "path" is kind=CDK.
1461+
! Alternate version of [[json_file_get_real_vec]], where "path" is kind=CDK.
14621462

1463-
subroutine wrap_json_file_get_double_vec(me, path, vec, found)
1463+
subroutine wrap_json_file_get_real_vec(me, path, vec, found)
14641464

14651465
implicit none
14661466

@@ -1471,15 +1471,15 @@ subroutine wrap_json_file_get_double_vec(me, path, vec, found)
14711471

14721472
call me%get(to_unicode(path), vec, found)
14731473

1474-
end subroutine wrap_json_file_get_double_vec
1474+
end subroutine wrap_json_file_get_real_vec
14751475
!*****************************************************************************************
14761476

14771477
#ifndef REAL32
14781478
!*****************************************************************************************
14791479
!> author: Jacob Williams
14801480
! date: 1/21/2019
14811481
!
1482-
! Alternate version of [[json_file_get_double]] where `val` is `real32`.
1482+
! Alternate version of [[json_file_get_real]] where `val` is `real32`.
14831483

14841484
subroutine json_file_get_real32 (me, path, val, found)
14851485

@@ -1517,7 +1517,7 @@ end subroutine wrap_json_file_get_real32
15171517
!> author: Jacob Williams
15181518
! date: 1/21/2019
15191519
!
1520-
! Alternate version of [[json_file_get_double_vec]] where `vec` is `real32`.
1520+
! Alternate version of [[json_file_get_real_vec]] where `vec` is `real32`.
15211521

15221522
subroutine json_file_get_real32_vec(me, path, vec, found)
15231523

@@ -1557,7 +1557,7 @@ end subroutine wrap_json_file_get_real32_vec
15571557
!> author: Jacob Williams
15581558
! date: 1/21/2019
15591559
!
1560-
! Alternate version of [[json_file_get_double]] where `val` is `real64`.
1560+
! Alternate version of [[json_file_get_real]] where `val` is `real64`.
15611561

15621562
subroutine json_file_get_real64 (me, path, val, found)
15631563

@@ -1595,7 +1595,7 @@ end subroutine wrap_json_file_get_real64
15951595
!> author: Jacob Williams
15961596
! date: 1/21/2019
15971597
!
1598-
! Alternate version of [[json_file_get_double_vec]] where `vec` is `real64`.
1598+
! Alternate version of [[json_file_get_real_vec]] where `vec` is `real64`.
15991599

16001600
subroutine json_file_get_real64_vec(me, path, vec, found)
16011601

@@ -1960,7 +1960,7 @@ end subroutine wrap_json_file_add_integer_vec
19601960
!
19611961
! Add a real(RK) variable value to a JSON file.
19621962

1963-
subroutine json_file_add_double(me,path,val,found,was_created)
1963+
subroutine json_file_add_real(me,path,val,found,was_created)
19641964

19651965
implicit none
19661966

@@ -1974,15 +1974,15 @@ subroutine json_file_add_double(me,path,val,found,was_created)
19741974

19751975
call me%core%add_by_path(me%p,path,val,found,was_created)
19761976

1977-
end subroutine json_file_add_double
1977+
end subroutine json_file_add_real
19781978
!*****************************************************************************************
19791979

19801980
!*****************************************************************************************
19811981
!> author: Jacob Williams
19821982
!
1983-
! Alternate version of [[json_file_add_double]], where "path" is kind=CDK.
1983+
! Alternate version of [[json_file_add_real]], where "path" is kind=CDK.
19841984

1985-
subroutine wrap_json_file_add_double(me,path,val,found,was_created)
1985+
subroutine wrap_json_file_add_real(me,path,val,found,was_created)
19861986

19871987
implicit none
19881988

@@ -1992,17 +1992,17 @@ subroutine wrap_json_file_add_double(me,path,val,found,was_created)
19921992
logical(LK),intent(out),optional :: found !! if the variable was found
19931993
logical(LK),intent(out),optional :: was_created !! if the variable had to be created
19941994

1995-
call me%json_file_add_double(to_unicode(path),val,found,was_created)
1995+
call me%json_file_add_real(to_unicode(path),val,found,was_created)
19961996

1997-
end subroutine wrap_json_file_add_double
1997+
end subroutine wrap_json_file_add_real
19981998
!*****************************************************************************************
19991999

20002000
!*****************************************************************************************
20012001
!> author: Jacob Williams
20022002
!
20032003
! Add a real(RK) vector to a JSON file.
20042004

2005-
subroutine json_file_add_double_vec(me,path,vec,found,was_created)
2005+
subroutine json_file_add_real_vec(me,path,vec,found,was_created)
20062006

20072007
implicit none
20082008

@@ -2016,15 +2016,15 @@ subroutine json_file_add_double_vec(me,path,vec,found,was_created)
20162016

20172017
call me%core%add_by_path(me%p,path,vec,found,was_created)
20182018

2019-
end subroutine json_file_add_double_vec
2019+
end subroutine json_file_add_real_vec
20202020
!*****************************************************************************************
20212021

20222022
!*****************************************************************************************
20232023
!> author: Jacob Williams
20242024
!
2025-
! Alternate version of [[json_file_add_double_vec]], where "path" is kind=CDK.
2025+
! Alternate version of [[json_file_add_real_vec]], where "path" is kind=CDK.
20262026

2027-
subroutine wrap_json_file_add_double_vec(me,path,vec,found,was_created)
2027+
subroutine wrap_json_file_add_real_vec(me,path,vec,found,was_created)
20282028

20292029
implicit none
20302030

@@ -2034,16 +2034,16 @@ subroutine wrap_json_file_add_double_vec(me,path,vec,found,was_created)
20342034
logical(LK),intent(out),optional :: found !! if the variable was found
20352035
logical(LK),intent(out),optional :: was_created !! if the variable had to be created
20362036

2037-
call me%json_file_add_double_vec(to_unicode(path),vec,found,was_created)
2037+
call me%json_file_add_real_vec(to_unicode(path),vec,found,was_created)
20382038

2039-
end subroutine wrap_json_file_add_double_vec
2039+
end subroutine wrap_json_file_add_real_vec
20402040
!*****************************************************************************************
20412041

20422042
#ifndef REAL32
20432043
!*****************************************************************************************
20442044
!> author: Jacob Williams
20452045
!
2046-
! Alternate version of [[json_file_add_double]] where `val` is `real32`.
2046+
! Alternate version of [[json_file_add_real]] where `val` is `real32`.
20472047

20482048
subroutine json_file_add_real32(me,path,val,found,was_created)
20492049

@@ -2083,7 +2083,7 @@ end subroutine wrap_json_file_add_real32
20832083
!*****************************************************************************************
20842084
!> author: Jacob Williams
20852085
!
2086-
! Alternate version of [[json_file_add_double_vec]] where `vec` is `real32`.
2086+
! Alternate version of [[json_file_add_real_vec]] where `vec` is `real32`.
20872087

20882088
subroutine json_file_add_real32_vec(me,path,vec,found,was_created)
20892089

@@ -2125,7 +2125,7 @@ end subroutine wrap_json_file_add_real32_vec
21252125
!*****************************************************************************************
21262126
!> author: Jacob Williams
21272127
!
2128-
! Alternate version of [[json_file_add_double]] where `val` is `real64`.
2128+
! Alternate version of [[json_file_add_real]] where `val` is `real64`.
21292129

21302130
subroutine json_file_add_real64(me,path,val,found,was_created)
21312131

@@ -2165,7 +2165,7 @@ end subroutine wrap_json_file_add_real64
21652165
!*****************************************************************************************
21662166
!> author: Jacob Williams
21672167
!
2168-
! Alternate version of [[json_file_add_double_vec]] where `vec` is `real64`.
2168+
! Alternate version of [[json_file_add_real_vec]] where `vec` is `real64`.
21692169

21702170
subroutine json_file_add_real64_vec(me,path,vec,found,was_created)
21712171

@@ -2600,9 +2600,6 @@ end subroutine wrap_json_file_update_logical
26002600
! Given the path string, if the variable is present in the file,
26012601
! and is a scalar, then update its value.
26022602
! If it is not present, then create it and set its value.
2603-
!
2604-
!### See also
2605-
! * [[json_update_double]]
26062603

26072604
subroutine json_file_update_real(me,path,val,found)
26082605

src/json_module.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ module json_module
6565
json_array, &
6666
json_logical,&
6767
json_integer,&
68+
json_real, &
6869
json_double, &
6970
json_string
7071
use json_value_module

src/json_parameters.F90

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ module json_parameters
2929
!! (see [[json_file_variable_info]] and [[json_info]])
3030
integer(IK),parameter :: json_array = 3 !! Array JSON data type
3131
!! (see [[json_file_variable_info]] and [[json_info]])
32-
integer(IK),parameter :: json_logical = 4 !! Logical JSON data type
32+
integer(IK),parameter :: json_logical = 4 !! Logical JSON data type (`logical(LK)`)
3333
!! (see [[json_file_variable_info]] and [[json_info]])
34-
integer(IK),parameter :: json_integer = 5 !! Integer JSON data type
34+
integer(IK),parameter :: json_integer = 5 !! Integer JSON data type (`integer(IK)`)
35+
!! (see [[json_file_variable_info]] and [[json_info]]).
36+
integer(IK),parameter :: json_real = 6 !! Real number JSON data type (`real(RK)`)
3537
!! (see [[json_file_variable_info]] and [[json_info]])
36-
integer(IK),parameter :: json_double = 6 !! Double JSON data type
38+
integer(IK),parameter :: json_string = 7 !! String JSON data type (`character(CK)`)
3739
!! (see [[json_file_variable_info]] and [[json_info]])
38-
integer(IK),parameter :: json_string = 7 !! String JSON data type
40+
integer(IK),parameter :: json_double = json_real !! Equivalent to `json_real` for
41+
!! backward compatibility.
3942

4043
!special JSON characters
4144
character(kind=CK,len=*),parameter :: space = CK_' ' !! space character

0 commit comments

Comments
 (0)