gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
dcstringfprintf.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine dcstringfprintf (unit, fmt, i, r, d, l, n, c1, c2, c3, ca)
 Formatted output conversion to file unit.

Function/Subroutine Documentation

◆ dcstringfprintf()

subroutine dcstringfprintf ( integer, intent(in), optional unit,
character(*), intent(in) fmt,
integer, dimension(:), intent(in), optional i,
real(sp), dimension(:), intent(in), optional r,
real(dp), dimension(:), intent(in), optional d,
logical, dimension(:), intent(in), optional l,
integer, dimension(:), intent(in), optional n,
character(*), intent(in), optional c1,
character(*), intent(in), optional c2,
character(*), intent(in), optional c3,
character(*), dimension(:), intent(in), optional ca )

Formatted output conversion to file unit.

Author
Yasuhiro MORIKAWA, Eizi TOYODA

Format a string like C sprintf(3) and output to a file unit. Note that the implementation is quite different from C sprintf(3).

Format string and output to unit

Return a formatted string according to format string fmt to unit unit. If unit is omitted, output to standard output. Use specifiers starting with '' in fmt. Use '%' to output a literal ''. See dcstringsprintf.f90 for specifier details and examples.

Parameters
[in]unitOutput unit number (default: standard output)
[in]fmtFormat string with specifiers
[in]iInteger array data for d, o, x
[in]rSingle precision real array data for r
[in]dDouble precision real array data for f
[in]LLogical array data for b, y
[in]nRepeat counts for %* specifier
[in]c1First character string for c
[in]c2Second character string for c
[in]c3Third character string for c
[in]caCharacter array for a

Definition at line 67 of file dcstringfprintf.f90.

68
69 use dc_types, only: string, dp,sp
70 use dc_string, only: printf
71 implicit none
72 integer, intent(in), optional:: unit
73 character(*), intent(in):: fmt
74 integer, intent(in), optional:: i(:), n(:)
75 real(SP), intent(in), optional:: r(:)
76 real(DP), intent(in), optional:: d(:)
77 logical, intent(in), optional:: L(:)
78 character(*), intent(in), optional:: c1, c2, c3
79 character(*), intent(in), optional:: ca(:)
80 character(STRING):: buf
81 continue
82 call printf(buf, fmt, i=i, r=r, d=d, l=l, n=n, &
83 & c1=c1, c2=c2, c3=c3, ca=ca)
84 if (present(unit)) then
85 write(unit, '(A)') trim(buf)
86 else
87 write(*, '(A)') trim(buf)
88 endif
Handling character types.
Definition dc_string.f90:83
Provides kind type parameter values.
Definition dc_types.f90:55
integer, parameter, public string
Character length for string
Definition dc_types.f90:137
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:92
integer, parameter, public sp
Single Precision Real number.
Definition dc_types.f90:82

References dc_types::dp, dc_types::sp, and dc_types::string.