@@ -727,10 +727,13 @@ subroutine json_initialize(json,verbose,compact_reals,&
727
727
! ! and similar routines. If true [default],
728
728
! ! then the string is returned unescaped.
729
729
730
- character (kind= CDK,len= 10 ) :: w,d,e
731
- character (kind= CDK,len= 2 ) :: sgn, rl_edit_desc
732
- integer (IK) :: istat
733
- logical (LK) :: sgn_prnt
730
+ character (kind= CDK,len= 10 ) :: w ! ! max string length
731
+ character (kind= CDK,len= 10 ) :: d ! ! real precision digits
732
+ character (kind= CDK,len= 10 ) :: e ! ! real exponent digits
733
+ character (kind= CDK,len= 2 ) :: sgn ! ! sign flag: `ss` or `sp`
734
+ character (kind= CDK,len= 2 ) :: rl_edit_desc ! ! `G`, `E`, `EN`, or `ES`
735
+ integer (IK) :: istat ! ! `iostat` flag for write statements
736
+ logical (LK) :: sgn_prnt ! ! print sign flag
734
737
735
738
! reset exception to false:
736
739
call json% clear_exceptions()
@@ -776,7 +779,13 @@ subroutine json_initialize(json,verbose,compact_reals,&
776
779
! [this overrides the other options]
777
780
if (present (real_format)) then
778
781
if (real_format== star) then
779
- json% compact_real = .false.
782
+ if (present (compact_reals)) then
783
+ ! we will also allow for compact reals with
784
+ ! '*' format, if both arguments are present.
785
+ json% compact_real = compact_reals
786
+ else
787
+ json% compact_real = .false.
788
+ end if
780
789
json% real_fmt = star
781
790
return
782
791
end if
@@ -1043,10 +1052,10 @@ subroutine json_info_by_path(json,p,path,found,var_type,n_children,name)
1043
1052
integer (IK),intent (out ),optional :: n_children ! ! number of children
1044
1053
character (kind= CK,len= :),allocatable ,intent (out ),optional :: name ! ! variable name
1045
1054
1046
- type (json_value),pointer :: p_var
1047
- logical (LK) :: ok
1055
+ type (json_value),pointer :: p_var ! ! temporary pointer
1056
+ logical (LK) :: ok ! ! if the variable was found
1048
1057
#if defined __GFORTRAN__
1049
- character (kind= CK,len= :),allocatable :: p_name
1058
+ character (kind= CK,len= :),allocatable :: p_name ! ! temporary variable for getting name
1050
1059
#endif
1051
1060
1052
1061
call json% get(p,path,p_var,found)
@@ -1158,7 +1167,7 @@ subroutine json_matrix_info(json,p,is_matrix,var_type,n_sets,set_size,name)
1158
1167
integer :: i ! ! counter
1159
1168
integer :: j ! ! counter
1160
1169
#if defined __GFORTRAN__
1161
- character (kind= CK,len= :),allocatable :: p_name
1170
+ character (kind= CK,len= :),allocatable :: p_name ! ! temporary variable for getting name
1162
1171
#endif
1163
1172
1164
1173
! get info about the variable:
@@ -1273,7 +1282,7 @@ subroutine json_matrix_info_by_path(json,p,path,is_matrix,found,&
1273
1282
type (json_value),pointer :: p_var
1274
1283
logical (LK) :: ok
1275
1284
#if defined __GFORTRAN__
1276
- character (kind= CK,len= :),allocatable :: p_name
1285
+ character (kind= CK,len= :),allocatable :: p_name ! ! temporary variable for getting name
1277
1286
#endif
1278
1287
1279
1288
call json% get(p,path,p_var,found)
0 commit comments