gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
dcdatetimevalidcaltype.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!-----------------------------------------------------------------------
5!>
6!> @author Yasuhiro MORIKAWA
7!> @copyright Copyright (C) GFD Dennou Club, 2000-2026. All rights reserved. <br/>
8!> License is BSD-2-Clause. see [COPYRIGHT](@ref COPYRIGHT) in detail
9!> @en
10!> @brief Check if calendar type is valid in dc_date_types
11!> @details
12!> Procedures described in this file are provided from "dc_date" module.
13!> @enden
14!>
15!> @ja
16!> @brief 暦法が dc_date_types で有効なものかどうかを調べる
17!> @details
18!> このファイルで提供される手続き群は dc_date モジュールにて提供されます。
19!> @endja
20!>
21
22!> @en
23!> @brief Check if calendar type is valid
24!> @details
25!> Returns .true. if the given calendar type is valid in dc_date_types,
26!> .false. otherwise.
27!>
28!> @param[in] caltype Calendar type to check
29!> @return .true. if valid, .false. otherwise
30!> @enden
31!>
32!> @ja
33!> @brief 暦法が有効かどうかをチェック
34!> @details
35!> 与えられる暦法が dc_date_types 内で有効であれば
36!> .true. を, それ以外の場合は .false. を返します.
37!>
38!> @param[in] caltype チェックする暦法
39!> @return 有効な場合は .true., それ以外は .false.
40!> @endja
41function dcdatetimevalidcaltype(caltype) result(result)
42
44 implicit none
45 integer, intent(in):: caltype
46 logical:: result
47 integer:: caltypes_size, i
48continue
49 result = .false.
50 caltypes_size = size(prepared_caltypes) - 1
51 do i = 0, caltypes_size
52 if (caltype == prepared_caltypes(i)) then
53 result = .true.
54 exit
55 end if
56 end do
57end function dcdatetimevalidcaltype
logical function dcdatetimevalidcaltype(caltype)
Check if calendar type is valid in dc_date_types.
Derived types and parameters for date and time.
integer, save, public caltype
Default calendar type (Gregorian)
integer, dimension(0:3), parameter, public prepared_caltypes
Array of prepared calendar types