gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
dcdatetimeputline.f90
Go to the documentation of this file.
1! -*- mode: f90; coding: utf-8 -*-
2!-----------------------------------------------------------------------
3! Copyright (c) 2000-2026 Gtool Development Group. All rights reserved.
4!-----------------------------------------------------------------------
21
45subroutine dcdatetimeputline( time, unit, indent )
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)
102end subroutine dcdatetimeputline
103
127subroutine dcdifftimeputline( diff, unit, indent )
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)
191end subroutine dcdifftimeputline
192
193
194!-----------------------------------------------
205subroutine dcdatetimeputline_bc(time, unit)
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 )
212end subroutine dcdatetimeputline_bc
213
224subroutine dcdifftimeputline_bc(diff, unit)
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 )
231end subroutine dcdifftimeputline_bc
subroutine dcdifftimeputline_bc(diff, unit)
subroutine dcdatetimeputline_bc(time, unit)
subroutine dcdifftimeputline(diff, unit, indent)
subroutine dcdatetimeputline(time, unit, indent)
Print DC_DATETIME, DC_DIFFTIME information.
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 stdout
Unit number for Standard OUTPUT
Definition dc_types.f90:117
integer, parameter, public string
Character length for string
Definition dc_types.f90:137