SUEWS API Site
Documentation of SUEWS source code
Data Types | Functions/Subroutines
strings Module Reference

Data Types

interface  value
 
interface  writenum
 
interface  writeq
 

Functions/Subroutines

subroutine parse (str, delims, args, nargs)
 
subroutine compact (str)
 
subroutine removesp (str)
 
subroutine, private value_dr (str, rnum, ios)
 
subroutine, private value_sr (str, rnum, ios)
 
subroutine, private value_di (str, inum, ios)
 
subroutine, private value_si (str, inum, ios)
 
subroutine shiftstr (str, n)
 
subroutine insertstr (str, strins, loc)
 
subroutine delsubstr (str, substr)
 
subroutine delall (str, substr)
 
character(len=len_trim(str)) function uppercase (str)
 
character(len=len_trim(str)) function lowercase (str)
 
subroutine readline (nunitr, line, ios)
 
subroutine match (str, ipos, imatch)
 
subroutine, private write_dr (rnum, str, fmt)
 
subroutine, private write_sr (rnum, str, fmt)
 
subroutine, private write_di (inum, str, fmt)
 
subroutine, private write_si (inum, str, fmt)
 
subroutine trimzero (str)
 
subroutine, private writeq_dr (unit, namestr, value, fmt)
 
subroutine, private writeq_sr (unit, namestr, value, fmt)
 
subroutine, private writeq_di (unit, namestr, ivalue, fmt)
 
subroutine, private writeq_si (unit, namestr, ivalue, fmt)
 
logical function is_letter (ch)
 
logical function is_digit (ch)
 
subroutine split (str, delims, before, sep)
 
subroutine removebksl (str)
 

Function/Subroutine Documentation

◆ compact()

subroutine strings::compact ( character(len=*) str)

Definition at line 104 of file suews_util_stringmod.f95.

105
106! Converts multiple spaces and tabs to single spaces; deletes control characters;
107! removes initial spaces.
108
109 CHARACTER(len=*) :: str
110 CHARACTER(len=1) :: ch
111 CHARACTER(len=LEN_TRIM(str)) :: outstr
112
113 str = adjustl(str)
114 lenstr = len_trim(str)
115 outstr = ' '
116 isp = 0
117 k = 0
118
119 DO i = 1, lenstr
120 ch = str(i:i)
121 ich = iachar(ch)
122
123 SELECT CASE (ich)
124
125 CASE (9, 32) ! space or tab character
126 IF (isp == 0) THEN
127 k = k + 1
128 outstr(k:k) = ' '
129 END IF
130 isp = 1
131
132 CASE (33:) ! not a space, quote, or control character
133 k = k + 1
134 outstr(k:k) = ch
135 isp = 0
136
137 END SELECT
138
139 END DO
140
141 str = adjustl(outstr)
142

Referenced by parse(), and split().

Here is the caller graph for this function:

◆ delall()

subroutine strings::delall ( character(len=*) str,
character(len=*) substr )

Definition at line 322 of file suews_util_stringmod.f95.

323
324! Deletes all occurrences of substring 'substr' from string 'str' and
325! shifts characters left to fill holes.
326
327 CHARACTER(len=*) :: str, substr
328
329 lensubstr = len_trim(substr)
330 DO
331 ipos = index(str, substr)
332 IF (ipos == 0) EXIT
333 IF (ipos == 1) THEN
334 str = str(lensubstr + 1:)
335 ELSE
336 str = str(:ipos - 1)//str(ipos + lensubstr:)
337 END IF
338 END DO
339 RETURN
340

◆ delsubstr()

subroutine strings::delsubstr ( character(len=*) str,
character(len=*) substr )

Definition at line 300 of file suews_util_stringmod.f95.

301
302! Deletes first occurrence of substring 'substr' from string 'str' and
303! shifts characters left to fill hole. Trailing spaces or blanks are
304! not considered part of 'substr'.
305
306 CHARACTER(len=*) :: str, substr
307
308 lensubstr = len_trim(substr)
309 ipos = index(str, substr)
310 IF (ipos == 0) RETURN
311 IF (ipos == 1) THEN
312 str = str(lensubstr + 1:)
313 ELSE
314 str = str(:ipos - 1)//str(ipos + lensubstr:)
315 END IF
316 RETURN
317

◆ insertstr()

subroutine strings::insertstr ( character(len=*) str,
character(len=*) strins,
loc )

Definition at line 279 of file suews_util_stringmod.f95.

280
281! Inserts the string 'strins' into the string 'str' at position 'loc'.
282! Characters in 'str' starting at position 'loc' are shifted right to
283! make room for the inserted string. Trailing spaces of 'strins' are
284! removed prior to insertion
285
286 CHARACTER(len=*) :: str, strins
287 CHARACTER(len=LEN(str)) :: tempstr
288
289 lenstrins = len_trim(strins)
290 tempstr = str(loc:)
291 CALL shiftstr(tempstr, lenstrins)
292 tempstr(1:lenstrins) = strins(1:lenstrins)
293 str(loc:) = tempstr
294 RETURN
295

References shiftstr().

Here is the call graph for this function:

◆ is_digit()

logical function strings::is_digit ( character ch)

Definition at line 679 of file suews_util_stringmod.f95.

680
681! Returns .true. if ch is a digit (0,1,...,9) and .false. otherwise
682
683 CHARACTER :: ch
684 LOGICAL :: res
685
686 SELECT CASE (ch)
687 CASE ('0':'9')
688 res = .true.
689 CASE default
690 res = .false.
691 END SELECT
692 RETURN
693

Referenced by strings::value::value_dr().

Here is the caller graph for this function:

◆ is_letter()

logical function strings::is_letter ( character ch)

Definition at line 660 of file suews_util_stringmod.f95.

661
662! Returns .true. if ch is a letter and .false. otherwise
663
664 CHARACTER :: ch
665 LOGICAL :: res
666
667 SELECT CASE (ch)
668 CASE ('A':'Z', 'a':'z')
669 res = .true.
670 CASE default
671 res = .false.
672 END SELECT
673 RETURN
674

◆ lowercase()

character(len=len_trim(str)) function strings::lowercase ( character(len=*) str)

Definition at line 380 of file suews_util_stringmod.f95.

381
382! convert string to lower case
383
384 CHARACTER(len=*) :: str
385 CHARACTER(len=LEN_TRIM(str)) :: lcstr
386
387 ilen = len_trim(str)
388 ioffset = iachar('A') - iachar('a')
389 iquote = 0
390 lcstr = str
391 DO i = 1, ilen
392 iav = iachar(str(i:i))
393 IF (iquote == 0 .AND. (iav == 34 .OR. iav == 39)) THEN
394 iquote = 1
395 iqc = iav
396 cycle
397 END IF
398 IF (iquote == 1 .AND. iav == iqc) THEN
399 iquote = 0
400 cycle
401 END IF
402 IF (iquote == 1) cycle
403 IF (iav >= iachar('A') .AND. iav <= iachar('Z')) THEN
404 lcstr(i:i) = achar(iav - ioffset)
405 ELSE
406 lcstr(i:i) = str(i:i)
407 END IF
408 END DO
409 RETURN
410

◆ match()

subroutine strings::match ( character(len=*) str,
ipos,
imatch )

Definition at line 437 of file suews_util_stringmod.f95.

438
439! Sets imatch to the position in string of the delimiter matching the delimiter
440! in position ipos. Allowable delimiters are (), [], {}, <>.
441
442 CHARACTER(len=*) :: str
443 CHARACTER :: delim1, delim2, ch
444
445 lenstr = len_trim(str)
446 delim1 = str(ipos:ipos)
447 SELECT CASE (delim1)
448 CASE ('(')
449 idelim2 = iachar(delim1) + 1
450 istart = ipos + 1
451 iend = lenstr
452 inc = 1
453 CASE (')')
454 idelim2 = iachar(delim1) - 1
455 istart = ipos - 1
456 iend = 1
457 inc = -1
458 CASE ('[', '{', '<')
459 idelim2 = iachar(delim1) + 2
460 istart = ipos + 1
461 iend = lenstr
462 inc = 1
463 CASE (']', '}', '>')
464 idelim2 = iachar(delim1) - 2
465 istart = ipos - 1
466 iend = 1
467 inc = -1
468 CASE default
469 WRITE (*, *) delim1, ' is not a valid delimiter'
470 RETURN
471 END SELECT
472 IF (istart < 1 .OR. istart > lenstr) THEN
473 WRITE (*, *) delim1, ' has no matching delimiter'
474 RETURN
475 END IF
476 delim2 = achar(idelim2) ! matching delimiter
477
478 isum = 1
479 DO i = istart, iend, inc
480 ch = str(i:i)
481 IF (ch /= delim1 .AND. ch /= delim2) cycle
482 IF (ch == delim1) isum = isum + 1
483 IF (ch == delim2) isum = isum - 1
484 IF (isum == 0) EXIT
485 END DO
486 IF (isum /= 0) THEN
487 WRITE (*, *) delim1, ' has no matching delimiter'
488 RETURN
489 END IF
490 imatch = i
491
492 RETURN
493

◆ parse()

subroutine strings::parse ( character(len=*) str,
character(len=*) delims,
character(len=*), dimension(:) args,
nargs )

Definition at line 70 of file suews_util_stringmod.f95.

71
72! Parses the string 'str' into arguments args(1), ..., args(nargs) based on
73! the delimiters contained in the string 'delims'. Preceding a delimiter in
74! 'str' by a backslash (\‍) makes this particular instance not a delimiter.
75! The integer output variable nargs contains the number of arguments found.
76
77 CHARACTER(len=*) :: str, delims
78 CHARACTER(len=LEN_TRIM(str)) :: strsav
79 CHARACTER(len=*), DIMENSION(:) :: args
80
81 strsav = str
82 CALL compact(str)
83 na = SIZE(args)
84 DO i = 1, na
85 args(i) = ' '
86 END DO
87 nargs = 0
88 lenstr = len_trim(str)
89 IF (lenstr == 0) RETURN
90 k = 0
91
92 DO
93 IF (len_trim(str) == 0) EXIT
94 nargs = nargs + 1
95 CALL split(str, delims, args(nargs))
96 CALL removebksl(args(nargs))
97 END DO
98 str = strsav
99

References compact(), removebksl(), and split().

Referenced by ctrl_output::suews_output_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readline()

subroutine strings::readline ( nunitr,
character(len=*) line,
ios )

Definition at line 415 of file suews_util_stringmod.f95.

416
417! Reads line from unit=nunitr, ignoring blank lines
418! and deleting comments beginning with an exclamation point(!)
419
420 CHARACTER(len=*) :: line
421
422 DO
423 READ (nunitr, '(a)', iostat=ios) line ! read input line
424 IF (ios /= 0) RETURN
425 line = adjustl(line)
426 ipos = index(line, '!')
427 IF (ipos == 1) cycle
428 IF (ipos /= 0) line = line(:ipos - 1)
429 IF (len_trim(line) /= 0) EXIT
430 END DO
431 RETURN
432

◆ removebksl()

subroutine strings::removebksl ( character(len=*) str)

Definition at line 766 of file suews_util_stringmod.f95.

767
768! Removes backslash (\‍) characters. Double backslashes (\\‍) are replaced
769! by a single backslash.
770
771 CHARACTER(len=*) :: str
772 CHARACTER(len=1) :: ch
773 CHARACTER(len=LEN_TRIM(str)) :: outstr
774
775 str = adjustl(str)
776 lenstr = len_trim(str)
777 outstr = ' '
778 k = 0
779 ibsl = 0 ! backslash initially inactive
780
781 DO i = 1, lenstr
782 ch = str(i:i)
783 IF (ibsl == 1) THEN ! backslash active
784 k = k + 1
785 outstr(k:k) = ch
786 ibsl = 0
787 cycle
788 END IF
789 IF (ch == '\') THEN ! backslash with backslash inactive
790 ibsl = 1
791 cycle
792 END IF
793 k = k + 1
794 outstr(k:k) = ch ! non-backslash with backslash inactive
795 END DO
796
797 str = adjustl(outstr)
798

Referenced by parse().

Here is the caller graph for this function:

◆ removesp()

subroutine strings::removesp ( character(len=*) str)

Definition at line 147 of file suews_util_stringmod.f95.

148
149! Removes spaces, tabs, and control characters in string str
150
151 CHARACTER(len=*) :: str
152 CHARACTER(len=1) :: ch
153 CHARACTER(len=LEN_TRIM(str)) :: outstr
154
155 str = adjustl(str)
156 lenstr = len_trim(str)
157 outstr = ' '
158 k = 0
159
160 DO i = 1, lenstr
161 ch = str(i:i)
162 ich = iachar(ch)
163 SELECT CASE (ich)
164 CASE (0:32) ! space, tab, or control character
165 cycle
166 CASE (33:)
167 k = k + 1
168 outstr(k:k) = ch
169 END SELECT
170 END DO
171
172 str = adjustl(outstr)
173

◆ shiftstr()

subroutine strings::shiftstr ( character(len=*) str,
n )

Definition at line 256 of file suews_util_stringmod.f95.

257
258! Shifts characters in in the string 'str' n positions (positive values
259! denote a right shift and negative values denote a left shift). Characters
260! that are shifted off the end are lost. Positions opened up by the shift
261! are replaced by spaces.
262
263 CHARACTER(len=*) :: str
264
265 lenstr = len(str)
266 nabs = iabs(n)
267 IF (nabs >= lenstr) THEN
268 str = repeat(' ', lenstr)
269 RETURN
270 END IF
271 IF (n < 0) str = str(nabs + 1:)//repeat(' ', nabs) ! shift left
272 IF (n > 0) str = repeat(' ', nabs)//str(:lenstr - nabs) ! shift right
273 RETURN
274

Referenced by insertstr().

Here is the caller graph for this function:

◆ split()

subroutine strings::split ( character(len=*) str,
character(len=*) delims,
character(len=*) before,
character, optional sep )

Definition at line 698 of file suews_util_stringmod.f95.

699
700! Routine finds the first instance of a character from 'delims' in the
701! the string 'str'. The characters before the found delimiter are
702! output in 'before'. The characters after the found delimiter are
703! output in 'str'. The optional output character 'sep' contains the
704! found delimiter. A delimiter in 'str' is treated like an ordinary
705! character if it is preceded by a backslash (\‍). If the backslash
706! character is desired in 'str', then precede it with another backslash.
707
708 CHARACTER(len=*) :: str, delims, before
709 CHARACTER, OPTIONAL :: sep
710 LOGICAL :: pres
711 CHARACTER :: ch, cha
712
713 pres = PRESENT(sep)
714 str = adjustl(str)
715 CALL compact(str)
716 lenstr = len_trim(str)
717 IF (lenstr == 0) RETURN ! string str is empty
718 k = 0
719 ibsl = 0 ! backslash initially inactive
720 before = ' '
721 DO i = 1, lenstr
722 ch = str(i:i)
723 IF (ibsl == 1) THEN ! backslash active
724 k = k + 1
725 before(k:k) = ch
726 ibsl = 0
727 cycle
728 END IF
729 IF (ch == '\') THEN ! backslash with backslash inactive
730 k = k + 1
731 before(k:k) = ch
732 ibsl = 1
733 cycle
734 END IF
735 ipos = index(delims, ch)
736 IF (ipos == 0) THEN ! character is not a delimiter
737 k = k + 1
738 before(k:k) = ch
739 cycle
740 END IF
741 IF (ch /= ' ') THEN ! character is a delimiter that is not a space
742 str = str(i + 1:)
743 IF (pres) sep = ch
744 EXIT
745 END IF
746 cha = str(i + 1:i + 1) ! character is a space delimiter
747 iposa = index(delims, cha)
748 IF (iposa > 0) THEN ! next character is a delimiter
749 str = str(i + 2:)
750 IF (pres) sep = cha
751 EXIT
752 ELSE
753 str = str(i + 1:)
754 IF (pres) sep = ch
755 EXIT
756 END IF
757 END DO
758 IF (i >= lenstr) str = ''
759 str = adjustl(str) ! remove initial spaces
760 RETURN
761

References compact().

Referenced by parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trimzero()

subroutine strings::trimzero ( character(len=*) str)

Definition at line 562 of file suews_util_stringmod.f95.

563
564! Deletes nonsignificant trailing zeroes from number string str. If number
565! string ends in a decimal point, one trailing zero is added.
566
567 CHARACTER(len=*) :: str
568 CHARACTER :: ch
569 CHARACTER(len=10) :: exp
570
571 ipos = scan(str, 'eE')
572 IF (ipos > 0) THEN
573 exp = str(ipos:)
574 str = str(1:ipos - 1)
575 END IF
576 lstr = len_trim(str)
577 DO i = lstr, 1, -1
578 ch = str(i:i)
579 IF (ch == '0') cycle
580 IF (ch == '.') THEN
581 str = str(1:i)//'0'
582 IF (ipos > 0) str = trim(str)//trim(exp)
583 EXIT
584 END IF
585 str = str(1:i)
586 EXIT
587 END DO
588 IF (ipos > 0) str = trim(str)//trim(exp)
589

Referenced by strings::writeq::writeq_di(), strings::writeq::writeq_dr(), strings::writeq::writeq_si(), and strings::writeq::writeq_sr().

Here is the caller graph for this function:

◆ uppercase()

character(len=len_trim(str)) function strings::uppercase ( character(len=*) str)

Definition at line 345 of file suews_util_stringmod.f95.

346
347! convert string to upper case
348
349 CHARACTER(len=*) :: str
350 CHARACTER(len=LEN_TRIM(str)) :: ucstr
351
352 ilen = len_trim(str)
353 ioffset = iachar('A') - iachar('a')
354 iquote = 0
355 ucstr = str
356 DO i = 1, ilen
357 iav = iachar(str(i:i))
358 IF (iquote == 0 .AND. (iav == 34 .OR. iav == 39)) THEN
359 iquote = 1
360 iqc = iav
361 cycle
362 END IF
363 IF (iquote == 1 .AND. iav == iqc) THEN
364 iquote = 0
365 cycle
366 END IF
367 IF (iquote == 1) cycle
368 IF (iav >= iachar('a') .AND. iav <= iachar('z')) THEN
369 ucstr(i:i) = achar(iav + ioffset)
370 ELSE
371 ucstr(i:i) = str(i:i)
372 END IF
373 END DO
374 RETURN
375

◆ value_di()

subroutine, private strings::value_di ( character(len=*) str,
integer(ki8) inum,
ios )
private

Definition at line 218 of file suews_util_stringmod.f95.

219
220! Converts number string to a double precision integer value
221
222 CHARACTER(len=*) :: str
223 INTEGER(ki8) :: inum
224 REAL(kr8) :: rnum
225
226 CALL value_dr(str, rnum, ios)
227 IF (abs(rnum) > huge(real(inum, kr8))) THEN
228 ios = 15
229 RETURN
230 END IF
231 inum = nint(rnum, ki8)
232

◆ value_dr()

subroutine, private strings::value_dr ( character(len=*) str,
real(kr8) rnum,
integer ios )
private

Definition at line 178 of file suews_util_stringmod.f95.

179
180! Converts number string to a double precision real number
181
182 CHARACTER(len=*) :: str
183 REAL(kr8) :: rnum
184 INTEGER :: ios
185
186 ilen = len_trim(str)
187 ipos = scan(str, 'Ee')
188 IF (.NOT. is_digit(str(ilen:ilen)) .AND. ipos /= 0) THEN
189 ios = 3
190 RETURN
191 END IF
192 READ (str, *, iostat=ios) rnum
193

Referenced by strings::value::value_di(), strings::value::value_si(), and strings::value::value_sr().

Here is the caller graph for this function:

◆ value_si()

subroutine, private strings::value_si ( character(len=*) str,
integer(ki4) inum,
ios )
private

Definition at line 237 of file suews_util_stringmod.f95.

238
239! Converts number string to a single precision integer value
240
241 CHARACTER(len=*) :: str
242 INTEGER(ki4) :: inum
243 REAL(kr8) :: rnum
244
245 CALL value_dr(str, rnum, ios)
246 IF (abs(rnum) > huge(inum)) THEN
247 ios = 15
248 RETURN
249 END IF
250 inum = nint(rnum, ki4)
251

◆ value_sr()

subroutine, private strings::value_sr ( character(len=*) str,
real(kr4) rnum,
ios )
private

Definition at line 198 of file suews_util_stringmod.f95.

199
200! Converts number string to a single precision real number
201
202 CHARACTER(len=*) :: str
203 REAL(kr4) :: rnum
204 REAL(kr8) :: rnumd
205
206 CALL value_dr(str, rnumd, ios)
207 IF (abs(rnumd) > huge(rnum)) THEN
208 ios = 15
209 RETURN
210 END IF
211 IF (abs(rnumd) < tiny(rnum)) rnum = 0.0_kr4
212 rnum = real(rnumd, kr4)
213

◆ write_di()

subroutine, private strings::write_di ( integer(ki8) inum,
character(len=*) str,
character(len=*) fmt )
private

Definition at line 530 of file suews_util_stringmod.f95.

531
532! Writes double precision integer inum to string str using format fmt
533
534 INTEGER(ki8) :: inum
535 CHARACTER(len=*) :: str, fmt
536 CHARACTER(len=80) :: formt
537
538 formt = '('//trim(fmt)//')'
539 WRITE (str, formt) inum
540 str = adjustl(str)
541

◆ write_dr()

subroutine, private strings::write_dr ( real(kr8) rnum,
character(len=*) str,
character(len=*) fmt )
private

Definition at line 498 of file suews_util_stringmod.f95.

499
500! Writes double precision real number rnum to string str using format fmt
501
502 REAL(kr8) :: rnum
503 CHARACTER(len=*) :: str, fmt
504 CHARACTER(len=80) :: formt
505
506 formt = '('//trim(fmt)//')'
507 WRITE (str, formt) rnum
508 str = adjustl(str)
509

◆ write_si()

subroutine, private strings::write_si ( integer(ki4) inum,
character(len=*) str,
character(len=*) fmt )
private

Definition at line 546 of file suews_util_stringmod.f95.

547
548! Writes single precision integer inum to string str using format fmt
549
550 INTEGER(ki4) :: inum
551 CHARACTER(len=*) :: str, fmt
552 CHARACTER(len=80) :: formt
553
554 formt = '('//trim(fmt)//')'
555 WRITE (str, formt) inum
556 str = adjustl(str)
557

◆ write_sr()

subroutine, private strings::write_sr ( real(kr4) rnum,
character(len=*) str,
character(len=*) fmt )
private

Definition at line 514 of file suews_util_stringmod.f95.

515
516! Writes single precision real number rnum to string str using format fmt
517
518 REAL(kr4) :: rnum
519 CHARACTER(len=*) :: str, fmt
520 CHARACTER(len=80) :: formt
521
522 formt = '('//trim(fmt)//')'
523 WRITE (str, formt) rnum
524 str = adjustl(str)
525

◆ writeq_di()

subroutine, private strings::writeq_di ( integer unit,
character(len=*) namestr,
integer(ki8) ivalue,
character(len=*) fmt )
private

Definition at line 628 of file suews_util_stringmod.f95.

629
630! Writes a string of the form <name> = ivalue to unit
631
632 INTEGER(ki8) :: ivalue
633 INTEGER :: unit
634 CHARACTER(len=*) :: namestr, fmt
635 CHARACTER(len=32) :: tempstr
636 CALL writenum(ivalue, tempstr, fmt)
637 CALL trimzero(tempstr)
638 WRITE (unit, *) trim(namestr)//' = '//trim(tempstr)
639

◆ writeq_dr()

subroutine, private strings::writeq_dr ( integer unit,
character(len=*) namestr,
real(kr8) value,
character(len=*) fmt )
private

Definition at line 594 of file suews_util_stringmod.f95.

595
596! Writes a string of the form <name> = value to unit
597
598 REAL(kr8) :: VALUE
599 INTEGER :: unit
600 CHARACTER(len=*) :: namestr, fmt
601 CHARACTER(len=32) :: tempstr
602
603 CALL writenum(VALUE, tempstr, fmt)
604 CALL trimzero(tempstr)
605 WRITE (unit, *) trim(namestr)//' = '//trim(tempstr)
606

◆ writeq_si()

subroutine, private strings::writeq_si ( integer unit,
character(len=*) namestr,
integer(ki4) ivalue,
character(len=*) fmt )
private

Definition at line 644 of file suews_util_stringmod.f95.

645
646! Writes a string of the form <name> = ivalue to unit
647
648 INTEGER(ki4) :: ivalue
649 INTEGER :: unit
650 CHARACTER(len=*) :: namestr, fmt
651 CHARACTER(len=32) :: tempstr
652 CALL writenum(ivalue, tempstr, fmt)
653 CALL trimzero(tempstr)
654 WRITE (unit, *) trim(namestr)//' = '//trim(tempstr)
655

◆ writeq_sr()

subroutine, private strings::writeq_sr ( integer unit,
character(len=*) namestr,
real(kr4) value,
character(len=*) fmt )
private

Definition at line 611 of file suews_util_stringmod.f95.

612
613! Writes a string of the form <name> = value to unit
614
615 REAL(kr4) :: VALUE
616 INTEGER :: unit
617 CHARACTER(len=*) :: namestr, fmt
618 CHARACTER(len=32) :: tempstr
619
620 CALL writenum(VALUE, tempstr, fmt)
621 CALL trimzero(tempstr)
622 WRITE (unit, *) trim(namestr)//' = '//trim(tempstr)
623