dc_calendar_generic.f90
Go to the documentation of this file.
1 != dc_calendar より提供される手続の引用仕様宣言
2 != Interface of procedures provided from dc_calendar
3 !
4 ! Authors:: Yasuhiro MORIKAWA
5 ! Version:: $Id: dc_calendar_generic.f90,v 1.9 2009-12-29 16:10:02 morikawa Exp $
6 ! Tag Name:: $Name: $
7 ! Copyright:: Copyright (C) GFD Dennou Club, 2009-. All rights reserved.
8 ! License:: See COPYRIGHT[link:../../COPYRIGHT]
9 
11  != dc_calendar より提供される手続の引用仕様宣言
12  != Interface of procedures provided from dc_calendar
13  !
14  ! モジュールの概要や使用法については, dc_calendar
15  ! を参照ください.
16  !
17  ! See "dc_calendar" for brief of this module and usage.
18  !
19  !== Procedures List
20  !
21  ! 暦に関する手続
22  !
23  ! Procedures for calendar
24  !
25  ! DCCalCreate :: 暦の設定
26  ! DCCalInquire :: 暦情報の問い合わせ
27  ! DCCalConvertByUnit :: 単位の変換
28  ! DCCalConvertToSec :: 時間の秒への変換
29  ! DCCalConvertToMin :: 時間の分への変換
30  ! DCCalConvertToHour :: 時間の時への変換
31  ! DCCalConvertToDay :: 時間の日への変換
32  ! DCCalDefault :: デフォルトの暦情報の取得
33  ! DCCalToChar :: 暦情報の文字列への変換
34  ! DCCalParseUnit :: 単位の解釈
35  ! ------------ ::
36  ! DCCalCreate :: Set calendar
37  ! DCCalInquire :: Inquire information of calendar
38  ! DCCalConvertByUnit :: Convert of unit
39  ! DCCalConvertToSec :: Convert time into second
40  ! DCCalConvertToMin :: Convert time into minute
41  ! DCCalConvertToHour :: Convert time into hour
42  ! DCCalConvertToDay :: Convert time into day
43  ! DCCalDefault :: Get information of default calendar
44  ! DCCalToChar :: Convert calender information into strings
45  ! DCCalParseUnit :: Parse units
46  !
47  !
48  ! 日時に関する手続
49  !
50  ! Procedures for date
51  !
52  ! DCCalDateCreate :: 日時の設定
53  ! DCCalDateInquire :: 日時の問い合わせ
54  ! DCCalDateEval :: 日時の算出
55  ! DCCalDateDifference :: 日時差の算出
56  ! DCCalDateEvalSecOfYear :: 年始めからの通秒の算出
57  ! DCCalDateEvalDayOfYear :: 年始めからの通日の算出
58  ! DCCalDateEvalSecOfDay :: 日始めからの通秒の算出
59  ! DCCalDateChkLeapYear :: 閏年かどうかの判定
60  ! DCCalDateCurrent :: 実時間の取得
61  ! DCCalDateParseStr :: 日時を示す文字列 (YYYY-MM-DDThh:mm:ss.sTZD) の解釈
62  ! DCCalDateToChar :: 日時の文字列 (YYYY-MM-DDThh:mm:ss.sTZD) への変換
63  ! ------------ ::
64  ! DCCalDateCreate :: Set date
65  ! DCCalDateInquire :: Inquire date
66  ! DCCalDateEval :: Evaluate date
67  ! DCCalDateDifference :: Evaluate difference of date
68  ! DCCalDateEvalSecOfYear :: Evaluate second of year
69  ! DCCalDateEvalDayOfYear :: Evaluate day of year
70  ! DCCalDateEvalSecOfDay :: Evaluate second of day
71  ! DCCalDateChkLeapYear :: Judge whether it is a leap year
72  ! DCCalDateCurrent :: Get actual time
73  ! DCCalDateParseStr :: Parse a string of date (YYYY-MM-DDThh:mm:ss.sTZD)
74  ! DCCalDateToChar :: Convert date into a string (YYYY-MM-DDThh:mm:ss.sTZD)
75  !
76 
77  implicit none
78 
79  interface dccalcreate
80  subroutine dccalcreate1( cal_type, cal, err )
82  character(*), intent(in):: cal_type
83  type(dc_cal), intent(out), optional, target:: cal
84  logical, intent(out), optional:: err
85  end subroutine dccalcreate1
86 
87  subroutine dccalcreate2( month_in_year, day_in_month, &
88  & hour_in_day, min_in_hour, sec_in_min, &
89  & cal, err )
91  use dc_types, only: dp
92  integer, intent(in):: month_in_year
93  integer, intent(in):: day_in_month(:)
94  integer, intent(in):: hour_in_day, min_in_hour
95  real(DP), intent(in):: sec_in_min
96  type(dc_cal), intent(out), optional, target:: cal
97  logical, intent(out), optional:: err
98  end subroutine dccalcreate2
99  end interface
100 
101  interface dccaldefault
102  subroutine dccaldefault1( cal )
104  type(dc_cal), intent(out):: cal
105  end subroutine dccaldefault1
106  end interface
107 
108  interface dccalinquire
109  subroutine dccalinquire1( cal_type, &
110  & month_in_year, &
111  & day_in_month, day_in_month_ptr, &
112  & hour_in_day, min_in_hour, sec_in_min, &
113  & cal, err )
115  use dc_types, only: dp
116  character(*), intent(out), optional:: cal_type
117  integer, intent(out), optional:: month_in_year
118  integer, intent(out), optional:: day_in_month(:)
119  integer, pointer, optional:: day_in_month_ptr(:)
120  integer, intent(out), optional:: hour_in_day, min_in_hour
121  real(DP), intent(out), optional:: sec_in_min
122  type(dc_cal), intent(in), optional, target:: cal
123  logical, intent(out), optional:: err
124  end subroutine dccalinquire1
125  end interface
126 
127  interface dccaltochar
128  function dccaltochar1( cal ) result(result)
130  use dc_types, only: string
131  character(STRING):: result
132  type(dc_cal), intent(in):: cal
133  end function dccaltochar1
134  end interface
135 
137  function dccalconvertbyunit1( in_time, in_unit, out_unit, cal ) result( out_time )
139  use dc_types, only: dp
140  real(DP):: out_time
141  real(DP), intent(in):: in_time
142  character(*), intent(in):: in_unit
143  character(*), intent(in):: out_unit
144  type(dc_cal), intent(in), optional, target:: cal
145  end function dccalconvertbyunit1
146 
147  function dccalconvertbyunit2( in_time, in_unit, out_unit, cal ) result( out_time )
149  use dc_types, only: dp
150  real(DP):: out_time
151  real(DP), intent(in):: in_time
152  integer, intent(in):: in_unit
153  integer, intent(in):: out_unit
154  type(dc_cal), intent(in), optional, target:: cal
155  end function dccalconvertbyunit2
156  end interface
157 
159 
160  function dccalconverttosec1( in_time, in_unit, cal ) result( out_time )
162  use dc_types, only: dp
163  real(DP):: out_time
164  real(DP), intent(in):: in_time
165  character(*), intent(in):: in_unit
166  type(dc_cal), intent(in), optional, target:: cal
167  end function dccalconverttosec1
168 
169  function dccalconverttosec2( in_time, in_unit, cal ) result( out_time )
171  use dc_types, only: dp
172  real(DP):: out_time
173  real(DP), intent(in):: in_time
174  integer, intent(in):: in_unit
175  type(dc_cal), intent(in), optional, target:: cal
176  end function dccalconverttosec2
177 
178  end interface
179 
181 
182  function dccalconverttomin1( in_time, in_unit, cal ) result( out_time )
184  use dc_types, only: dp
185  real(DP):: out_time
186  real(DP), intent(in):: in_time
187  character(*), intent(in):: in_unit
188  type(dc_cal), intent(in), optional, target:: cal
189  end function dccalconverttomin1
190 
191  function dccalconverttomin2( in_time, in_unit, cal ) result( out_time )
193  use dc_types, only: dp
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  end function dccalconverttomin2
199 
200  end interface
201 
203 
204  function dccalconverttohour1( in_time, in_unit, cal ) result( out_time )
206  use dc_types, only: dp
207  real(DP):: out_time
208  real(DP), intent(in):: in_time
209  character(*), intent(in):: in_unit
210  type(dc_cal), intent(in), optional, target:: cal
211  end function dccalconverttohour1
212 
213  function dccalconverttohour2( in_time, in_unit, cal ) result( out_time )
215  use dc_types, only: dp
216  real(DP):: out_time
217  real(DP), intent(in):: in_time
218  integer, intent(in):: in_unit
219  type(dc_cal), intent(in), optional, target:: cal
220  end function dccalconverttohour2
221 
222  end interface
223 
225 
226  function dccalconverttoday1( in_time, in_unit, cal ) result( out_time )
228  use dc_types, only: dp
229  real(DP):: out_time
230  real(DP), intent(in):: in_time
231  character(*), intent(in):: in_unit
232  type(dc_cal), intent(in), optional, target:: cal
233  end function dccalconverttoday1
234 
235  function dccalconverttoday2( in_time, in_unit, cal ) result( out_time )
237  use dc_types, only: dp
238  real(DP):: out_time
239  real(DP), intent(in):: in_time
240  integer, intent(in):: in_unit
241  type(dc_cal), intent(in), optional, target:: cal
242  end function dccalconverttoday2
243 
244  end interface
245 
246  interface dccalparseunit
247  subroutine dccalparseunit1( unit_str, unit_sym, err )
248  character(*), intent(in):: unit_str
249  integer, intent(out):: unit_sym
250  logical, intent(out), optional:: err
251  end subroutine dccalparseunit1
252  end interface
253 
254  interface dccaldatecreate
255  subroutine dccaldatecreate1( year, month, day, hour, min, sec, date, zone, err )
257  use dc_types, only: dp
258  integer, intent(in):: year, month, day, hour, min
259  real(DP), intent(in):: sec
260  type(dc_cal_date), intent(out), optional, target:: date
261  character(*), intent(in), optional:: zone
262  logical, intent(out), optional:: err
263  end subroutine dccaldatecreate1
264 
265  subroutine dccaldatecreate2( date_str, date, err )
267  character(*), intent(in):: date_str
268  type(dc_cal_date), intent(out), optional, target:: date
269  logical, intent(out), optional:: err
270  end subroutine dccaldatecreate2
271  end interface
272 
274  subroutine dccaldatecurrent1( date, err )
276  type(dc_cal_date), intent(out):: date
277  logical, intent(out), optional:: err
278  end subroutine dccaldatecurrent1
279  end interface
280 
282  subroutine dccaldateparsestr1( date_str, &
283  & year, month, day, hour, min, sec, zone, &
284  & err )
285  use dc_types, only: dp
286  character(*), intent(in):: date_str
287  integer, intent(out):: year, month, day, hour, min
288  real(DP), intent(out):: sec
289  character(*), intent(out):: zone
290  logical, intent(out), optional:: err
291  end subroutine dccaldateparsestr1
292  end interface
293 
295  subroutine dccaldateinquire1( year, month, day, hour, min, sec, zone, &
296  & elapse_sec, date, cal, err )
298  use dc_types, only: dp
299  integer, intent(out), optional:: year, month, day, hour, min
300  real(DP), intent(out), optional:: sec
301  character(*), intent(out), optional:: zone
302  real(DP), intent(in), optional:: elapse_sec
303  type(dc_cal_date), intent(in), optional, target:: date
304  type(dc_cal), intent(in), optional, target:: cal
305  logical, intent(out), optional:: err
306  end subroutine dccaldateinquire1
307 
308  subroutine dccaldateinquire2( date_str, elapse_sec, date, cal, err )
309  use dc_types, only: dp
311  character(*), intent(out):: date_str
312  real(DP), intent(in), optional:: elapse_sec
313  type(dc_cal_date), intent(in), optional, target:: date
314  type(dc_cal), intent(in), optional, target:: cal
315  logical, intent(out), optional:: err
316  end subroutine dccaldateinquire2
317  end interface
318 
319  interface dccaldatetochar
320  function dccaldatetochar1( year, month, day, hour, min, sec, zone ) &
321  & result(result)
322  use dc_types, only: string, dp, token
323  character(STRING):: result
324  integer, intent(in):: year, month, day, hour, min
325  real(DP), intent(in):: sec
326  character(*), intent(in), optional:: zone
327  end function dccaldatetochar1
328  end interface
329 
330  interface dccaldateeval
331  subroutine dccaldateevalymdhms1( year, month, day, hour, min, sec, elapse_sec, cal, date, err )
333  use dc_types, only: dp
334  integer, intent(in):: year, month, day, hour, min
335  real(DP), intent(in):: sec, elapse_sec
336  type(dc_cal), intent(in), optional, target:: cal
337  type(dc_cal_date), intent(out), optional, target:: date
338  logical, intent(out), optional:: err
339  end subroutine dccaldateevalymdhms1
340 
341  subroutine dccaldateevalymdhms2( year, month, day, hour, min, sec, elapse_time, units, cal, date, err )
343  use dc_types, only: dp
344  integer, intent(in):: year, month, day, hour, min
345  real(DP), intent(in):: sec, elapse_time
346  character(*), intent(in):: units
347  type(dc_cal), intent(in), optional, target:: cal
348  type(dc_cal_date), intent(out), optional, target:: date
349  logical, intent(out), optional:: err
350  end subroutine dccaldateevalymdhms2
351 
352  subroutine dccaldateevalid1( init_date, elapse_sec, cal, date, err )
354  use dc_types, only: dp
355  type(dc_cal_date), intent(in):: init_date
356  real(DP), intent(in):: elapse_sec
357  type(dc_cal), intent(in), optional, target:: cal
358  type(dc_cal_date), intent(out), optional, target:: date
359  logical, intent(out), optional:: err
360  end subroutine dccaldateevalid1
361 
362  subroutine dccaldateevalid2( init_date, elapse_time, units, cal, date, err )
364  use dc_types, only: dp
365  type(dc_cal_date), intent(in):: init_date
366  real(DP), intent(in):: elapse_time
367  character(*), intent(in):: units
368  type(dc_cal), intent(in), optional, target:: cal
369  type(dc_cal_date), intent(out), optional, target:: date
370  logical, intent(out), optional:: err
371  end subroutine dccaldateevalid2
372 
373  subroutine dccaldateevalym2ym1( &
374  & year1, month1, day1, hour1, min1, sec1, &
375  & elapse_sec, &
376  & year2, month2, day2, hour2, min2, sec2, &
377  & cal, err )
379  use dc_types, only: dp
380  integer, intent(in):: year1, month1, day1, hour1, min1
381  real(DP), intent(in):: sec1, elapse_sec
382  integer, intent(out):: year2, month2, day2, hour2, min2
383  real(DP), intent(out):: sec2
384  type(dc_cal), intent(in), optional, target:: cal
385  logical, intent(out), optional:: err
386  end subroutine dccaldateevalym2ym1
387 
388  subroutine dccaldateevalym2ym2( &
389  & year1, month1, day1, hour1, min1, sec1, &
390  & elapse_time, units, &
391  & year2, month2, day2, hour2, min2, sec2, &
392  & cal, err )
394  use dc_types, only: dp
395  integer, intent(in):: year1, month1, day1, hour1, min1
396  real(DP), intent(in):: sec1, elapse_time
397  character(*), intent(in):: units
398  integer, intent(out):: year2, month2, day2, hour2, min2
399  real(DP), intent(out):: sec2
400  type(dc_cal), intent(in), optional, target:: cal
401  logical, intent(out), optional:: err
402  end subroutine dccaldateevalym2ym2
403 
404  end interface
405 
407  function dccaldatedifference1( start_date, end_date, cal ) result(sec)
409  use dc_types, only: dp
410  type(dc_cal_date), intent(in):: start_date, end_date
411  type(dc_cal), intent(in), optional, target:: cal
412  real(DP):: sec
413  end function dccaldatedifference1
414  end interface
415 
417  function dccaldateevalsecofyear1( elapse_sec, date, cal ) result(result)
419  use dc_types, only: dp
420  real(DP), intent(in):: elapse_sec
421  type(dc_cal_date), intent(in), optional, target:: date
422  type(dc_cal), intent(in), optional, target:: cal
423  real(DP):: result
424  end function dccaldateevalsecofyear1
425  end interface
426 
428  function dccaldateevaldayofyear1( elapse_sec, date, cal ) result(result)
430  use dc_types, only: dp
431  real(DP), intent(in):: elapse_sec
432  type(dc_cal_date), intent(in), optional, target:: date
433  type(dc_cal), intent(in), optional, target:: cal
434  real(DP):: result
435  end function dccaldateevaldayofyear1
436  end interface
437 
439  function dccaldateevalsecofday1( elapse_sec, date, cal ) result(result)
441  use dc_types, only: dp
442  real(DP), intent(in):: elapse_sec
443  type(dc_cal_date), intent(in), optional, target:: date
444  type(dc_cal), intent(in), optional, target:: cal
445  real(DP):: result
446  end function dccaldateevalsecofday1
447  end interface
448 
450  function dccaldatechkleapyear1( elapse_sec, date, cal ) result(result)
452  use dc_types, only: dp
453  real(DP), intent(in):: elapse_sec
454  type(dc_cal_date), intent(in), optional, target:: date
455  type(dc_cal), intent(in), optional, target:: cal
456  logical:: result
457  end function dccaldatechkleapyear1
458  end interface
459 
460 end module dc_calendar_generic
real(dp) function dccalconverttomin2(in_time, in_unit, cal)
real(dp) function dccaldateevaldayofyear1(elapse_sec, date, cal)
subroutine dccalinquire1(cal_type, month_in_year, day_in_month, day_in_month_ptr, hour_in_day, min_in_hour, sec_in_min, cal, err)
subroutine dccaldatecreate1(year, month, day, hour, min, sec, date, zone, err)
real(dp) function dccaldateevalsecofyear1(elapse_sec, date, cal)
subroutine dccaldateinquire1(year, month, day, hour, min, sec, zone, elapse_sec, date, cal, err)
subroutine dccaldatecreate2(date_str, date, err)
real(dp) function dccaldateevalsecofday1(elapse_sec, date, cal)
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition: dc_types.f90:109
subroutine dccaldatecurrent1(date, err)
real(dp) function dccalconverttosec1(in_time, in_unit, cal)
subroutine dccalcreate1(cal_type, cal, err)
Definition: dccalcreate.f90:16
subroutine dccaldateevalymdhms1(year, month, day, hour, min, sec, elapse_sec, cal, date, err)
real(dp) function dccalconverttohour2(in_time, in_unit, cal)
real(dp) function dccalconvertbyunit2(in_time, in_unit, out_unit, cal)
subroutine dccaldateevalid2(init_date, elapse_time, units, cal, date, err)
subroutine dccaldateevalym2ym2(year1, month1, day1, hour1, min1, sec1, elapse_time, units, year2, month2, day2, hour2, min2, sec2, cal, err)
subroutine dccalparseunit1(unit_str, unit_sym, err)
subroutine dccaldateparsestr1(date_str, year, month, day, hour, min, sec, zone, err)
subroutine dccaldateinquire2(date_str, elapse_sec, date, cal, err)
subroutine dccaldateevalym2ym1(year1, month1, day1, hour1, min1, sec1, elapse_sec, year2, month2, day2, hour2, min2, sec2, cal, err)
subroutine dccaldateevalid1(init_date, elapse_sec, cal, date, err)
real(dp) function dccalconverttoday1(in_time, in_unit, cal)
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
real(dp) function dccalconverttoday2(in_time, in_unit, cal)
real(dp) function dccaldatedifference1(start_date, end_date, cal)
real(dp) function dccalconverttosec2(in_time, in_unit, cal)
subroutine dccaldefault1(cal)
character(string) function dccaltochar1(cal)
Definition: dccaltochar.f90:12
subroutine dccalcreate2(month_in_year, day_in_month, hour_in_day, min_in_hour, sec_in_min, cal, err)
種別型パラメタを提供します。
Definition: dc_types.f90:49
real(dp) function dccalconverttohour1(in_time, in_unit, cal)
real(dp) function dccalconverttomin1(in_time, in_unit, cal)
subroutine dccaldateevalymdhms2(year, month, day, hour, min, sec, elapse_time, units, cal, date, err)
logical function dccaldatechkleapyear1(elapse_sec, date, cal)
real(dp) function dccalconvertbyunit1(in_time, in_unit, out_unit, cal)
character(string) function dccaldatetochar1(year, month, day, hour, min, sec, zone)
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118