Skip to content

Commit 36b16d2

Browse files
committed
Unit tests now compile when changing the default real kind. Fixes #383
1 parent c012823 commit 36b16d2

17 files changed

+34
-34
lines changed

src/json_value_module.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ module json_value_module
354354
!### Example
355355
!
356356
!````fortran
357-
! use, intrinsic :: iso_fortran_env, only: output_unit, wp=>real64
358-
! use json_module
357+
! use, intrinsic :: iso_fortran_env, only: output_unit
358+
! use json_module, wp=>json_RK
359359
! type(json_core) :: json
360360
! type(json_value) :: p
361361
! call json%create_object(p,'root') ! create the root

src/tests/jf_test_01.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
module jf_test_1_mod
99

10-
use json_module
11-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
10+
use json_module, wp => json_RK
11+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1212

1313
implicit none
1414

src/tests/jf_test_02.F90

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
module jf_test_2_mod
99

10-
use json_module
11-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
10+
use json_module, wp => json_RK
11+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1212

1313
implicit none
1414

@@ -193,7 +193,7 @@ subroutine test_2(error_cnt)
193193
!trajectory variables:
194194
call add_variables_to_input(json, traj, 'Rx', 'km', 'J2000', 'EARTH', [1.0_wp, 2.0_wp, 3.0_wp], error_cnt )
195195
call add_variables_to_input(json, traj, 'Ry', 'km', 'J2000', 'EARTH', [10.0_wp, 20.0_wp, 30.0_wp], error_cnt )
196-
call add_variables_to_input(json, traj, 'Rz', 'km', 'J2000', 'EARTH', [100.0_wp, 200.0d0, 300.0_wp], error_cnt )
196+
call add_variables_to_input(json, traj, 'Rz', 'km', 'J2000', 'EARTH', [100.0_wp, 200.0_wp, 300.0_wp], error_cnt )
197197
call add_variables_to_input(json, traj, 'Vx', 'km/s', 'J2000', 'EARTH', [1.0e-3_wp, 2.0e-3_wp, 3.0e-3_wp], error_cnt )
198198
call add_variables_to_input(json, traj, 'Vy', 'km/s', 'J2000', 'EARTH', [2.0e-3_wp, 20.0e-3_wp, 3.0e-3_wp], error_cnt )
199199
call add_variables_to_input(json, traj, 'Vz', 'km/s', 'J2000', 'EARTH', [3.0e-3_wp, 30.0e-3_wp, 40.0e-3_wp], error_cnt )

src/tests/jf_test_03.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
module jf_test_3_mod
99

10-
use json_module
11-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
10+
use json_module, wp => json_RK
11+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1212

1313
implicit none
1414

src/tests/jf_test_04.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
module jf_test_4_mod
99

10-
use json_module
11-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
10+
use json_module, wp => json_RK
11+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1212

1313
implicit none
1414

src/tests/jf_test_05.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
module jf_test_5_mod
99

10-
use json_module
11-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
10+
use json_module, wp => json_RK
11+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1212

1313
implicit none
1414

src/tests/jf_test_06.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module jf_test_6_mod
99

1010
use json_module, CK => json_CK, LK => json_LK
1111
use json_parameters, only: newline
12-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
12+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1313

1414
implicit none
1515

src/tests/jf_test_07.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
module jf_test_7_mod
99

1010
use json_module
11-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
11+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1212

1313
implicit none
1414

src/tests/jf_test_08.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
! Module for the eighth unit test.
44
!
55
!# HISTORY
6-
! * Izaak Beekman : 2/18/2015 : Created (refactoried original json_example.f90 file)
6+
! * Izaak Beekman : 2/18/2015 : Created (refactored original json_example.f90 file)
77

88
module jf_test_8_mod
99

1010
use json_module
11-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
11+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1212

1313
implicit none
1414

src/tests/jf_test_09.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
module jf_test_9_mod
88

99
use json_module
10-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
10+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1111

1212
implicit none
1313

src/tests/jf_test_10.F90

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
module jf_test_10_mod
88

9-
use json_module
10-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
9+
use json_module, wp => json_RK
10+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1111

1212
implicit none
1313

@@ -176,7 +176,7 @@ subroutine test_10(error_cnt)
176176
end if
177177

178178
write(error_unit,'(A)') 'json_file_update_real [variable present]...'
179-
call f2%update('data[2].real',100.0d0,found)
179+
call f2%update('data[2].real',100.0_wp,found)
180180
if (f2%failed()) then
181181
call f2%print_error_message(error_unit)
182182
error_cnt = error_cnt + 1
@@ -189,7 +189,7 @@ subroutine test_10(error_cnt)
189189
end if
190190
end if
191191
write(error_unit,'(A)') 'json_file_update_real [variable not present]...'
192-
call f2%update('new_real',1776.0d0,found)
192+
call f2%update('new_real',1776.0_wp,found)
193193
if (f2%failed()) then
194194
call f2%print_error_message(error_unit)
195195
error_cnt = error_cnt + 1
@@ -269,7 +269,7 @@ subroutine test_10(error_cnt)
269269
end if
270270

271271
write(error_unit,'(A)') 'json_update_double...'
272-
call json%update(p,'data(2).real',-1.0d0,found)
272+
call json%update(p,'data(2).real',-1.0_wp,found)
273273
if (json%failed()) then
274274
call json%print_error_message(error_unit)
275275
error_cnt = error_cnt + 1
@@ -315,7 +315,7 @@ subroutine test_10(error_cnt)
315315
write(error_unit,'(A)') 'json_create...'
316316
write(error_unit,'(A)') 'json_create_logical...'; call json%destroy(p); call json%create_logical(p,.true.,'foo')
317317
write(error_unit,'(A)') 'json_create_integer...'; call json%destroy(p); call json%create_integer(p,1000,'foo')
318-
write(error_unit,'(A)') 'json_create_double ...'; call json%destroy(p); call json%create_double (p,9.0d0,'foo')
318+
write(error_unit,'(A)') 'json_create_double ...'; call json%destroy(p); call json%create_double (p,9.0_wp,'foo')
319319
write(error_unit,'(A)') 'json_create_string ...'; call json%destroy(p); call json%create_string (p,'foo','bar')
320320
write(error_unit,'(A)') 'json_create_null ...'; call json%destroy(p); call json%create_null (p,'foo')
321321
write(error_unit,'(A)') 'json_create_object ...'; call json%destroy(p); call json%create_object (p,'foo')

src/tests/jf_test_11.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
module jf_test_11_mod
88

9-
use json_module
10-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
9+
use json_module, wp => json_RK
10+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1111

1212
implicit none
1313

src/tests/jf_test_12.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
module jf_test_12_mod
88

9-
use json_module, CK => json_CK
10-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
9+
use json_module, CK => json_CK, wp => json_RK
10+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1111

1212
implicit none
1313

src/tests/jf_test_15.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
module jf_test_15_mod
99

10-
use json_module, CK => json_CK
11-
use, intrinsic :: iso_fortran_env , only: error_unit,output_unit,wp=>real64
10+
use json_module, CK => json_CK, wp => json_RK
11+
use, intrinsic :: iso_fortran_env , only: error_unit,output_unit
1212

1313
implicit none
1414

src/tests/jf_test_22.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module jf_test_22_mod
66

77
use json_module, CK => json_CK
8-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
8+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
99

1010
implicit none
1111

src/tests/jf_test_23.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
module jf_test_23_mod
66

7-
use json_module
8-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
7+
use json_module, wp => json_RK
8+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
99

1010
implicit none
1111

src/tests/jf_test_24.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module jf_test_24_mod
66

77
use json_module, rk => json_rk, lk => json_lk, ik => json_ik, ck => json_ck, cdk => json_cdk
8-
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
8+
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
99

1010
implicit none
1111

0 commit comments

Comments
 (0)