@@ -3880,7 +3880,7 @@ subroutine json_add_double_vec_by_path(json,me,path,value,found,was_created)
3880
3880
class(json_core),intent (inout ) :: json
3881
3881
type (json_value),pointer :: me ! ! the JSON structure
3882
3882
character (kind= CK,len=* ),intent (in ) :: path ! ! the path to the variable
3883
- real (RK),dimension (:),intent (in ) :: value ! ! the vector to add
3883
+ real (RK),dimension (:),intent (in ) :: value ! ! the vector to add
3884
3884
logical (LK),intent (out ),optional :: found ! ! if the variable was found
3885
3885
logical (LK),intent (out ),optional :: was_created ! ! if the variable had to be created
3886
3886
@@ -5294,8 +5294,8 @@ recursive subroutine json_value_print(json,p,iunit,str,indent,&
5294
5294
logical (LK) :: is_array ! ! if this is an element in an array
5295
5295
integer (IK) :: var_type ! ! for getting the variable type of children
5296
5296
integer (IK) :: var_type_prev ! ! for getting the variable type of children
5297
- logical (LK) :: is_vector ! ! if all elements of a vector
5298
- ! ! are scalars of the same type
5297
+ logical (LK) :: is_vector ! ! if all elements of a vector
5298
+ ! ! are scalars of the same type
5299
5299
character (kind= CK,len= :),allocatable :: str_escaped ! ! escaped version of
5300
5300
! ! `name` or `str_value`
5301
5301
@@ -8938,7 +8938,7 @@ recursive subroutine parse_value(json, unit, str, value)
8938
8938
type (json_value),pointer :: value ! ! JSON data that is extracted
8939
8939
8940
8940
logical (LK) :: eof ! ! end-of-file flag
8941
- character (kind= CK,len= 1 ) :: c ! ! character read from file (or string)
8941
+ character (kind= CK,len= 1 ) :: c ! ! character read from file (or string) by [[pop_char]]
8942
8942
#if defined __GFORTRAN__
8943
8943
character (kind= CK,len= :),allocatable :: tmp ! ! this is a work-around for a bug
8944
8944
! ! in the gfortran 4.9 compiler.
@@ -9227,8 +9227,8 @@ subroutine wrap_json_value_create_string(json,p,val,name,trim_str,adjustl_str)
9227
9227
type (json_value),pointer :: p
9228
9228
character (kind= CDK,len=* ),intent (in ) :: val
9229
9229
character (kind= CDK,len=* ),intent (in ) :: name
9230
- logical (LK),intent (in ),optional :: trim_str ! ! if TRIM() should be called for the `val`
9231
- logical (LK),intent (in ),optional :: adjustl_str ! ! if ADJUSTL() should be called for the `val`
9230
+ logical (LK),intent (in ),optional :: trim_str ! ! if TRIM() should be called for the `val`
9231
+ logical (LK),intent (in ),optional :: adjustl_str ! ! if ADJUSTL() should be called for the `val`
9232
9232
9233
9233
call json% create_string(p,to_unicode(val),to_unicode(name),trim_str,adjustl_str)
9234
9234
@@ -9432,7 +9432,7 @@ subroutine to_integer(json,p,val,name)
9432
9432
if (present (val)) then
9433
9433
p% int_value = val
9434
9434
else
9435
- p% int_value = 0 ! default value
9435
+ p% int_value = 0_IK ! default value
9436
9436
end if
9437
9437
9438
9438
! name:
@@ -9616,9 +9616,9 @@ recursive subroutine parse_object(json, unit, str, parent)
9616
9616
character (kind= CK,len=* ),intent (in ) :: str ! ! JSON string (if parsing from a string)
9617
9617
type (json_value),pointer :: parent ! ! the parsed object will be added as a child of this
9618
9618
9619
- type (json_value),pointer :: pair
9620
- logical (LK) :: eof
9621
- character (kind= CK,len= 1 ) :: c
9619
+ type (json_value),pointer :: pair ! ! temp variable
9620
+ logical (LK) :: eof ! ! end of file flag
9621
+ character (kind= CK,len= 1 ) :: c ! ! character returned by [[pop_char]]
9622
9622
#if defined __GFORTRAN__
9623
9623
character (kind= CK,len= :),allocatable :: tmp ! ! this is a work-around for a bug
9624
9624
! ! in the gfortran 4.9 compiler.
@@ -9719,9 +9719,9 @@ recursive subroutine parse_array(json, unit, str, array)
9719
9719
character (kind= CK,len=* ),intent (in ) :: str ! ! JSON string (if parsing from a string)
9720
9720
type (json_value),pointer :: array
9721
9721
9722
- type (json_value),pointer :: element
9723
- logical (LK) :: eof
9724
- character (kind= CK,len= 1 ) :: c
9722
+ type (json_value),pointer :: element ! ! temp variable for array element
9723
+ logical (LK) :: eof ! ! end of file flag
9724
+ character (kind= CK,len= 1 ) :: c ! ! character returned by [[pop_char]]
9725
9725
9726
9726
do
9727
9727
@@ -9783,14 +9783,17 @@ subroutine parse_string(json, unit, str, string)
9783
9783
character (kind= CK,len=* ),intent (in ) :: str ! ! JSON string (if parsing from a string)
9784
9784
character (kind= CK,len= :),allocatable ,intent (out ) :: string ! ! the string (unescaped if necessary)
9785
9785
9786
- logical (LK) :: eof, is_hex, escape
9787
- character (kind= CK,len= 1 ) :: c
9788
- character (kind= CK,len= 4 ) :: hex
9789
- integer (IK) :: i
9790
- integer (IK) :: ip ! ! index to put next character,
9791
- ! ! to speed up by reducing the number of character string reallocations.
9786
+ logical (LK) :: eof ! ! end of file flag
9787
+ logical (LK) :: is_hex ! ! it is a hex string
9788
+ logical (LK) :: escape ! ! for escape string parsing
9789
+ character (kind= CK,len= 1 ) :: c ! ! character returned by [[pop_char]]
9790
+ character (kind= CK,len= 4 ) :: hex ! ! hex string
9791
+ integer (IK) :: i ! ! counter
9792
+ integer (IK) :: ip ! ! index to put next character,
9793
+ ! ! to speed up by reducing the number
9794
+ ! ! of character string reallocations.
9792
9795
character (kind= CK,len= :),allocatable :: string_unescaped ! ! temp variable
9793
- character (kind= CK,len= :),allocatable :: error_message ! ! for string unescaping
9796
+ character (kind= CK,len= :),allocatable :: error_message ! ! for string unescaping
9794
9797
9795
9798
! at least return a blank string if there is a problem:
9796
9799
string = repeat (space, chunk_size)
@@ -9903,9 +9906,10 @@ subroutine parse_for_chars(json, unit, str, chars)
9903
9906
character (kind= CK,len=* ),intent (in ) :: str ! ! JSON string (if parsing from a string)
9904
9907
character (kind= CK,len=* ),intent (in ) :: chars ! ! the string to check for.
9905
9908
9906
- integer (IK) :: i, length
9907
- logical (LK) :: eof
9908
- character (kind= CK,len= 1 ) :: c
9909
+ integer (IK) :: i ! ! counter
9910
+ integer (IK) :: length ! ! trimmed length of `chars`
9911
+ logical (LK) :: eof ! ! end of file flag
9912
+ character (kind= CK,len= 1 ) :: c ! ! character returned by [[pop_char]]
9909
9913
9910
9914
if (.not. json% exception_thrown) then
9911
9915
@@ -9949,16 +9953,16 @@ subroutine parse_number(json, unit, str, value)
9949
9953
character (kind= CK,len=* ),intent (in ) :: str ! ! JSON string (if parsing from a string)
9950
9954
type (json_value),pointer :: value
9951
9955
9952
- character (kind= CK,len= :),allocatable :: tmp
9953
- character (kind= CK,len= 1 ) :: c
9954
- logical (LK) :: eof
9955
- real (RK) :: rval
9956
- integer (IK) :: ival
9957
- logical (LK) :: first
9958
- logical (LK) :: is_integer
9959
- integer (IK) :: ip ! ! index to put next character
9960
- ! ! [to speed up by reducing the number
9961
- ! ! of character string reallocations]
9956
+ character (kind= CK,len= :),allocatable :: tmp ! ! temp string
9957
+ character (kind= CK,len= 1 ) :: c ! ! character returned by [[pop_char]]
9958
+ logical (LK) :: eof ! ! end of file flag
9959
+ real (RK) :: rval ! ! real value
9960
+ integer (IK) :: ival ! ! integer value
9961
+ logical (LK) :: first ! ! first character
9962
+ logical (LK) :: is_integer ! ! it is an integer
9963
+ integer (IK) :: ip ! ! index to put next character
9964
+ ! ! [to speed up by reducing the number
9965
+ ! ! of character string reallocations]
9962
9966
9963
9967
if (.not. json% exception_thrown) then
9964
9968
@@ -10241,7 +10245,8 @@ subroutine json_print_error_message(json,io_unit)
10241
10245
implicit none
10242
10246
10243
10247
class(json_core),intent (inout ) :: json
10244
- integer , intent (in ), optional :: io_unit
10248
+ integer , intent (in ), optional :: io_unit ! ! unit number for
10249
+ ! ! printing error message
10245
10250
10246
10251
character (kind= CK,len= :),allocatable :: error_msg ! ! error message
10247
10252
logical :: status_ok ! ! false if there were any errors thrown
0 commit comments