3 use iso_c_binding
, only: c_double
32 integer,
intent(in) :: arg
33 character(:),
allocatable :: str
36 str=trim(adjustl(stmp))
40 real(c_double),
intent(in) :: arg
41 character(:),
allocatable :: str
44 str=trim(adjustl(stmp))
48 integer,
intent(in) :: arg(:)
49 character(*),
intent(in),
optional :: separator
50 character(:),
allocatable :: str
55 if (present(separator))
then
66 real(c_double),
intent(in) :: arg(:)
67 character(*),
intent(in),
optional :: separator
68 character(:),
allocatable :: str
74 if (present(separator))
then
86 character(:),
allocatable,
intent(in) :: arg
87 character(:),
allocatable :: str
88 if (
allocated(arg))
then
96 integer,
allocatable,
intent(in) :: arg(:)
97 character(*),
intent(in),
optional :: separator
98 character(:),
allocatable :: str
100 if (
allocated(arg))
then
101 if (present(separator))
then
112 real(c_double),
allocatable,
intent(in) :: arg(:)
113 character(*),
intent(in),
optional :: separator
114 character(:),
allocatable :: str
115 if (
allocated(arg))
then
116 if (present(separator))
then
128 character(:),
pointer,
intent(in) :: arg
129 character(:),
allocatable :: str
130 if (
associated(arg))
then
138 character(132),
pointer,
intent(in) :: arg(:)
139 character(:),
allocatable :: str
141 if (
associated(arg))
then
144 str = str//trim(arg(ind))
152 integer,
pointer,
intent(in) :: arg(:)
153 character(*),
intent(in),
optional :: separator
154 character(:),
allocatable :: str
155 character(16) :: stmp
156 if (
associated(arg))
then
157 if (present(separator))
then
168 real(c_double),
pointer,
intent(in) :: arg(:)
169 character(*),
intent(in),
optional :: separator
170 character(:),
allocatable :: str
171 if (
associated(arg))
then
172 if (present(separator))
then
183 real(c_double),
pointer,
intent(in) :: arg(:,:)
184 character(*),
intent(in),
optional :: separator
185 character(:),
allocatable :: str
188 if (
associated(arg))
then
190 if (present(separator))
then
205 character(*),
intent(in) :: in
206 character(132),
pointer,
intent(out) :: out(:)
209 integer :: nout, jout, jcount, jend
211 nout = ceiling(
real(len(in)) /
real(132) )
215 jend = min( jcount+132 , len(in) )
216 out(jout) = in(jcount+1:jend)
222 character(*),
intent(out) :: out
223 character(132),
pointer,
intent(in) :: in(:)
224 character(*),
intent(in) :: linebreak
227 integer :: count, step
231 if (.not.
associated(in))
return
234 loop_lines:
do j=1,
size(in)
235 if (count < len(out))
then
236 step = len(trim(in(j))) + len(linebreak)
237 if (count + step < len(out))
then
238 out(count+1:count+step) = trim(in(j)) // linebreak
240 elseif (count + len(trim(in(j))) + 3 < len(out))
then
241 step = len(trim(in(j)) //
'...')
242 out(count+1:count+step) = trim(in(j)) //
'...'
245 step = len(out) - count
246 out(count+1:count+step) = in(j)(1:step-3) //
'...'
254 character(*),
intent(inout) :: outstring
255 character(*),
intent(in) :: valuestring
256 character(*),
intent(in) :: separator
257 character(:),
allocatable :: tmp
258 integer :: string_len
260 string_len = len( trim(outstring)//separator//trim(valuestring) )
261 allocate(
character(string_len) :: tmp)
262 tmp = trim(outstring)//separator//trim(valuestring)
263 if (len(tmp) > len(outstring))
then
264 outstring = tmp(1:len(outstring))
273 character(*),
intent(in) :: valuestring
274 character(132),
pointer,
intent(inout) :: outstring(:)
277 character(132),
pointer :: tmpstring(:)
281 if (len(valuestring) > 132)
then
283 do while (count < len(valuestring))
284 step = min(132 , len(valuestring)-count)
291 if (
associated(outstring))
then
293 allocate(tmpstring(
size(outstring)))
294 tmpstring = outstring
295 deallocate(outstring)
296 allocate(outstring(
size(tmpstring)+1))
297 outstring(1:
size(tmpstring)) = tmpstring(:)
298 deallocate(tmpstring)
300 allocate(outstring(1))
304 outstring(
size(outstring)) = valuestring
309 character(*),
intent(in) :: val
310 character(:),
pointer,
intent(inout) :: out
313 character(:),
pointer :: tmp
316 if (
associated(out))
then
317 allocate(
character( len(out) ) :: tmp)
320 allocate(
character( len(tmp) + len(val) ) :: out)
324 allocate(
character( len(val) ) :: out)