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

Go to the source code of this file.

Functions/Subroutines

subroutine dcdatetimeputline (time, unit, indent)
 Print DC_DATETIME, DC_DIFFTIME information.
subroutine dcdifftimeputline (diff, unit, indent)
subroutine dcdatetimeputline_bc (time, unit)
subroutine dcdifftimeputline_bc (diff, unit)

Function/Subroutine Documentation

◆ dcdatetimeputline()

subroutine dcdatetimeputline ( type(dc_datetime), intent(in) time,
integer, intent(in), optional unit,
character(*), intent(in), optional indent )

Print DC_DATETIME, DC_DIFFTIME information.

Author
Yasuhiro MORIKAWA

Procedures described in this file are provided from "dc_date" module.

Print information of DC_DATETIME

Print the information set in the argument time. By default, messages are output to standard output. The output destination can be changed by specifying a unit number in unit.

Parameters
[in]timeDatetime to print
[in]unitUnit number for output (default: standard output)
[in]indentIndentation for displayed messages

Definition at line 45 of file dcdatetimeputline.f90.

46
47 use dc_date_types, only: dc_datetime
48 use dc_date_generic, only: tochar
49 use dc_string, only: printf
50 use dc_trace, only: beginsub, endsub
51 use dc_types, only: stdout, string
53 implicit none
54 type(DC_DATETIME), intent(in) :: time
55 integer, intent(in), optional :: unit
56 character(*), intent(in), optional:: indent
57
58 integer :: out_unit
59 integer:: indent_len
60 character(STRING):: indent_str
61 character(*), parameter :: subname = 'DCDateTimePutLine'
62continue
63 call beginsub(subname)
64 if (present(unit)) then
65 out_unit = unit
66 else
67 out_unit = stdout
68 end if
69
70 indent_len = 0
71 indent_str = ''
72 if ( present(indent) ) then
73 if ( len(indent) /= 0 ) then
74 indent_len = len(indent)
75 indent_str(1:indent_len) = indent
76 end if
77 end if
78
79 call printf(out_unit, &
80 & indent_str(1:indent_len) // &
81 & '#<DC_DATETIME:: @date=%c @caltype=%d @zone=%c', &
82 & i=(/time % caltype/), c1=trim(tochar(time)), c2=trim(time % zone) )
83
84 call printf(out_unit, &
85 & indent_str(1:indent_len) // &
86 & ' @day=' )
87 call dcscaledsecputline( time % day, unit = unit, &
88 & indent = indent_str(1:indent_len) // &
89 & ' ' )
90
91 call printf(out_unit, &
92 & indent_str(1:indent_len) // &
93 & ' @sec=' )
94 call dcscaledsecputline( time % sec, unit = unit, &
95 & indent = indent_str(1:indent_len) // &
96 & ' ' )
97
98 call printf(out_unit, &
99 & indent_str(1:indent_len) // '>' )
100
101 call endsub(subname)
Interface declarations for procedures provided from dc_date.
Derived types and parameters for date and time.
Scaled seconds module for precise time operations.
subroutine, public dcscaledsecputline(sclsec, unit, indent)
Handling character types.
Definition dc_string.f90:83
Debug tracing module.
Definition dc_trace.f90:150
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:457
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:580
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 stdout
Unit number for Standard OUTPUT
Definition dc_types.f90:117

References dc_trace::beginsub(), dc_scaledsec::dcscaledsecputline(), dc_trace::endsub(), dc_types::stdout, and dc_types::string.

Here is the call graph for this function:

◆ dcdatetimeputline_bc()

subroutine dcdatetimeputline_bc ( type(dc_datetime), intent(in) time,
integer, intent(in), optional unit )

Print DC_DATETIME (for backward compatibility)

Parameters
[in]timeDatetime to print
[in]unitUnit number for output

Definition at line 205 of file dcdatetimeputline.f90.

206 use dc_date_types, only: dc_datetime
208 type(DC_DATETIME), intent(in) :: time
209 integer, intent(in), optional :: unit
210continue
211 call dcdatetimeputline( time, unit )

◆ dcdifftimeputline()

subroutine dcdifftimeputline ( type(dc_difftime), intent(in) diff,
integer, intent(in), optional unit,
character(*), intent(in), optional indent )

Print information of DC_DIFFTIME

Print the information set in the argument diff. By default, messages are output to standard output. The output destination can be changed by specifying a unit number in unit.

Parameters
[in]diffTime difference to print
[in]unitUnit number for output (default: standard output)
[in]indentIndentation for displayed messages

Definition at line 127 of file dcdatetimeputline.f90.

128
129 use dc_date_types, only: dc_difftime
130 use dc_date_generic, only: tochar
131 use dc_string, only: printf
132 use dc_trace, only: beginsub, endsub
133 use dc_types, only: stdout, string
135 implicit none
136 type(DC_DIFFTIME), intent(in) :: diff
137 integer, intent(in), optional :: unit
138 character(*), intent(in), optional:: indent
139
140 integer :: out_unit
141 integer:: indent_len
142 character(STRING):: indent_str
143 character(*), parameter :: subname = 'DCDiffTimePutLine'
144continue
145 call beginsub(subname)
146 if (present(unit)) then
147 out_unit = unit
148 else
149 out_unit = stdout
150 end if
151
152 indent_len = 0
153 indent_str = ''
154 if ( present(indent) ) then
155 if ( len(indent) /= 0 ) then
156 indent_len = len(indent)
157 indent_str(1:indent_len) = indent
158 end if
159 end if
160
161 call printf(out_unit, &
162 & indent_str(1:indent_len) // &
163 & '#<DC_DIFFTIME:: @diff=%c @nondim=%b', &
164 & c1 = trim(tochar(diff)), l = (/ diff % nondim_flag /) )
165
166 call printf(out_unit, &
167 & indent_str(1:indent_len) // &
168 & ' @mon=' )
169 call dcscaledsecputline( diff % mon, unit = unit, &
170 & indent = indent_str(1:indent_len) // &
171 & ' ' )
172
173 call printf(out_unit, &
174 & indent_str(1:indent_len) // &
175 & ' @day=' )
176 call dcscaledsecputline( diff % day, unit = unit, &
177 & indent = indent_str(1:indent_len) // &
178 & ' ' )
179
180 call printf(out_unit, &
181 & indent_str(1:indent_len) // &
182 & ' @sec=' )
183 call dcscaledsecputline( diff % sec, unit = unit, &
184 & indent = indent_str(1:indent_len) // &
185 & ' ' )
186
187 call printf(out_unit, &
188 & indent_str(1:indent_len) // '>' )
189
190 call endsub(subname)

References dc_trace::beginsub(), dc_scaledsec::dcscaledsecputline(), dc_trace::endsub(), dc_types::stdout, and dc_types::string.

Here is the call graph for this function:

◆ dcdifftimeputline_bc()

subroutine dcdifftimeputline_bc ( type(dc_difftime), intent(in) diff,
integer, intent(in), optional unit )

Print DC_DIFFTIME (for backward compatibility)

Parameters
[in]diffTime difference to print
[in]unitUnit number for output

Definition at line 224 of file dcdatetimeputline.f90.

225 use dc_date_types, only: dc_difftime
227 type(DC_DIFFTIME), intent(in) :: diff
228 integer, intent(in), optional :: unit
229continue
230 call dcdifftimeputline( diff, unit )