@@ -82,7 +82,7 @@ pure subroutine integer_to_string(ival,int_fmt,str)
82
82
83
83
integer (IK),intent (in ) :: ival ! ! integer value.
84
84
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.
86
86
87
87
integer (IK) :: istat
88
88
@@ -115,7 +115,7 @@ subroutine real_to_string(rval,real_fmt,compact_real,str)
115
115
character (kind= CDK,len=* ),intent (in ) :: real_fmt ! ! format for real numbers
116
116
logical (LK),intent (in ) :: compact_real ! ! compact the string so that it is
117
117
! ! 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.
119
119
120
120
integer (IK) :: istat
121
121
@@ -152,10 +152,14 @@ subroutine compact_real_string(str)
152
152
153
153
character (kind= CK,len=* ),intent (inout ) :: str ! ! string representation of a real number.
154
154
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
156
157
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
159
163
160
164
str = adjustl (str)
161
165
exp_start = scan (str,CK_' eEdD' )
@@ -226,9 +230,11 @@ subroutine escape_string(str_in, str_out)
226
230
character (kind= CK,len=* ),intent (in ) :: str_in
227
231
character (kind= CK,len= :),allocatable ,intent (out ) :: str_out
228
232
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.
232
238
#if defined __GFORTRAN__
233
239
character (kind= CK,len= :),allocatable :: tmp ! ! workaround for bug in gfortran 6.1
234
240
#endif
0 commit comments