Loading...
Searching...
No Matches
dccaltochar.f90
Go to the documentation of this file.
1!= 暦情報の文字列変換
2!= Convert calendar information into strings
3!
4! Authors:: Yasuhiro MORIKAWA
5! Version:: $Id: dccaltochar.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
11function dccaltochar1( cal ) result(result)
12 !
13 ! dc_calendar_types#DC_CAL 型変数 *cal* を文字型変数 *result*
14 ! へ変換して返します.
15 ! 書式は下記のようになります.
16 !
17 ! CCCC:month_in_year=MM,day_in_month=(/DD1,.../),hour_in_day=hh,min_in_hour=mm,sec_in_min=ss
18 !
19 ! CCCC が暦のタイプ (文字数は任意), 以降は一年の月数等の情報となります.
20 !
21 ! Convert a "dc_calendar_types#DC_CAL" variable *cal* into
22 ! a character variable *result*
23 ! The format is as follows.
24 !
25 ! CCCC:month_in_year=MM,day_in_month=(/DD1,.../),hour_in_day=hh,min_in_hour=mm,sec_in_min=ss
26 !
27 ! CCCC is a type of calencar (number of strings is arbitrary).
28 ! The rest is information about number of months of a year, etc.
29 !
30 use dc_calendar_types, only: dc_cal
32 use dc_types, only: string, token, dp
33 use dc_string, only: tochar, cprintf, stoa, tochar
34 use dc_message, only: messagenotify
35 implicit none
36 character(STRING):: result
37 type(dc_cal), intent(in):: cal
38 ! 暦情報を収めたオブジェクト.
39 !
40 ! An object that stores information of
41 ! calendar.
42
43 character(TOKEN):: cal_str
44continue
45
46 cal_str = dccaltype_str( cal % cal_type )
47
48 result = cprintf('%c:month_in_year=%d,day_in_month=(/%c/),hour_in_day=%d,min_in_hour=%d,sec_in_min=%f', &
49 & i = (/ cal % month_in_year, cal % hour_in_day, cal % min_in_hour /), &
50 & d = (/ cal % sec_in_min /), &
51 & c1=trim(cal_str), c2=trim(tochar(cal % day_in_month)))
52
53end function dccaltochar1
character(string) function dccaltochar1(cal)
character(token) function, public dccaltype_str(cal_type)
Provides kind type parameter values.
Definition dc_types.f90:49
integer, parameter, public token
Character length for word, token
Definition dc_types.f90:109
integer, parameter, public string
Character length for string
Definition dc_types.f90:118
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:83