gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dccaltochar.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 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 Convert calendar information into strings
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 Convert DC_CAL variable to character string
24!> @details
25!> Convert a dc_calendar_types#DC_CAL variable `cal` into
26!> a character variable `result`.
27!> The format is as follows.
28!>
29!> CCCC:month_in_year=MM,day_in_month=(/DD1,.../),hour_in_day=hh,min_in_hour=mm,sec_in_min=ss
30!>
31!> CCCC is a type of calendar (number of characters is arbitrary).
32!> The rest is information about number of months of a year, etc.
33!>
34!> @param[in] cal An object that stores information of calendar
35!> @return Character representation of the calendar information
36!> @enden
37!>
38!> @ja
39!> @brief DC_CAL 型変数を文字列に変換
40!> @details
41!> dc_calendar_types#DC_CAL 型変数 `cal` を文字型変数 `result`
42!> へ変換して返します.
43!> 書式は下記のようになります.
44!>
45!> CCCC:month_in_year=MM,day_in_month=(/DD1,.../),hour_in_day=hh,min_in_hour=mm,sec_in_min=ss
46!>
47!> CCCC が暦のタイプ (文字数は任意), 以降は一年の月数等の情報となります.
48!>
49!> @param[in] cal 暦情報を収めたオブジェクト
50!> @return 暦情報の文字列表現
51!> @endja
52function dccaltochar1( cal ) result(result)
53
54 use dc_calendar_types, only: dc_cal
56 use dc_types, only: string, token
57 use dc_string, only: tochar, cprintf, stoa, tochar
58 use dc_message, only: messagenotify
59 implicit none
60 character(STRING):: result
61 type(dc_cal), intent(in):: cal
62
63 character(TOKEN):: cal_str
64continue
65
66 cal_str = dccaltype_str( cal % cal_type )
67
68 result = cprintf('%c:month_in_year=%d,day_in_month=(/%c/),hour_in_day=%d,min_in_hour=%d,sec_in_min=%f', &
69 & i = (/ cal % month_in_year, cal % hour_in_day, cal % min_in_hour /), &
70 & d = (/ cal % sec_in_min /), &
71 & c1=trim(cal_str), c2=trim(tochar(cal % day_in_month)))
72
73end function dccaltochar1
character(string) function dccaltochar1(cal)
暦情報の文字列変換
dc_calendar用の内部モジュール
character(token) function, public dccaltype_str(cal_type)
暦と日時に関する構造データ型と定数
メッセージの出力
文字型変数の操作
Definition dc_string.f90:83
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition dc_types.f90:128
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:137