gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dccaldatechkleapyear.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
64function dccaldatechkleapyear1( elapse_sec, date, cal ) result(result)
65
71 use dc_types, only: dp
72 implicit none
73 logical:: result
74 real(dp), intent(in):: elapse_sec
75 type(dc_cal_date), intent(in), optional, target:: date
76 type(dc_cal), intent(in), optional, target:: cal
77
78 ! 作業変数
79 ! Work variables
80 !
81 type(dc_cal_date), pointer:: datep =>null()
82 type(dc_cal), pointer:: calp =>null()
83 integer:: year, month, day, hour, min
84 real(dp):: sec
85continue
86
87 ! オブジェクトのポインタ割付
88 ! Associate pointer of an object
89 !
90 if ( present( date ) ) then
91 datep => date
92 else
93 datep => default_date
94 end if
95
96 if ( present( cal ) ) then
97 calp => cal
98 else
99 calp => default_cal
100 if ( .not. calp % initialized ) call default_cal_set
101 end if
102
103 ! 初期設定のチェック
104 ! Check initialization
105 !
106 result = .false.
107 if ( .not. datep % initialized ) return
108 if ( .not. calp % initialized ) return
109
110 ! 経過時間を与えた場合の日時を取得
111 ! Inquire date and time when elapse time is given
112 !
113 call dccaldateinquire( year, month, day, hour, min, sec, & ! (out)
114 & elapse_sec = elapse_sec, date = datep , cal = calp ) ! (in)
115
116 ! 閏年の判定
117 ! Judge leap year
118 !
119 select case( calp % cal_type )
120 case( cal_julian )
121 if ( mod( year, 4 ) == 0 ) then
122 result = .true.
123 else
124 result = .false.
125 end if
126
127 case( cal_gregorian )
128 if ( mod( year, 400 ) == 0 ) then
129 result = .true.
130 elseif ( mod( year, 100 ) == 0 ) then
131 result = .false.
132 elseif ( mod( year, 4 ) == 0 ) then
133 result = .true.
134 else
135 result = .false.
136 end if
137
138 case default
139 result = .false.
140 end select
141
142end function dccaldatechkleapyear1
logical function dccaldatechkleapyear1(elapse_sec, date, cal)
閏年かどうかの判定
dc_calendar 手続のインターフェース宣言
dc_calendar用の内部モジュール
integer function, public dccaldate_normalize(year, month, day, hour, min, sec, cal)
integer function, public dccaldate_ym2d(year, month, day, cal, day_of_year)
type(dc_cal), target, save, public default_cal
デフォルトの暦. DCCal で始まる手続のうち, DC_CAL 型の省略可能引数が与えられない 場合にはこの暦が設定もしくは利用される.
subroutine, public default_cal_set
type(dc_cal_date), target, save, public default_date
デフォルトの日時. DCCalDate で始まる手続のうち, DC_CAL_DATE 型の省略可能引数が 与えられない場合にはこの日時が設定もしくは利用される.
暦と日時に関する構造データ型と定数
integer, parameter, public cal_julian
integer, parameter, public cal_gregorian
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public dp
倍精度実数型変数
Definition dc_types.f90:92