gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
dccaldefault.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 Youhei SASAKI, Yasuhiro MORIKAWA
7!> @copyright Copyright (C) GFD Dennou Club, 2009-2026. All rights reserved. <br/>
8!> License is BSD-2-Clause. see [COPYRIGHT](@ref COPYRIGHT) in detail
9!> @en
10!> @brief Get information of default calendar
11!> @details
12!> Procedures described in this file are provided from "dc_calendar" module.
13!> @enden
14!>
15!> @ja
16!> @brief デフォルトの暦情報の取得
17!> @details
18!> このファイルに記載される手続き群は dc_calendar モジュールから提供されます.
19!> @endja
20!>
21
22!> @en
23!> @brief Get the default calendar settings
24!> @details
25!> Default calendar in "dc_calendar" is returned.
26!> The default calendar is set by dc_calendar_generic#DCCalCreate
27!> without optional argument `cal`.
28!> If the DCCalCreate is not called, the calendar becomes Gregorian calendar.
29!>
30!> @param[out] cal An object that stores information of calendar
31!> @enden
32!>
33!> @ja
34!> @brief デフォルトの暦設定を取得
35!> @details
36!> dc_calendar においてデフォルト設定となっている暦を返します.
37!> このデフォルトの暦は, dc_calendar_generic#DCCalCreate
38!> において省略可能引数 `cal` を省略して指定された暦が該当します.
39!> ただし DCCalCreate が呼び出されていない場合にはグレゴリオ暦となります.
40!>
41!> @param[out] cal 暦情報を収めたオブジェクト
42!> @endja
43subroutine dccaldefault1( cal )
44
45 use dc_calendar_types, only: dc_cal
47 use dc_trace, only: beginsub, endsub
48 implicit none
49 type(dc_cal), intent(out):: cal
50
51 ! 作業変数
52 ! Work variables
53 !
54 type(dc_cal), pointer:: calp =>null()
55 character(*), parameter:: subname = 'DCCalDefault1'
56continue
57 call beginsub( subname )
58
59 ! オブジェクトのポインタ割付
60 ! Associate pointer of an object
61 !
62 calp => default_cal
63 if ( .not. calp % initialized ) call default_cal_set
64
65 ! 各要素への値の設定
66 ! Configure elements
67 !
68 cal % cal_type = calp % cal_type
69
70 allocate( cal % day_in_month( calp % month_in_year ) )
71 cal % month_in_year = calp % month_in_year
72 cal % day_in_month = calp % day_in_month
73 cal % hour_in_day = calp % hour_in_day
74 cal % min_in_hour = calp % min_in_hour
75 cal % sec_in_min = calp % sec_in_min
76
77 ! 終了処理, 例外処理
78 ! Termination and Exception handling
79 !
80 cal % initialized = .true.
81 nullify( calp )
82 call endsub( subname )
83end subroutine dccaldefault1
subroutine dccaldefault1(cal)
Get information of default calendar.
Internal module for dc_calendar.
type(dc_cal), target, save, public default_cal
Default calendar object
subroutine, public default_cal_set
Derived types and parameters of calendar and date.
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