104 character(*),
intent(in):: cal_type
105 type(
dc_cal),
intent(out),
optional,
target:: cal
106 logical,
intent(out),
optional:: err
111 type(
dc_cal),
pointer:: calp =>null()
113 character(STRING):: cause_c
114 character(*),
parameter:: version = &
116 &
'$Id: dccalcreate.f90,v 1.4 2009-10-18 12:02:32 morikawa Exp $'
117 character(*),
parameter:: subname =
'DCCalCreate1'
126 if (
present( cal ) )
then
135 select case(
lchar(trim(cal_type)) )
149 &
'cal_type=<%c> is invalid calender type.', &
150 & c1 = trim(cal_type) )
157 allocate( calp % day_in_month(1:12) )
158 calp % month_in_year = 12
159 calp % hour_in_day = 24
160 calp % min_in_hour = 60
161 calp % sec_in_min = 60.0_dp
163 select case( calp % cal_type )
165 calp % day_in_month(1:12) = &
166 & (/ 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 30 /)
168 calp % day_in_month(1:12) = &
169 & (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /)
171 calp % day_in_month(1:12) = &
172 & (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /)
174 calp % day_in_month(1:12) = &
175 & (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /)
177 calp % day_in_month(1:12) = &
178 & (/ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 /)
185 calp % initialized = .true.
188 call storeerror( stat, subname, err, cause_c )
249 & hour_in_day, min_in_hour, sec_in_min, &
260 integer,
intent(in):: month_in_year
261 integer,
intent(in):: day_in_month(:)
262 integer,
intent(in):: hour_in_day
263 integer,
intent(in):: min_in_hour
264 real(DP),
intent(in):: sec_in_min
265 type(
dc_cal),
intent(out),
optional,
target:: cal
266 logical,
intent(out),
optional:: err
271 type(
dc_cal),
pointer:: calp =>null()
272 integer:: size_day_in_month
274 character(STRING):: cause_c
275 character(*),
parameter:: version = &
277 &
'$Id: dccalcreate.f90,v 1.4 2009-10-18 12:02:32 morikawa Exp $'
278 character(*),
parameter:: subname =
'DCCalCreate2'
287 if (
present( cal ) )
then
296 size_day_in_month =
size ( day_in_month )
301 if ( .not. month_in_year == size_day_in_month )
then
304 &
'month_in_year=<%d> is not equal to size of day_in_month=<%d>', &
305 & i = (/ month_in_year, size_day_in_month /) )
309 if ( month_in_year < 1 )
then
311 call messagenotify(
'W', subname,
'month_in_year=<%d> must be positive', &
312 & i = (/ month_in_year /) )
316 if ( hour_in_day < 1 )
then
318 call messagenotify(
'W', subname,
'hour_in_day=<%d> must be positive', &
319 & i = (/ hour_in_day /) )
323 if ( min_in_hour < 1 )
then
325 call messagenotify(
'W', subname,
'min_in_hour=<%d> must be positive', &
326 & i = (/ min_in_hour /) )
330 if ( .not. sec_in_min > 0.0_dp )
then
332 call messagenotify(
'W', subname,
'sec_in_min=<%f> must be positive', &
333 & d = (/ sec_in_min /) )
341 calp % month_in_year = month_in_year
342 allocate( calp % day_in_month(1:size_day_in_month) )
343 calp % day_in_month = day_in_month
344 calp % hour_in_day = hour_in_day
345 calp % min_in_hour = min_in_hour
346 calp % sec_in_min = sec_in_min
351 calp % initialized = .true.
354 call storeerror( stat, subname, err, cause_c )
subroutine dccalcreate2(month_in_year, day_in_month, hour_in_day, min_in_hour, sec_in_min, cal, err)
subroutine dccalcreate1(cal_type, cal, err)
Calendar creation procedures.
Internal module for dc_calendar.
type(dc_cal), target, save, public default_cal
Default calendar object
Derived types and parameters of calendar and date.
integer, parameter, public cal_user_defined
integer, parameter, public cal_julian
integer, parameter, public cal_gregorian
integer, parameter, public cal_360day
integer, parameter, public cal_noleap
integer, parameter, public cal_cyclic
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public dc_noerr
Error storage variables
integer, parameter, public dc_ebadcaltype
Handling character types.
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Provides kind type parameter values.
integer, parameter, public dp
Double Precision Real number
integer, parameter, public string
Character length for string