Skip to content

Commit 4edda49

Browse files
committed
Merge pull request #194 from jacobwilliams/minor
minor commenting changes.
2 parents 82cf326 + 66d90da commit 4edda49

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/json_string_utilities.F90

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pure subroutine integer_to_string(ival,int_fmt,str)
8282

8383
integer(IK),intent(in) :: ival !! integer value.
8484
character(kind=CDK,len=*),intent(in) :: int_fmt !! format for integers
85-
character(kind=CK,len=*),intent(out) :: str !! ival converted to a string.
85+
character(kind=CK,len=*),intent(out) :: str !! `ival` converted to a string.
8686

8787
integer(IK) :: istat
8888

@@ -115,7 +115,7 @@ subroutine real_to_string(rval,real_fmt,compact_real,str)
115115
character(kind=CDK,len=*),intent(in) :: real_fmt !! format for real numbers
116116
logical(LK),intent(in) :: compact_real !! compact the string so that it is
117117
!! displayed with fewer characters
118-
character(kind=CK,len=*),intent(out) :: str !! rval converted to a string.
118+
character(kind=CK,len=*),intent(out) :: str !! `rval` converted to a string.
119119

120120
integer(IK) :: istat
121121

@@ -152,10 +152,14 @@ subroutine compact_real_string(str)
152152

153153
character(kind=CK,len=*),intent(inout) :: str !! string representation of a real number.
154154

155-
character(kind=CK,len=len(str)) :: significand, expnt
155+
character(kind=CK,len=len(str)) :: significand
156+
character(kind=CK,len=len(str)) :: expnt
156157
character(kind=CK,len=2) :: separator
157-
158-
integer(IK) :: exp_start,decimal_pos,sig_trim,exp_trim,i
158+
integer(IK) :: exp_start
159+
integer(IK) :: decimal_pos
160+
integer(IK) :: sig_trim
161+
integer(IK) :: exp_trim
162+
integer(IK) :: i !! counter
159163

160164
str = adjustl(str)
161165
exp_start = scan(str,CK_'eEdD')
@@ -226,9 +230,11 @@ subroutine escape_string(str_in, str_out)
226230
character(kind=CK,len=*),intent(in) :: str_in
227231
character(kind=CK,len=:),allocatable,intent(out) :: str_out
228232

229-
integer(IK) :: i
230-
integer(IK) :: ipos
231-
character(kind=CK,len=1) :: c
233+
integer(IK) :: i !! counter
234+
integer(IK) :: ipos !! accumulated string size
235+
!! (so we can allocate it in chunks for
236+
!! greater runtime efficiency)
237+
character(kind=CK,len=1) :: c !! for reading `str_in` one character at a time.
232238
#if defined __GFORTRAN__
233239
character(kind=CK,len=:),allocatable :: tmp !! workaround for bug in gfortran 6.1
234240
#endif

0 commit comments

Comments
 (0)