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

Go to the source code of this file.

Functions/Subroutines

subroutine dccalinquire1 (cal_type, month_in_year, day_in_month, day_in_month_ptr, hour_in_day, min_in_hour, sec_in_min, cal, err)
 Inquire information of calendar.

Function/Subroutine Documentation

◆ dccalinquire1()

subroutine dccalinquire1 ( character(*), intent(out), optional cal_type,
integer, intent(out), optional month_in_year,
integer, dimension(:), intent(out), optional day_in_month,
integer, dimension(:), optional, pointer day_in_month_ptr,
integer, intent(out), optional hour_in_day,
integer, intent(out), optional min_in_hour,
real(dp), intent(out), optional sec_in_min,
type(dc_cal), intent(in), optional, target cal,
logical, intent(out), optional err )

Inquire information of calendar.

Author
Yasuhiro MORIKAWA

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

Inquire information of calendar

Inquire information of calendar.

Following strings are returned to cal_type.

cal_type Description
gregorian Gregorian calendar
julian Julian calendar
noleap A calendar without leap year
360day A calendar in which number of days of a month is 30
cyclic A calendar in which number of days of a year is "30.6 x (number of months) - (total days until last month)" (truncate fractional part)
user_defined User defined calendar

If an optional argument cal is omitted, information of a calendar that is stored in the "dc_calendar" is returned. If cal is not omitted, information of the variable is returned.

Parameters
[out]cal_typeStrings that specify a kind of calendar
[out]month_in_yearMonths in a year
[out]day_in_monthDays in months (array)
[out]day_in_month_ptrDays in months (pointer)
[out]hour_in_dayHours in a day
[out]min_in_hourMinutes in an hour
[out]sec_in_minSeconds in a minute
[in]calAn object that stores information of calendar
[out]errException handling flag

Definition at line 88 of file dccalinquire.f90.

92
93 use dc_calendar_types, only: dc_cal
95 use dc_message, only: messagenotify
96 use dc_string, only: lchar
97 use dc_trace, only: beginsub, endsub
99 use dc_types, only: string, dp
100 implicit none
101 character(*), intent(out), optional:: cal_type
102 integer, intent(out), optional:: month_in_year
103 integer, intent(out), optional:: day_in_month(:)
104 integer, pointer, optional:: day_in_month_ptr(:)
105 integer, intent(out), optional:: hour_in_day
106 integer, intent(out), optional:: min_in_hour
107 real(DP), intent(out), optional:: sec_in_min
108 type(DC_CAL), intent(in), optional, target:: cal
109 logical, intent(out), optional:: err
110
111 ! 作業変数
112 ! Work variables
113 !
114 type(DC_CAL), pointer:: calp =>null()
115 integer:: siz_dm
116 integer:: stat
117 character(STRING):: cause_c
118 character(*), parameter:: subname = 'DCCalInquire1'
119continue
120 call beginsub( subname )
121 stat = dc_noerr
122 cause_c = ''
123
124 ! オブジェクトのポインタ割付
125 ! Associate pointer of an object
126 !
127 if ( present( cal ) ) then
128 calp => cal
129 else
130 calp => default_cal
131 if ( .not. calp % initialized ) call default_cal_set
132 end if
133
134 ! 初期設定のチェック
135 ! Check initialization
136 !
137 if ( .not. calp % initialized ) then
138 stat = dc_enotinit
139 cause_c = 'DC_CAL'
140 goto 999
141 end if
142
143 ! 各要素への値の参照
144 ! Refer elements
145 !
146 if ( present( cal_type ) ) then
147 cal_type = dccaltype_str( calp % cal_type )
148 end if
149 if ( present( month_in_year ) ) month_in_year = calp % month_in_year
150 if ( present( hour_in_day ) ) hour_in_day = calp % hour_in_day
151 if ( present( min_in_hour ) ) min_in_hour = calp % min_in_hour
152 if ( present( sec_in_min ) ) sec_in_min = calp % sec_in_min
153
154 if ( present( day_in_month ) ) then
155 if ( size( day_in_month ) > 0 ) then
156 day_in_month = 0
157 siz_dm = min( size( day_in_month ), size( calp % day_in_month ) )
158 day_in_month(1:siz_dm) = calp % day_in_month(1:siz_dm)
159 end if
160 end if
161
162 if ( present( day_in_month_ptr ) ) then
163 siz_dm = size( calp % day_in_month )
164 allocate( day_in_month_ptr(1:siz_dm) )
165 day_in_month_ptr(1:siz_dm) = calp % day_in_month(1:siz_dm)
166 end if
167
168 ! 終了処理, 例外処理
169 ! Termination and Exception handling
170 !
171999 continue
172 nullify( calp )
173 call storeerror( stat, subname, err, cause_c )
174 call endsub( subname )
Internal module for dc_calendar.
type(dc_cal), target, save, public default_cal
Default calendar object
character(token) function, public dccaltype_str(cal_type)
subroutine, public default_cal_set
Derived types and parameters of calendar and date.
Error handling module.
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
integer, parameter, public dc_enotinit
-400 or less: DC utilities errors
Definition dc_error.f90:534
integer, parameter, public dc_noerr
Error storage variables
Definition dc_error.f90:468
Message output module.
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 dp
Double Precision Real number
Definition dc_types.f90:92

References dc_trace::beginsub(), dc_error::dc_enotinit, dc_error::dc_noerr, dc_calendar_internal::dccaltype_str(), dc_calendar_internal::default_cal, dc_calendar_internal::default_cal_set(), dc_types::dp, dc_trace::endsub(), dc_error::storeerror(), and dc_types::string.

Here is the call graph for this function: