dccaldefault.f90
Go to the documentation of this file.
1 != デフォルトの暦情報の取得
2 != Get information of default calendar
3 !
4 ! Authors:: Yasuhiro MORIKAWA
5 ! Version:: $Id: dccaldefault.f90,v 1.2 2009-10-17 14:08:58 morikawa Exp $
6 ! Tag Name:: $Name: $
7 ! Copyright:: Copyright (C) GFD Dennou Club, 2009-. All rights reserved.
8 ! License:: See COPYRIGHT[link:../../COPYRIGHT]
9 !
10 ! このファイルに記載される手続き群は dc_calendar モジュールから提供されます.
11 !
12 ! Procedures described in this file are provided from "dc_calendar" module.
13 !
14 
15 subroutine dccaldefault1( cal )
16  !
17  ! dc_calendar においてデフォルト設定となっている暦を返します.
18  ! このデフォルトの暦は, dc_calendar_generic#DCCalCreate
19  ! において省略可能引数 *cal* を省略して指定された暦が該当します.
20  ! ただし DCCalCreate が呼び出されていない場合にはグレゴリオ暦となります.
21  !
22  ! Default calender in "dc_calendar" is returned.
23  ! The default calender is set by dc_calendar_generic#DCCalCreate
24  ! without optional argument *cal*.
25  ! If the DCCalCreate is called, the calendar becomes Gregorian calendar.
26  !
27  use dc_calendar_types, only: dc_cal, &
30  use dc_message, only: messagenotify
31  use dc_string, only: lchar
32  use dc_trace, only: beginsub, endsub
34  use dc_types, only: string, dp
35  implicit none
36  type(dc_cal), intent(out):: cal
37  ! 暦情報を収めたオブジェクト.
38  !
39  ! An object that stores information of
40  ! calendar.
41 
42  ! 作業変数
43  ! Work variables
44  !
45  type(dc_cal), pointer:: calp =>null()
46  integer:: stat
47  character(STRING):: cause_c
48  character(*), parameter:: subname = 'DCCalDefault1'
49 continue
50  call beginsub( subname )
51 
52  ! オブジェクトのポインタ割付
53  ! Associate pointer of an object
54  !
55  calp => default_cal
56  if ( .not. calp % initialized ) call default_cal_set
57 
58 !!$ ! 初期設定のチェック
59 !!$ ! Check initialization
60 !!$ !
61 !!$ if ( calp % initialized ) then
62 !!$ stat = DC_EALREADYINIT
63 !!$ cause_c = 'DC_CAL'
64 !!$ goto 999
65 !!$ end if
66 
67  ! 各要素への値の設定
68  ! Configure elements
69  !
70  cal % cal_type = calp % cal_type
71 
72  allocate( cal % day_in_month( calp % month_in_year ) )
73  cal % month_in_year = calp % month_in_year
74  cal % day_in_month = calp % day_in_month
75  cal % hour_in_day = calp % hour_in_day
76  cal % min_in_hour = calp % min_in_hour
77  cal % sec_in_min = calp % sec_in_min
78 
79  ! 終了処理, 例外処理
80  ! Termination and Exception handling
81  !
82  cal % initialized = .true.
83 999 continue
84  nullify( calp )
85  call endsub( subname )
86 end subroutine dccaldefault1
87 
integer, parameter, public cal_gregorian
integer, parameter, public cal_julian
integer, parameter, public cal_noleap
type(dc_cal), target, save, public default_cal
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
integer, parameter, public cal_360day
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
subroutine dccaldefault1(cal)
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
integer, parameter, public dc_ebadcaltype
Definition: dc_error.f90:560
integer, parameter, public cal_cyclic
subroutine, public default_cal_set
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
integer, parameter, public dc_ealreadyinit
Definition: dc_error.f90:558
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118