gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dccalconverttomin.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
72function dccalconverttomin1( in_time, in_unit, cal ) result( out_time )
73
78 use dc_message, only: messagenotify
79 use dc_types, only: dp
80 implicit none
81 real(dp):: out_time
82 real(dp), intent(in):: in_time
83 character(*), intent(in):: in_unit
84 type(dc_cal), intent(in), optional, target:: cal
85
86 ! 作業変数
87 ! Work variables
88 !
89 type(dc_cal), pointer:: calp =>null()
90 integer:: in_unit_sym, out_unit_sym
91 character(*), parameter:: subname = 'DCCalConvertToMin1'
92continue
93
94 out_time = -1.0
95
96 ! オブジェクトのポインタ割付
97 ! Associate pointer of an object
98 !
99 if ( present( cal ) ) then
100 calp => cal
101 else
102 calp => default_cal
103 if ( .not. calp % initialized ) call default_cal_set
104 end if
105
106 ! 初期設定のチェック
107 ! Check initialization
108 !
109 if ( .not. calp % initialized ) then
110 call messagenotify('W', subname, '"cal" is not initialized. <-1> is returned.' )
111 goto 999
112 end if
113
114 ! 単位の解釈
115 ! Parse units
116 !
117 in_unit_sym = dccaldate_str2usym( in_unit )
118 out_unit_sym = unit_symbol_min
119
120 ! 数値の変換
121 ! Convert a value
122 !
123 out_time = dccalconvertbyunit( in_time, in_unit_sym, out_unit_sym, cal )
124
125 ! 終了処理, 例外処理
126 ! Termination and Exception handling
127 !
128999 continue
129 nullify( calp )
130end function dccalconverttomin1
131
132!---------------------------------------------------------------------
133
186function dccalconverttomin2( in_time, in_unit, cal ) result( out_time )
187
191 use dc_message, only: messagenotify
192 use dc_types, only: dp
193 implicit none
194 real(dp):: out_time
195 real(dp), intent(in):: in_time
196 integer, intent(in):: in_unit
197 type(dc_cal), intent(in), optional, target:: cal
198
199 ! 作業変数
200 ! Work variables
201 !
202 type(dc_cal), pointer:: calp =>null()
203 integer:: out_unit
204 character(*), parameter:: subname = 'DCCalConvertToMin2'
205continue
206
207 out_time = -1.0
208
209 ! オブジェクトのポインタ割付
210 ! Associate pointer of an object
211 !
212 if ( present( cal ) ) then
213 calp => cal
214 else
215 calp => default_cal
216 if ( .not. calp % initialized ) call default_cal_set
217 end if
218
219 ! 初期設定のチェック
220 ! Check initialization
221 !
222 if ( .not. calp % initialized ) then
223 call messagenotify('W', subname, '"cal" is not initialized. <-1> is returned.' )
224 goto 999
225 end if
226
227 ! 単位の解釈
228 ! Parse units
229 !
230 out_unit = unit_symbol_min
231
232 ! 数値の変換
233 ! Convert a value
234 !
235 out_time = dccalconvertbyunit( in_time, in_unit, out_unit, cal )
236
237 ! 終了処理, 例外処理
238 ! Termination and Exception handling
239 !
240999 continue
241 nullify( calp )
242end function dccalconverttomin2
real(dp) function dccalconverttomin2(in_time, in_unit, cal)
real(dp) function dccalconverttomin1(in_time, in_unit, cal)
時間を分の単位に変換
dc_calendar 手続のインターフェース宣言
dc_calendar用の内部モジュール
type(dc_cal), target, save, public default_cal
デフォルトの暦. DCCal で始まる手続のうち, DC_CAL 型の省略可能引数が与えられない 場合にはこの暦が設定もしくは利用される.
subroutine, public default_cal_set
integer function, public dccaldate_str2usym(str)
暦と日時に関する構造データ型と定数
integer, parameter, public unit_symbol_min
メッセージの出力
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public dp
倍精度実数型変数
Definition dc_types.f90:92