77
88module jf_test_1_mod
99
10- use json_module, wp = > json_RK
10+ use json_module, wp = > json_RK, IK = > json_IK, LK = > json_LK
1111 use , intrinsic :: iso_fortran_env , only: error_unit, output_unit
1212
1313 implicit none
@@ -31,17 +31,17 @@ subroutine test_1(error_cnt)
3131 type (json_value),pointer :: p ! ! a pointer for low-level manipulations
3232 type (json_core) :: core ! ! factory for manipulating `json_value` pointers
3333 integer ,intent (out ) :: error_cnt
34- integer :: ival
34+ integer (IK) :: ival
3535 character (kind= json_CK,len= :),allocatable :: cval
3636 real (wp) :: rval
37- logical :: found
38- logical :: lval
39- integer ,dimension (:),allocatable :: ivec
40- integer ,dimension (:),allocatable :: ilen
37+ logical (LK) :: found
38+ logical (LK) :: lval
39+ integer (IK) ,dimension (:),allocatable :: ivec
40+ integer (IK) ,dimension (:),allocatable :: ilen
4141 real (wp),dimension (:),allocatable :: rvec
4242 character (kind= json_CK,len= 1 ),dimension (:),allocatable :: cvec
4343 character (kind= json_CK,len= :),dimension (:),allocatable :: acvec
44- logical ,dimension (:),allocatable :: lvec
44+ logical (LK) ,dimension (:),allocatable :: lvec
4545
4646 error_cnt = 0
4747 call json% initialize()
@@ -72,7 +72,7 @@ subroutine test_1(error_cnt)
7272 ! print the parsed data to the console
7373 write (error_unit,' (A)' ) ' '
7474 write (error_unit,' (A)' ) ' printing the file...'
75- call json% print_file(error_unit)
75+ call json% print_file(int ( error_unit,IK) )
7676 if (json% failed()) then
7777 call json% print_error_message(error_unit)
7878 error_cnt = error_cnt + 1
@@ -102,7 +102,7 @@ subroutine test_1(error_cnt)
102102 write (error_unit,' (A)' ) ' '
103103 write (error_unit,' (A)' ) ' printing each variable [JSONPath style]'
104104 write (error_unit,' (A)' ) ' '
105- call core% initialize(path_mode= 3 ,unescape_strings= .false. )
105+ call core% initialize(path_mode= 3_IK ,unescape_strings= .false. )
106106 call core% traverse(p,print_json_variable)
107107
108108 call core% destroy()
@@ -113,7 +113,7 @@ subroutine test_1(error_cnt)
113113 write (error_unit,' (A)' ) ' '
114114 write (error_unit,' (A)' ) ' get some data from the file...'
115115
116- call json% initialize(path_mode= 1 ,path_separator= json_CK_' %' ) ! use fortran-style paths
116+ call json% initialize(path_mode= 1_IK ,path_separator= json_CK_' %' ) ! use fortran-style paths
117117
118118 call json% get(' version%svn' , ival)
119119 if (json% failed()) then
@@ -336,7 +336,7 @@ subroutine test_1(error_cnt)
336336
337337 write (error_unit,' (A)' ) ' '
338338 write (error_unit,' (A)' ) ' printing the modified structure...'
339- call json% print_file(error_unit)
339+ call json% print_file(int ( error_unit,IK) )
340340 if (json% failed()) then
341341 call json% print_error_message(error_unit)
342342 error_cnt = error_cnt + 1
@@ -362,15 +362,15 @@ subroutine test_1(error_cnt)
362362 ! call json%update(p,'real',[1.0_wp, 2.0_wp, 3.0_wp],found) !don't have one like this yet...
363363
364364 ! use the json_file procedure to update a variable:
365- call json% update(' version.svn' ,999 ,found)
365+ call json% update(' version.svn' ,999_IK ,found)
366366 if (json% failed()) then
367367 call json% print_error_message(error_unit)
368368 error_cnt = error_cnt + 1
369369 end if
370370
371371 write (error_unit,' (A)' ) ' '
372372 write (error_unit,' (A)' ) ' printing the modified structure...'
373- call json% print_file(error_unit)
373+ call json% print_file(int ( error_unit,IK) )
374374 if (json% failed()) then
375375 call json% print_error_message(error_unit)
376376 error_cnt = error_cnt + 1
@@ -379,7 +379,7 @@ subroutine test_1(error_cnt)
379379 write (error_unit,' (A)' ) ' '
380380 write (error_unit,' (A)' ) ' printing the modified structure (compact mode)...'
381381 call json% initialize(no_whitespace= .true. )
382- call json% print_file(error_unit)
382+ call json% print_file(int ( error_unit,IK) )
383383 if (json% failed()) then
384384 call json% print_error_message(error_unit)
385385 error_cnt = error_cnt + 1
@@ -389,7 +389,7 @@ subroutine test_1(error_cnt)
389389 write (error_unit,' (A)' ) ' '
390390 write (error_unit,' (A)' ) ' get some data from the file (bracket notation)...'
391391
392- call json% initialize(path_mode= 3 )
392+ call json% initialize(path_mode= 3_IK )
393393
394394 ! get an integer value:
395395 write (error_unit,' (A)' ) ' '
@@ -445,13 +445,13 @@ subroutine print_json_variable(json,p,finished)
445445
446446 class(json_core),intent (inout ) :: json
447447 type (json_value),pointer ,intent (in ) :: p
448- logical (json_LK ),intent (out ) :: finished ! ! set true to stop traversing
448+ logical (LK ),intent (out ) :: finished ! ! set true to stop traversing
449449
450450 character (kind= json_CK,len= :),allocatable :: path ! ! path to the variable
451- logical (json_LK ) :: found ! ! error flag
451+ logical (LK ) :: found ! ! error flag
452452 type (json_value),pointer :: child ! ! variable's first child
453453 character (kind= json_CK,len= :),allocatable :: value ! ! variable value as a string
454- integer (json_IK ) :: var_type ! ! JSON variable type
454+ integer (IK ) :: var_type ! ! JSON variable type
455455
456456 call json% get_child(p,child)
457457 finished = .false.
0 commit comments