79 character(*),
intent(in):: cal_type
83 type(
dc_cal),
intent(out),
optional,
target:: cal
88 logical,
intent(out),
optional:: err
107 type(
dc_cal),
pointer:: calp =>null()
109 character(STRING):: cause_c
110 character(*),
parameter:: version = &
112 &
'$Id: dccalcreate.f90,v 1.4 2009-10-18 12:02:32 morikawa Exp $' 113 character(*),
parameter:: subname =
'DCCalCreate1' 122 if (
present( cal ) )
then 140 select case(
lchar(trim(cal_type)) )
154 &
'cal_type=<%c> is invalid calender type.', &
155 & c1 = trim(cal_type) )
162 allocate( calp % day_in_month(1:12) )
163 calp % month_in_year = 12
164 calp % hour_in_day = 24
165 calp % min_in_hour = 60
166 calp % sec_in_min = 60.0_dp
168 select case( calp % cal_type )
170 calp % day_in_month(1:12) = &
171 & (/ 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 30 /)
173 calp % day_in_month(1:12) = &
174 & (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /)
176 calp % day_in_month(1:12) = &
177 & (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /)
179 calp % day_in_month(1:12) = &
180 & (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /)
182 calp % day_in_month(1:12) = &
183 & (/ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 /)
190 calp % initialized = .true.
193 call storeerror( stat, subname, err, cause_c )
198 & hour_in_day, min_in_hour, sec_in_min, &
238 integer,
intent(in):: month_in_year
241 integer,
intent(in):: day_in_month(:)
244 integer,
intent(in):: hour_in_day
247 integer,
intent(in):: min_in_hour
250 real(DP),
intent(in):: sec_in_min
253 type(
dc_cal),
intent(out),
optional,
target:: cal
258 logical,
intent(out),
optional:: err
277 type(
dc_cal),
pointer:: calp =>null()
278 integer:: size_day_in_month
280 character(STRING):: cause_c
281 character(*),
parameter:: version = &
283 &
'$Id: dccalcreate.f90,v 1.4 2009-10-18 12:02:32 morikawa Exp $' 284 character(*),
parameter:: subname =
'DCCalCreate2' 293 if (
present( cal ) )
then 311 size_day_in_month =
size ( day_in_month )
316 if ( .not. month_in_year == size_day_in_month )
then 319 &
'month_in_year=<%d> is not equal to size of day_in_month=<%d>', &
320 & i = (/ month_in_year, size_day_in_month /) )
324 if ( month_in_year < 1 )
then 326 call messagenotify(
'W', subname,
'month_in_year=<%d> must be positive', &
327 & i = (/ month_in_year /) )
331 if ( hour_in_day < 1 )
then 333 call messagenotify(
'W', subname,
'hour_in_day=<%d> must be positive', &
334 & i = (/ hour_in_day /) )
338 if ( min_in_hour < 1 )
then 340 call messagenotify(
'W', subname,
'min_in_hour=<%d> must be positive', &
341 & i = (/ min_in_hour /) )
345 if ( .not. sec_in_min > 0.0_dp )
then 347 call messagenotify(
'W', subname,
'sec_in_min=<%f> must be positive', &
348 & d = (/ sec_in_min /) )
356 calp % month_in_year = month_in_year
357 allocate( calp % day_in_month(1:size_day_in_month) )
358 calp % day_in_month = day_in_month
359 calp % hour_in_day = hour_in_day
360 calp % min_in_hour = min_in_hour
361 calp % sec_in_min = sec_in_min
366 calp % initialized = .true.
369 call storeerror( stat, subname, err, cause_c )
integer, parameter, public cal_gregorian
integer, parameter, public cal_julian
integer, parameter, public cal_user_defined
integer, parameter, public cal_noleap
subroutine dccalcreate1(cal_type, cal, err)
type(dc_cal), target, save, public default_cal
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public dc_noerr
integer, parameter, public cal_360day
integer, parameter, public dp
倍精度実数型変数
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
subroutine dccalcreate2(month_in_year, day_in_month, hour_in_day, min_in_hour, sec_in_min, cal, err)
integer, parameter, public dc_ebadcaltype
integer, parameter, public cal_cyclic
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
integer, parameter, public dc_ealreadyinit
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ