| Class | gtool_history |
| In: |
gtool_history.F90
|
gtool_history モジュールは, 数値モデルの結果を gtool4 netCDF 規約 に基づくデータ形式 (以降, gtool4 データと呼びます) で出力するためのインターフェースです. 主に時間積分の結果を等時間間隔で出力することを念頭においてます. このモジュールを用いれば, Fortran90 で書かれたプログラムの計算結果を gtool4 データで出力することが簡単に実現できます.
なお, Fortran77 用のインターフェースとして, HSPACK も用意しています.
以下の use 文を Fortran 90 プログラムの先頭に書き込んでください. 本 gtool_history モジュール内の手続きと構造型変数が 利用できるようになります.
use gtool_history
【出力用】
| HistoryCreate : | gtool4 データ出力用初期設定 |
| HistoryAddVariable : | 変数定義 |
| HistoryCopyVariable : | 変数定義 (別ファイルの変数コピー) |
| HistoryPut : | データ出力 |
| HistoryAddAttr : | 変数に属性付加 |
| HistoryClose : | 終了処理 |
| HistorySetTime : | 時刻指定 |
| HistoryPutAxisMPI : | 領域全体の座標データ指定 (MPI 使用時のみ有効) |
【入力用】
| HistoryGet : | データ入力 (固定長配列用) |
| HistoryGetPointer : | データ入力 (ポインタ配列用) |
【その他】
| HistoryInquire : | GT_HISTORY 型変数への問い合わせ |
| HistoryCopy : | GT_HISTORY 型変数のコピー |
| HistoryPutLine : | GT_HISTORY 型変数の印字 |
| HistoryInitialized : | GT_HISTORY 型変数の初期設定をチェック |
| HistoryAxisCreate : | 作成 (初期設定) |
| HistoryAxisCopy : | コピー |
| HistoryAxisAddAttr : | 属性付加 |
| HistoryAxisInquire : | 問い合わせ |
| HistoryAxisClear : | 終了処理 |
| HistoryVarinfoCreate : | 作成 (初期設定) |
| HistoryVarinfoCopy : | コピー |
| HistoryVarinfoAddAttr : | 属性付加 |
| HistoryVarinfoInquire : | 問い合わせ |
| HistoryVarinfoClear : | 終了処理 |
| HistoryVarinfoInitialized : | 初期設定チェック |
| GT_HISTORY : | gtool4 データ出力用 |
| GT_HISTORY_AXIS : | gtool4 データ座標軸情報 |
| GT_HISTORY_VARINFO : | gtool4 データ変数情報 |
バージョン gtool4_netCDF_version に対応しています。
出力するデータには以下の大域属性を必ず与えます。
| netCDF属性: | 与えられる値 |
| Conventions : | ユーザによる指定が無い限り gtool4_netCDF_Conventions が与えられます. |
| gt_version : | ユーザによる指定が無い限り gtool4_netCDF_version が与えられます. |
| title : | ユーザによって指定されます. |
| source : | ユーザによって指定されます. |
| institution : | ユーザによって指定されます. |
| history : | "unknown 2005-08-05T21:48:37+09:00> gtool_history: HistoryCreate\n" といった値が与えられます. "unknown" の部分には, 環境変数 USER から取得される ユーザ名が与えられます. その後ろにはファイルの生成を 開始した時刻が与えられます. |
出力するデータの変数には以下の属性を必ず与えます.
| netCDF属性: | 与えられる値 |
| long_name : | ユーザによって指定されます. |
| units : | ユーザによって指定されます. |
この他の属性に関して HistoryAddAttr などによって任意に与えることは 可能です. 禁止の属性に関しては警告を発するべきですが, 現在は チェックを行っていません.
原則的に, 現在の gtool_history は全ての属性の解釈を行ないません. 本来ならば, HistoryGet は scale_factor, add_offset, valid_range などの属性を解釈すべきかも知れません. ただし, HistoryCopyVariable は変数コピーの際, 変数に属する全ての属性と その値を引き継ぎます.
| Subroutine : | |||
| axis_dest : | type(GT_HISTORY_AXIS),intent(out)
| ||
| axis_src : | type(GT_HISTORY_AXIS),intent(in)
| ||
| err : | logical, intent(out), optional | ||
| name : | character(*) , intent(in), optional
| ||
| length : | integer, intent(in), optional
| ||
| longname : | character(*) , intent(in), optional
| ||
| units : | character(*) , intent(in), optional
| ||
| xtype : | character(*) , intent(in), optional
|
GT_HISTORY_AXIS 型の変数 axis_src を axis_dest にコピーします。 axis_src は HistoryAxisCreate によって初期設定されている必要が あります。 さらに属性を付加する場合には HistoryAxisAddAttr を用いてください。
err を与えておくと、コピーの際何らかの不具合が生じても 終了せずに err が真になって返ります。
err 以降の引数は、コピーの際に上書きする値です。
Alias for HistoryAxisCopy1
| Subroutine : | |
| hist_dest : | type(GT_HISTORY), intent(out), target |
| file : | character(*), intent(in) |
| hist_src : | type(GT_HISTORY), intent(in), optional, target |
| title : | character(*), intent(in), optional |
| source : | character(*), intent(in), optional |
| institution : | character(*), intent(in), optional |
| origin : | real, intent(in), optional |
| interval : | real, intent(in), optional |
| conventions : | character(*), intent(in), optional |
| gt_version : | character(*), intent(in), optional |
引数 hist_src の内容にコピーし, hist_dest へ返します. hist_src が与えられない場合は, 引数 history を与えずに呼び出した HistoryCreate の設定内容が参照されます. HistoryCreate と同様に, 出力の初期設定を行います. file は必ず与えなければならず, hist_src と同じファイルへ出力 しようとする場合はエラーを生じます. HistoryAddVariable で設定される内容に関してはコピーされません.
それ以降の引数を与えることで, hist_src の設定を 上書きすることが可能です.
Alias for HistoryCopy1
| Subroutine : | |||
| varinfo_dest : | type(GT_HISTORY_VARINFO),intent(out) | ||
| varinfo_src : | type(GT_HISTORY_VARINFO),intent(in) | ||
| err : | logical, intent(out), optional | ||
| name : | character(*) , intent(in), optional
| ||
| dims(:) : | character(*) , intent(in), optional, target
| ||
| longname : | character(*) , intent(in), optional
| ||
| units : | character(*) , intent(in), optional
| ||
| xtype : | character(*) , intent(in), optional
|
GT_HISTORY_VARINFO 型の変数 varinfo_src を varinfo_dest にコピーします。 varinfo_src は HistoryVarinfoCreate によって初期設定されている必要が あります。 さらに属性を付加する場合には HistoryVarinfoAddAttr を用いてください。
err を与えておくと、コピーの際何らかの不具合が生じても 終了せずに err が真になって返ります。
err 以降の引数は、コピーの際に上書きする値です。
Alias for HistoryVarinfoCopy1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(out) | ||
| name : | character(*) , intent(in)
| ||
| size : | integer, intent(in)
| ||
| longname : | character(*) , intent(in)
| ||
| units : | character(*) , intent(in)
| ||
| xtype : | character(*) , intent(in)
|
GT_HISTORY_AXIS 型変数を作成します。 このサブルーチンによる設定の後、 HistoryCreate の axes に与えます。 さらに属性を付加する場合には HistoryAxisAddAttr を用いてください。
Constructor of GT_HISTORY_AXIS
Alias for HistoryAxisCreate1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| name : | character(*), intent(in)
| ||
| dims(:) : | character(*), intent(in)
| ||
| longname : | character(*), intent(in)
| ||
| units : | character(*), intent(in)
| ||
| xtype : | character(*), intent(in), optional
| ||
| time_average : | logical, intent(in), optional
| ||
| average : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
GT_HISTORY_VARINFO 型変数を作成します。 このサブルーチンによる設定の後、 HistoryAddVariable の varinfo に与えます。 さらに属性を付加する場合には HistoryVarinfoAddAttr を用いてください。
Constructor of GT_HISTORY_VARINFO
Alias for HistoryVarinfoCreate1
| Derived Type : | |||
| initialized = .false. : | logical
| ||
| unlimited_index = 0 : | integer
| ||
| unlimited_units = ’’ : | character(TOKEN)
| ||
| unlimited_units_symbol = UNIT_SYMBOL_ERR : | integer
| ||
| dimvars(:) =>null() : | type(GT_VARIABLE), pointer
| ||
| dim_value_written(:) =>null() : | logical, pointer
| ||
| origin : | type(DC_DIFFTIME) | ||
| interval : | type(DC_DIFFTIME) | ||
| newest : | type(DC_DIFFTIME) | ||
| oldest : | type(DC_DIFFTIME) | ||
| origin_setting = .false. : | logical
| ||
| vars(:) =>null() : | type(GT_VARIABLE), pointer
| ||
| growable_indices(:) =>null() : | integer, pointer
| ||
| count(:) =>null() : | integer, pointer
| ||
| var_avr_count(:) =>null() : | integer, pointer
| ||
| var_avr_data(:) =>null() : | type(GT_HISTORY_AVRDATA),
pointer
| ||
| var_avr_firstput(:) =>null() : | logical, pointer
| ||
| var_avr_coefsum(:) =>null() : | real(DP), pointer
| ||
| var_avr_baseint(:) =>null() : | type(DC_DIFFTIME), pointer
| ||
| var_avr_prevtime(:) =>null() : | type(DC_DIFFTIME), pointer
| ||
| time_bnds(1:2) = 0.0_DP : | real(DP)
| ||
| time_bnds_output_count = 0 : | integer
| ||
| time_nv_index = 0 : | integer
| ||
| mpi_myrank = -1 : | integer
| ||
| mpi_nprocs = -1 : | integer
| ||
| mpi_gather = .false. : | logical
| ||
| mpi_split = .false. : | logical
| ||
| mpi_fileinfo =>null() : | type(GT_HISTORY_MPIFILEINFO),
pointer
| ||
| mpi_dimdata_all(:) =>null() : | type(GT_HISTORY_MPIAXISDATA),
pointer
| ||
| mpi_dimdata_each(:) =>null() : | type(GT_HISTORY_MPIAXISDATA),
pointer
| ||
| mpi_gthr_info(:) =>null() : | type(GT_HISTORY_MPIAXISINFO),
pointer
| ||
| mpi_varinfo(:) =>null() : | type(GT_HISTORY_VARINFO),
pointer
| ||
| mpi_vars_index(:) =>null() : | type(GT_HISTORY_MPIVARINDEX),
pointer
|
この型の変数は HistoryCreate によって初期設定される必要があります。 初期設定後、データ出力用の複数のサブルーチンによって利用されます。 最終的には HistoryClose によって終了処理してください。
この構造体の内部の要素は非公開になっています。 問い合わせの際には HistoryInquire を利用してください。
Data entity of this type represents a netCDF dataset controlled by gtool5 library. It must be initialized by HistoryCreate , then used in many subroutines, and must be finalized by HistoryClose . Note that the resultant file is undefined if you forget to finalize it.
Users are recommended to retain the object of this type returned by HistoryCreate, to use it as the last argument called history for all following subroutine calls. However, it is not mandatory. When you are going to write ONLY one dataset, argument history of all subroutine calls can be omitted, and the history entity will be internally managed within this module.
| Derived Type : | |||
| name = "" : | character(TOKEN)
| ||
| length = 0 : | integer
| ||
| longname = "" : | character(STRING)
| ||
| units = "" : | character(STRING)
| ||
| xtype = "" : | character(TOKEN)
| ||
| attrs(:) =>null() : | type(GT_HISTORY_ATTR),
pointer
|
この型の変数は HistoryAxisCreate, HistoryAxisCopy, HistoryInquire によって初期設定される必要があります。 初期設定後、HistoryCreate の axes に与えます。
問い合わせは HistoryAxisInquire によって行います。 属性の付加は HistoryAxisAddAttr によって行います。 初期化は HistoryAxisClear によって行います。
This type may be used as a argument axes of HistoryCreate to define features of axes of a history dataset. Typically, a constant array of this type will be used for fixed specification.
| Derived Type : | |||
| name = "" : | character(TOKEN)
| ||
| dims(:) =>null() : | character(TOKEN), pointer
| ||
| longname = "" : | character(STRING)
| ||
| units = "" : | character(STRING)
| ||
| xtype = "" : | character(TOKEN)
| ||
| attrs(:) =>null() : | type(GT_HISTORY_ATTR),
pointer
| ||
| time_average = .false. : | logical
| ||
| initialized = .false. : | logical
|
この型の変数は HistoryVarinfoCreate, HistoryVarinfoCopy, HistoryInquire によって初期設定される必要があります。 初期設定後、HistoryAddVariable の varinfo に与えます。
問い合わせは HistoryVarinfoInquire によって行います。 属性の付加は HistoryVarinfoAddAttr によって行います。 初期化は HistoryVarinfoClear によって行います。
This type may be used as a argument varinfo of HistoryAddVariable to define features of variable of a history dataset.
| Subroutine : | |||
| varname : | character(*), intent(in)
| ||
| attrname : | character(*), intent(in)
| ||
| value : | character(*), intent(in)
| ||
| history : | type(GT_HISTORY),
intent(inout), target, optional
| ||
| err : | logical, intent(out), optional
|
gtool4 データおよびそのデータ内の変数に属性を付加します。 このサブルーチンを用いる前に、 HistoryCreate による初期設定が 必要です。
属性名 attrname の先頭にプラス "+" を付加する 場合は、gtool4 データ自体の属性 (大域属性) として属性が付加されます この場合、varname は無視されますが、その場合でも varname へは 引数の解説にもある通り有効な値を与えてください。
HistoryAddAttr は複数のサブルーチンの総称名です。value には いくつかの型を与えることが可能です。 下記のサブルーチンを参照ください。
Alias for HistoryAddAttrChar0
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
Alias for HistoryAddAttrInt0
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value : | logical, intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
Alias for HistoryAddAttrLogical0
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
Alias for HistoryAddAttrDouble0
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
Alias for HistoryAddAttrReal0
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value(:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
Alias for HistoryAddAttrInt1
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value(:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
Alias for HistoryAddAttrDouble1
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value(:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
Alias for HistoryAddAttrReal1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),
intent(in)
| ||
| history : | type(GT_HISTORY),
intent(inout), optional
| ||
| err : | logical, intent(out), optional
|
gtool4 データ内の変数の定義を行います。このサブルーチンを 用いる前に、 HistoryCreate による初期設定が必要です。
既に gtool4 データが存在し、そのデータ内の変数と全く同じ 構造の変数を定義したい場合は HistoryCopyVariable を利用すると 便利です。
HistoryAddVariable というサブルーチン名は 2 つの別々の サブルーチンの総称名です。下記のサブルーチンも参照ください。
Alias for HistoryAddVariable2
| Subroutine : | recursive | ||
| varname : | character(len = *), intent(in)
| ||
| dims(:) : | character(len = *), intent(in)
| ||
| longname : | character(len = *), intent(in)
| ||
| units : | character(len = *), intent(in)
| ||
| xtype : | character(len = *), intent(in), optional
| ||
| time_average : | logical, intent(in), optional
| ||
| average : | logical, intent(in), optional
| ||
| history : | type(GT_HISTORY),
intent(inout), optional, target
| ||
| err : | logical, intent(out), optional
|
gtool4 データ内の変数の定義を行います。このサブルーチンを 用いる前に、 HistoryCreate による初期設定が必要です。
既に gtool4 データが存在し、そのデータ内の変数と全く同じ 構造の変数を定義したい場合は HistoryCopyVariable を利用すると便利です。
HistoryAddVariable というサブルーチン名は 2 つの別々の サブルーチンの総称名です。上記のサブルーチンも参照ください。
Alias for HistoryAddVariable1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | character(*), intent(in)
|
GT_HISTORY_AXIS 型の変数 axis へ属性を付加します。
HistoryAxisAddAttr は複数のサブルーチンの総称名です。 value には様々な型の引数を与えることが可能です。 下記のサブルーチンを参照ください。
Alias for HistoryAxisAddAttrChar0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | integer, intent(in) |
Alias for HistoryAxisAddAttrInt0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | logical, intent(in) |
Alias for HistoryAxisAddAttrLogical0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real(DP), intent(in) |
Alias for HistoryAxisAddAttrDouble0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real, intent(in) |
Alias for HistoryAxisAddAttrReal0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | integer, intent(in) |
Alias for HistoryAxisAddAttrInt1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real(DP), intent(in) |
Alias for HistoryAxisAddAttrDouble1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real, intent(in) |
Alias for HistoryAxisAddAttrReal1
| Subroutine : | |
| axis : | type(GT_HISTORY_AXIS),intent(inout) |
axis で与えられた変数を HistoryAxisCreate による初期設定よりも さらに前の状態に初期化します。
Destructor of GT_HISTORY_AXIS
subroutine HistoryAxisClear(axis)
!
!== GT_HISTORY_AXIS 型変数初期化
!
! *axis* で与えられた変数を HistoryAxisCreate による初期設定よりも
! さらに前の状態に初期化します。
!
! Destructor of GT_HISTORY_AXIS
!
implicit none
type(GT_HISTORY_AXIS),intent(inout) :: axis
character(len = *), parameter:: subname = "HistoryAxisClear1"
call BeginSub(subname)
axis % name = ""
axis % length = 0
axis % longname = ""
axis % units = ""
axis % xtype = ""
if (associated(axis % attrs)) then
deallocate(axis % attrs)
end if
call EndSub(subname)
end subroutine HistoryAxisClear
| Subroutine : | |||
| axis_dest : | type(GT_HISTORY_AXIS),intent(out)
| ||
| axis_src : | type(GT_HISTORY_AXIS),intent(in)
| ||
| err : | logical, intent(out), optional | ||
| name : | character(*) , intent(in), optional
| ||
| length : | integer, intent(in), optional
| ||
| longname : | character(*) , intent(in), optional
| ||
| units : | character(*) , intent(in), optional
| ||
| xtype : | character(*) , intent(in), optional
|
GT_HISTORY_AXIS 型の変数 axis_src を axis_dest にコピーします。 axis_src は HistoryAxisCreate によって初期設定されている必要が あります。 さらに属性を付加する場合には HistoryAxisAddAttr を用いてください。
err を与えておくと、コピーの際何らかの不具合が生じても 終了せずに err が真になって返ります。
err 以降の引数は、コピーの際に上書きする値です。
Alias for HistoryAxisCopy1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(out) | ||
| name : | character(*) , intent(in)
| ||
| size : | integer, intent(in)
| ||
| longname : | character(*) , intent(in)
| ||
| units : | character(*) , intent(in)
| ||
| xtype : | character(*) , intent(in)
|
GT_HISTORY_AXIS 型変数を作成します。 このサブルーチンによる設定の後、 HistoryCreate の axes に与えます。 さらに属性を付加する場合には HistoryAxisAddAttr を用いてください。
Constructor of GT_HISTORY_AXIS
Alias for HistoryAxisCreate1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(in) | ||
| name : | character(*) , intent(out), optional
| ||
| size : | integer, intent(out), optional
| ||
| longname : | character(*) , intent(out), optional
| ||
| units : | character(*) , intent(out), optional
| ||
| xtype : | character(*) , intent(out), optional
|
GT_HISTORY_AXIS 型の変数内の各情報を参照します。
Alias for HistoryAxisInquire1
| Subroutine : | |||
| history : | type(GT_HISTORY),
intent(inout), optional, target
| ||
| quiet : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
HistoryCreate で始まったデータ出力の終了処理をおこなうものです. プログラム内で HistoryCreate を用いた場合, プログラムを終了する 前に必ずこのサブルーチンを呼んで下さい.
subroutine HistoryClose( history, quiet, err )
!
!== gtool4 データの終了処理
!
! HistoryCreate で始まったデータ出力の終了処理をおこなうものです.
! プログラム内で HistoryCreate を用いた場合, プログラムを終了する
! 前に必ずこのサブルーチンを呼んで下さい.
!
use gtdata_generic, only: Close, Inquire
use dc_message, only: MessageNotify
use dc_url, only: UrlSplit
use dc_present, only: present_and_true
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
type(GT_HISTORY), intent(inout), optional, target:: history
! 出力ファイルの設定に関する情報を
! 格納した構造体
!
! ここに指定するものは,
! HistoryCreate によって初期設定
! されていなければなりません.
!
logical, intent(in), optional:: quiet
! .true. を与えた場合,
! メッセージ出力が抑制されます.
!
! If ".true." is given,
! messages are suppressed.
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY), pointer:: hst =>null()
character(STRING):: url, file
integer:: i, v_size
integer:: stat
character(STRING):: cause_c
character(len = *), parameter:: subname = "HistoryClose"
continue
call BeginSub(subname)
stat = DC_NOERR
cause_c = ""
if (present(history)) then
hst => history
else
hst => default
endif
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( .not. hst % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY'
goto 999
end if
!-----------------------------------------------------------------
! メッセージ出力用にファイル名取得
! Get filename for output messages
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
if ( .not. present_and_true(quiet) ) then
call Inquire( hst % dimvars(1), url = url ) ! (out)
call UrlSplit( fullname = url, file = file ) ! (out)
end if
#ifdef LIB_MPI
endif
#endif
!-----------------------------------------------------------------
! 変数のクローズ
! Close variables
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
v_size = size(hst % dimvars)
do, i = 1, v_size
if (.not. hst % dim_value_written(i)) call set_fake_dim_value(hst, i)
call Close(hst % dimvars(i))
enddo
v_size = size(hst % vars)
do, i = 1, v_size
call Close(hst % vars(i))
enddo
#ifdef LIB_MPI
endif
#endif
deallocate(hst % dimvars)
v_size = size(hst % vars)
!-----------------------------------------------------------------
! 設定のクリア
! Clear configurations
!-----------------------------------------------------------------
hst % unlimited_index = 0
hst % unlimited_units = ''
hst % unlimited_units_symbol = UNIT_SYMBOL_ERR
if (associated(hst % vars)) deallocate(hst % vars)
if (associated(hst % count)) deallocate(hst % count)
if (associated(hst % var_avr_count)) deallocate(hst % var_avr_count)
do, i = 1, v_size
if (associated(hst % var_avr_data(i) % a_DataAvr)) deallocate(hst % var_avr_data(i) % a_DataAvr)
enddo
if (associated(hst % var_avr_data)) deallocate(hst % var_avr_data)
if (associated(hst % var_avr_firstput)) deallocate(hst % var_avr_firstput)
if (associated(hst % var_avr_coefsum)) deallocate(hst % var_avr_coefsum)
if (associated(hst % var_avr_baseint)) deallocate(hst % var_avr_baseint)
if (associated(hst % var_avr_prevtime)) deallocate(hst % var_avr_prevtime)
hst % time_bnds = 0.0_DP
hst % time_bnds_output_count = 0
hst % time_nv_index = 0
hst % origin_setting = .false.
#ifdef LIB_MPI
if ( associated( hst % mpi_fileinfo % axes ) ) deallocate( hst % mpi_fileinfo % axes )
if ( associated( hst % mpi_fileinfo ) ) deallocate( hst % mpi_fileinfo )
v_size = size(hst % mpi_dimdata_all)
do, i = 1, v_size
if ( associated( hst % mpi_dimdata_all(i) % a_Axis ) ) deallocate( hst % mpi_dimdata_all(i) % a_Axis )
if ( associated( hst % mpi_dimdata_all(i) % attrs ) ) deallocate( hst % mpi_dimdata_all(i) % attrs )
enddo
if ( associated( hst % mpi_dimdata_all ) ) deallocate( hst % mpi_dimdata_all )
v_size = size(hst % mpi_dimdata_each)
do, i = 1, v_size
if ( associated( hst % mpi_dimdata_each(i) % a_Axis ) ) deallocate( hst % mpi_dimdata_each(i) % a_Axis )
enddo
if ( associated( hst % mpi_dimdata_each ) ) deallocate( hst % mpi_dimdata_each )
if ( associated( hst % mpi_gthr_info ) ) then
v_size = size(hst % mpi_gthr_info)
do, i = 1, v_size
if ( associated( hst % mpi_gthr_info(i) % index_all ) ) deallocate( hst % mpi_gthr_info(i) % index_all )
if ( associated( hst % mpi_gthr_info(i) % length ) ) deallocate( hst % mpi_gthr_info(i) % length )
end do
deallocate( hst % mpi_gthr_info )
end if
if ( associated(hst % mpi_varinfo) ) then
v_size = size(hst % mpi_varinfo)
do, i = 1, v_size
call HistoryVarinfoClear( hst % mpi_varinfo(i), err )
end do
deallocate( hst % mpi_varinfo )
end if
if ( associated(hst % mpi_vars_index) ) then
v_size = size(hst % mpi_vars_index)
do, i = 1, v_size
if ( associated( hst % mpi_vars_index(i) % each2all ) ) deallocate( hst % mpi_vars_index(i) % each2all )
if ( associated( hst % mpi_vars_index(i) % allcount ) ) deallocate( hst % mpi_vars_index(i) % allcount )
end do
deallocate( hst % mpi_vars_index )
end if
#endif
!-----------------------------------------------------------------
! メッセージ出力
! Output messages
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
if ( .not. present_and_true(quiet) ) then
call MessageNotify('M', subname, '"%c" is closed', c1 = trim( file ), rank_mpi = -1 )
end if
#ifdef LIB_MPI
endif
hst % mpi_myrank = -1
hst % mpi_nprocs = -1
hst % mpi_gather = .false.
hst % mpi_split = .false.
#endif
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
hst % initialized = .false.
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub( subname )
end subroutine HistoryClose
| Subroutine : | |
| hist_dest : | type(GT_HISTORY), intent(out), target |
| file : | character(*), intent(in) |
| hist_src : | type(GT_HISTORY), intent(in), optional, target |
| title : | character(*), intent(in), optional |
| source : | character(*), intent(in), optional |
| institution : | character(*), intent(in), optional |
| origin : | real, intent(in), optional |
| interval : | real, intent(in), optional |
| conventions : | character(*), intent(in), optional |
| gt_version : | character(*), intent(in), optional |
引数 hist_src の内容にコピーし, hist_dest へ返します. hist_src が与えられない場合は, 引数 history を与えずに呼び出した HistoryCreate の設定内容が参照されます. HistoryCreate と同様に, 出力の初期設定を行います. file は必ず与えなければならず, hist_src と同じファイルへ出力 しようとする場合はエラーを生じます. HistoryAddVariable で設定される内容に関してはコピーされません.
それ以降の引数を与えることで, hist_src の設定を 上書きすることが可能です.
Alias for HistoryCopy1
| Subroutine : | |||
| file : | character(len = *), intent(in)
| ||
| varname : | character(len = *), intent(in)
| ||
| history : | type(GT_HISTORY),
intent(inout), optional, target
| ||
| overwrite : | logical, intent(in), optional
|
gtool4 データ内の変数の定義を行います。 他の gtool4 データの ファイル名とその中の変数名を指定することで、 自動的のその変数の 構造や属性をコピーして変数定義します。このサブルーチンを 用いる前に、 HistoryCreate による初期設定が必要です。
構造や属性を手動で設定する場合には HistoryAddVariable を用いて下さい。
Alias for HistoryCopyVariable1
| Subroutine : | |||
| file : | character(*), intent(in)
| ||
| title : | character(*), intent(in)
| ||
| source : | character(*), intent(in)
| ||
| institution : | character(*), intent(in)
| ||
| dims(:) : | character(*), intent(in)
| ||
| dimsizes(:) : | integer, intent(in)
| ||
| longnames(:) : | character(*), intent(in)
| ||
| units(:) : | character(*), intent(in)
| ||
| origin : | real, intent(in), optional
| ||
| interval : | real, intent(in), optional
| ||
| xtypes(:) : | character(*), intent(in), optional
| ||
| history : | type(GT_HISTORY), intent(out),
optional, target
| ||
| conventions : | character(*), intent(in), optional
| ||
| gt_version : | character(*), intent(in), optional
| ||
| overwrite : | logical, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| flag_mpi_gather : | logical, intent(in), optional
| ||
| flag_mpi_split : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
このサブルーチンは、gtool4 データ出力の初期設定を行います。 HistoryAddVariable、 HistoryCopyVariable、 HistoryPut、 HistoryAddAttr、 HistoryClose、 HistorySetTime を用いるためには、HistoryCreate による初期設定が必要です。
なお、プログラム内で HistoryCreate を呼び出した場合、 プログラムを終了する前に必ず、 HistoryClose を呼び出して 終了処理を行なって下さい。
HistoryCreate というサブルーチン名は 2 つの別々の サブルーチンの総称名です。上記のサブルーチンも参照ください。
Two specific subroutines shares common part:
Both two ones initializes a dataset file. The result of type GT_HISTORY will be returned by history or managed internally if omitted. Mandatory global attributes are defined by arguments title, source, and institution; they are all declared as ((character(len = *))). Spatial axis definitions have two different forms: a primitive one uses several arrays of various types: dims, dimsizes, longnames, units, and xtypes. Another sophisticated one has only array of type GT_HISTORY_AXIS, axes. Temporal definition is done without origin, interval.
Alias for HistoryCreate1
| Subroutine : | |||
| file : | character(*), intent(in)
| ||
| title : | character(*), intent(in) | ||
| source : | character(*), intent(in) | ||
| institution : | character(*), intent(in) | ||
| axes(:) : | type(GT_HISTORY_AXIS),
intent(in)
| ||
| origin : | real, intent(in), optional | ||
| interval : | real, intent(in), optional | ||
| history : | type(GT_HISTORY), intent(out), optional, target | ||
| conventions : | character(*), intent(in), optional | ||
| gt_version : | character(*), intent(in), optional | ||
| overwrite : | logical, intent(in), optional | ||
| quiet : | logical, intent(in), optional
| ||
| flag_mpi_gather : | logical, intent(in), optional
| ||
| flag_mpi_split : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
HistoryCreate というサブルーチン名は 2 つの別々の サブルーチンの総称名です。まずは HistoryCreate を参照ください。
もう 1 つのサブルーチンと異なる点は、座標軸の情報を dims, dimsizes, longnames, units, and xtypes といった 個別の引数で与えるのではなく、構造体 GT_HISTORY_AXIS 型の 引数 axes で与える点にあります。
GT_HISTORY_AXIS 型変数の生成 (constructer) は HistoryAxisCreate にて行います。
Two specific subroutines shares common part:
Both two ones initializes a dataset file. The result of type GT_HISTORY will be returned by history or managed internally if omitted. Mandatory global attributes are defined by arguments title, source, and institution; they are all declared as ((character(len = *))). Spatial axis definitions have two different forms: a primitive one uses several arrays of various types: dims, dimsizes, longnames, units, and xtypes. Another sophisticated one has only array of type GT_HISTORY_AXIS, axes. Temporal definition is done without origin, interval.
Alias for HistoryCreate2
| Subroutine : | |||
| file : | character(*), intent(in)
| ||
| title : | character(*), intent(in)
| ||
| source : | character(*), intent(in)
| ||
| institution : | character(*), intent(in)
| ||
| dims(:) : | character(*), intent(in)
| ||
| dimsizes(:) : | integer, intent(in)
| ||
| longnames(:) : | character(*), intent(in)
| ||
| units(:) : | character(*), intent(in)
| ||
| origin : | type(DC_DIFFTIME), intent(in)
| ||
| interval : | type(DC_DIFFTIME), intent(in), optional
| ||
| xtypes(:) : | character(*), intent(in), optional
| ||
| history : | type(GT_HISTORY), intent(out),
optional, target
| ||
| conventions : | character(*), intent(in), optional
| ||
| gt_version : | character(*), intent(in), optional
| ||
| overwrite : | logical, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| flag_mpi_gather : | logical, intent(in), optional
| ||
| flag_mpi_split : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
このサブルーチンは、gtool4 データ出力の初期設定を行います。 HistoryAddVariable、 HistoryCopyVariable、 HistoryPut、 HistoryAddAttr、 HistoryClose、 HistorySetTime を用いるためには、HistoryCreate による初期設定が必要です。
なお、プログラム内で HistoryCreate を呼び出した場合、 プログラムを終了する前に必ず、 HistoryClose を呼び出して 終了処理を行なって下さい。
HistoryCreate というサブルーチン名は 2 つの別々の サブルーチンの総称名です。上記のサブルーチンも参照ください。
Two specific subroutines shares common part:
Both two ones initializes a dataset file. The result of type GT_HISTORY will be returned by history or managed internally if omitted. Mandatory global attributes are defined by arguments title, source, and institution; they are all declared as ((character(len = *))). Spatial axis definitions have two different forms: a primitive one uses several arrays of various types: dims, dimsizes, longnames, units, and xtypes. Another sophisticated one has only array of type GT_HISTORY_AXIS, axes. Temporal definition is done without origin, interval.
Alias for HistoryCreate3
| Subroutine : | |||
| file : | character(*), intent(in)
| ||
| varname : | character(*), intent(in)
| ||
| array : | real(DP), intent(out)
| ||
| range : | character(*), intent(in), optional
| ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
Note that Japanese and English are described in parallel.
netCDF データを入力します. gtool4 netCDF 規約に基づくデータを想定 していますが, 大抵の netCDF データの入力は可能であると期待されます.
デフォルトでは, ファイル内の最新データ, すなわちデータを 時刻最大で切り出したものを入力します. 別の時刻または 別の次元で切り出したデータを 入力したい場合には, 下記の time オプションもしくは range オプションを利用してください.
file にファイル名を, varname に変数名を与えます. array にはファイルから入力されたデータが返ります. ポインタの配列へデータを入力を行う場合は, HistoryGetPointer を利用してください.
ある時刻のデータを明示したい場合には, その時刻を time に与えます. 整数型, 単精度実数型, 倍精度実数型の数値を与えることが可能です.
range には gtool4 のコンマ記法 (gtool4 netCDF 規約 の「5.4 コンマ記法」参照) を与えることで, 任意の次元で入力データを切り出すことが可能です. range に空文字を与えた場合は切り出しを行いません.
HistoryGet は複数のサブルーチンの総称名です. array には 0 〜 7 次元の整数型, 単精度実数型, 倍精度実数型の配列を与えることが可能です.
デフォルトでは, データの入力時にどのファイルのどの変数が どの次元で切り出されて入力されたのかを表示します. メッセージ出力が不要な場合は quiet に .true. を与えてください.
Input netCDF data. NetCDF data with gtool4 conventions is assumed, but most netCDF data is expected to be input.
Give filename to file, variable name to varname. Input data is returned to array. If you want to use pointer array, use "HistoryGetPointer".
By default, recent data, that is to say, data clipped with maximum time is input. In order to input data clipped with other time or other dimension, use time option or range option as follows.
In order to get data at certain time, specify the time to time. Type is integer or single precision real or double precision.
Give gtool4 comma-graphy (See "5.4 gtool4 comma-graphy" in gtool4 netCDF Convention) to range, then input data can be clipped by an arbitrary dimension. If null character is given to range, data is not clipped.
HistoryGet is generic name of multiple subroutines. Integer, single precision real, and double precision real 0 — 7 rank array can be given to array.
By default, when data is input, filename and variable name and clipping information is printed. The message is suppressed when .true. is given to quiet
Original external subprogram is historyget.F90#HistoryGetDouble0
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array : | integer, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt0
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array : | real, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal0
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | integer, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt1
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | real(DP), intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble1
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | real, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal1
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | integer, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt2
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | real(DP), intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble2
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | real, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal2
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | integer, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt3
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real(DP), intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble3
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal3
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | integer, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt4
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real(DP), intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble4
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal4
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | integer, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt5
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real(DP), intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble5
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal5
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | integer, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt6
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real(DP), intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble6
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal6
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | integer, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt7
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real(DP), intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble7
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real, intent(out) |
| range : | character(*), intent(in), optional |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGet を参照してください.
See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal7
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array : | integer, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt0TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array : | integer, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt0TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array : | integer, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt0TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array : | real(DP), intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble0TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array : | real(DP), intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble0TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array : | real(DP), intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble0TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array : | real, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal0TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array : | real, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal0TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array : | real, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal0TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | integer, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt1TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | integer, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt1TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | integer, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt1TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | real(DP), intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble1TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | real(DP), intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble1TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | real(DP), intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble1TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | real, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal1TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | real, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal1TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:) : | real, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal1TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | integer, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt2TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | integer, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt2TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | integer, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt2TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | real(DP), intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble2TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | real(DP), intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble2TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | real(DP), intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble2TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | real, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal2TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | real, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal2TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:) : | real, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal2TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | integer, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt3TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | integer, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt3TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | integer, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt3TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real(DP), intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble3TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real(DP), intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble3TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real(DP), intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble3TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal3TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal3TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal3TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | integer, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt4TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | integer, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt4TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | integer, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt4TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real(DP), intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble4TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real(DP), intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble4TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real(DP), intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble4TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal4TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal4TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal4TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | integer, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt5TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | integer, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt5TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | integer, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt5TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real(DP), intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble5TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real(DP), intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble5TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real(DP), intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble5TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal5TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal5TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal5TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | integer, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt6TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | integer, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt6TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | integer, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt6TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real(DP), intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble6TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real(DP), intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble6TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real(DP), intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble6TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal6TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal6TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal6TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | integer, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt7TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | integer, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt7TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | integer, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt7TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real(DP), intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble7TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real(DP), intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble7TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real(DP), intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble7TimeR
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real, intent(out) |
| time : | integer, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal7TimeI
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real, intent(out) |
| time : | real(DP), intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal7TimeD
| Subroutine : | |
| file : | character(*), intent(in) |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real, intent(out) |
| time : | real, intent(in) |
| quiet : | logical, intent(in), optional |
| flag_mpi_split : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGetPointer です. 使用方法に関しては HistoryGetPointer を参照してください.
This is "HistoryGetPointer" with numerical argument time for specification of time. See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal7TimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | integer, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt0Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | real(DP), pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
Note that Japanese and English are described in parallel.
netCDF データを入力します. gtool4 netCDF 規約に基づくデータを想定 していますが, 大抵の netCDF データの入力は可能であると期待されます.
基本的な使い方に関しては HistoryGet を参照してください. HistoryGet との違いは, array にポインタ配列を与えることです. array には必ず空状態の配列を与えてください. すなわち与える配列に対し, 初期値 =>null() を設定するか nullify を用いてください. 既に割り付けられている場合, もしくは不定状態の場合には エラーを返します.
Input netCDF data. NetCDF data with gtool4 conventions is assumed, but most netCDF data is expected to be input.
See "HistoryGet", for basic usage. Difference from "HistoryGet" is that array is pointer array. Give null array to array. More specifically, use ’=>null()’ as initial value or use ‘nullify’ to the array. If the array is allocated already, or undefined, error is occurred.
Original external subprogram is historyget.F90#HistoryGetDouble0Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | real, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal0Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | integer, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt1Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | real(DP), pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble1Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | real, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal1Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | integer, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt2Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | real(DP), pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble2Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | real, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal2Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | integer, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt3Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | real(DP), pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble3Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | real, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal3Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | integer, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt4Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | real(DP), pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble4Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | real, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal4Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | integer, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt5Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | real(DP), pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble5Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | real, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal5Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | integer, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt6Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | real(DP), pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble6Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | real, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal6Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | integer, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt7Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | real(DP), pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble7Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | real, pointer
| ||
| range : | character(*), intent(in), optional | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
使用方法に関しては HistoryGetPointer を参照してください.
See "HistoryGetPointer", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal7Pointer
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | integer, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt0PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | integer, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt0PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | integer, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt0PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | real(DP), pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble0PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | real(DP), pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble0PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | real(DP), pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble0PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | real, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal0PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | real, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal0PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array : | real, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal0PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | integer, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt1PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | integer, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt1PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | integer, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt1PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | real(DP), pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble1PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | real(DP), pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble1PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | real(DP), pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble1PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | real, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal1PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | real, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal1PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:) : | real, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal1PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | integer, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt2PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | integer, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt2PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | integer, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt2PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | real(DP), pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble2PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | real(DP), pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble2PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | real(DP), pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble2PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | real, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal2PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | real, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal2PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:) : | real, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal2PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | integer, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt3PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | integer, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt3PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | integer, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt3PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | real(DP), pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble3PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | real(DP), pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble3PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | real(DP), pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble3PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | real, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal3PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | real, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal3PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:) : | real, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal3PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | integer, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt4PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | integer, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt4PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | integer, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt4PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | real(DP), pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble4PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | real(DP), pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble4PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | real(DP), pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble4PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | real, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal4PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | real, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal4PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:) : | real, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal4PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | integer, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt5PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | integer, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt5PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | integer, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt5PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | real(DP), pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble5PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | real(DP), pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble5PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | real(DP), pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble5PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | real, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal5PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | real, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal5PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:) : | real, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal5PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | integer, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt6PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | integer, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt6PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | integer, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt6PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | real(DP), pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble6PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | real(DP), pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble6PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | real(DP), pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble6PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | real, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal6PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | real, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal6PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:) : | real, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal6PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | integer, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt7PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | integer, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt7PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | integer, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetInt7PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | real(DP), pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble7PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | real(DP), pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble7PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | real(DP), pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetDouble7PointerTimeR
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | real, pointer
| ||
| time : | integer, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal7PointerTimeI
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | real, pointer
| ||
| time : | real(DP), intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal7PointerTimeD
| Subroutine : | |||
| file : | character(*), intent(in) | ||
| varname : | character(*), intent(in) | ||
| array(:,:,:,:,:,:,:) : | real, pointer
| ||
| time : | real, intent(in) | ||
| quiet : | logical, intent(in), optional | ||
| flag_mpi_split : | logical, intent(in), optional | ||
| err : | logical, intent(out), optional |
Note that Japanese and English are described in parallel.
数値型引数 time で時刻指定可能な HistoryGet です. 使用方法に関しては HistoryGet を参照してください.
This is "HistoryGet" with numerical argument time for specification of time. See "HistoryGet", for basic usage.
Original external subprogram is historyget.F90#HistoryGetReal7PointerTimeR
| Function : | |
| result : | logical |
| history : | type(GT_HISTORY), intent(in) |
history が初期設定されている場合には .true. が, 初期設定されていない場合には .false. が返ります.
If history is initialized, .true. is returned. If history is not initialized, .false. is returned.
Alias for HistoryInitialized0
| Subroutine : | |||
| history : | character(*), intent(in) | ||
| err : | logical, intent(out), optional | ||
| file : | character(*), intent(out), optional | ||
| title : | character(*), intent(out), optional | ||
| source : | character(*), intent(out), optional | ||
| dims(:) : | character(*), pointer, optional
| ||
| dimsizes(:) : | integer,pointer, optional
| ||
| longnames(:) : | character(*), pointer, optional
| ||
| units(:) : | character(*), pointer, optional
| ||
| xtypes(:) : | character(*), pointer, optional
| ||
| institution : | character(*), intent(out), optional | ||
| origin : | real,intent(out), optional | ||
| interval : | real,intent(out), optional | ||
| newest : | real,intent(out), optional | ||
| oldest : | real,intent(out), optional | ||
| conventions : | character(*), intent(out), optional | ||
| gt_version : | character(*), intent(out), optional | ||
| axes(:) : | type(GT_HISTORY_AXIS),
pointer, optional
| ||
| varinfo(:) : | type(GT_HISTORY_VARINFO),
pointer, optional
|
HistoryCreate で history を指定しなかった場合はこちらの サブルーチンで問い合わせを行います。 history には必ず "default" という文字列を与えてください。
HistoryInquire は 2 つのサブルーチンの総称名です。 各引数の情報に関しては下記のサブルーチンを参照してください。
Alias for HistoryInquire2
| Subroutine : | |||
| history : | type(GT_HISTORY), intent(in) | ||
| err : | logical, intent(out), optional | ||
| file : | character(*), intent(out), optional | ||
| title : | character(*), intent(out), optional | ||
| source : | character(*), intent(out), optional | ||
| dims(:) : | character(*), pointer, optional
| ||
| dimsizes(:) : | integer,pointer, optional
| ||
| longnames(:) : | character(*), pointer, optional
| ||
| units(:) : | character(*), pointer, optional
| ||
| xtypes(:) : | character(*), pointer, optional
| ||
| institution : | character(*), intent(out), optional | ||
| origin : | real,intent(out), optional | ||
| interval : | real,intent(out), optional | ||
| newest : | real,intent(out), optional
| ||
| oldest : | real,intent(out), optional
| ||
| conventions : | character(*), intent(out), optional | ||
| gt_version : | character(*), intent(out), optional | ||
| axes(:) : | type(GT_HISTORY_AXIS),
pointer, optional
| ||
| varinfo(:) : | type(GT_HISTORY_VARINFO),
pointer, optional
|
HistoryCreate や HistoryAddVariable などで設定した値の 参照を行います。
file, title, source, institution, origin, interval, conventions, gt_version, dims, dimsizes, longnames, units, xtypes に関しては HistoryCreate を参照してください。
title, source, institution, origin, interval, conventions, gt_version に関しては、値が得られなかった場合は "unknown" が返ります。
dims, dimsizes, longnames, units, xtypes に関してはポインタに 値を返すため、必ずポインタを空状態にしてから与えてください。
axes と varinfo にはそれぞれ座標軸情報と変数情報を返します。 将来的には全ての属性の値も一緒に返す予定ですが、現在は long_name, units, xtype のみが属性の値として返ります。
HistoryInquire は 2 つのサブルーチンの総称名です。 HistoryCreate で history を与えなかった場合の問い合わせに関しては 上記のサブルーチンを参照してください。
以下の場合に、このサブルーチンはエラーを生じプログラムを終了させます。 ただし、err 引数を与える場合、この引数に .true. を 返し、プログラムは続行します。
Alias for HistoryInquire1
| Subroutine : | |||
| varname : | character(*), intent(in)
| ||
| array(:) : | real(DP), intent(in)
| ||
| history : | type(GT_HISTORY),
intent(inout), optional, target
| ||
| range : | character(*), intent(in), optional
| ||
| time : | real, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| difftime : | type(DC_DIFFTIME), intent(in), optional
| ||
| time_average_store : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
gtool4 データ内の変数へデータの出力を行います。 このサブルーチンを用いる前に、HistoryCreate による初期設定が必要です。
HistoryPut は複数のサブルーチンの総称名です。array には 0 〜 7 次元のデータを与えることが可能です。 (下記のサブルーチンを参照ください)。 ただし、0 次元のデータを与える際の引数キーワードは value を用いてください。
HistoryPut を最初に呼んだ時、時間次元の変数は HistoryCreate の origin の値に設定されます。
ある変数 varname に対して HistoryPut を複数回呼ぶと、 HistoryCreate の interval × HistoryPut を呼んだ回数、 の分だけ 時間次元の変数の値が増やされます。
これらの時間次元の変数の値を明示的に設定したい場合は HistorySetTime を用いるか、HistoryPut 自身で時間次元の変数へ値 を出力してください。
Alias for HistoryPutDouble1
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutInt1
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutReal1
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutInt2
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutDouble2
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutReal2
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutInt3
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutDouble3
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutReal3
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutInt4
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutDouble4
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutReal4
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutInt5
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutDouble5
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutReal5
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutInt6
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutDouble6
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutReal6
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutInt7
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutDouble7
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutReal7
| Subroutine : | |
| varname : | character(*), intent(in) |
| value : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutInt0
| Subroutine : | |
| varname : | character(*), intent(in) |
| value : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutDouble0
| Subroutine : | |
| varname : | character(*), intent(in) |
| value : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
Alias for HistoryPutReal0
| Subroutine : | |||
| varname : | character(*), intent(in)
| ||
| array(:) : | real(DP), intent(in)
| ||
| history : | type(GT_HISTORY),
intent(inout), optional, target
| ||
| err : | logical, intent(out), optional
|
MPI 使用時に, 各々のノード上のデータを単一ファイルに 集約して出力する場合には, このサブルーチンに領域全体の座標データを与えてください. また, HistoryCreate のオプショナル論理型引数 flag_mpi_gather に .true. を与えてください.
HistoryPut よりも後に使用してください HistoryAddVariable, HistoryAddAttr よりも前に使用してください.
When MPI is used, if data on each node is integrated and output to one file, give data of axes in whole area to this subroutine. And give .true. to optional logical argument flag_mpi_gather in "HistoryCreate".
Use this subroutine after "HistoryPut", and before "HistoryAddVariable", "HistoryAddAttr".
Alias for HistoryPutAxisMPIDouble
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| err : | logical, intent(out), optional |
MPI 使用時に, 各々のノード上のデータを単一ファイルに 集約して出力する場合には, このサブルーチンに領域全体の座標データを与えてください. また, HistoryCreate のオプショナル論理型引数 flag_mpi_gather に .true. を与えてください.
HistoryPut よりも後に使用してください HistoryAddVariable, HistoryAddAttr よりも前に使用してください.
When MPI is used, if data on each node is integrated and output to one file, give data of axes in whole area to this subroutine. And give .true. to optional logical argument flag_mpi_gather in "HistoryCreate".
Use this subroutine after "HistoryPut", and before "HistoryAddVariable", "HistoryAddAttr".
Alias for HistoryPutAxisMPIInt
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| err : | logical, intent(out), optional |
MPI 使用時に, 各々のノード上のデータを単一ファイルに 集約して出力する場合には, このサブルーチンに領域全体の座標データを与えてください. また, HistoryCreate のオプショナル論理型引数 flag_mpi_gather に .true. を与えてください.
HistoryPut よりも後に使用してください HistoryAddVariable, HistoryAddAttr よりも前に使用してください.
When MPI is used, if data on each node is integrated and output to one file, give data of axes in whole area to this subroutine. And give .true. to optional logical argument flag_mpi_gather in "HistoryCreate".
Use this subroutine after "HistoryPut", and before "HistoryAddVariable", "HistoryAddAttr".
Alias for HistoryPutAxisMPIReal
| Subroutine : | recursive | ||
| varname : | character(*), intent(in) | ||
| array(arraysize) : | integer, intent(in) | ||
| arraysize : | integer, intent(in) | ||
| history : | type(GT_HISTORY), intent(inout), target, optional | ||
| range : | character(*), intent(in), optional
| ||
| time : | real, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| difftime : | type(DC_DIFFTIME), intent(in), optional
| ||
| time_average_store : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
こちらは配列サイズを指定する必要があるため、 HistoryPut を利用してください。
Alias for HistoryPutIntEx
| Subroutine : | recursive | ||
| varname : | character(*), intent(in) | ||
| array(arraysize) : | real(DP), intent(in) | ||
| arraysize : | integer, intent(in) | ||
| history : | type(GT_HISTORY), intent(inout), target, optional | ||
| range : | character(*), intent(in), optional
| ||
| time : | real, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| difftime : | type(DC_DIFFTIME), intent(in), optional
| ||
| time_average_store : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
こちらは配列サイズを指定する必要があるため、 HistoryPut を利用してください。
Alias for HistoryPutDoubleEx
| Subroutine : | recursive | ||
| varname : | character(*), intent(in) | ||
| array(arraysize) : | real, intent(in) | ||
| arraysize : | integer, intent(in) | ||
| history : | type(GT_HISTORY), intent(inout), target, optional | ||
| range : | character(*), intent(in), optional
| ||
| time : | real, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| difftime : | type(DC_DIFFTIME), intent(in), optional
| ||
| time_average_store : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
こちらは配列サイズを指定する必要があるため、 HistoryPut を利用してください。
Alias for HistoryPutRealEx
| Subroutine : | |||
| history : | type(GT_HISTORY), intent(in), target, optional | ||
| unit : | integer, intent(in), optional
| ||
| indent : | character(*), intent(in), optional
| ||
| err : | logical, intent(out), optional
|
引数 history に設定されている情報を印字します. デフォルトではメッセージは標準出力に出力されます. unit に装置番号を指定することで, 出力先を変更することが可能です.
Print information of history. By default messages are output to standard output. Unit number for output can be changed by unit argument.
subroutine HistoryPutLine( history, unit, indent, err )
!
! 引数 *history* に設定されている情報を印字します.
! デフォルトではメッセージは標準出力に出力されます.
! *unit* に装置番号を指定することで, 出力先を変更することが可能です.
!
! Print information of *history*.
! By default messages are output to standard output.
! Unit number for output can be changed by *unit* argument.
!
use dc_trace, only: BeginSub, EndSub
use dc_string, only: PutLine, Printf, Split, StrInclude, StoA, JoinChar
use dc_types, only: DP, STRING, TOKEN, STDOUT
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
use gtdata_generic, only: PutLine, Get_Attr
use dc_date, only: EvalByUnit
implicit none
type(GT_HISTORY), intent(in), target, optional:: history
integer, intent(in), optional:: unit
! 出力先の装置番号.
! デフォルトの出力先は標準出力.
!
! Unit number for output.
! Default value is standard output.
character(*), intent(in), optional:: indent
! 表示されるメッセージの字下げ.
!
! Indent of displayed messages.
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
!-----------------------------------
! 作業変数
! Work variables
type(GT_HISTORY), pointer:: hst =>null()
integer:: i, max
integer:: stat
character(STRING):: cause_c
integer:: out_unit
integer:: indent_len
character(STRING):: indent_str
character(STRING):: file, title, source, institution
character(STRING):: conventions, gt_version
character(TOKEN), pointer:: dims(:) =>null()
integer, pointer:: dimsizes(:) =>null()
character(STRING), pointer:: longnames(:) =>null()
character(TOKEN), pointer:: units(:) =>null()
character(TOKEN), pointer:: xtypes(:) =>null()
real:: origin, interval, newest, oldest
character(*), parameter:: subname = 'HistoryPutLine'
continue
call BeginSub( subname )
stat = DC_NOERR
cause_c = ''
!-----------------------------------------------------------------
! 出力先装置番号と字下げの設定
! Configure output unit number and indents
!-----------------------------------------------------------------
if ( present(unit) ) then
out_unit = unit
else
out_unit = STDOUT
end if
indent_len = 0
indent_str = ''
if ( present(indent) ) then
if ( len(indent) /= 0 ) then
indent_len = len(indent)
indent_str(1:indent_len) = indent
end if
end if
if (present(history)) then
hst => history
else
hst => default
endif
!-----------------------------------------------------------------
! "GT_HISTORY" の設定の印字
! Print the settings for "GT_HISTORY"
!-----------------------------------------------------------------
if ( hst % initialized ) then
call Printf( out_unit, indent_str(1:indent_len) // '#<GT_HISTORY:: @initialized=%y', l = (/hst % initialized/) )
call HistoryInquire( history = hst, err = err, file = file, title = title, source = source, institution = institution, dims = dims, dimsizes = dimsizes, longnames = longnames, units = units, xtypes = xtypes, conventions = conventions, gt_version = gt_version ) ! (out)
call Printf( out_unit, indent_str(1:indent_len) // ' @file=%c @title=%c', c1 = trim(file), c2 = trim(title) )
call Printf( out_unit, indent_str(1:indent_len) // ' @source=%c @institution=%c', c1 = trim(source), c2 = trim(institution) )
max = size( dims )
call Printf( out_unit, indent_str(1:indent_len) // ' @dims=%c @dimsizes=%*d', c1 = trim( JoinChar(dims, ',') ), i = dimsizes, n = (/max/) )
deallocate( dims, dimsizes )
call Printf( out_unit, indent_str(1:indent_len) // ' @longnames=%c', c1 = trim( JoinChar(longnames, ',') ) )
deallocate( longnames )
call Printf( out_unit, indent_str(1:indent_len) // ' @units=%c @xtypes=%c', c1 = trim( JoinChar(units, ',') ), c2 = trim( JoinChar(xtypes, ',') ) )
deallocate( units, xtypes )
call Printf( out_unit, indent_str(1:indent_len) // ' @conventions=%c @gt_version=%c', c1 = trim(conventions), c2 = trim(gt_version) )
call Printf( out_unit, indent_str(1:indent_len) // ' @unlimited_index=%d', i = (/hst % unlimited_index/) )
max = size( hst % dim_value_written )
call Printf( out_unit, indent_str(1:indent_len) // ' @dim_value_written=%*y', l = hst % dim_value_written, n = (/max/) )
origin = EvalByUnit( hst % origin, '', hst % unlimited_units_symbol )
interval = EvalByUnit( hst % interval, '', hst % unlimited_units_symbol )
newest = EvalByUnit( hst % newest, '', hst % unlimited_units_symbol )
oldest = EvalByUnit( hst % oldest, '', hst % unlimited_units_symbol )
call Printf( out_unit, indent_str(1:indent_len) // ' @origin=%r @interval=%r @newest=%r @oldest=%r', r = (/origin, interval, newest, oldest/) )
if ( associated( hst % growable_indices ) ) then
max = size( hst % growable_indices )
call Printf( out_unit, indent_str(1:indent_len) // ' @growable_indices=%*d', i = hst % growable_indices, n = (/max/) )
else
call Printf( out_unit, indent_str(1:indent_len) // ' @growable_indices=<null>' )
end if
if ( associated( hst % count ) ) then
max = size( hst % count )
call Printf( out_unit, indent_str(1:indent_len) // ' @count=%*d', i = hst % count, n = (/max/) )
else
call Printf( out_unit, indent_str(1:indent_len) // ' @count=<null>' )
end if
if ( associated( hst % dimvars ) ) then
call Printf( out_unit, indent_str(1:indent_len) // ' @dimvars=' )
max = size( hst % dimvars )
do i = 1, max
call PutLine( hst % dimvars(i), out_unit, indent_str(1:indent_len) // ' ', err )
end do
else
call Printf( out_unit, indent_str(1:indent_len) // ' @dimvars=<null>' )
end if
if ( associated( hst % vars ) ) then
call Printf( out_unit, indent_str(1:indent_len) // ' @vars=' )
max = size( hst % vars )
do i = 1, max
call PutLine( hst % vars(i), out_unit, indent_str(1:indent_len) // ' ', err )
end do
else
call Printf( out_unit, indent_str(1:indent_len) // ' @vars=<null>' )
end if
if ( associated( hst % var_avr_count ) ) then
max = size( hst % var_avr_count )
call Printf( out_unit, indent_str(1:indent_len) // ' @var_avr_count=%*d', i = hst % var_avr_count, n = (/max/) )
else
call Printf( out_unit, indent_str(1:indent_len) // ' @var_avr_count=<null>' )
end if
if ( associated( hst % var_avr_firstput ) ) then
max = size( hst % var_avr_firstput )
call Printf( out_unit, indent_str(1:indent_len) // ' @var_avr_firstput=%*b', l = hst % var_avr_firstput, n = (/max/) )
else
call Printf( out_unit, indent_str(1:indent_len) // ' @var_avr_firstput=<null>' )
end if
if ( associated( hst % var_avr_coefsum ) ) then
max = size( hst % var_avr_coefsum )
call Printf( out_unit, indent_str(1:indent_len) // ' @var_avr_coefsum=%*f', d = hst % var_avr_coefsum, n = (/max/) )
else
call Printf( out_unit, indent_str(1:indent_len) // ' @var_avr_coefsum=<null>' )
end if
call Printf( out_unit, indent_str(1:indent_len) // ' @time_bnds=%*f, @time_bnds_output_count=%d', i = (/hst % time_bnds_output_count/), d = hst % time_bnds, n = (/ size(hst % time_bnds) /) )
if ( associated( hst % var_avr_data ) ) then
call Printf( out_unit, indent_str(1:indent_len) // ' @var_avr_data=' )
max = size( hst % var_avr_data )
do i = 1, max
call Printf( out_unit, indent_str(1:indent_len) // ' #<GT_HISTORY_AVRDATA:: @length=%d', i = (/hst % var_avr_data(i) % length/) )
call PutLine( hst % var_avr_data(i) % a_DataAvr, unit = out_unit, lbounds = lbound(hst % var_avr_data(i) % a_DataAvr), ubounds = ubound(hst % var_avr_data(i) % a_DataAvr), indent = indent_str(1:indent_len) // ' @a_DataAvr=' )
end do
else
call Printf( out_unit, indent_str(1:indent_len) // ' @var_avr_data=<null>' )
end if
call Printf( out_unit, indent_str(1:indent_len) // '>' )
else
call Printf( out_unit, indent_str(1:indent_len) // '#<GT_HISTORY:: @initialized=%y>', l = (/hst % initialized/) )
end if
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub( subname )
end subroutine HistoryPutLine
| Subroutine : | |||
| time : | real, intent(in), optional
| ||
| history : | type(GT_HISTORY),
intent(inout), optional, target
| ||
| difftime : | type(DC_DIFFTIME), intent(in), optional
|
明示的に時刻指定を行なうためのサブルーチンです。 このサブルーチンを用いる前に、HistoryCreate による初期設定が必要です。 このサブルーチンを使用する事で HistoryCreate の interval が無効 になるので注意してください。
subroutine HistorySetTime(time, history, difftime)
!
!== 時刻指定
!
! 明示的に時刻指定を行なうためのサブルーチンです。
! このサブルーチンを用いる前に、HistoryCreate による初期設定が必要です。
! このサブルーチンを使用する事で HistoryCreate の *interval* が無効
! になるので注意してください。
!
!
!
use gtdata_generic, only: Slice, Put, Get
use dc_date, only: DCDiffTimeCreate, operator(<), operator(>), EvalByUnit, min, max, DCDiffTimePutLine
use dc_trace, only: BeginSub, EndSub, DbgMessage, Debug
implicit none
real, intent(in), optional:: time
! 時刻
!
! ここで言う "時刻" とは、
! HistoryCreate の *dims* で "0"
! と指定されたものです。
! もしも時刻が定義されていな
! い場合は、 このサブルーチン
! は何の効果も及ぼしません。
!
type(GT_HISTORY), intent(inout), optional, target:: history
! 出力ファイルの設定に関する情報を
! 格納した構造体
!
! ここに指定するものは、
! HistoryCreate によって初期設定
! されていなければなりません。
!
type(DC_DIFFTIME), intent(in), optional:: difftime
! 時刻 (dc_date_types#DC_DIFFTIME 型)
!
! ここで言う "時刻" とは、
! HistoryCreate の *dims* で "0"
! と指定されたものです。
! もしも時刻が定義されていな
! い場合は、 このサブルーチン
! は何の効果も及ぼしません。
!
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE):: var
real, pointer:: buffer(:) =>null()
type(DC_DIFFTIME):: dt
real(DP):: timew
logical:: err
#ifdef LIB_MPI
integer:: err_mpi
#endif
character(*), parameter:: subname = "HistorySetTime"
continue
call BeginSub(subname)
if (present(history)) then
hst => history
else
hst => default
endif
if ( present(time) ) call DbgMessage('time=%r', r = (/time/) )
if ( present(difftime) .and. Debug() ) then
timew = EvalByUnit( difftime, '', hst % unlimited_units_symbol )
call DbgMessage('time=%f', d = (/timew/) )
end if
if (hst % unlimited_index == 0) then
goto 999
endif
var = hst % dimvars(hst % unlimited_index)
hst % dim_value_written(hst % unlimited_index) = .true.
if ( present(difftime) ) then
dt = difftime
timew = EvalByUnit( dt, '', hst % unlimited_units_symbol )
elseif ( present(time) ) then
call DCDiffTimeCreate( dt, time, '', hst % unlimited_units_symbol ) ! (in)
timew = time
end if
if ( dt < hst % oldest .or. dt > hst % newest .or. hst % count(2) == 0 ) then
hst % count(:) = maxval(hst % count(:)) + 1
hst % newest = max(hst % newest, dt)
hst % oldest = min(hst % oldest, dt)
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
call Slice(var, 1, start=hst % count(1), count=1)
timew = EvalByUnit( dt, '', hst % unlimited_units_symbol )
call Put(var, (/timew/), 1, err)
if (err) call DumpError()
#ifdef LIB_MPI
end if
#endif
goto 999
endif
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
call Slice(var, 1, start=1, count=hst % count(2))
nullify(buffer)
call Get(var, buffer, err)
hst % count(1:1) = minloc(abs(buffer - timew))
#ifdef LIB_MPI
if ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) then
call MPI_Bcast( hst % count(1:1), 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
end if
elseif ( hst % mpi_gather .and. hst % mpi_myrank /= 0 ) then
call MPI_Bcast( hst % count(1:1), 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
end if
#endif
999 continue
call EndSub(subname)
end subroutine HistorySetTime
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | character(*), intent(in)
| ||
| err : | logical, intent(out), optional
|
GT_HISTORY_VARINFO 型の変数 varinfo へ属性を付加します。
HistoryVarinfoAddAttr は複数のサブルーチンの総称名です。 value には様々な型の引数を与えることが可能です。 下記のサブルーチンを参照ください。
Alias for HistoryVarinfoAddAttrChar0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | integer, intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrInt0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | logical, intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrLogical0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real(DP), intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrDouble0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real, intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrReal0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | integer, intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrInt1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real(DP), intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrDouble1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real, intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrReal1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| err : | logical, intent(out), optional
|
varinfo で与えられた変数を HistoryVarinfoCreate による初期設定よりも さらに前の状態に初期化します。
Destructor of GT_HISTORY_VARINFO
Alias for HistoryVarinfoClear0
| Subroutine : | |||
| varinfo_dest : | type(GT_HISTORY_VARINFO),intent(out) | ||
| varinfo_src : | type(GT_HISTORY_VARINFO),intent(in) | ||
| err : | logical, intent(out), optional | ||
| name : | character(*) , intent(in), optional
| ||
| dims(:) : | character(*) , intent(in), optional, target
| ||
| longname : | character(*) , intent(in), optional
| ||
| units : | character(*) , intent(in), optional
| ||
| xtype : | character(*) , intent(in), optional
|
GT_HISTORY_VARINFO 型の変数 varinfo_src を varinfo_dest にコピーします。 varinfo_src は HistoryVarinfoCreate によって初期設定されている必要が あります。 さらに属性を付加する場合には HistoryVarinfoAddAttr を用いてください。
err を与えておくと、コピーの際何らかの不具合が生じても 終了せずに err が真になって返ります。
err 以降の引数は、コピーの際に上書きする値です。
Alias for HistoryVarinfoCopy1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| name : | character(*), intent(in)
| ||
| dims(:) : | character(*), intent(in)
| ||
| longname : | character(*), intent(in)
| ||
| units : | character(*), intent(in)
| ||
| xtype : | character(*), intent(in), optional
| ||
| time_average : | logical, intent(in), optional
| ||
| average : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
GT_HISTORY_VARINFO 型変数を作成します。 このサブルーチンによる設定の後、 HistoryAddVariable の varinfo に与えます。 さらに属性を付加する場合には HistoryVarinfoAddAttr を用いてください。
Constructor of GT_HISTORY_VARINFO
Alias for HistoryVarinfoCreate1
| Function : | |
| result : | logical |
| varinfo : | type(GT_HISTORY_VARINFO),intent(in) |
varinfo が初期設定されている場合には .true. が, 初期設定されていない場合には .false. が返ります.
If varinfo is initialized, .true. is returned. If varinfo is not initialized, .false. is returned.
Alias for HistoryVarinfoInitialized0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(in) | ||
| name : | character(*), intent(out), optional
| ||
| dims(:) : | character(*), pointer, optional
| ||
| longname : | character(*), intent(out), optional
| ||
| units : | character(*), intent(out), optional
| ||
| xtype : | character(*), intent(out), optional
| ||
| time_average : | logical, intent(out), optional
| ||
| average : | logical, intent(out), optional
| ||
| err : | logical, intent(out), optional
|
(out) optional
GT_HISTORY_VARINFO 型の変数内の各情報を参照します。
dims はポインタ配列です。空状態にして与えてください。
Alias for HistoryVarinfoInquire1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(in) | ||
| name : | character(*) , intent(out), optional
| ||
| size : | integer, intent(out), optional
| ||
| longname : | character(*) , intent(out), optional
| ||
| units : | character(*) , intent(out), optional
| ||
| xtype : | character(*) , intent(out), optional
|
GT_HISTORY_AXIS 型の変数内の各情報を参照します。
Alias for HistoryAxisInquire1
| Subroutine : | |||
| history : | character(*), intent(in) | ||
| err : | logical, intent(out), optional | ||
| file : | character(*), intent(out), optional | ||
| title : | character(*), intent(out), optional | ||
| source : | character(*), intent(out), optional | ||
| dims(:) : | character(*), pointer, optional
| ||
| dimsizes(:) : | integer,pointer, optional
| ||
| longnames(:) : | character(*), pointer, optional
| ||
| units(:) : | character(*), pointer, optional
| ||
| xtypes(:) : | character(*), pointer, optional
| ||
| institution : | character(*), intent(out), optional | ||
| origin : | real,intent(out), optional | ||
| interval : | real,intent(out), optional | ||
| newest : | real,intent(out), optional | ||
| oldest : | real,intent(out), optional | ||
| conventions : | character(*), intent(out), optional | ||
| gt_version : | character(*), intent(out), optional | ||
| axes(:) : | type(GT_HISTORY_AXIS),
pointer, optional
| ||
| varinfo(:) : | type(GT_HISTORY_VARINFO),
pointer, optional
|
HistoryCreate で history を指定しなかった場合はこちらの サブルーチンで問い合わせを行います。 history には必ず "default" という文字列を与えてください。
HistoryInquire は 2 つのサブルーチンの総称名です。 各引数の情報に関しては下記のサブルーチンを参照してください。
Alias for HistoryInquire2
| Subroutine : | |||
| history : | type(GT_HISTORY), intent(in) | ||
| err : | logical, intent(out), optional | ||
| file : | character(*), intent(out), optional | ||
| title : | character(*), intent(out), optional | ||
| source : | character(*), intent(out), optional | ||
| dims(:) : | character(*), pointer, optional
| ||
| dimsizes(:) : | integer,pointer, optional
| ||
| longnames(:) : | character(*), pointer, optional
| ||
| units(:) : | character(*), pointer, optional
| ||
| xtypes(:) : | character(*), pointer, optional
| ||
| institution : | character(*), intent(out), optional | ||
| origin : | real,intent(out), optional | ||
| interval : | real,intent(out), optional | ||
| newest : | real,intent(out), optional
| ||
| oldest : | real,intent(out), optional
| ||
| conventions : | character(*), intent(out), optional | ||
| gt_version : | character(*), intent(out), optional | ||
| axes(:) : | type(GT_HISTORY_AXIS),
pointer, optional
| ||
| varinfo(:) : | type(GT_HISTORY_VARINFO),
pointer, optional
|
HistoryCreate や HistoryAddVariable などで設定した値の 参照を行います。
file, title, source, institution, origin, interval, conventions, gt_version, dims, dimsizes, longnames, units, xtypes に関しては HistoryCreate を参照してください。
title, source, institution, origin, interval, conventions, gt_version に関しては、値が得られなかった場合は "unknown" が返ります。
dims, dimsizes, longnames, units, xtypes に関してはポインタに 値を返すため、必ずポインタを空状態にしてから与えてください。
axes と varinfo にはそれぞれ座標軸情報と変数情報を返します。 将来的には全ての属性の値も一緒に返す予定ですが、現在は long_name, units, xtype のみが属性の値として返ります。
HistoryInquire は 2 つのサブルーチンの総称名です。 HistoryCreate で history を与えなかった場合の問い合わせに関しては 上記のサブルーチンを参照してください。
以下の場合に、このサブルーチンはエラーを生じプログラムを終了させます。 ただし、err 引数を与える場合、この引数に .true. を 返し、プログラムは続行します。
Alias for HistoryInquire1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(in) | ||
| name : | character(*), intent(out), optional
| ||
| dims(:) : | character(*), pointer, optional
| ||
| longname : | character(*), intent(out), optional
| ||
| units : | character(*), intent(out), optional
| ||
| xtype : | character(*), intent(out), optional
| ||
| time_average : | logical, intent(out), optional
| ||
| average : | logical, intent(out), optional
| ||
| err : | logical, intent(out), optional
|
(out) optional
GT_HISTORY_VARINFO 型の変数内の各情報を参照します。
dims はポインタ配列です。空状態にして与えてください。
Alias for HistoryVarinfoInquire1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | character(*), intent(in)
|
GT_HISTORY_AXIS 型の変数 axis へ属性を付加します。
HistoryAxisAddAttr は複数のサブルーチンの総称名です。 value には様々な型の引数を与えることが可能です。 下記のサブルーチンを参照ください。
Alias for HistoryAxisAddAttrChar0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | integer, intent(in) |
Alias for HistoryAxisAddAttrInt0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | logical, intent(in) |
Alias for HistoryAxisAddAttrLogical0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real(DP), intent(in) |
Alias for HistoryAxisAddAttrDouble0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real, intent(in) |
Alias for HistoryAxisAddAttrReal0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | integer, intent(in) |
Alias for HistoryAxisAddAttrInt1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real(DP), intent(in) |
Alias for HistoryAxisAddAttrDouble1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real, intent(in) |
Alias for HistoryAxisAddAttrReal1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | character(*), intent(in)
| ||
| err : | logical, intent(out), optional
|
GT_HISTORY_VARINFO 型の変数 varinfo へ属性を付加します。
HistoryVarinfoAddAttr は複数のサブルーチンの総称名です。 value には様々な型の引数を与えることが可能です。 下記のサブルーチンを参照ください。
Alias for HistoryVarinfoAddAttrChar0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | integer, intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrInt0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | logical, intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrLogical0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real(DP), intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrDouble0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real, intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrReal0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | integer, intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrInt1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real(DP), intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrDouble1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real, intent(in) | ||
| err : | logical, intent(out), optional
|
Alias for HistoryVarinfoAddAttrReal1
| Constant : | |||
| gtool4_netCDF_Conventions = "www.gfd-dennou.org/library/gtool4/conventions/" : | character(len = STRING), parameter, public
|
| Constant : | |||
| gtool4_netCDF_version = "4.3" : | character(len = STRING), parameter, public
|
| Function : | |
| result : | logical |
| history : | type(GT_HISTORY), intent(in) |
history が初期設定されている場合には .true. が, 初期設定されていない場合には .false. が返ります.
If history is initialized, .true. is returned. If history is not initialized, .false. is returned.
Alias for HistoryInitialized0
| Function : | |
| result : | integer |
| history : | type(GT_HISTORY), intent(in) |
| varname : | character(len = *), intent(in) |
history 内の varname 変数の変数番号を返す. 現在, 明示的に history 変数を与えない場合の変数番号の 検索は出来ない.
integer function lookup_variable_ord(history, varname) result(result)
!
! history 内の varname 変数の変数番号を返す.
! 現在, 明示的に history 変数を与えない場合の変数番号の
! 検索は出来ない.
!
use dc_types, only: string
use gtdata_generic, only: inquire
type(GT_HISTORY), intent(in):: history
character(len = *), intent(in):: varname
character(len = string):: name
character(len = *), parameter:: subname = 'lookup_variable_ord'
continue
call BeginSub(subname)
if (associated(history % vars)) then
do, result = 1, size(history % vars)
call Inquire(history % vars(result), name=name)
if (name == varname) goto 999
call DbgMessage('no match <%c> <%c>', c1=trim(name), c2=trim(varname))
enddo
endif
result = 0
999 continue
call EndSub(subname, "result=%d", i=(/result/))
end function
| Derived Type : | |||
| attrname : | character(TOKEN)
| ||
| attrtype : | character(TOKEN)
| ||
| array = .false. : | logical
| ||
| Charvalue : | character(STRING)
| ||
| Intvalue : | integer
| ||
| Realvalue : | real
| ||
| Doublevalue : | real(DP)
| ||
| Logicalvalue : | logical
| ||
| Intarray(:) =>null() : | integer ,pointer
| ||
| Realarray(:) =>null() : | real ,pointer
| ||
| Doublearray(:) =>null() : | real(DP) ,pointer
|
変数の属性情報の構造体. 外部参照はさせず, GT_HISTORY_VARINFO および GT_HISTORY_AXIS に内包されて利用されることを 想定している. 直接的にこの構造体を変数にとる サブルーチンは HistoryAttrAdd および HistoryAttrCopy.
| Derived Type : | |
| a_DataAvr(:) =>null() : | real(DP), pointer |
| length : | integer |
時間方向の平均値を出力するためのデータ一時保管用配列.
Array for temporary keeping data for time average value output.
| Derived Type : | |||
| a_Axis(:) =>null() : | real(DP), pointer | ||
| length = -1 : | integer | ||
| attrs(:) =>null() : | type(GT_HISTORY_ATTR),
pointer
|
MPI 使用時に, 軸データを保管するための配列.
Array for keeping data of axes when MPI is used.
| Derived Type : | |
| index_all(:,:) =>null() : | integer, pointer |
| length(:) =>null() : | integer, pointer |
MPI 使用時に, データを一箇所に集約する際に必要な情報.
Information for integration of data when MPI is used.
| Derived Type : | |
| already_output = .false. : | logical |
| axes(:) =>null() : | type(GT_HISTORY_AXIS), pointer |
| overwrite : | logical |
| file : | character(STRING) |
| title : | character(STRING) |
| source : | character(STRING) |
| institution : | character(STRING) |
| conventions : | character(STRING) |
| gt_version : | character(TOKEN) |
| gtver_add : | logical |
| quiet : | logical |
| nc_history : | character(STRING) |
MPI 使用時に, ファイルに書き出す基本情報. (各ノード上のデータを統合して一つのファイルに出力する際に使用)
Basic information output to a file when MPI is used. (This is used when data on each node is integrated and output to one file )
| Derived Type : | |
| each2all(:,:) =>null() : | integer, pointer |
| allcount(:) =>null() : | integer, pointer |
| allcount_all = 0 : | integer |
MPI 使用時に, データを一箇所に集約する際に必要な情報.
Information for integration of data when MPI is used.
| Subroutine : | |||
| varname : | character(*), intent(in)
| ||
| attrname : | character(*), intent(in)
| ||
| value : | character(*), intent(in)
| ||
| history : | type(GT_HISTORY),
intent(inout), target, optional
| ||
| err : | logical, intent(out), optional
|
gtool4 データおよびそのデータ内の変数に属性を付加します。 このサブルーチンを用いる前に、 HistoryCreate による初期設定が 必要です。
属性名 attrname の先頭にプラス "+" を付加する 場合は、gtool4 データ自体の属性 (大域属性) として属性が付加されます この場合、varname は無視されますが、その場合でも varname へは 引数の解説にもある通り有効な値を与えてください。
HistoryAddAttr は複数のサブルーチンの総称名です。value には いくつかの型を与えることが可能です。 下記のサブルーチンを参照ください。
subroutine HistoryAddAttrChar0( varname, attrname, value, history, err)
!
!
!== gtool4 データ内の変数への属性付加
!
! gtool4 データおよびそのデータ内の変数に属性を付加します。
! このサブルーチンを用いる前に、 HistoryCreate による初期設定が
! 必要です。
!
! 属性名 *attrname* の先頭にプラス "<b><tt>+</tt></b>" を付加する
! 場合は、gtool4 データ自体の属性 (大域属性) として属性が付加されます
! この場合、*varname* は無視されますが、その場合でも *varname* へは
! 引数の解説にもある通り有効な値を与えてください。
!
! *HistoryAddAttr* は複数のサブルーチンの総称名です。*value* には
! いくつかの型を与えることが可能です。
! 下記のサブルーチンを参照ください。
!
!
use gtdata_generic, only: Put_Attr
use dc_string, only: toChar, JoinChar
use dc_url, only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, NF_ENOTVAR, HST_EMPINOAXISDATA
use dc_message, only: MessageNotify
implicit none
character(*), intent(in):: varname
! 変数の名前。
!
! ここで指定するものは、
! HistoryCreateの *dims* 、
! または HistoryAddVariable の
! *varname* で既に指定されてい
! なければなりません。
!
character(*), intent(in):: attrname
! 変数またはファイル全体に付
! 加する属性の名前
!
! "<b><tt>+</tt></b>" (プラ
! ス) を属性名の先頭につける
! 場合には、ファイル全体に属
! 性を付加します。
! ファイル全体へ属性を付加
! する場合でも、 HistoryCreate
! の *dims* 、または
! HistoryAddVariable の
! *varname* で既に指定されてい
! る変数を *varname* に指定する
! 必要があります。
!
character(*), intent(in):: value
! 属性の値
!
type(GT_HISTORY), intent(inout), target, optional:: history
! 出力ファイルの設定に関する情報を
! 格納した構造体
!
! ここに指定するものは、
! HistoryCreate によって初期設定
! されていなければなりません。
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE):: var
integer:: v_ord
logical:: err_not_found
integer:: stat
character(STRING):: cause_c
character(len = *), parameter:: subname = "HistoryAddAttrChar0"
continue
call BeginSub(subname, 'varname=<%c> attrname=<%c>, value=<%c>', c1=trim(varname), c2=trim(attrname), c3=trim(value))
stat = DC_NOERR
cause_c = ''
! 操作対象決定
if (present(history)) then
hst => history
else
hst => default
endif
#ifdef LIB_MPI
if ( hst % mpi_gather .and. .not. hst % mpi_fileinfo % already_output ) then
call MessageNotify('W', subname, 'Specify data of axes in whole area by "HistoryPutAxisMPI" explicitly ' // 'before "call HistoryAddAttr".' )
stat = HST_EMPINOAXISDATA
cause_c = ''
goto 999
end if
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
if (varname == "") then
! とりあえず無駄だが大域属性を何度もつける
do, v_ord = 1, size(hst % vars)
call Put_Attr(hst % vars(v_ord), GT_PLUS // attrname, value)
enddo
else
call lookup_var_or_dim( hst, varname, var, err_not_found )
if ( .not. err_not_found ) then
call Put_Attr(var, attrname, value)
else
stat = NF_ENOTVAR
cause_c = 'varname="' // trim(varname) // '" is not found'
goto 999
endif
endif
#ifdef LIB_MPI
end if
#endif
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
subroutine HistoryAddAttrDouble0( varname, attrname, value, history, err)
!
!
use gtdata_generic, only: Put_Attr
use dc_string, only: toChar, JoinChar
use dc_url, only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, NF_ENOTVAR, HST_EMPINOAXISDATA
use dc_message, only: MessageNotify
implicit none
character(*), intent(in):: varname
character(*), intent(in):: attrname
real(DP), intent(in):: value
type(GT_HISTORY), intent(inout), target, optional:: history
logical, intent(out), optional:: err
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE):: var
integer:: v_ord
logical:: err_not_found
integer:: stat
character(STRING):: cause_c
character(len = *), parameter:: subname = "HistoryAddAttrDouble0"
continue
call BeginSub(subname, 'varname=<%c> attrname=<%c>, value=<%c>', c1=trim(varname), c2=trim(attrname), c3=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
! 操作対象決定
if (present(history)) then
hst => history
else
hst => default
endif
#ifdef LIB_MPI
if ( hst % mpi_gather .and. .not. hst % mpi_fileinfo % already_output ) then
call MessageNotify('W', subname, 'Specify data of axes in whole area by "HistoryPutAxisMPI" explicitly ' // 'before "call HistoryAddAttr".' )
stat = HST_EMPINOAXISDATA
cause_c = ''
goto 999
end if
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
if (varname == "") then
! とりあえず無駄だが大域属性を何度もつける
do, v_ord = 1, size(hst % vars)
call Put_Attr(hst % vars(v_ord), GT_PLUS // attrname, (/value/))
enddo
else
call lookup_var_or_dim( hst, varname, var, err_not_found )
if ( .not. err_not_found ) then
call Put_Attr(var, attrname, (/value/))
else
stat = NF_ENOTVAR
cause_c = 'varname="' // trim(varname) // '" is not found'
goto 999
endif
endif
#ifdef LIB_MPI
end if
#endif
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value(:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
subroutine HistoryAddAttrDouble1( varname, attrname, value, history, err)
!
!
use gtdata_generic, only: Put_Attr
use dc_string, only: toChar, JoinChar
use dc_url, only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, NF_ENOTVAR, HST_EMPINOAXISDATA
use dc_message, only: MessageNotify
implicit none
character(*), intent(in):: varname
character(*), intent(in):: attrname
real(DP), intent(in):: value(:)
type(GT_HISTORY), intent(inout), target, optional:: history
logical, intent(out), optional:: err
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE):: var
integer:: v_ord
logical:: err_not_found
integer:: stat
character(STRING):: cause_c
character(len = *), parameter:: subname = "HistoryAddAttrDouble1"
continue
call BeginSub(subname, 'varname=<%c> attrname=<%c>, value=<%c>', c1=trim(varname), c2=trim(attrname), c3=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
! 操作対象決定
if (present(history)) then
hst => history
else
hst => default
endif
#ifdef LIB_MPI
if ( hst % mpi_gather .and. .not. hst % mpi_fileinfo % already_output ) then
call MessageNotify('W', subname, 'Specify data of axes in whole area by "HistoryPutAxisMPI" explicitly ' // 'before "call HistoryAddAttr".' )
stat = HST_EMPINOAXISDATA
cause_c = ''
goto 999
end if
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
if (varname == "") then
! とりあえず無駄だが大域属性を何度もつける
do, v_ord = 1, size(hst % vars)
call Put_Attr(hst % vars(v_ord), GT_PLUS // attrname, (/value/))
enddo
else
call lookup_var_or_dim( hst, varname, var, err_not_found )
if ( .not. err_not_found ) then
call Put_Attr(var, attrname, (/value/))
else
stat = NF_ENOTVAR
cause_c = 'varname="' // trim(varname) // '" is not found'
goto 999
endif
endif
#ifdef LIB_MPI
end if
#endif
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
subroutine HistoryAddAttrInt0( varname, attrname, value, history, err)
!
!
use gtdata_generic, only: Put_Attr
use dc_string, only: toChar, JoinChar
use dc_url, only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, NF_ENOTVAR, HST_EMPINOAXISDATA
use dc_message, only: MessageNotify
implicit none
character(*), intent(in):: varname
character(*), intent(in):: attrname
integer, intent(in):: value
type(GT_HISTORY), intent(inout), target, optional:: history
logical, intent(out), optional:: err
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE):: var
integer:: v_ord
logical:: err_not_found
integer:: stat
character(STRING):: cause_c
character(len = *), parameter:: subname = "HistoryAddAttrInt0"
continue
call BeginSub(subname, 'varname=<%c> attrname=<%c>, value=<%c>', c1=trim(varname), c2=trim(attrname), c3=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
! 操作対象決定
if (present(history)) then
hst => history
else
hst => default
endif
#ifdef LIB_MPI
if ( hst % mpi_gather .and. .not. hst % mpi_fileinfo % already_output ) then
call MessageNotify('W', subname, 'Specify data of axes in whole area by "HistoryPutAxisMPI" explicitly ' // 'before "call HistoryAddAttr".' )
stat = HST_EMPINOAXISDATA
cause_c = ''
goto 999
end if
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
if (varname == "") then
! とりあえず無駄だが大域属性を何度もつける
do, v_ord = 1, size(hst % vars)
call Put_Attr(hst % vars(v_ord), GT_PLUS // attrname, (/value/))
enddo
else
call lookup_var_or_dim( hst, varname, var, err_not_found )
if ( .not. err_not_found ) then
call Put_Attr(var, attrname, (/value/))
else
stat = NF_ENOTVAR
cause_c = 'varname="' // trim(varname) // '" is not found'
goto 999
endif
endif
#ifdef LIB_MPI
end if
#endif
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value(:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
subroutine HistoryAddAttrInt1( varname, attrname, value, history, err)
!
!
use gtdata_generic, only: Put_Attr
use dc_string, only: toChar, JoinChar
use dc_url, only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, NF_ENOTVAR, HST_EMPINOAXISDATA
use dc_message, only: MessageNotify
implicit none
character(*), intent(in):: varname
character(*), intent(in):: attrname
integer, intent(in):: value(:)
type(GT_HISTORY), intent(inout), target, optional:: history
logical, intent(out), optional:: err
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE):: var
integer:: v_ord
logical:: err_not_found
integer:: stat
character(STRING):: cause_c
character(len = *), parameter:: subname = "HistoryAddAttrInt1"
continue
call BeginSub(subname, 'varname=<%c> attrname=<%c>, value=<%c>', c1=trim(varname), c2=trim(attrname), c3=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
! 操作対象決定
if (present(history)) then
hst => history
else
hst => default
endif
#ifdef LIB_MPI
if ( hst % mpi_gather .and. .not. hst % mpi_fileinfo % already_output ) then
call MessageNotify('W', subname, 'Specify data of axes in whole area by "HistoryPutAxisMPI" explicitly ' // 'before "call HistoryAddAttr".' )
stat = HST_EMPINOAXISDATA
cause_c = ''
goto 999
end if
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
if (varname == "") then
! とりあえず無駄だが大域属性を何度もつける
do, v_ord = 1, size(hst % vars)
call Put_Attr(hst % vars(v_ord), GT_PLUS // attrname, (/value/))
enddo
else
call lookup_var_or_dim( hst, varname, var, err_not_found )
if ( .not. err_not_found ) then
call Put_Attr(var, attrname, (/value/))
else
stat = NF_ENOTVAR
cause_c = 'varname="' // trim(varname) // '" is not found'
goto 999
endif
endif
#ifdef LIB_MPI
end if
#endif
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value : | logical, intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
subroutine HistoryAddAttrLogical0( varname, attrname, value, history, err)
!
!
use gtdata_generic, only: Put_Attr
use dc_string, only: toChar, JoinChar
use dc_url, only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, NF_ENOTVAR, HST_EMPINOAXISDATA
use dc_message, only: MessageNotify
implicit none
character(*), intent(in):: varname
character(*), intent(in):: attrname
logical, intent(in):: value
type(GT_HISTORY), intent(inout), target, optional:: history
logical, intent(out), optional:: err
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE):: var
integer:: v_ord
logical:: err_not_found
integer:: stat
character(STRING):: cause_c
character(len = *), parameter:: subname = "HistoryAddAttrLogical0"
continue
call BeginSub(subname, 'varname=<%c> attrname=<%c>, value=<%c>', c1=trim(varname), c2=trim(attrname), c3=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
! 操作対象決定
if (present(history)) then
hst => history
else
hst => default
endif
#ifdef LIB_MPI
if ( hst % mpi_gather .and. .not. hst % mpi_fileinfo % already_output ) then
call MessageNotify('W', subname, 'Specify data of axes in whole area by "HistoryPutAxisMPI" explicitly ' // 'before "call HistoryAddAttr".' )
stat = HST_EMPINOAXISDATA
cause_c = ''
goto 999
end if
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
if (varname == "") then
! とりあえず無駄だが大域属性を何度もつける
do, v_ord = 1, size(hst % vars)
call Put_Attr(hst % vars(v_ord), GT_PLUS // attrname, value)
enddo
else
call lookup_var_or_dim( hst, varname, var, err_not_found )
if ( .not. err_not_found ) then
call Put_Attr(var, attrname, value)
else
stat = NF_ENOTVAR
cause_c = 'varname="' // trim(varname) // '" is not found'
goto 999
endif
endif
#ifdef LIB_MPI
end if
#endif
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
subroutine HistoryAddAttrReal0( varname, attrname, value, history, err)
!
!
use gtdata_generic, only: Put_Attr
use dc_string, only: toChar, JoinChar
use dc_url, only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, NF_ENOTVAR, HST_EMPINOAXISDATA
use dc_message, only: MessageNotify
implicit none
character(*), intent(in):: varname
character(*), intent(in):: attrname
real, intent(in):: value
type(GT_HISTORY), intent(inout), target, optional:: history
logical, intent(out), optional:: err
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE):: var
integer:: v_ord
logical:: err_not_found
integer:: stat
character(STRING):: cause_c
character(len = *), parameter:: subname = "HistoryAddAttrReal0"
continue
call BeginSub(subname, 'varname=<%c> attrname=<%c>, value=<%c>', c1=trim(varname), c2=trim(attrname), c3=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
! 操作対象決定
if (present(history)) then
hst => history
else
hst => default
endif
#ifdef LIB_MPI
if ( hst % mpi_gather .and. .not. hst % mpi_fileinfo % already_output ) then
call MessageNotify('W', subname, 'Specify data of axes in whole area by "HistoryPutAxisMPI" explicitly ' // 'before "call HistoryAddAttr".' )
stat = HST_EMPINOAXISDATA
cause_c = ''
goto 999
end if
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
if (varname == "") then
! とりあえず無駄だが大域属性を何度もつける
do, v_ord = 1, size(hst % vars)
call Put_Attr(hst % vars(v_ord), GT_PLUS // attrname, (/value/))
enddo
else
call lookup_var_or_dim( hst, varname, var, err_not_found )
if ( .not. err_not_found ) then
call Put_Attr(var, attrname, (/value/))
else
stat = NF_ENOTVAR
cause_c = 'varname="' // trim(varname) // '" is not found'
goto 999
endif
endif
#ifdef LIB_MPI
end if
#endif
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrname : | character(*), intent(in) |
| value(:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
| err : | logical, intent(out), optional |
subroutine HistoryAddAttrReal1( varname, attrname, value, history, err)
!
!
use gtdata_generic, only: Put_Attr
use dc_string, only: toChar, JoinChar
use dc_url, only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, NF_ENOTVAR, HST_EMPINOAXISDATA
use dc_message, only: MessageNotify
implicit none
character(*), intent(in):: varname
character(*), intent(in):: attrname
real, intent(in):: value(:)
type(GT_HISTORY), intent(inout), target, optional:: history
logical, intent(out), optional:: err
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE):: var
integer:: v_ord
logical:: err_not_found
integer:: stat
character(STRING):: cause_c
character(len = *), parameter:: subname = "HistoryAddAttrReal1"
continue
call BeginSub(subname, 'varname=<%c> attrname=<%c>, value=<%c>', c1=trim(varname), c2=trim(attrname), c3=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
! 操作対象決定
if (present(history)) then
hst => history
else
hst => default
endif
#ifdef LIB_MPI
if ( hst % mpi_gather .and. .not. hst % mpi_fileinfo % already_output ) then
call MessageNotify('W', subname, 'Specify data of axes in whole area by "HistoryPutAxisMPI" explicitly ' // 'before "call HistoryAddAttr".' )
stat = HST_EMPINOAXISDATA
cause_c = ''
goto 999
end if
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
if (varname == "") then
! とりあえず無駄だが大域属性を何度もつける
do, v_ord = 1, size(hst % vars)
call Put_Attr(hst % vars(v_ord), GT_PLUS // attrname, (/value/))
enddo
else
call lookup_var_or_dim( hst, varname, var, err_not_found )
if ( .not. err_not_found ) then
call Put_Attr(var, attrname, (/value/))
else
stat = NF_ENOTVAR
cause_c = 'varname="' // trim(varname) // '" is not found'
goto 999
endif
endif
#ifdef LIB_MPI
end if
#endif
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname)
end subroutine
| Subroutine : | recursive | ||
| varname : | character(len = *), intent(in)
| ||
| dims(:) : | character(len = *), intent(in)
| ||
| longname : | character(len = *), intent(in)
| ||
| units : | character(len = *), intent(in)
| ||
| xtype : | character(len = *), intent(in), optional
| ||
| time_average : | logical, intent(in), optional
| ||
| average : | logical, intent(in), optional
| ||
| history : | type(GT_HISTORY),
intent(inout), optional, target
| ||
| err : | logical, intent(out), optional
|
gtool4 データ内の変数の定義を行います。このサブルーチンを 用いる前に、 HistoryCreate による初期設定が必要です。
既に gtool4 データが存在し、そのデータ内の変数と全く同じ 構造の変数を定義したい場合は HistoryCopyVariable を利用すると便利です。
HistoryAddVariable というサブルーチン名は 2 つの別々の サブルーチンの総称名です。上記のサブルーチンも参照ください。
recursive subroutine HistoryAddVariable1( varname, dims, longname, units, xtype, time_average, average, history, err )
!
!== 変数定義
!
! gtool4 データ内の変数の定義を行います。このサブルーチンを
! 用いる前に、 HistoryCreate による初期設定が必要です。
!
! 既に gtool4 データが存在し、そのデータ内の変数と全く同じ
! 構造の変数を定義したい場合は HistoryCopyVariable を利用すると便利です。
!
! *HistoryAddVariable* というサブルーチン名は 2 つの別々の
! サブルーチンの総称名です。上記のサブルーチンも参照ください。
!
use netcdf_f77, only: NF_EBADDIM
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT, HST_ENODEPENDTIME, HST_EMPINOAXISDATA
use dc_string, only: CPrintf, JoinChar, StoA
use gtdata_generic, only: Inquire, Create, Slice, Put_Attr, Put, PutLine
use dc_url, only: GT_ATMARK, UrlResolve
use dc_present, only: present_and_true
use dc_types, only: STRING
use dc_date, only: DCDiffTimeCreate
use dc_message, only: MessageNotify
implicit none
character(len = *), intent(in):: varname
! 定義する変数の名前
!
! 最大文字数は dc_type#TOKEN
!
character(len = *), intent(in):: dims(:)
! 変数が依存する次元の名前
!
! 時間の次元は配列の最後に指定
! しなければならない。
! ここで指定するものは、
! HistoryCreate にて dims で指定
! されていなければならない。
!
! もしもスカラー変数を作成
! する場合には, サイズが 1 で
! 中身が空の文字型配列,
! すなわち <tt> (/''/) </tt>
! を与えること.
!
character(len = *), intent(in):: longname
! 変数の記述的名称
!
! 最大文字数は dc_types#STRING
!
character(len = *), intent(in):: units
! 変数の単位
!
! 最大文字数は dc_types#STRING
!
character(len = *), intent(in), optional:: xtype
! 変数のデータ型
!
! デフォルトはfloat (単精度実数型)
! である。 有効なのは、
! double (倍精度実数型)、 int
! (整数型)である。 指定しない
! 場合や、無効な型を指定した
! 場合には、 float (単精度実数型)
! となる。
!
logical, intent(in), optional:: time_average
! 出力データを時間平均する場合には
! .true. を与えます。
! デフォルトは .false. です。
!
! If output data is averaged in time direction,
! specify ".true.".
! Default is ".false.".
!
logical, intent(in), optional:: average
! time_average の旧版.
! Old version of "time_average"
type(GT_HISTORY), intent(inout), optional, target:: history
! 出力ファイルの設定に関する情報を
! 格納した構造体
!
! ここに指定するものは、
! HistoryCreate によって初期設定
! されていなければなりません。
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE), pointer:: vwork(:) =>null(), dimvars(:) =>null()
character(STRING):: fullname, url, cause_c
integer, pointer:: count_work(:) =>null()
integer, pointer:: var_avr_count_work(:) =>null()
integer:: var_avr_length
type(GT_HISTORY_AVRDATA), pointer:: var_avr_data_work(:) =>null()
logical, pointer:: var_avr_firstput_work(:) =>null()
real(DP), pointer:: var_avr_coefsum_work(:) =>null()
type(DC_DIFFTIME), pointer:: var_avr_baseint_work(:) =>null()
type(DC_DIFFTIME), pointer:: var_avr_prevtime_work(:) =>null()
character(STRING):: time_name, time_xtype, time_url
type(GT_VARIABLE), pointer:: dimvars_work(:) =>null()
logical, pointer:: dim_value_written_work(:) =>null()
integer:: dimvars_size
logical:: nv_exist, bnds_exist
character(STRING):: nv_name_check, bnds_name_check
character(*), parameter:: nv_suffix = '_nv'
character(*), parameter:: bnds_suffix = '_bnds'
type(GT_VARIABLE), pointer:: timevar
integer, pointer:: dimord(:) =>null()
integer:: nvars, numdims, i, stat
#ifdef LIB_MPI
integer:: err_mpi
type(GT_HISTORY_VARINFO), pointer:: work_mpi_varinfo(:) =>null()
type(GT_HISTORY_MPIVARINDEX), pointer:: work_mpi_vars_index(:) =>null()
#endif
character(*), parameter:: subname = "HistoryAddVariable1"
continue
call BeginSub(subname, 'name=<%a>, dims=<%a>, longname=<%a>, units=<%a>', ca=StoA(varname, JoinChar(dims), longname, units))
stat = DC_NOERR
cause_c = ''
! 操作対象決定
!
if (present(history)) then
hst => history
else
hst => default
endif
! 初期設定のチェック
! Check initialization
!
if ( .not. hst % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY'
goto 999
end if
#ifdef LIB_MPI
! HistoryPutAxisMPI が既に呼ばれていることをチェック
! Check that "HistoryPutAxisMPI" is already called
!
if ( hst % mpi_gather .and. hst % mpi_myrank == 0 .and. .not. hst % mpi_fileinfo % already_output ) then
call MessageNotify('W', subname, 'Specify data of axes in whole area by "HistoryPutAxisMPI" explicitly ' // 'before "call HistoryAddVariable".' )
stat = HST_EMPINOAXISDATA
goto 999
end if
! 変数表拡張 (MPI, ファイル統合版)
!
if ( hst % mpi_gather ) then
if ( associated(hst % mpi_varinfo) ) then
nvars = size(hst % mpi_varinfo(:))
work_mpi_varinfo => hst % mpi_varinfo
nullify( hst % mpi_varinfo )
allocate( hst % mpi_varinfo(nvars + 1) )
hst % mpi_varinfo(1:nvars) = work_mpi_varinfo
deallocate( work_mpi_varinfo )
nvars = size(hst % mpi_vars_index(:))
work_mpi_vars_index => hst % mpi_vars_index
nullify( hst % mpi_vars_index )
allocate( hst % mpi_vars_index(nvars + 1) )
hst % mpi_vars_index(1:nvars) = work_mpi_vars_index
deallocate( work_mpi_vars_index )
else
nvars = 0
allocate( hst % mpi_varinfo(nvars + 1) )
allocate( hst % mpi_vars_index(nvars + 1) )
end if
call HistoryVarinfoCreate( hst % mpi_varinfo(nvars + 1), varname, dims, longname, units, xtype, time_average, average ) ! (in) optional
end if
#endif
! 変数表拡張
!
if (associated(hst % vars)) then
nvars = size(hst % vars(:))
vwork => hst % vars
count_work => hst % count
nullify(hst % vars, hst % count)
allocate(hst % vars(nvars + 1), hst % count(nvars + 1))
hst % vars(1:nvars) = vwork(1:nvars)
hst % count(1:nvars) = count_work(1:nvars)
deallocate(vwork, count_work)
count_work => hst % growable_indices
nullify(hst % growable_indices)
allocate(hst % growable_indices(nvars + 1))
hst % growable_indices(1:nvars) = count_work(1:nvars)
deallocate(count_work)
! 平均値出力のための変数表コピー
! Copy table of variables for average value output
!
var_avr_count_work => hst % var_avr_count
nullify( hst % var_avr_count )
allocate( hst % var_avr_count(nvars + 1) )
hst % var_avr_count(1:nvars) = var_avr_count_work(1:nvars)
deallocate( var_avr_count_work )
var_avr_data_work => hst % var_avr_data
nullify(hst % var_avr_data)
allocate(hst % var_avr_data(nvars + 1))
do i = 1, nvars
hst % var_avr_data(i) % length = var_avr_data_work(i) % length
allocate(hst % var_avr_data(i) % a_DataAvr(var_avr_data_work(i) % length))
hst % var_avr_data(i) % a_DataAvr = var_avr_data_work(i) % a_DataAvr
end do
deallocate( var_avr_data_work )
var_avr_firstput_work => hst % var_avr_firstput
nullify( hst % var_avr_firstput )
allocate( hst % var_avr_firstput(nvars + 1) )
hst % var_avr_firstput(1:nvars) = var_avr_firstput_work(1:nvars)
deallocate( var_avr_firstput_work )
var_avr_coefsum_work => hst % var_avr_coefsum
nullify( hst % var_avr_coefsum )
allocate( hst % var_avr_coefsum(nvars + 1) )
hst % var_avr_coefsum(1:nvars) = var_avr_coefsum_work(1:nvars)
deallocate( var_avr_coefsum_work )
var_avr_baseint_work => hst % var_avr_baseint
nullify( hst % var_avr_baseint )
allocate( hst % var_avr_baseint(nvars + 1) )
hst % var_avr_baseint(1:nvars) = var_avr_baseint_work(1:nvars)
deallocate( var_avr_baseint_work )
var_avr_prevtime_work => hst % var_avr_prevtime
nullify( hst % var_avr_prevtime )
allocate( hst % var_avr_prevtime(nvars + 1) )
hst % var_avr_prevtime(1:nvars) = var_avr_prevtime_work(1:nvars)
deallocate( var_avr_prevtime_work )
else
! トリッキーだが, ここで count だけ 2 要素確保するのは,
! HistorySetTime による巻き戻しに備えるため.
!
allocate(hst % vars(1), hst % count(2), hst % growable_indices(1))
hst % count(2) = 0
allocate(hst % var_avr_count(1), hst % var_avr_data(1))
allocate(hst % var_avr_firstput(1), hst % var_avr_coefsum(1))
allocate(hst % var_avr_baseint(1), hst % var_avr_prevtime(1))
endif
nvars = size(hst % vars(:))
hst % growable_indices(nvars) = 0
if ( nvars < 2 ) then
hst % count(nvars) = 0
else
hst % count(nvars) = hst % count(1)
end if
! スカラー変数作成への対応
!
if (size(dims) == 1 .and. trim(dims(1)) == '') then
numdims = 0
else
numdims = size(dims)
end if
allocate( dimvars(numdims), dimord(numdims) )
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
! 次元の ID の取得
!
do, i = 1, numdims
! hst 内で, 次元変数名 dim(i) に当たる次元変数の ID である
! hst % dimvar(i) を dimvars(i) に, 添字を dimord に
!
dimvars(i) = lookup_dimension( hst, dims(i), ord = dimord(i) ) ! (out)
if (dimord(i) == 0) then
stat = NF_EBADDIM
cause_c = CPrintf('"%c" dimension is not found.', c1=trim(dims(i)))
goto 999
end if
end do
#ifdef LIB_MPI
if ( hst % mpi_gather ) then
call MPI_Bcast( dimord, numdims, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
end if
elseif ( hst % mpi_gather .and. hst % mpi_myrank /= 0 ) then
call MPI_Bcast( dimord, numdims, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
end if
#endif
! 変数添字次元を決定
!
do, i = 1, numdims
! 無制限次元の添字と一致する場合に,
! その添字を hst % growable_indices(nvars) に
!
if (dimord(i) == hst % unlimited_index) then
hst % growable_indices(nvars) = i
endif
enddo
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
! 変数作成
!
call Inquire(hst % dimvars(1), url=url)
fullname = UrlResolve((GT_ATMARK // trim(varname)), trim(url))
call Create(hst % vars(nvars), trim(fullname), dimvars, xtype=xtype)
! 拡張可能次元があったらそれをサイズ 1 に拡張しておく
!
if (hst % growable_indices(nvars) /= 0) then
call Slice(hst % vars(nvars), hst % growable_indices(nvars), start=1, count=1, stride=1)
endif
call Put_Attr(hst % vars(nvars), 'long_name', longname)
call Put_Attr(hst % vars(nvars), 'units', units)
#ifdef LIB_MPI
end if
#endif
deallocate(dimvars)
! 平均処理に関する情報管理
!
if ( present_and_true( time_average ) .or. present_and_true( average ) ) then
hst % var_avr_count(nvars) = 0
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
! 情報の取得
! Get Information
!
timevar => hst % dimvars( hst % unlimited_index )
call Inquire( var = timevar, name = time_name, url = time_url, xtype = time_xtype ) ! (out)
#ifdef LIB_MPI
if ( hst % mpi_gather ) then
call MPI_Bcast( time_name, STRING, MPI_CHARACTER, 0, MPI_COMM_WORLD, err_mpi )
call MPI_Bcast( time_url, STRING, MPI_CHARACTER, 0, MPI_COMM_WORLD, err_mpi )
call MPI_Bcast( time_xtype, STRING, MPI_CHARACTER, 0, MPI_COMM_WORLD, err_mpi )
end if
elseif ( hst % mpi_gather .and. hst % mpi_myrank /= 0 ) then
call MPI_Bcast( time_name, STRING, MPI_CHARACTER, 0, MPI_COMM_WORLD, err_mpi )
call MPI_Bcast( time_url, STRING, MPI_CHARACTER, 0, MPI_COMM_WORLD, err_mpi )
call MPI_Bcast( time_xtype, STRING, MPI_CHARACTER, 0, MPI_COMM_WORLD, err_mpi )
end if
#endif
! 変数のデータ数の取得
!
#ifdef LIB_MPI
if ( .not. hst % mpi_gather ) then
#endif
call Inquire(hst % vars(nvars), size = var_avr_length )
#ifdef LIB_MPI
else
var_avr_length = 1
do i = 1, numdims
if ( hst % unlimited_index == dimord(i) ) cycle
var_avr_length = var_avr_length * hst % mpi_dimdata_each( dimord(i) ) % length
end do
end if
#endif
! 割り付け
!
hst % var_avr_data(nvars) % length = var_avr_length
allocate(hst % var_avr_data(nvars) % a_DataAvr(var_avr_length))
hst % var_avr_data(nvars) % a_DataAvr = 0.0_DP
! デフォルト値設定
!
hst % var_avr_firstput = .true.
hst % var_avr_coefsum(nvars) = 0.0_DP
call DCDiffTimeCreate( hst % var_avr_baseint(nvars), sec = 0.0_DP ) ! (in)
hst % var_avr_prevtime(nvars) = hst % var_avr_baseint(nvars)
! 時間次元情報の取得
!
if ( hst % growable_indices(nvars) < 1 ) then
stat = HST_ENODEPENDTIME
cause_c = trim(varname)
goto 999
end if
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 ) ) then
#endif
! 時間次元への属性 "bounds" の追加
!
call Put_Attr( var = timevar, name = 'bounds', value = trim(time_name) // bnds_suffix ) ! (in)
! 変数 "varname" への属性 "cell_methods" の追加
!
call Put_Attr( var = hst % vars(nvars), name = 'cell_methods', value = trim(time_name) // ': mean' ) ! (in)
! "time_nv" 次元の作成 (既に作成されていたら何もしない)
!
dimvars_size = size( hst % dimvars )
nv_exist = .false.
do i = 1, dimvars_size
call Inquire( var = hst % dimvars(i), name = nv_name_check ) ! (out)
if ( trim(time_name) // trim(nv_suffix) == trim(nv_name_check) ) then
nv_exist = .true.
exit
end if
end do
if ( .not. nv_exist ) then
dimvars_work => hst % dimvars
dim_value_written_work => hst % dim_value_written
nullify(hst % dimvars, hst % dim_value_written)
allocate(hst % dimvars(dimvars_size + 1))
allocate(hst % dim_value_written(dimvars_size + 1))
hst % dimvars(1:dimvars_size) = dimvars_work(1:dimvars_size)
hst % dim_value_written(1:dimvars_size) = dim_value_written_work(1:dimvars_size)
deallocate(dimvars_work)
deallocate(dim_value_written_work)
call Create( var = hst % dimvars(dimvars_size + 1), url = trim(time_url) // trim(nv_suffix), length = 2, xtype = 'integer' ) ! (in)
hst % time_nv_index = dimvars_size + 1
call Put_Attr( var = hst % dimvars(dimvars_size + 1), name = 'long_name', value = 'number of vertices of time') ! (in)
call Put_Attr( var = hst % dimvars(dimvars_size + 1), name = 'units', value = '1' ) ! (in)
call Put( var = hst % dimvars(dimvars_size + 1), value = (/1, 2/) ) ! (in)
hst % dim_value_written(dimvars_size + 1) = .true.
end if
! "time_bnds" 変数の作成 (既に作成されていたら何もしない)
!
bnds_exist = .false.
do i = 1, nvars
call Inquire( var = hst % vars(i), name = bnds_name_check ) ! (out)
if ( trim(time_name) // trim(bnds_suffix) == trim(bnds_name_check) ) then
bnds_exist = .true.
exit
end if
end do
#ifdef LIB_MPI
if ( hst % mpi_gather ) then
call MPI_Bcast( hst % time_nv_index, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
call MPI_Bcast( bnds_exist, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, err_mpi )
end if
elseif ( hst % mpi_gather .and. hst % mpi_myrank /= 0 ) then
call MPI_Bcast( hst % time_nv_index, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
call MPI_Bcast( bnds_exist, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, err_mpi )
end if
#endif
if ( .not. bnds_exist ) then
call HistoryAddVariable( history = hst, varname = trim(time_name) // trim(bnds_suffix), dims = StoA( trim(time_name) // trim(nv_suffix), trim(time_name) ), longname = 'bounds of time', units = hst % unlimited_units, xtype = time_xtype ) ! (in)
end if
! 平均処理が不要な場合
!
else
hst % var_avr_count(nvars) = -1
! 割り付け
!
var_avr_length = 1
hst % var_avr_data(nvars) % length = var_avr_length
allocate(hst % var_avr_data(nvars) % a_DataAvr(var_avr_length))
hst % var_avr_data(nvars) % a_DataAvr = 0.0_DP
! デフォルト値設定
!
hst % var_avr_firstput = .true.
hst % var_avr_coefsum(nvars) = 0.0_DP
call DCDiffTimeCreate( hst % var_avr_baseint(nvars), sec = 0.0_DP ) ! (in)
hst % var_avr_prevtime(nvars) = hst % var_avr_baseint(nvars)
end if
! 終了処理, 例外処理
! Termination and Exception handling
!
999 continue
call StoreError(stat, subname, err, cause_c)
call EndSub(subname)
end subroutine HistoryAddVariable1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),
intent(in)
| ||
| history : | type(GT_HISTORY),
intent(inout), optional
| ||
| err : | logical, intent(out), optional
|
gtool4 データ内の変数の定義を行います。このサブルーチンを 用いる前に、 HistoryCreate による初期設定が必要です。
既に gtool4 データが存在し、そのデータ内の変数と全く同じ 構造の変数を定義したい場合は HistoryCopyVariable を利用すると 便利です。
HistoryAddVariable というサブルーチン名は 2 つの別々の サブルーチンの総称名です。下記のサブルーチンも参照ください。
subroutine HistoryAddVariable2( varinfo, history, err )
!
!== 変数定義
!
! gtool4 データ内の変数の定義を行います。このサブルーチンを
! 用いる前に、 HistoryCreate による初期設定が必要です。
!
! 既に gtool4 データが存在し、そのデータ内の変数と全く同じ
! 構造の変数を定義したい場合は HistoryCopyVariable を利用すると
! 便利です。
!
! *HistoryAddVariable* というサブルーチン名は 2 つの別々の
! サブルーチンの総称名です。下記のサブルーチンも参照ください。
!
use dc_string, only: JoinChar
implicit none
type(GT_HISTORY_VARINFO), intent(in) :: varinfo
! 変数情報を格納した構造体
!
! ここに指定するものは、
! HistoryVarinfoCreate によって
! 初期設定されていなければなりません。
!
type(GT_HISTORY), intent(inout), optional:: history
! 出力ファイルの設定に関する情報を
! 格納した構造体
!
! ここに指定するものは、
! HistoryCreate によって初期設定
! されていなければなりません。
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
character(len = *), parameter:: subname = "HistoryAddVariable2"
continue
call BeginSub(subname, 'varname=<%c>, dims=<%c>, longname=<%c>', c1=trim(varinfo % name), c2=trim(JoinChar(varinfo % dims)), c3=trim(varinfo % longname) )
call HistoryAddVariable1( history = history, varname = varinfo % name, dims = varinfo % dims, longname = varinfo % longname, units = varinfo % units, xtype = varinfo % xtype, time_average = varinfo % time_average, err = err ) ! (out) optional
if (associated( varinfo % attrs )) then
call HistoryAttrAdd( varinfo % name, varinfo % attrs, history )
end if
call EndSub(subname)
end subroutine HistoryAddVariable2
| Subroutine : | |
| varname : | character(*), intent(in) |
| attrs(:) : | type(GT_HISTORY_ATTR), intent(in) |
| history : | type(GT_HISTORY), intent(inout), target, optional |
GT_HISTORY_ATTR 変数を history の varname 変数に 付加するためのサブルーチン. 公開用ではなく, HistoryCreate や HistoryAddVariable に GT_HISTORY_AXIS や GT_HISTORY_VARINFO が与えられた時に内部的に利用される.
subroutine HistoryAttrAdd(varname, attrs, history)
!
! GT_HISTORY_ATTR 変数を history の varname 変数に
! 付加するためのサブルーチン. 公開用ではなく,
! HistoryCreate や HistoryAddVariable に GT_HISTORY_AXIS
! や GT_HISTORY_VARINFO が与えられた時に内部的に利用される.
!
use gtdata_generic, only: Put_Attr
use dc_string , only: StrHead, LChar, toChar
implicit none
character(*), intent(in):: varname
type(GT_HISTORY_ATTR), intent(in):: attrs(:)
type(GT_HISTORY), intent(inout), target, optional:: history
type(GT_HISTORY), pointer:: hst =>null()
integer :: i
character(*), parameter:: subname = "HistoryAttrAdd"
continue
call BeginSub(subname, 'varname=<%c>, size(attrs(:))=<%d>', c1=trim(varname), i=(/size(attrs(:))/))
if (present(history)) then
hst => history
else
hst => default
endif
! attrs(:) のサイズ分だけループ
do i = 1, size( attrs(:) )
! attrs(i)%attrtype の種別で与える変数を変える
if ( StrHead( 'char', trim(LChar(attrs(i)%attrtype))) ) then
call HistoryAddAttr( varname, attrs(i)%attrname, trim(attrs(i)%Charvalue), hst )
elseif ( StrHead( 'int', trim(LChar(attrs(i)%attrtype))) ) then
if ( attrs(i)%array ) then
call DbgMessage('Intarray(:) is selected.')
call HistoryAddAttr( varname, attrs(i)%attrname , attrs(i)%Intarray, hst )
else
call DbgMessage('Intvalue is selected')
call HistoryAddAttr( varname, attrs(i)%attrname , attrs(i)%Intvalue, hst )
endif
elseif ( StrHead( 'real', trim(LChar(attrs(i)%attrtype))) ) then
if ( attrs(i)%array ) then
call DbgMessage('Realarray(:) is selected.')
call HistoryAddAttr( varname, attrs(i)%attrname, attrs(i)%Realarray, hst)
else
call DbgMessage('Realvalue is selected')
call HistoryAddAttr( varname, attrs(i)%attrname, attrs(i)%Realvalue, hst)
endif
elseif ( StrHead( 'double', trim(LChar(attrs(i)%attrtype))) ) then
if ( attrs(i)%array ) then
call DbgMessage('Doublearray(:) is selected.')
call HistoryAddAttr( varname, attrs(i)%attrname, attrs(i)%Doublearray, hst)
else
call DbgMessage('Doublevalue is selected')
call HistoryAddAttr( varname, attrs(i)%attrname, attrs(i)%Doublevalue, hst)
endif
elseif ( StrHead( 'logical', trim(LChar(attrs(i)%attrtype))) ) then
call HistoryAddAttr( varname, attrs(i)%attrname, attrs(i)%Logicalvalue, hst)
else
call DbgMessage('attrtype=<%c>=<%c>is Invalid.' , c1=trim(attrs(i)%attrtype) , c2=trim(LChar(attrs(i)%attrtype)) )
endif
enddo
call EndSub(subname)
end subroutine HistoryAttrAdd
| Subroutine : | |
| from(:) : | type(GT_HISTORY_ATTR), intent(in) |
| to(:) : | type(GT_HISTORY_ATTR), intent(out) |
| err : | logical, intent(out), optional |
GT_HISTORY_ATTR 変数をコピーするためのサブルーチン このモジュール内部で利用されることを想定している. from と to の配列サイズは同じであることが想定されている. err を与えると, コピーの際何らかの不具合が生じると 終了せずに err が真になって返る.
subroutine HistoryAttrCopy(from, to, err)
!
! GT_HISTORY_ATTR 変数をコピーするためのサブルーチン
! このモジュール内部で利用されることを想定している.
! from と to の配列サイズは同じであることが想定されている.
! err を与えると, コピーの際何らかの不具合が生じると
! 終了せずに err が真になって返る.
!
use dc_string,only: LChar, StrHead
use dc_trace, only: BeginSub, EndSub, DbgMessage
use dc_error, only: StoreError, GT_EARGSIZEMISMATCH, GT_EBADATTRNAME, DC_NOERR
implicit none
type(GT_HISTORY_ATTR), intent(in) :: from(:)
type(GT_HISTORY_ATTR), intent(out) :: to(:)
logical, intent(out), optional :: err
integer :: i, stat
character(STRING) :: cause_c
character(STRING), parameter:: subname = "HistoryAttrCopy"
continue
call BeginSub(subname)
stat = DC_NOERR
cause_c = ''
call DbgMessage('size(from)=<%d>, size(to)=<%d>, So copy <%d> times.', i=(/ size(from), size(to), min(size(from),size(to)) /) )
if ( size(to) < size(from) ) then
stat = GT_EARGSIZEMISMATCH
cause_c = 'from is larger than to'
goto 999
end if
! from と to の小さい方に合わせてループ
do i = 1, min( size(from), size(to) )
! attrname と attrtype と array はまずコピー
to(i)%attrname = from(i)%attrname
to(i)%attrtype = from(i)%attrtype
to(i)%array = from(i)%array
! from(i)%attrtype の種別でコピーする変数を変える.
if ( StrHead( 'char', trim(LChar(from(i)%attrtype))) ) then
to(i)%Charvalue = from(i)%Charvalue
elseif ( StrHead( LChar('Int'), trim(LChar(from(i)%attrtype)))) then
if ( from(i)%array ) then
allocate( to(i)%Intarray( size(from(i)%Intarray) ) )
to(i)%Intarray = from(i)%Intarray
else
to(i)%Intvalue = from(i)%Intvalue
endif
elseif ( StrHead( LChar('Real'), trim(LChar(from(i)%attrtype)))) then
if ( from(i)%array ) then
allocate( to(i)%Realarray( size(from(i)%Realarray) ) )
to(i)%Realarray = from(i)%Realarray
else
to(i)%Realvalue = from(i)%Realvalue
endif
elseif ( StrHead( LChar('Double'), trim(LChar(from(i)%attrtype)))) then
if ( from(i)%array ) then
allocate( to(i)%Doublearray( size(from(i)%Doublearray) ) )
to(i)%Doublearray = from(i)%Doublearray
else
to(i)%Doublevalue = from(i)%Doublevalue
endif
elseif ( StrHead( 'logical', trim(LChar(from(i)%attrtype))) ) then
to(i)%Logicalvalue = from(i)%Logicalvalue
else
stat = GT_EBADATTRNAME
cause_c = from(i)%attrtype
goto 999
endif
enddo
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname)
end subroutine HistoryAttrCopy
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | character(*), intent(in)
|
GT_HISTORY_AXIS 型の変数 axis へ属性を付加します。
HistoryAxisAddAttr は複数のサブルーチンの総称名です。 value には様々な型の引数を与えることが可能です。 下記のサブルーチンを参照ください。
subroutine HistoryAxisAddAttrChar0( axis, attrname, value)
!
!
!== GT_HISTORY_AXIS 型変数への属性付加
!
! GT_HISTORY_AXIS 型の変数 *axis* へ属性を付加します。
!
! *HistoryAxisAddAttr* は複数のサブルーチンの総称名です。
! value には様々な型の引数を与えることが可能です。
! 下記のサブルーチンを参照ください。
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
implicit none
type(GT_HISTORY_AXIS),intent(inout) :: axis
character(*), intent(in):: attrname ! 属性の名前
character(*), intent(in):: value
! 属性に与えられる値
!
! 配列の場合でも、数値型以外
! では配列の 1 つ目の要素のみ
! 値として付加されます。
!
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num
character(STRING) :: name
character(*), parameter:: subname = "HistoryAxisAddAttrChar0"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(value))
call HistoryAxisInquire1( axis, name )
call DbgMessage('axis name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(axis % attrs) ) then
allocate( axis % attrs(1) )
attrs_num = 1
else
attrs_num = size( axis % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = axis % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( axis % attrs )
allocate( axis % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = axis % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
axis % attrs(attrs_num) % attrname = attrname
axis % attrs(attrs_num) % attrtype = 'Char'
axis % attrs(attrs_num) % array = .false.
axis % attrs(attrs_num) % Charvalue = value
call EndSub(subname)
end subroutine HistoryAxisAddAttrChar0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real(DP), intent(in) |
subroutine HistoryAxisAddAttrDouble0( axis, attrname, value)
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
implicit none
type(GT_HISTORY_AXIS),intent(inout) :: axis
character(*), intent(in):: attrname ! 属性の名前
real(DP), intent(in):: value
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num
character(STRING) :: name
character(*), parameter:: subname = "HistoryAxisAddAttrDouble0"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
call HistoryAxisInquire1( axis, name )
call DbgMessage('axis name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(axis % attrs) ) then
allocate( axis % attrs(1) )
attrs_num = 1
else
attrs_num = size( axis % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = axis % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( axis % attrs )
allocate( axis % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = axis % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
axis % attrs(attrs_num) % attrname = attrname
axis % attrs(attrs_num) % attrtype = 'Double'
axis % attrs(attrs_num) % array = .false.
axis % attrs(attrs_num) % Doublevalue = value
call EndSub(subname)
end subroutine HistoryAxisAddAttrDouble0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real(DP), intent(in) |
subroutine HistoryAxisAddAttrDouble1( axis, attrname, value)
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
implicit none
type(GT_HISTORY_AXIS),intent(inout) :: axis
character(*), intent(in):: attrname ! 属性の名前
real(DP), intent(in):: value(:)
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num
character(STRING) :: name
character(*), parameter:: subname = "HistoryAxisAddAttrDouble1"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
call HistoryAxisInquire1( axis, name )
call DbgMessage('axis name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(axis % attrs) ) then
allocate( axis % attrs(1) )
attrs_num = 1
else
attrs_num = size( axis % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = axis % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( axis % attrs )
allocate( axis % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = axis % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
axis % attrs(attrs_num) % attrname = attrname
axis % attrs(attrs_num) % attrtype = 'Double'
axis % attrs(attrs_num) % array = .true.
allocate( axis % attrs(attrs_num) % Doublearray( size(value) ) )
axis % attrs(attrs_num) % Doublearray = value
call EndSub(subname)
end subroutine HistoryAxisAddAttrDouble1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | integer, intent(in) |
subroutine HistoryAxisAddAttrInt0( axis, attrname, value)
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
implicit none
type(GT_HISTORY_AXIS),intent(inout) :: axis
character(*), intent(in):: attrname ! 属性の名前
integer, intent(in):: value
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num
character(STRING) :: name
character(*), parameter:: subname = "HistoryAxisAddAttrInt0"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
call HistoryAxisInquire1( axis, name )
call DbgMessage('axis name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(axis % attrs) ) then
allocate( axis % attrs(1) )
attrs_num = 1
else
attrs_num = size( axis % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = axis % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( axis % attrs )
allocate( axis % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = axis % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
axis % attrs(attrs_num) % attrname = attrname
axis % attrs(attrs_num) % attrtype = 'Int'
axis % attrs(attrs_num) % array = .false.
axis % attrs(attrs_num) % Intvalue = value
call EndSub(subname)
end subroutine HistoryAxisAddAttrInt0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | integer, intent(in) |
subroutine HistoryAxisAddAttrInt1( axis, attrname, value)
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
implicit none
type(GT_HISTORY_AXIS),intent(inout) :: axis
character(*), intent(in):: attrname ! 属性の名前
integer, intent(in):: value(:)
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num
character(STRING) :: name
character(*), parameter:: subname = "HistoryAxisAddAttrInt1"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
call HistoryAxisInquire1( axis, name )
call DbgMessage('axis name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(axis % attrs) ) then
allocate( axis % attrs(1) )
attrs_num = 1
else
attrs_num = size( axis % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = axis % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( axis % attrs )
allocate( axis % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = axis % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
axis % attrs(attrs_num) % attrname = attrname
axis % attrs(attrs_num) % attrtype = 'Int'
axis % attrs(attrs_num) % array = .true.
allocate( axis % attrs(attrs_num) % Intarray( size(value) ) )
axis % attrs(attrs_num) % Intarray = value
call EndSub(subname)
end subroutine HistoryAxisAddAttrInt1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | logical, intent(in) |
subroutine HistoryAxisAddAttrLogical0( axis, attrname, value)
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
implicit none
type(GT_HISTORY_AXIS),intent(inout) :: axis
character(*), intent(in):: attrname ! 属性の名前
logical, intent(in):: value
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num
character(STRING) :: name
character(*), parameter:: subname = "HistoryAxisAddAttrLogical0"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
call HistoryAxisInquire1( axis, name )
call DbgMessage('axis name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(axis % attrs) ) then
allocate( axis % attrs(1) )
attrs_num = 1
else
attrs_num = size( axis % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = axis % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( axis % attrs )
allocate( axis % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = axis % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
axis % attrs(attrs_num) % attrname = attrname
axis % attrs(attrs_num) % attrtype = 'Logical'
axis % attrs(attrs_num) % array = .false.
axis % attrs(attrs_num) % Logicalvalue = value
call EndSub(subname)
end subroutine HistoryAxisAddAttrLogical0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real, intent(in) |
subroutine HistoryAxisAddAttrReal0( axis, attrname, value)
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
implicit none
type(GT_HISTORY_AXIS),intent(inout) :: axis
character(*), intent(in):: attrname ! 属性の名前
real, intent(in):: value
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num
character(STRING) :: name
character(*), parameter:: subname = "HistoryAxisAddAttrReal0"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
call HistoryAxisInquire1( axis, name )
call DbgMessage('axis name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(axis % attrs) ) then
allocate( axis % attrs(1) )
attrs_num = 1
else
attrs_num = size( axis % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = axis % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( axis % attrs )
allocate( axis % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = axis % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
axis % attrs(attrs_num) % attrname = attrname
axis % attrs(attrs_num) % attrtype = 'Real'
axis % attrs(attrs_num) % array = .false.
axis % attrs(attrs_num) % Realvalue = value
call EndSub(subname)
end subroutine HistoryAxisAddAttrReal0
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real, intent(in) |
subroutine HistoryAxisAddAttrReal1( axis, attrname, value)
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
implicit none
type(GT_HISTORY_AXIS),intent(inout) :: axis
character(*), intent(in):: attrname ! 属性の名前
real, intent(in):: value(:)
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num
character(STRING) :: name
character(*), parameter:: subname = "HistoryAxisAddAttrReal1"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
call HistoryAxisInquire1( axis, name )
call DbgMessage('axis name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(axis % attrs) ) then
allocate( axis % attrs(1) )
attrs_num = 1
else
attrs_num = size( axis % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = axis % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( axis % attrs )
allocate( axis % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = axis % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
axis % attrs(attrs_num) % attrname = attrname
axis % attrs(attrs_num) % attrtype = 'Real'
axis % attrs(attrs_num) % array = .true.
allocate( axis % attrs(attrs_num) % Realarray( size(value) ) )
axis % attrs(attrs_num) % Realarray = value
call EndSub(subname)
end subroutine HistoryAxisAddAttrReal1
| Subroutine : | |||
| axis_dest : | type(GT_HISTORY_AXIS),intent(out)
| ||
| axis_src : | type(GT_HISTORY_AXIS),intent(in)
| ||
| err : | logical, intent(out), optional | ||
| name : | character(*) , intent(in), optional
| ||
| length : | integer, intent(in), optional
| ||
| longname : | character(*) , intent(in), optional
| ||
| units : | character(*) , intent(in), optional
| ||
| xtype : | character(*) , intent(in), optional
|
GT_HISTORY_AXIS 型の変数 axis_src を axis_dest にコピーします。 axis_src は HistoryAxisCreate によって初期設定されている必要が あります。 さらに属性を付加する場合には HistoryAxisAddAttr を用いてください。
err を与えておくと、コピーの際何らかの不具合が生じても 終了せずに err が真になって返ります。
err 以降の引数は、コピーの際に上書きする値です。
subroutine HistoryAxisCopy1(axis_dest, axis_src, err, name, length, longname, units, xtype)
!
!== GT_HISTORY_AXIS 型変数コピー
!
! GT_HISTORY_AXIS 型の変数 *axis_src* を
! *axis_dest* にコピーします。
! *axis_src* は HistoryAxisCreate によって初期設定されている必要が
! あります。
! さらに属性を付加する場合には HistoryAxisAddAttr
! を用いてください。
!
! *err* を与えておくと、コピーの際何らかの不具合が生じても
! 終了せずに err が真になって返ります。
!
! *err* 以降の引数は、コピーの際に上書きする値です。
!
use dc_trace, only: BeginSub, EndSub, DbgMessage
use dc_present,only: present_select
implicit none
type(GT_HISTORY_AXIS),intent(out) :: axis_dest ! コピー先 GT_HISTORY_AXIS
type(GT_HISTORY_AXIS),intent(in) :: axis_src ! コピー元 GT_HISTORY_AXIS
logical, intent(out), optional :: err
character(*) , intent(in), optional:: name ! 次元変数名
integer, intent(in), optional:: length ! 次元長 (配列サイズ)
character(*) , intent(in), optional:: longname ! 次元変数の記述的名称
character(*) , intent(in), optional:: units ! 次元変数の単位
character(*) , intent(in), optional:: xtype ! 次元変数の型
character(STRING), parameter:: subname = "HistoryAxisCopy1"
continue
call BeginSub(subname)
axis_dest % name = present_select('', axis_src % name, name)
axis_dest % length = present_select(.false., axis_src % length, length)
axis_dest % longname = present_select('', axis_src % longname, longname)
axis_dest % units = present_select('', axis_src % units, units)
axis_dest % xtype = present_select('', axis_src % xtype, xtype)
if (associated( axis_src % attrs ) ) then
allocate( axis_dest % attrs( size( axis_src % attrs) ) )
call HistoryAttrCopy( from = axis_src % attrs, to = axis_dest % attrs, err = err)
end if
call EndSub(subname)
end subroutine HistoryAxisCopy1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(out) | ||
| name : | character(*) , intent(in)
| ||
| size : | integer, intent(in)
| ||
| longname : | character(*) , intent(in)
| ||
| units : | character(*) , intent(in)
| ||
| xtype : | character(*) , intent(in)
|
GT_HISTORY_AXIS 型変数を作成します。 このサブルーチンによる設定の後、 HistoryCreate の axes に与えます。 さらに属性を付加する場合には HistoryAxisAddAttr を用いてください。
Constructor of GT_HISTORY_AXIS
subroutine HistoryAxisCreate1( axis, name, size, longname, units, xtype)
!
!== GT_HISTORY_AXIS 型変数作成
!
! GT_HISTORY_AXIS 型変数を作成します。
! このサブルーチンによる設定の後、
! HistoryCreate の *axes* に与えます。
! さらに属性を付加する場合には HistoryAxisAddAttr
! を用いてください。
!
! Constructor of GT_HISTORY_AXIS
!
use dc_types, only: STRING, TOKEN, DP
use dc_trace, only: BeginSub, EndSub, DbgMessage
implicit none
type(GT_HISTORY_AXIS),intent(out) :: axis
character(*) , intent(in):: name ! 次元変数名
integer, intent(in):: size ! 次元長 (配列サイズ)
character(*) , intent(in):: longname ! 次元変数の記述的名称
character(*) , intent(in):: units ! 次元変数の単位
character(*) , intent(in):: xtype ! 次元変数の型
character(len = *), parameter:: subname = "HistoryAxisCreate1"
continue
call BeginSub(subname)
axis % name = name
axis % length = size
axis % longname = longname
axis % units = units
axis % xtype = xtype
call EndSub(subname)
end subroutine HistoryAxisCreate1
| Subroutine : | |||
| axis : | type(GT_HISTORY_AXIS),intent(in) | ||
| name : | character(*) , intent(out), optional
| ||
| size : | integer, intent(out), optional
| ||
| longname : | character(*) , intent(out), optional
| ||
| units : | character(*) , intent(out), optional
| ||
| xtype : | character(*) , intent(out), optional
|
GT_HISTORY_AXIS 型の変数内の各情報を参照します。
subroutine HistoryAxisInquire1( axis, name, size, longname, units, xtype)
!
!== GT_HISTORY_AXIS 型変数への問い合わせ
!
! GT_HISTORY_AXIS 型の変数内の各情報を参照します。
!
use dc_types, only: STRING, TOKEN, DP
use dc_trace, only: BeginSub, EndSub, DbgMessage
implicit none
type(GT_HISTORY_AXIS),intent(in) :: axis
character(*) , intent(out), optional:: name ! 次元変数名
integer, intent(out), optional:: size ! 次元長 (配列サイズ)
character(*) , intent(out), optional:: longname ! 次元変数の記述的名称
character(*) , intent(out), optional:: units ! 次元変数の単位
character(*) , intent(out), optional:: xtype ! 次元変数の型
character(len = *), parameter:: subname = "HistoryAxisInquire1"
continue
call BeginSub(subname)
if (present(name)) then
name = axis % name
end if
if (present(size)) then
size = axis % length
end if
if (present(longname)) then
longname = axis % longname
end if
if (present(units)) then
units = axis % units
end if
if (present(xtype)) then
xtype = axis % xtype
end if
call EndSub(subname)
end subroutine HistoryAxisInquire1
| Subroutine : | |
| hist_dest : | type(GT_HISTORY), intent(out), target |
| file : | character(*), intent(in) |
| hist_src : | type(GT_HISTORY), intent(in), optional, target |
| title : | character(*), intent(in), optional |
| source : | character(*), intent(in), optional |
| institution : | character(*), intent(in), optional |
| origin : | real, intent(in), optional |
| interval : | real, intent(in), optional |
| conventions : | character(*), intent(in), optional |
| gt_version : | character(*), intent(in), optional |
引数 hist_src の内容にコピーし, hist_dest へ返します. hist_src が与えられない場合は, 引数 history を与えずに呼び出した HistoryCreate の設定内容が参照されます. HistoryCreate と同様に, 出力の初期設定を行います. file は必ず与えなければならず, hist_src と同じファイルへ出力 しようとする場合はエラーを生じます. HistoryAddVariable で設定される内容に関してはコピーされません.
それ以降の引数を与えることで, hist_src の設定を 上書きすることが可能です.
subroutine HistoryCopy1(hist_dest, file, hist_src, title, source, institution, origin, interval, conventions, gt_version)
!
! 引数 *hist_src* の内容にコピーし, *hist_dest* へ返します. *hist_src*
! が与えられない場合は, 引数 *history* を与えずに呼び出した
! HistoryCreate の設定内容が参照されます.
! HistoryCreate と同様に, 出力の初期設定を行います. *file*
! は必ず与えなければならず, *hist_src* と同じファイルへ出力
! しようとする場合はエラーを生じます.
! HistoryAddVariable で設定される内容に関してはコピーされません.
!
! それ以降の引数を与えることで, hist_src の設定を
! 上書きすることが可能です.
!
use gtdata_generic, only: Inquire, Get_Attr, Copy_Attr, Get, Put
! use dc_url, only:
use dc_error, only: StoreError, DC_NOERR, GT_EARGSIZEMISMATCH
! use dc_string, only:
use dc_present, only: present_select
use dc_types, only: string, token
use dc_date, only: EvalByUnit
implicit none
type(GT_HISTORY), intent(out), target :: hist_dest
character(*), intent(in) :: file
type(GT_HISTORY), intent(in), optional, target:: hist_src
character(*), intent(in), optional:: title, source, institution
!!!$ type(GT_HISTORY_AXIS), intent(in),optional :: axes(:)
!!!$ type(GT_HISTORY_AXIS), intent(in),optional :: addaxes(:)
!!!$ character(*), intent(in), optional:: dims(:)
!!!$ integer, intent(in), optional:: dimsizes(:)
!!!$ character(*), intent(in), optional:: longnames(:)
!!!$ character(*), intent(in), optional:: units(:)
real, intent(in), optional:: origin, interval
!!!$ character(*), intent(in), optional:: xtypes(:)
character(*), intent(in), optional:: conventions, gt_version
! Internal Work
type(GT_HISTORY), pointer:: src =>null()
character(STRING) :: title_src, source_src, institution_src
character(STRING) :: conventions_src, gt_version_src
character(STRING), pointer:: dims(:) => null()
integer , pointer:: dimsizes(:) => null()
character(STRING), pointer:: longnames(:) => null()
character(STRING), pointer:: units(:) => null()
character(STRING), pointer:: xtypes(:) => null()
real:: originw, intervalw
integer :: i, numdims
logical :: err
real(DP),pointer :: dimvalue(:) => null()
character(len = *),parameter:: subname = "HistoryCopy1"
continue
call BeginSub(subname, 'file=<%c>', c1=trim(file))
if (present(hist_src)) then
src => hist_src
else
src => default
endif
#ifdef LIB_MPI
if ( .not. src % mpi_gather .or. ( src % mpi_gather .and. src % mpi_myrank == 0 ) ) then
#endif
numdims = size(src % dimvars)
call HistoryInquire1(history=src, title=title_src, source=source_src, institution=institution_src, dims=dims, dimsizes=dimsizes, longnames=longnames, units=units, xtypes=xtypes, conventions=conventions_src, gt_version=gt_version_src)
if ( present(origin) ) then
originw = origin
else
originw = EvalByUnit( src % origin, '', src % unlimited_units_symbol )
end if
intervalw = EvalByUnit( src % interval, '', src % unlimited_units_symbol )
if ( present(interval) ) then
if ( interval /= 0.0 ) then
intervalw = interval
end if
end if
call HistoryCreate1(file=trim(file), title=trim(present_select('', title_src, title)), source=trim(present_select('', source_src, source)), institution=trim(present_select('', institution_src, institution)), dims=dims, dimsizes=dimsizes, longnames=longnames, units=units, origin=originw, interval=intervalw, xtypes=xtypes, history=hist_dest, conventions=trim(present_select('', conventions_src, conventions)), gt_version=trim(present_select('', gt_version_src, gt_version)) )
!
! 次元変数が属性を持っている場合のことも考え, 最後に直接
! hist_dst % dimvars へ copy_attr (gtvarcopyattrall) をかける.
!
do i = 1, numdims
call Copy_Attr(hist_dest % dimvars(i), src % dimvars (i), global=.false.)
end do
! dimvars を Get してみて, 値を持っているようならデータを与えてしまう.
do i = 1, numdims
if (dimsizes(i) == 0) cycle
call Get(src % dimvars(i), dimvalue, err)
if (err) cycle
call HistoryPutDoubleEx(dims(i), dimvalue, size(dimvalue), hist_dest)
deallocate(dimvalue)
end do
deallocate(dims, dimsizes, longnames, units, xtypes)
#ifdef LIB_MPI
end if
#endif
call EndSub(subname)
end subroutine HistoryCopy1
| Subroutine : | |||
| file : | character(len = *), intent(in)
| ||
| varname : | character(len = *), intent(in)
| ||
| history : | type(GT_HISTORY),
intent(inout), optional, target
| ||
| overwrite : | logical, intent(in), optional
|
gtool4 データ内の変数の定義を行います。 他の gtool4 データの ファイル名とその中の変数名を指定することで、 自動的のその変数の 構造や属性をコピーして変数定義します。このサブルーチンを 用いる前に、 HistoryCreate による初期設定が必要です。
構造や属性を手動で設定する場合には HistoryAddVariable を用いて下さい。
subroutine HistoryCopyVariable1(file, varname, history, overwrite)
!
!== 変数定義 (別ファイルの変数コピー)
!
! gtool4 データ内の変数の定義を行います。 他の gtool4 データの
! ファイル名とその中の変数名を指定することで、 自動的のその変数の
! 構造や属性をコピーして変数定義します。このサブルーチンを
! 用いる前に、 HistoryCreate による初期設定が必要です。
!
! 構造や属性を手動で設定する場合には HistoryAddVariable
! を用いて下さい。
!
use gtdata_generic, only: Create, Inquire, Open, Slice, Close
use dc_present, only: present_and_false
use dc_url, only: UrlMerge, GT_ATMARK, UrlResolve
use dc_date, only: DCDiffTimeCreate
use dc_types, only: STRING
implicit none
character(len = *), intent(in) :: file
! コピーしようとする変数が格納された
! netCDF ファイル名
!
character(len = *), intent(in) :: varname
! コピー元となる変数の名前
!
! 定義される変数名もこれと
! 同じになります。
! 最大文字数は dc_types#TOKEN 。
!
! 依存する次元が存在しない
! 場合は自動的にその次元に関する
! 変数情報も元のファイルから
! コピーします。
! この場合に「同じ次元」と見
! なされるのは、(1) 無制限次
! 元 (自動的に「時間」と認識
! される)、
! (2) サイズと単位が同じ次元、
! です。
!
type(GT_HISTORY), intent(inout), optional, target :: history
! 出力ファイルの設定に関する情報を
! 格納した構造体
!
! ここに指定するものは、
! HistoryCreate によって初期設定
! されていなければなりません。
!
logical, intent(in), optional:: overwrite
! 上書きの可否の設定
!
! この引数に .false. を渡すと、
! 既存のファイルを上書きしません。
! デフォルトは上書きします。
!
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE), pointer:: vwork(:) =>null(), dimvars(:) =>null()
type(GT_VARIABLE):: copyfrom
character(STRING):: fullname, url, copyurl
integer, pointer:: count_work(:) =>null()
integer, pointer:: var_avr_count_work(:) =>null()
integer:: var_avr_length
logical, pointer:: var_avr_firstput_work(:) =>null()
real(DP), pointer:: var_avr_coefsum_work(:) =>null()
type(DC_DIFFTIME), pointer:: var_avr_baseint_work(:) =>null()
type(DC_DIFFTIME), pointer:: var_avr_prevtime_work(:) =>null()
type(GT_HISTORY_AVRDATA), pointer:: var_avr_data_work(:) =>null()
integer:: nvars, numdims, i
logical:: growable, overwrite_required
character(*), parameter:: subname = "HistoryCopyVariable1"
continue
call BeginSub(subname, 'file=%c varname=%c', c1=trim(file), c2=trim(varname))
!----- 操作対象決定 -----
if (present(history)) then
hst => history
else
hst => default
endif
!----- 変数表拡張 -----
if (associated(hst % vars)) then
nvars = size(hst % vars(:))
vwork => hst % vars
count_work => hst % count
nullify(hst % vars, hst % count)
allocate(hst % vars(nvars + 1), hst % count(nvars + 1))
hst % vars(1:nvars) = vwork(1:nvars)
hst % count(1:nvars) = count_work(1:nvars)
deallocate(vwork, count_work)
count_work => hst % growable_indices
nullify(hst % growable_indices)
allocate(hst % growable_indices(nvars + 1))
hst % growable_indices(1:nvars) = count_work(1:nvars)
deallocate(count_work)
!
! 平均値出力のための変数表コピー
! Copy table of variables for average value output
!
var_avr_count_work => hst % var_avr_count
nullify( hst % var_avr_count )
allocate( hst % var_avr_count(nvars + 1) )
hst % var_avr_count(1:nvars) = var_avr_count_work(1:nvars)
deallocate( var_avr_count_work )
var_avr_data_work => hst % var_avr_data
nullify(hst % var_avr_data)
allocate(hst % var_avr_data(nvars + 1))
do i = 1, nvars
hst % var_avr_data(i) % length = var_avr_data_work(i) % length
allocate(hst % var_avr_data(i) % a_DataAvr(var_avr_data_work(i) % length))
hst % var_avr_data(i) % a_DataAvr = var_avr_data_work(i) % a_DataAvr
end do
deallocate( var_avr_data_work )
var_avr_firstput_work => hst % var_avr_firstput
nullify( hst % var_avr_firstput )
allocate( hst % var_avr_firstput(nvars + 1) )
hst % var_avr_firstput(1:nvars) = var_avr_firstput_work(1:nvars)
deallocate( var_avr_firstput_work )
var_avr_coefsum_work => hst % var_avr_coefsum
nullify( hst % var_avr_coefsum )
allocate( hst % var_avr_coefsum(nvars + 1) )
hst % var_avr_coefsum(1:nvars) = var_avr_coefsum_work(1:nvars)
deallocate( var_avr_coefsum_work )
var_avr_baseint_work => hst % var_avr_baseint
nullify( hst % var_avr_baseint )
allocate( hst % var_avr_baseint(nvars + 1) )
hst % var_avr_baseint(1:nvars) = var_avr_baseint_work(1:nvars)
deallocate( var_avr_baseint_work )
var_avr_prevtime_work => hst % var_avr_prevtime
nullify( hst % var_avr_prevtime )
allocate( hst % var_avr_prevtime(nvars + 1) )
hst % var_avr_prevtime(1:nvars) = var_avr_prevtime_work(1:nvars)
deallocate( var_avr_prevtime_work )
else
! トリッキーだが、ここで count だけ 2 要素確保するのは、
! HistorySetTime による巻き戻しに備えるため。
allocate(hst % vars(1), hst % count(2), hst % growable_indices(1))
hst % count(2) = 0
allocate(hst % var_avr_count(1), hst % var_avr_data(1))
allocate(hst % var_avr_firstput(1), hst % var_avr_coefsum(1))
allocate(hst % var_avr_baseint(1), hst % var_avr_prevtime(1))
endif
nvars = size(hst % vars(:))
hst % growable_indices(nvars) = 0
hst % count(nvars) = 0
hst % var_avr_count(nvars) = -1
hst % var_avr_firstput = .true.
hst % var_avr_coefsum(nvars) = 0.0_DP
call DCDiffTimeCreate( hst % var_avr_baseint(nvars), sec = 0.0_DP ) ! (in)
hst % var_avr_prevtime(nvars) = hst % var_avr_baseint(nvars)
!----- コピー元ファイルの変数 ID 取得 -----
copyurl = UrlMerge(file, varname)
call Open(copyfrom, copyurl)
!----- 変数コピー -----
call Inquire(hst % dimvars(1), url=url)
fullname = UrlResolve((GT_ATMARK // trim(varname)), trim(url))
overwrite_required = .true.
if (present_and_false(overwrite)) overwrite_required = .false.
call Create(hst % vars(nvars), trim(fullname), copyfrom, copyvalue=.FALSE., overwrite=overwrite_required)
!----- 無制限次元の添字を探査 -----
call Inquire(hst % vars(nvars), alldims=numdims)
allocate(dimvars(numdims))
! 各次元毎に情報を取得し, growable == .TRUE. のもの (つまりは時間)
! の添字番号を取得する
do, i = 1, numdims
call Open(var=dimvars(i), source_var=hst % vars(nvars), dimord=i, count_compact=.TRUE.)
! 各次元変数の growable を調べる
call Inquire(var=dimvars(i), growable=growable)
if (growable) then
hst % growable_indices(nvars) = i
endif
enddo
!----- 拡張可能次元があったらそれをサイズ 1 に拡張しておく -----
if (hst % growable_indices(nvars) /= 0) then
call Slice(hst % vars(nvars), hst % growable_indices(nvars), start=1, count=1, stride=1)
endif
deallocate(dimvars)
call Inquire( hst % vars(nvars), size = var_avr_length )
allocate( hst % var_avr_data(nvars) % a_DataAvr(var_avr_length) )
hst % var_avr_data(nvars) % length = var_avr_length
hst % var_avr_data(nvars) % a_DataAvr = 0.0_DP
call Close(copyfrom)
call EndSub(subname)
end subroutine HistoryCopyVariable1
| Subroutine : | |||
| file : | character(*), intent(in)
| ||
| title : | character(*), intent(in)
| ||
| source : | character(*), intent(in)
| ||
| institution : | character(*), intent(in)
| ||
| dims(:) : | character(*), intent(in)
| ||
| dimsizes(:) : | integer, intent(in)
| ||
| longnames(:) : | character(*), intent(in)
| ||
| units(:) : | character(*), intent(in)
| ||
| origin : | real, intent(in), optional
| ||
| interval : | real, intent(in), optional
| ||
| xtypes(:) : | character(*), intent(in), optional
| ||
| history : | type(GT_HISTORY), intent(out),
optional, target
| ||
| conventions : | character(*), intent(in), optional
| ||
| gt_version : | character(*), intent(in), optional
| ||
| overwrite : | logical, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| flag_mpi_gather : | logical, intent(in), optional
| ||
| flag_mpi_split : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
このサブルーチンは、gtool4 データ出力の初期設定を行います。 HistoryAddVariable、 HistoryCopyVariable、 HistoryPut、 HistoryAddAttr、 HistoryClose、 HistorySetTime を用いるためには、HistoryCreate による初期設定が必要です。
なお、プログラム内で HistoryCreate を呼び出した場合、 プログラムを終了する前に必ず、 HistoryClose を呼び出して 終了処理を行なって下さい。
HistoryCreate というサブルーチン名は 2 つの別々の サブルーチンの総称名です。上記のサブルーチンも参照ください。
Two specific subroutines shares common part:
Both two ones initializes a dataset file. The result of type GT_HISTORY will be returned by history or managed internally if omitted. Mandatory global attributes are defined by arguments title, source, and institution; they are all declared as ((character(len = *))). Spatial axis definitions have two different forms: a primitive one uses several arrays of various types: dims, dimsizes, longnames, units, and xtypes. Another sophisticated one has only array of type GT_HISTORY_AXIS, axes. Temporal definition is done without origin, interval.
subroutine HistoryCreate1( file, title, source, institution, dims, dimsizes, longnames, units, origin, interval, xtypes, history, conventions, gt_version, overwrite, quiet, flag_mpi_gather, flag_mpi_split, err )
!
!== gtool4 データ出力用初期設定
!
! このサブルーチンは、gtool4 データ出力の初期設定を行います。
! HistoryAddVariable、 HistoryCopyVariable、 HistoryPut、
! HistoryAddAttr、 HistoryClose、 HistorySetTime
! を用いるためには、HistoryCreate による初期設定が必要です。
!
! なお、プログラム内で HistoryCreate を呼び出した場合、
! プログラムを終了する前に必ず、 HistoryClose を呼び出して
! 終了処理を行なって下さい。
!
! *HistoryCreate* というサブルーチン名は 2 つの別々の
! サブルーチンの総称名です。上記のサブルーチンも参照ください。
!
!
! Two specific subroutines shares common part:
!
! Both two ones initializes a dataset *file*.
! The result of type GT_HISTORY will be returned by *history*
! or managed internally if omitted.
! Mandatory global attributes are defined by arguments
! *title*, *source*, and *institution*;
! they are all declared as ((character(len = *))).
! Spatial axis definitions have two different forms:
! a primitive one uses several arrays of various types:
! *dims*, *dimsizes*, *longnames*, *units*, and *xtypes*.
! Another sophisticated one has only array of type GT_HISTORY_AXIS,
! *axes*.
! Temporal definition is done without *origin*, *interval*.
!
use gtdata_generic,only: Create, put_attr, Get_Attr
use dc_error, only: StoreError, DC_NOERR, GT_EARGSIZEMISMATCH, DC_EALREADYINIT
use dc_string, only: JoinChar, toChar, StoA
use dc_url, only: UrlMerge
use dc_present, only: present_and_not_empty, present_and_false, present_and_true
use dc_types, only: STRING, TOKEN
use dc_message, only: MessageNotify
use sysdep, only: SysdepEnvGet
use dc_date_types, only: DC_DATETIME, UNIT_SYMBOL_ERR, UNIT_SYMBOL_SEC
use dc_date, only: DCDateTimeCreate, toChar, DCDiffTimeCreate, EvalByUnit, ParseTimeUnits
implicit none
character(*), intent(in):: file
! 出力するファイルの名前.
! Name of output file
character(*), intent(in):: title
! データ全体の表題.
! Title of entire data
character(*), intent(in):: source
! データを作成する際の手段.
! Source of data file
character(*), intent(in):: institution
! ファイルを最終的に変更した組織/個人.
! Institution or person that changes files for the last time
character(*), intent(in):: dims(:)
! 次元の名前.
!
! 配列の大きさに制限はありません.
! 個々の次元の文字数は dc_types#TOKEN まで.
! 配列内の文字数は
! 全て同じでなければなりません.
! 足りない文字分は空白で
! 補ってください.
!
! Names of dimensions.
!
! Length of array is unlimited.
! Limits of numbers of characters of each
! dimensions are "dc_types#TOKEN".
! Numbers of characters in this array
! must be same.
! Make up a deficit with blanks.
!
integer, intent(in):: dimsizes (:)
! dims で指定したそれぞれの次元大きさ.
!
! 配列の大きさは dims の大きさと等しい
! 必要があります. '0' (数字のゼロ) を指定
! するとその次元は 無制限次元 (unlimited
! dimension) となります. (gtool_history
! では時間の次元に対して無制限次元を
! 用いることを想定しています). ただし,
! 1 つの NetCDF ファイル (バージョン 3)
! は最大で 1 つの無制限次元しか持てないので,
! 2 ヶ所以上に '0' を指定しないでください.
! その場合, 正しく gtool4 データが出力されません.
!
! Lengths of dimensions specified with "dims".
!
! Length of this array must be same as
! length of "dim". If '0' (zero) is
! specified, the dimension is treated as
! unlimited dimension.
! (In "gtool_history", unlimited dimension is
! expected to be used as time).
! Note that one NetCDF file (version 3)
! can not have two or more unlimited
! dimensions, so that do not specify '0'
! to two or more places. In that case,
! gtoo4 data is not output currently
!
character(*), intent(in):: longnames (:)
! dims で指定したそれぞれの次元の名前.
!
! 配列の大きさは dims の大きさ
! と等しい必要があります. 文字数
! は dc_types#STRING まで.
! 配列内の文字数は
! 全て同じでなければなりません.
! 足りない文字分は空白で補います.
!
! Names of dimensions specified with "dims".
!
! Length of this array must be same as
! length of "dim".
! Limits of numbers of characters are
! "dc_types#STRING".
! Numbers of characters in this array
! must be same.
! Make up a deficit with blanks.
!
character(*), intent(in):: units(:)
! dims で指定したそれぞれの次元の単位.
!
! 配列の大きさは dims の大きさ
! と等しい必要があります. 文字数
! は dc_types#STRING まで.
! 配列内の文字数は
! 全て同じでなければなりません.
! 足りない文字分は空白で補います.
!
! Units of dimensions specified with "dims".
!
! Length of this array must be same as
! length of "dim".
! Limits of numbers of characters are
! "dc_types#STRING".
! Numbers of characters in this array
! must be same.
! Make up a deficit with blanks.
!
real, intent(in), optional:: origin
! 時間の原点.
!
! これは HistoryPut により変数を最初に
! 出力するときの時間となります.
!
! 省略した場合, 時間の原点には
! 自動的に 0.0 が設定されます.
!
! Origin of time.
!
! This time is used as time
! when first output is done by "HistoryPut".
!
! If this argument is omitted,
! 0.0 is specified automatically.
!
real, intent(in), optional:: interval
! 出力時間間隔.
!
! 同じ変数に対して HistoryPut が複数回
! 呼ばれた時に, 自動的に時間変数がこの値
! だけ増やされて出力されます. なお,
! 各々の出力ファイルにつき HistorySetTime
! を一度でも用いた場合, この値は無効に
! なるので注意してください.
!
! 省略した場合, 自動的に 1.0 が設定されます.
!
! Interval of output time.
!
! When "HistoryPut" is called two or
! more times for the same variable, time
! is increased as this value and
! output automatically.
! Note that this value becomes
! invalid when "HistorySetTime" is
! used for each output file even once.
!
! If this argument is omitted,
! 1.0 is specified automatically.
!
character(*), intent(in), optional:: xtypes(:)
! dims で指定したそれぞれの
! 次元のデータ型.
!
! デフォルトは float (単精度実数型)
! です. 有効なのは,
! double (倍精度実数型),
! int (整数型) です. 指定しない
! 場合や, 無効な型を指定した場合には,
! float となります. なお, 配列の大きさ
! は *dims* の大きさと等しい必要が
! あります. 配列内の文字数は全て
! 同じでなければなりません.
! 足りない文字分は空白で補います.
!
! Data types of dimensions specified
! with "dims".
!
! Default value is "float" (single precision).
! Other valid values are
! "double" (double precision),
! "int" (integer).
! If no value or invalid value is specified,
! "float" is applied.
! Length of this array must be same as
! length of "dim".
! Numbers of characters in this array
! must be same.
! Make up a deficit with blanks.
!
type(GT_HISTORY), intent(out), optional, target:: history
! 出力ファイルの設定に関する情報を
! 格納した構造体.
!
! 1 つのプログラムで複数のファイル
! に gtool データを出力する
! 場合に利用します.
! (単独のファイルに書き出す場合は
! 指定する必要はありません)
!
! Derived type that
! stores information about output files.
!
! If multiple gtool4 data files are
! output from one program, use this
! argument.
! (If onlye one file is output,
! this argument is not needed).
!
character(*), intent(in), optional:: conventions
! 出力するファイルの netCDF
! 規約
!
! 省略した場合,
! もしくは空文字を与えた場合,
! 出力する netCDF 規約の
! Conventions 属性に値
! gtool4_netCDF_Conventions
! が自動的に与えられます.
!
! NetCDF conventions of output file.
!
! If this argument is omitted or,
! blanks are given,
! gtool4_netCDF_Conventions is given to
! attribute "Conventions" of an output file
! automatically.
!
character(*), intent(in), optional:: gt_version
! gtool4 netCDF 規約のバージョン
!
! 省略した場合, gt_version 属性に
! 規約の最新版のバージョンナンバー
! gtool4_netCDF_version
! が与えられます.
! (ただし, 引数 conventions に
! gtool4_netCDF_Conventions
! 以外が与えられる場合は
! gt_version 属性を作成しません).
!
! Version of gtool4 netCDF Conventions.
!
! If this argument is omitted,
! latest version number of gtool4 netCDF
! Conventions is given to attribute
! "gt_version" of an output file
! (However, gtool4_netCDF_Conventions is
! not given to an argument "conventions",
! attribute "gt_version" is not created).
!
logical, intent(in), optional:: overwrite
! 上書き可否
!
! この引数に .false. を渡すと,
! 既存のファイルを上書きしません.
! デフォルトは上書きします.
!
! Whether or not to overwrite.
!
! If .false. is specified to this
! argument, an existing file is not
! overwritten.
! By default, existing file is overwritten.
!
logical, intent(in), optional:: quiet
! .true. を与えた場合,
! メッセージ出力が抑制されます.
! デフォルトは .false. です.
!
! If ".true." is given,
! messages are suppressed.
! Default value is ".false.".
!
logical, intent(in), optional:: flag_mpi_gather
! MPI 使用時に, 各ノードで HistoryPut
! に与えたデータを一つのファイルに統合して出力
! する場合には .true. を与えてください.
! デフォルトは .false. です.
!
! .true. を与えた場合, HistoryPutAxisMPI
! に全体の軸データを与えてください.
!
! When MPI is used, if ".true." is given,
! data given to "HistoryPut" on each node
! is integrated and output to one file.
! Default value is ".false.".
!
! If .true. is given, give data of axes in
! whole area to "HistoryPutAxisMPI"
!
logical, intent(in), optional:: flag_mpi_split
! MPI 使用時にこの引数に .true. を与えると,
! 各ノードごとに
! *file* 引数に "_rankXXXXXX"
! (X は [0-9] の数値で, ノード番号を指す)
! を付加したファイルを出力します.
! 例えば, *file* に "output.nc" を与えた場合.
! ノード 0 では "output_rank000000.nc",
! ノード 12 では "output_rank000012.nc"
! を出力します.
! デフォルトは .false. です.
!
! When MPI is used, if ".true." is given,
! files that have names with suffixes
! "_rankXXXXXX"
! (X is [0-9] that indicates node number)
! are output on each node.
! For example, "output.nc" is given to *file*,
! "output_rank000000.nc", "output_rank000012.nc"
! are output on node 0 and node 12.
! Default value is ".false.".
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY), pointer:: hst =>null()
type(DC_DIFFTIME):: origind, intervald
integer:: i, numdims, blank_index
character(TOKEN):: unlimited_units
integer:: unit_symbol
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = "HistoryCreate1"
continue
call BeginSub(subname, 'file=%c ndims=%d', c1=trim(file), i=(/size(dims)/), version=version)
stat = DC_NOERR
cause_c = ""
numdims = size(dims)
unlimited_units = 'sec'
do, i = 1, numdims
if (dimsizes(i) == 0) unlimited_units = units(i)
end do
blank_index = index( trim( adjustl(unlimited_units) ), ' ' )
if ( blank_index > 1 ) then
unlimited_units = unlimited_units(1:blank_index-1)
end if
unit_symbol = ParseTimeUnits( unlimited_units )
if ( unit_symbol == UNIT_SYMBOL_ERR ) unit_symbol = UNIT_SYMBOL_SEC
if (present(interval)) then
call DCDiffTimeCreate( intervald, interval, '', unit_symbol ) ! (in)
else
call DCDiffTimeCreate( intervald, 1.0, '', unit_symbol ) ! (in)
end if
if (present(origin)) then
call DCDiffTimeCreate( origind, origin, '', unit_symbol ) ! (in)
else
call DCDiffTimeCreate( origind, 0.0, '', unit_symbol ) ! (in)
end if
call HistoryCreate3( file = file, title = title, source = source, institution = institution, dims = dims, dimsizes = dimsizes, longnames = longnames, units = units, origin = origind, interval = intervald, xtypes = xtypes, history = history, conventions = conventions, gt_version = gt_version, overwrite = overwrite, quiet = quiet, flag_mpi_gather = flag_mpi_gather, flag_mpi_split = flag_mpi_split, err = err )
if (present(history)) then
hst => history
else
hst => default
endif
hst % origin_setting = present(origin)
999 continue
call StoreError(stat, subname, cause_c=cause_c)
call EndSub(subname, 'stat=%d', i = (/stat/) )
end subroutine HistoryCreate1
| Subroutine : | |||
| file : | character(*), intent(in)
| ||
| title : | character(*), intent(in) | ||
| source : | character(*), intent(in) | ||
| institution : | character(*), intent(in) | ||
| axes(:) : | type(GT_HISTORY_AXIS),
intent(in)
| ||
| origin : | real, intent(in), optional | ||
| interval : | real, intent(in), optional | ||
| history : | type(GT_HISTORY), intent(out), optional, target | ||
| conventions : | character(*), intent(in), optional | ||
| gt_version : | character(*), intent(in), optional | ||
| overwrite : | logical, intent(in), optional | ||
| quiet : | logical, intent(in), optional
| ||
| flag_mpi_gather : | logical, intent(in), optional
| ||
| flag_mpi_split : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
HistoryCreate というサブルーチン名は 2 つの別々の サブルーチンの総称名です。まずは HistoryCreate を参照ください。
もう 1 つのサブルーチンと異なる点は、座標軸の情報を dims, dimsizes, longnames, units, and xtypes といった 個別の引数で与えるのではなく、構造体 GT_HISTORY_AXIS 型の 引数 axes で与える点にあります。
GT_HISTORY_AXIS 型変数の生成 (constructer) は HistoryAxisCreate にて行います。
Two specific subroutines shares common part:
Both two ones initializes a dataset file. The result of type GT_HISTORY will be returned by history or managed internally if omitted. Mandatory global attributes are defined by arguments title, source, and institution; they are all declared as ((character(len = *))). Spatial axis definitions have two different forms: a primitive one uses several arrays of various types: dims, dimsizes, longnames, units, and xtypes. Another sophisticated one has only array of type GT_HISTORY_AXIS, axes. Temporal definition is done without origin, interval.
subroutine HistoryCreate2(file, title, source, institution, axes, origin, interval, history, conventions, gt_version, overwrite, quiet, flag_mpi_gather, flag_mpi_split, err )
!
!== gtool4 データ出力用初期設定
!
! *HistoryCreate* というサブルーチン名は 2 つの別々の
! サブルーチンの総称名です。まずは HistoryCreate を参照ください。
!
! もう 1 つのサブルーチンと異なる点は、座標軸の情報を
! *dims*, *dimsizes*, *longnames*, *units*, and *xtypes* といった
! 個別の引数で与えるのではなく、構造体 GT_HISTORY_AXIS 型の
! 引数 *axes* で与える点にあります。
!
! GT_HISTORY_AXIS 型変数の生成 (constructer) は
! HistoryAxisCreate にて行います。
!
!
! Two specific subroutines shares common part:
!
! Both two ones initializes a dataset *file*.
! The result of type GT_HISTORY will be returned by *history*
! or managed internally if omitted.
! Mandatory global attributes are defined by arguments
! *title*, *source*, and *institution*;
! they are all declared as ((character(len = *))).
! Spatial axis definitions have two different forms:
! a primitive one uses several arrays of various types:
! *dims*, *dimsizes*, *longnames*, *units*, and *xtypes*.
! Another sophisticated one has only array of type GT_HISTORY_AXIS,
! *axes*.
! Temporal definition is done without *origin*, *interval*.
!
use dc_present, only: present_and_true
implicit none
character(*), intent(in):: file
! HistoryCreate 参照
! (以下 axes を除く引数も同様)
!
character(*), intent(in):: title, source, institution
type(GT_HISTORY_AXIS), intent(in):: axes(:)
! 次元情報を格納した構造型変数
!
! GT_HISTORY_AXIS 型変数の生成
! (constructer) は
! HistoryAxisCreate にて行いま
! す。配列の大きさに制限は
! ありません。
!
real, intent(in), optional:: origin, interval
type(GT_HISTORY), intent(out), optional, target:: history
character(*), intent(in), optional:: conventions, gt_version
logical, intent(in), optional:: overwrite
logical, intent(in), optional:: quiet
! .true. を与えた場合,
! メッセージ出力が抑制されます.
! デフォルトは .false. です.
!
! If ".true." is given,
! messages are suppressed.
! Default value is ".false.".
!
logical, intent(in), optional:: flag_mpi_gather
! MPI 使用時に, 各ノードで HistoryPut
! に与えたデータを一つのファイルに統合して出力
! する場合には .true. を与えてください.
! デフォルトは .false. です.
!
! .true. を与えた場合, HistoryPutAxisMPI
! に全体の軸データを与えてください.
!
! When MPI is used, if ".true." is given,
! data given to "HistoryPut" on each node
! is integrated and output to one file.
! Default value is ".false.".
!
! If .true. is given, give data of axes in
! whole area to "HistoryPutAxisMPI"
!
logical, intent(in), optional:: flag_mpi_split
! MPI 使用時にこの引数に .true. を与えると,
! 各ノードごとに
! *file* 引数に "_rankXXXXXX"
! (X は [0-9] の数値で, ノード番号を指す)
! を付加したファイルを出力します.
! 例えば, *file* に "output.nc" を与えた場合.
! ノード 0 では "output_rank000000.nc",
! ノード 12 では "output_rank000012.nc"
! を出力します.
! デフォルトは .false. です.
!
! When MPI is used, if ".true." is given,
! files that have names with suffixes
! "_rankXXXXXX"
! (X is [0-9] that indicates node number)
! are output on each node.
! For example, "output.nc" is given to *file*,
! "output_rank000000.nc", "output_rank000012.nc"
! are output on node 0 and node 12.
! Default value is ".false.".
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
! 構造体 GT_HISTORY_AXIS のデータ蓄積用
character(STRING), allocatable:: axes_name(:)
integer , allocatable:: axes_length(:)
character(STRING), allocatable:: axes_longname(:)
character(STRING), allocatable:: axes_units(:)
character(STRING), allocatable:: axes_xtype(:)
integer:: i, ndims
#ifdef LIB_MPI
type(GT_HISTORY), pointer:: hst =>null()
integer:: attr_size
#endif
character(len = *), parameter:: subname = "HistoryCreate2"
continue
call BeginSub(subname, 'file=%c ndims=%d', c1=trim(file), i=(/size(axes)/) )
! 構造体 GT_HISTORY_AXIS の axes からのデータ取得
! (Fujitsu Fortran などなら axes(:)%name という表記で配列
! データをそのまま引き渡せるが、Intel Fortran 8 などだと
! その表記をまともに解釈してくれないので、美しくないけど
! いったん他の配列に情報を引き渡す)。2004/11/27 morikawa
ndims = size( axes(:) )
allocate( axes_name(ndims) )
allocate( axes_length(ndims) )
allocate( axes_longname(ndims) )
allocate( axes_units(ndims) )
allocate( axes_xtype(ndims) )
do i = 1, ndims
axes_name(i) = axes(i) % name
axes_length(i) = axes(i) % length
axes_longname(i) = axes(i) % longname
axes_units(i) = axes(i) % units
axes_xtype(i) = axes(i) % xtype
call DbgMessage('axes(%d):name=<%c>, length=<%d>, ' // 'longname=<%c>, units=<%c>' , i=(/i, axes(i) % length/) , c1=( trim(axes(i) % name) ) , c2=( trim(axes(i) % longname) ) , c3=( trim(axes(i) % units) ) )
enddo
call HistoryCreate1(file, title, source, institution, dims = axes_name(:), dimsizes = axes_length(:), longnames = axes_longname(:), units = axes_units(:), xtypes = axes_xtype(:), origin = origin, interval = interval, history = history, conventions = conventions, gt_version = gt_version, overwrite = overwrite, quiet = quiet, flag_mpi_gather = flag_mpi_gather, flag_mpi_split = flag_mpi_split, err = err )
! Fujitsu Fortran や Intel Fortran 7 、 SunStudio 8 などなら
! 可能な方法。Intel 8 に対応するため、上記のように
! 書き換えてみた。 2004/11/27 morikawa
! call HistoryCreate1(file, title, source, institution, &
! & dims=axes(:) % name, dimsizes=axes(:) % length, &
! & longnames=axes(:) % longname, units=axes(:) % units, &
! & xtypes=axes(:) % xtype, &
! & origin=origin, interval=interval, &
! & history=history, conventions=conventions, &
! & gt_version=gt_version)
deallocate( axes_name )
deallocate( axes_length )
deallocate( axes_longname )
deallocate( axes_units )
deallocate( axes_xtype )
#ifdef LIB_MPI
if ( .not. present_and_true( flag_mpi_gather ) ) then
#endif
do i = 1, ndims
if ( .not. associated( axes(i) % attrs ) ) cycle
call HistoryAttrAdd( axes(i) % name, axes(i) % attrs, history )
end do
#ifdef LIB_MPI
else
if (present(history)) then
hst => history
else
hst => default
endif
do i = 1, ndims
if ( .not. associated( axes(i) % attrs ) ) cycle
attr_size = size( axes(i) % attrs )
allocate( hst % mpi_dimdata_all(i) % attrs( attr_size ) )
call HistoryAttrCopy( from = axes(i) % attrs, to = hst % mpi_dimdata_all(i) % attrs )
end do
endif
#endif
call EndSub(subname)
end subroutine HistoryCreate2
| Subroutine : | |||
| file : | character(*), intent(in)
| ||
| title : | character(*), intent(in)
| ||
| source : | character(*), intent(in)
| ||
| institution : | character(*), intent(in)
| ||
| dims(:) : | character(*), intent(in)
| ||
| dimsizes(:) : | integer, intent(in)
| ||
| longnames(:) : | character(*), intent(in)
| ||
| units(:) : | character(*), intent(in)
| ||
| origin : | type(DC_DIFFTIME), intent(in)
| ||
| interval : | type(DC_DIFFTIME), intent(in), optional
| ||
| xtypes(:) : | character(*), intent(in), optional
| ||
| history : | type(GT_HISTORY), intent(out),
optional, target
| ||
| conventions : | character(*), intent(in), optional
| ||
| gt_version : | character(*), intent(in), optional
| ||
| overwrite : | logical, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| flag_mpi_gather : | logical, intent(in), optional
| ||
| flag_mpi_split : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
このサブルーチンは、gtool4 データ出力の初期設定を行います。 HistoryAddVariable、 HistoryCopyVariable、 HistoryPut、 HistoryAddAttr、 HistoryClose、 HistorySetTime を用いるためには、HistoryCreate による初期設定が必要です。
なお、プログラム内で HistoryCreate を呼び出した場合、 プログラムを終了する前に必ず、 HistoryClose を呼び出して 終了処理を行なって下さい。
HistoryCreate というサブルーチン名は 2 つの別々の サブルーチンの総称名です。上記のサブルーチンも参照ください。
Two specific subroutines shares common part:
Both two ones initializes a dataset file. The result of type GT_HISTORY will be returned by history or managed internally if omitted. Mandatory global attributes are defined by arguments title, source, and institution; they are all declared as ((character(len = *))). Spatial axis definitions have two different forms: a primitive one uses several arrays of various types: dims, dimsizes, longnames, units, and xtypes. Another sophisticated one has only array of type GT_HISTORY_AXIS, axes. Temporal definition is done without origin, interval.
subroutine HistoryCreate3( file, title, source, institution, dims, dimsizes, longnames, units, origin, interval, xtypes, history, conventions, gt_version, overwrite, quiet, flag_mpi_gather, flag_mpi_split, err )
!
!== gtool4 データ出力用初期設定
!
! このサブルーチンは、gtool4 データ出力の初期設定を行います。
! HistoryAddVariable、 HistoryCopyVariable、 HistoryPut、
! HistoryAddAttr、 HistoryClose、 HistorySetTime
! を用いるためには、HistoryCreate による初期設定が必要です。
!
! なお、プログラム内で HistoryCreate を呼び出した場合、
! プログラムを終了する前に必ず、 HistoryClose を呼び出して
! 終了処理を行なって下さい。
!
! *HistoryCreate* というサブルーチン名は 2 つの別々の
! サブルーチンの総称名です。上記のサブルーチンも参照ください。
!
!
! Two specific subroutines shares common part:
!
! Both two ones initializes a dataset *file*.
! The result of type GT_HISTORY will be returned by *history*
! or managed internally if omitted.
! Mandatory global attributes are defined by arguments
! *title*, *source*, and *institution*;
! they are all declared as ((character(len = *))).
! Spatial axis definitions have two different forms:
! a primitive one uses several arrays of various types:
! *dims*, *dimsizes*, *longnames*, *units*, and *xtypes*.
! Another sophisticated one has only array of type GT_HISTORY_AXIS,
! *axes*.
! Temporal definition is done without *origin*, *interval*.
!
use gtdata_generic,only: Create, put_attr, Get_Attr
use dc_error, only: StoreError, DC_NOERR, GT_EARGSIZEMISMATCH, DC_EALREADYINIT
use dc_string, only: JoinChar, toChar, StoA, CPrintf, LChar
use dc_url, only: UrlMerge
use dc_present, only: present_and_not_empty, present_and_false, present_and_true
use dc_types, only: STRING, TOKEN
use dc_message, only: MessageNotify
use sysdep, only: SysdepEnvGet
use dc_date_types, only: DC_DATETIME, UNIT_SYMBOL_ERR, UNIT_SYMBOL_SEC
use dc_date, only: DCDateTimeCreate, toChar, DCDiffTimeCreate, EvalByUnit, ParseTimeUnits
implicit none
character(*), intent(in):: file
! 出力するファイルの名前.
! Name of output file
character(*), intent(in):: title
! データ全体の表題.
! Title of entire data
character(*), intent(in):: source
! データを作成する際の手段.
! Source of data file
character(*), intent(in):: institution
! ファイルを最終的に変更した組織/個人.
! Institution or person that changes files for the last time
character(*), intent(in):: dims(:)
! 次元の名前.
!
! 配列の大きさに制限はありません.
! 個々の次元の文字数は dc_types#TOKEN まで.
! 配列内の文字数は
! 全て同じでなければなりません.
! 足りない文字分は空白で
! 補ってください.
!
! Names of dimensions.
!
! Length of array is unlimited.
! Limits of numbers of characters of each
! dimensions are "dc_types#TOKEN".
! Numbers of characters in this array
! must be same.
! Make up a deficit with blanks.
!
integer, intent(in):: dimsizes (:)
! dims で指定したそれぞれの次元大きさ.
!
! 配列の大きさは dims の大きさと等しい
! 必要があります. '0' (数字のゼロ) を指定
! するとその次元は 無制限次元 (unlimited
! dimension) となります. (gtool_history
! では時間の次元に対して無制限次元を
! 用いることを想定しています). ただし,
! 1 つの NetCDF ファイル (バージョン 3)
! は最大で 1 つの無制限次元しか持てないので,
! 2 ヶ所以上に '0' を指定しないでください.
! その場合, 正しく gtool4 データが出力されません.
!
! Lengths of dimensions specified with "dims".
!
! Length of this array must be same as
! length of "dim". If '0' (zero) is
! specified, the dimension is treated as
! unlimited dimension.
! (In "gtool_history", unlimited dimension is
! expected to be used as time).
! Note that one NetCDF file (version 3)
! can not have two or more unlimited
! dimensions, so that do not specify '0'
! to two or more places. In that case,
! gtoo4 data is not output currently
!
character(*), intent(in):: longnames (:)
! dims で指定したそれぞれの次元の名前.
!
! 配列の大きさは dims の大きさ
! と等しい必要があります. 文字数
! は dc_types#STRING まで.
! 配列内の文字数は
! 全て同じでなければなりません.
! 足りない文字分は空白で補います.
!
! Names of dimensions specified with "dims".
!
! Length of this array must be same as
! length of "dim".
! Limits of numbers of characters are
! "dc_types#STRING".
! Numbers of characters in this array
! must be same.
! Make up a deficit with blanks.
!
character(*), intent(in):: units(:)
! dims で指定したそれぞれの次元の単位.
!
! 配列の大きさは dims の大きさ
! と等しい必要があります. 文字数
! は dc_types#STRING まで.
! 配列内の文字数は
! 全て同じでなければなりません.
! 足りない文字分は空白で補います.
!
! Units of dimensions specified with "dims".
!
! Length of this array must be same as
! length of "dim".
! Limits of numbers of characters are
! "dc_types#STRING".
! Numbers of characters in this array
! must be same.
! Make up a deficit with blanks.
!
type(DC_DIFFTIME), intent(in):: origin
! 時間の原点.
!
! これは HistoryPut により変数を最初に
! 出力するときの時間となります.
!
! 省略した場合, 時間の原点には
! 自動的に 0.0 が設定されます.
!
! Origin of time.
!
! This time is used as time
! when first output is done by "HistoryPut".
!
! If this argument is omitted,
! 0.0 is specified automatically.
!
type(DC_DIFFTIME), intent(in), optional:: interval
! 出力時間間隔.
!
! 同じ変数に対して HistoryPut が複数回
! 呼ばれた時に, 自動的に時間変数がこの値
! だけ増やされて出力されます. なお,
! 各々の出力ファイルにつき HistorySetTime
! を一度でも用いた場合, この値は無効に
! なるので注意してください.
!
! 省略した場合, 自動的に 1.0 が設定されます.
!
! Interval of output time.
!
! When "HistoryPut" is called two or
! more times for the same variable, time
! is increased as this value and
! output automatically.
! Note that this value becomes
! invalid when "HistorySetTime" is
! used for each output file even once.
!
! If this argument is omitted,
! 1.0 is specified automatically.
!
character(*), intent(in), optional:: xtypes(:)
! dims で指定したそれぞれの
! 次元のデータ型.
!
! デフォルトは float (単精度実数型)
! です. 有効なのは,
! double (倍精度実数型),
! int (整数型) です. 指定しない
! 場合や, 無効な型を指定した場合には,
! float となります. なお, 配列の大きさ
! は *dims* の大きさと等しい必要が
! あります. 配列内の文字数は全て
! 同じでなければなりません.
! 足りない文字分は空白で補います.
!
! Data types of dimensions specified
! with "dims".
!
! Default value is "float" (single precision).
! Other valid values are
! "double" (double precision),
! "int" (integer).
! If no value or invalid value is specified,
! "float" is applied.
! Length of this array must be same as
! length of "dim".
! Numbers of characters in this array
! must be same.
! Make up a deficit with blanks.
!
type(GT_HISTORY), intent(out), optional, target:: history
! 出力ファイルの設定に関する情報を
! 格納した構造体.
!
! 1 つのプログラムで複数のファイル
! に gtool データを出力する
! 場合に利用します.
! (単独のファイルに書き出す場合は
! 指定する必要はありません)
!
! Derived type that
! stores information about output files.
!
! If multiple gtool4 data files are
! output from one program, use this
! argument.
! (If onlye one file is output,
! this argument is not needed).
!
character(*), intent(in), optional:: conventions
! 出力するファイルの netCDF
! 規約
!
! 省略した場合,
! もしくは空文字を与えた場合,
! 出力する netCDF 規約の
! Conventions 属性に値
! gtool4_netCDF_Conventions
! が自動的に与えられます.
!
! NetCDF conventions of output file.
!
! If this argument is omitted or,
! blanks are given,
! gtool4_netCDF_Conventions is given to
! attribute "Conventions" of an output file
! automatically.
!
character(*), intent(in), optional:: gt_version
! gtool4 netCDF 規約のバージョン
!
! 省略した場合, gt_version 属性に
! 規約の最新版のバージョンナンバー
! gtool4_netCDF_version
! が与えられます.
! (ただし, 引数 conventions に
! gtool4_netCDF_Conventions
! 以外が与えられる場合は
! gt_version 属性を作成しません).
!
! Version of gtool4 netCDF Conventions.
!
! If this argument is omitted,
! latest version number of gtool4 netCDF
! Conventions is given to attribute
! "gt_version" of an output file
! (However, gtool4_netCDF_Conventions is
! not given to an argument "conventions",
! attribute "gt_version" is not created).
!
logical, intent(in), optional:: overwrite
! 上書き可否
!
! この引数に .false. を渡すと,
! 既存のファイルを上書きしません.
! デフォルトは上書きします.
!
! Whether or not to overwrite.
!
! If .false. is specified to this
! argument, an existing file is not
! overwritten.
! By default, existing file is overwritten.
!
logical, intent(in), optional:: quiet
! .true. を与えた場合,
! メッセージ出力が抑制されます.
! デフォルトは .false. です.
!
! If ".true." is given,
! messages are suppressed.
! Default value is ".false.".
!
logical, intent(in), optional:: flag_mpi_gather
! MPI 使用時に, 各ノードで HistoryPut
! に与えたデータを一つのファイルに統合して出力
! する場合には .true. を与えてください.
! デフォルトは .false. です.
!
! .true. を与えた場合, HistoryPutAxisMPI
! に全体の軸データを与えてください.
!
! When MPI is used, if ".true." is given,
! data given to "HistoryPut" on each node
! is integrated and output to one file.
! Default value is ".false.".
!
! If .true. is given, give data of axes in
! whole area to "HistoryPutAxisMPI"
!
logical, intent(in), optional:: flag_mpi_split
! MPI 使用時にこの引数に .true. を与えると,
! 各ノードごとに
! *file* 引数に "_rankXXXXXX"
! (X は [0-9] の数値で, ノード番号を指す)
! を付加したファイルを出力します.
! 例えば, *file* に "output.nc" を与えた場合.
! ノード 0 では "output_rank000000.nc",
! ノード 12 では "output_rank000012.nc"
! を出力します.
! デフォルトは .false. です.
!
! When MPI is used, if ".true." is given,
! files that have names with suffixes
! "_rankXXXXXX"
! (X is [0-9] that indicates node number)
! are output on each node.
! For example, "output.nc" is given to *file*,
! "output_rank000000.nc", "output_rank000012.nc"
! are output on node 0 and node 12.
! Default value is ".false.".
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
integer:: numdims, i, stat, blank_index
real:: origin_work!, interval_work
type(GT_HISTORY), pointer:: hst =>null()
character(TOKEN):: my_xtype, origin_str!, interval_str
character(STRING):: file_work, url, x_inst, x_conv, x_gtver, nc_history
character(STRING):: cause_c
logical:: gtver_add, overwrite_required
character(TOKEN):: username
type(DC_DATETIME):: now_time
#ifdef LIB_MPI
integer:: err_mpi, index_nc_mpi
character(STRING):: file_mpi
character(TOKEN):: myrank_str_mpi, nc_suffix_mpi
#endif
character(*), parameter:: subname = "HistoryCreate3"
continue
call BeginSub(subname, 'file=%c ndims=%d', c1=trim(file), i=(/size(dims)/), version=version)
stat = DC_NOERR
cause_c = ""
call DbgMessage( 'dims(:)=%a, dimsizes(:)=%a, longnames(:)=%a, units(:)=%a', ca=StoA(JoinChar(dims), toChar(dimsizes), JoinChar(longnames), JoinChar(units)))
if (present(history)) then
hst => history
else
hst => default
endif
! 初期設定のチェック
! Check initialization
!
if ( hst % initialized ) then
stat = DC_EALREADYINIT
cause_c = 'GT_HISTORY'
goto 999
end if
! dims, dimsizes, longnames, units の整合性チェック
! Check consistency about "dims", "dimsizes", "longnames", "units"
!
numdims = size(dims)
if ( size(dimsizes) /= numdims ) then
cause_c = 'dimsizes, dims'
elseif ( size(longnames) /= numdims ) then
cause_c = 'longnames, dims'
elseif ( size(units) /= numdims ) then
cause_c = 'units, dims'
endif
if ( trim(cause_c) /= "" ) then
stat = GT_EARGSIZEMISMATCH
goto 999
end if
! 次元変数表作成.
! Create table of dimensional variables
!
allocate(hst % dimvars(numdims))
allocate(hst % dim_value_written(numdims))
hst % dim_value_written(:) = .false.
hst % unlimited_index = 0
! ユーザ名の取得
! Get user name
!
call SysdepEnvGet('USER', username)
if (trim(username) == '') username = 'unknown'
! 現在時刻の取得
! Get current time
!
call DCDateTimeCreate(now_time)
nc_history = trim(toChar(now_time)) // ' ' // trim(username) // '> gtool_history: HistoryCreate' // achar(10)
! MPI に関連する情報の初期設定
! Initialize information about MPI
!
#ifdef LIB_MPI
hst % mpi_gather = present_and_true( flag_mpi_gather )
hst % mpi_split = present_and_true( flag_mpi_split )
allocate( hst % mpi_fileinfo )
allocate( hst % mpi_fileinfo % axes(numdims) )
allocate( hst % mpi_dimdata_all(numdims) )
allocate( hst % mpi_dimdata_each(numdims) )
if ( hst % unlimited_index /= 0 ) then
hst % mpi_dimdata_all( hst % unlimited_index ) % length = 0
hst % mpi_dimdata_each( hst % unlimited_index ) % length = 0
end if
#else
hst % mpi_gather = .false.
hst % mpi_split = .false.
#endif
! MPI 使用時のファイル名の扱い
! Treat file names when MPI is used
!
#ifndef LIB_MPI
file_work = file
#else
file_work = file
if ( hst % mpi_gather .or. hst % mpi_split ) then
call MPI_Comm_Rank(MPI_COMM_WORLD, hst % mpi_myrank, err_mpi)
call MPI_Comm_Size(MPI_COMM_WORLD, hst % mpi_nprocs, err_mpi)
end if
if ( hst % mpi_split ) then
file_mpi = file
myrank_str_mpi = CPrintf( '_rank%06d', i = (/ hst % mpi_myrank /) )
index_nc_mpi = index( LChar(file_mpi), '.nc' )
if ( index_nc_mpi > 1 ) then
nc_suffix_mpi = file_mpi(index_nc_mpi:)
file_mpi = file_mpi(:index_nc_mpi-1) // trim( myrank_str_mpi ) // trim( nc_suffix_mpi )
elseif ( index_nc_mpi > 0 ) then
file_mpi = trim( myrank_str_mpi ) // trim( file_mpi )
else
file_mpi = trim( file_mpi ) // trim( myrank_str_mpi )
end if
file_work = file_mpi
end if
#endif
! 変数 URL (出力ファイル) の作成
! Create variable URL (output file)
!
do, i = 1, numdims
my_xtype = ""
if ( present(xtypes) ) then
if ( size(xtypes) >= i ) then
my_xtype = xtypes(i)
end if
end if
#ifndef LIB_MPI
url = UrlMerge(file=file, var=dims(i))
#else
if ( hst % mpi_split ) then
url = UrlMerge(file=file_mpi, var=dims(i))
else
url = UrlMerge(file=file, var=dims(i))
end if
#endif
overwrite_required = .true.
if (present_and_false(overwrite)) overwrite_required = .false.
#ifdef LIB_MPI
if ( .not. hst % mpi_gather ) then
#endif
call Create( hst % dimvars(i), trim(url), dimsizes(i), xtype=trim(my_xtype), overwrite=overwrite_required)
! conventions が存在しない場合はデフォルトの値を
! 属性 Conventions に付加。
if ( present_and_not_empty(conventions) ) then
x_conv = conventions
else
x_conv = gtool4_netCDF_Conventions
endif
! 1) gt_version がある場合、それを gt_version 属性に渡す。
! 2) gt_version が無い場合、conventions も無いか、または
! gtool4 netCDF 規約が入っていれば最新版を gt_version
! に与える。そうでない場合は gt_version 属性を与えない。
if (present_and_not_empty(gt_version)) then
x_gtver = gt_version
gtver_add = .TRUE.
else
if ( present_and_not_empty(conventions) .and. .not. x_conv == gtool4_netCDF_Conventions ) then
gtver_add = .FALSE.
else
x_gtver = gtool4_netCDF_version
gtver_add = .TRUE.
endif
endif
if (trim(institution) /= "") then
x_inst = institution
else
x_inst = "a gtool_history (by GFD Dennou Club) user"
endif
call Put_Attr(hst % dimvars(i), '+Conventions', trim(x_conv))
if (gtver_add) then
call Put_Attr(hst % dimvars(i), '+gt_version', trim(x_gtver))
endif
! title, source, institution, history, long_name, units 属性の付加
call Put_Attr(hst % dimvars(i), '+title', title)
call Put_Attr(hst % dimvars(i), '+source', source)
call Put_Attr(hst % dimvars(i), '+institution', trim(x_inst))
call Put_Attr(hst % dimvars(i), '+history', trim(nc_history))
call Put_Attr(hst % dimvars(i), 'long_name', trim(longnames(i)))
call Put_Attr(hst % dimvars(i), 'units', trim(units(i)))
#ifdef LIB_MPI
else
my_xtype = ""
if ( present(xtypes) ) then
if ( size(xtypes) >= i ) then
my_xtype = xtypes(i)
end if
end if
call HistoryAxisCreate( hst % mpi_fileinfo % axes(i), dims(i), dimsizes(i), longnames(i), units(i), my_xtype )
hst % mpi_fileinfo % file = file
hst % mpi_fileinfo % title = title
hst % mpi_fileinfo % source = source
hst % mpi_fileinfo % overwrite = .true.
if (present_and_false(overwrite)) hst % mpi_fileinfo % overwrite = .false.
if ( present_and_not_empty(conventions) ) then
hst % mpi_fileinfo % conventions = conventions
else
hst % mpi_fileinfo % conventions = gtool4_netCDF_Conventions
endif
if (present_and_not_empty(gt_version)) then
hst % mpi_fileinfo % gt_version = gt_version
hst % mpi_fileinfo % gtver_add = .TRUE.
else
if ( present_and_not_empty(conventions) .and. .not. hst % mpi_fileinfo % conventions == gtool4_netCDF_Conventions ) then
hst % mpi_fileinfo % gtver_add = .FALSE.
else
hst % mpi_fileinfo % gt_version = gtool4_netCDF_version
hst % mpi_fileinfo % gtver_add = .TRUE.
endif
endif
if (trim(institution) /= "") then
hst % mpi_fileinfo % institution = institution
else
hst % mpi_fileinfo % institution = "a gtool_history (by GFD Dennou Club) user"
endif
hst % mpi_fileinfo % quiet = .false.
hst % mpi_fileinfo % quiet = present_and_true(quiet)
hst % mpi_fileinfo % nc_history = nc_history
end if
#endif
if (dimsizes(i) == 0) then
hst % unlimited_index = i
hst % unlimited_units = units(i)
end if
enddo
! 従属変数表の初期化
! Initialize table of dependent variables
!
nullify(hst % vars, hst % growable_indices, hst % count)
! 時刻の単位
!
if ( hst % unlimited_index == 0 ) then
hst % unlimited_units_symbol = UNIT_SYMBOL_SEC
else
blank_index = index( trim( adjustl(hst % unlimited_units) ), ' ' )
if ( blank_index > 1 ) then
hst % unlimited_units = hst % unlimited_units(1:blank_index-1)
end if
hst % unlimited_units_symbol = ParseTimeUnits( hst % unlimited_units )
if ( hst % unlimited_units_symbol == UNIT_SYMBOL_ERR ) then
call MessageNotify('W', subname, 'units of time (%c) can not be recognized as units of time. ' // 'This units is treated as (%c)', c1 = trim(hst % unlimited_units), c2 = 'sec')
hst % unlimited_units_symbol = UNIT_SYMBOL_SEC
end if
end if
! 時間カウンタ
!
if ( present(interval) ) then
hst % interval = interval
else
call DCDiffTimeCreate( hst % interval, 1.0, '', hst % unlimited_units_symbol ) ! (in)
end if
hst % origin = origin
origin_work = EvalByUnit( hst % origin, '', hst % unlimited_units_symbol )
origin_str = trim( toChar( origin_work ) ) // ' [' // trim( hst % unlimited_units ) // ']'
hst % newest = hst % origin
hst % oldest = hst % origin
hst % origin_setting = .true.
! 時間平均値出力に関するデフォルト設定
! Default settings for time-averaged value output
!
hst % time_bnds = EvalByUnit( hst % origin, '', hst % unlimited_units_symbol )
hst % time_bnds_output_count = 0
! メッセージ出力
! Output messages
!
#ifdef LIB_MPI
if ( .not. hst % mpi_gather ) then
#endif
if ( .not. present_and_true(quiet) ) then
call MessageNotify('M', subname, '"%c" is created (origin=%c)', c1 = trim( file_work ), c2 = trim( origin_str ), rank_mpi = -1 )
end if
#ifdef LIB_MPI
end if
#endif
! 終了処理, 例外処理
! Termination and Exception handling
!
hst % initialized = .true.
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname, 'stat=%d', i = (/stat/) )
end subroutine HistoryCreate3
| Function : | |
| result : | logical |
| history : | type(GT_HISTORY), intent(in) |
history が初期設定されている場合には .true. が, 初期設定されていない場合には .false. が返ります.
If history is initialized, .true. is returned. If history is not initialized, .false. is returned.
logical function HistoryInitialized0( history ) result(result)
!
! *history* が初期設定されている場合には .true. が,
! 初期設定されていない場合には .false. が返ります.
!
! If *history* is initialized, .true. is returned.
! If *history* is not initialized, .false. is returned.
!
implicit none
type(GT_HISTORY), intent(in):: history
continue
result = history % initialized
end function HistoryInitialized0
| Subroutine : | |||
| history : | type(GT_HISTORY), intent(in) | ||
| err : | logical, intent(out), optional | ||
| file : | character(*), intent(out), optional | ||
| title : | character(*), intent(out), optional | ||
| source : | character(*), intent(out), optional | ||
| dims(:) : | character(*), pointer, optional
| ||
| dimsizes(:) : | integer,pointer, optional
| ||
| longnames(:) : | character(*), pointer, optional
| ||
| units(:) : | character(*), pointer, optional
| ||
| xtypes(:) : | character(*), pointer, optional
| ||
| institution : | character(*), intent(out), optional | ||
| origin : | real,intent(out), optional | ||
| interval : | real,intent(out), optional | ||
| newest : | real,intent(out), optional
| ||
| oldest : | real,intent(out), optional
| ||
| conventions : | character(*), intent(out), optional | ||
| gt_version : | character(*), intent(out), optional | ||
| axes(:) : | type(GT_HISTORY_AXIS),
pointer, optional
| ||
| varinfo(:) : | type(GT_HISTORY_VARINFO),
pointer, optional
|
HistoryCreate や HistoryAddVariable などで設定した値の 参照を行います。
file, title, source, institution, origin, interval, conventions, gt_version, dims, dimsizes, longnames, units, xtypes に関しては HistoryCreate を参照してください。
title, source, institution, origin, interval, conventions, gt_version に関しては、値が得られなかった場合は "unknown" が返ります。
dims, dimsizes, longnames, units, xtypes に関してはポインタに 値を返すため、必ずポインタを空状態にしてから与えてください。
axes と varinfo にはそれぞれ座標軸情報と変数情報を返します。 将来的には全ての属性の値も一緒に返す予定ですが、現在は long_name, units, xtype のみが属性の値として返ります。
HistoryInquire は 2 つのサブルーチンの総称名です。 HistoryCreate で history を与えなかった場合の問い合わせに関しては 上記のサブルーチンを参照してください。
以下の場合に、このサブルーチンはエラーを生じプログラムを終了させます。 ただし、err 引数を与える場合、この引数に .true. を 返し、プログラムは続行します。
subroutine HistoryInquire1(history, err, file, title, source, dims, dimsizes, longnames, units, xtypes, institution, origin, interval, newest, oldest, conventions, gt_version, axes, varinfo )
!
!== GT_HISTORY 型変数への問い合わせ
!
! HistoryCreate や HistoryAddVariable などで設定した値の
! 参照を行います。
!
! file, title, source, institution, origin, interval,
! conventions, gt_version, dims, dimsizes, longnames, units,
! xtypes に関しては HistoryCreate を参照してください。
!
! title, source, institution, origin, interval, conventions, gt_version
! に関しては、値が得られなかった場合は "unknown" が返ります。
!
! dims, dimsizes, longnames, units, xtypes に関してはポインタに
! 値を返すため、必ずポインタを空状態にしてから与えてください。
!
! axes と varinfo にはそれぞれ座標軸情報と変数情報を返します。
! 将来的には全ての属性の値も一緒に返す予定ですが、現在は
! long_name, units, xtype のみが属性の値として返ります。
!
! *HistoryInquire* は 2 つのサブルーチンの総称名です。
! HistoryCreate で *history* を与えなかった場合の問い合わせに関しては
! 上記のサブルーチンを参照してください。
!
!=== エラー
!
! 以下の場合に、このサブルーチンはエラーを生じプログラムを終了させます。
! ただし、*err* 引数を与える場合、この引数に <tt>.true.</tt> を
! 返し、プログラムは続行します。
!
! - *history* が HistoryCreate によって初期設定されていない場合
! - HistoryAddVariable や HistoryCopyVariable 等による変数定義が
! 一度も行われていない GT_HISTORY 変数に対して引数 varinfo
! を渡した場合
!
use dc_error, only: StoreError, DC_NOERR, GT_EBADHISTORY, NF_ENOTVAR
use gtdata_generic, only: Inquire, Get_Attr, Open, Close
use dc_url, only: UrlSplit
use dc_date, only: EvalByUnit
implicit none
type(GT_HISTORY), intent(in):: history
logical, intent(out), optional :: err
character(*), intent(out), optional:: file, title, source, institution
real,intent(out), optional:: origin, interval
real,intent(out), optional:: newest ! 最新の時刻
real,intent(out), optional:: oldest ! 最初の時刻
character(*), intent(out), optional:: conventions, gt_version
character(*), pointer, optional:: dims(:) ! (out)
integer,pointer, optional:: dimsizes(:) ! (out)
character(*), pointer, optional:: longnames(:) ! (out)
character(*), pointer, optional:: units(:) ! (out)
character(*), pointer, optional:: xtypes(:) ! (out)
type(GT_HISTORY_AXIS), pointer, optional :: axes(:) ! (out)
type(GT_HISTORY_VARINFO), pointer, optional :: varinfo(:) ! (out)
! Internal Work
character(STRING) :: url, cause_c
character(TOKEN) :: unknown_mes = 'unknown'
integer :: i, j, numdims, numvars, alldims, stat
logical :: growable
type(GT_VARIABLE) :: dimvar
character(*), parameter:: subname = "HistoryInquire1"
continue
call BeginSub(subname)
stat = DC_NOERR
cause_c = ''
if (.not. associated(history % dimvars) .or. size(history % dimvars) < 1) then
stat = GT_EBADHISTORY
goto 999
end if
if (present(file)) then
call Inquire(history % dimvars(1), url=url)
call UrlSplit(fullname=url, file=file)
end if
if (present(title)) then
call Get_Attr(history % dimvars(1), '+title', title, trim(unknown_mes))
end if
if (present(source)) then
call Get_Attr(history % dimvars(1), '+source', source, trim(unknown_mes))
end if
if (present(institution)) then
call Get_Attr(history % dimvars(1), '+institution', institution, trim(unknown_mes))
end if
if (present(origin)) then
origin = EvalByUnit( history % origin, '', history % unlimited_units_symbol )
end if
if (present(interval)) then
interval = EvalByUnit( history % interval, '', history % unlimited_units_symbol )
end if
if (present(newest)) then
newest = EvalByUnit( history % newest, '', history % unlimited_units_symbol )
end if
if (present(oldest)) then
oldest = EvalByUnit( history % oldest, '', history % unlimited_units_symbol )
end if
if (present(conventions)) then
call Get_Attr(history % dimvars(1), '+Conventions', conventions, trim(unknown_mes))
end if
if (present(gt_version)) then
call Get_Attr(history % dimvars(1), '+gt_version', gt_version, trim(unknown_mes))
end if
if (present(dims)) then
numdims = size(history % dimvars)
allocate(dims(numdims))
do i = 1, numdims
call Inquire(history % dimvars(i), name=dims(i))
end do
end if
if (present(dimsizes)) then
numdims = size(history % dimvars)
allocate(dimsizes(numdims))
do i = 1, numdims
call Inquire(history % dimvars(i), size=dimsizes(i), growable=growable)
if (growable) dimsizes(i) = 0
end do
end if
if (present(longnames)) then
numdims = size(history % dimvars)
allocate(longnames(numdims))
do i = 1, numdims
call Get_attr(history % dimvars(i), 'long_name', longnames(i), 'unknown')
end do
end if
if (present(units)) then
numdims = size(history % dimvars)
allocate(units(numdims))
do i = 1, numdims
call Get_attr(history % dimvars(i), 'units', units(i), 'unknown')
end do
end if
if (present(xtypes)) then
numdims = size(history % dimvars)
allocate(xtypes(numdims))
do i = 1, numdims
call Inquire(history % dimvars(i), xtype=xtypes(i))
end do
end if
if (present(axes)) then
numvars = size(history % dimvars)
allocate(axes(numvars))
do i = 1, numvars
call Inquire(history % dimvars(i), allcount=axes(i) % length, xtype=axes(i) % xtype, name=axes(i) % name)
call Get_Attr(history % dimvars(i), 'long_name', axes(i) % longname, 'unknown')
call Get_Attr(history % dimvars(i), 'units', axes(i) % units, 'unknown')
! 属性 GT_HISTORY_ATTR はまだ取得できない
!
! するためには, 属性名に対して様々な型が存在しうると
! 考えられるため, get_attr (gtdata_generic および an_generic)
! に err 属性を装備させ, 取得できない際にエラーを
! 返してもらわなければならないだろう.
end do
end if
if (present(varinfo)) then
if (.not. associated(history % vars) .or. size(history % vars) < 1) then
stat = NF_ENOTVAR
goto 999
end if
numvars = size(history % vars)
allocate(varinfo(numvars))
do i = 1, numvars
call Inquire(history % vars(i), alldims=alldims, xtype=varinfo(i) % xtype, name=varinfo(i) % name)
call Get_Attr(history % vars(i), 'long_name', varinfo(i) % longname, 'unknown')
call Get_Attr(history % vars(i), 'units', varinfo(i) % units, 'unknown')
! 属性 GT_HISTORY_ATTR はまだ取得できない
!
! するためには, 属性名に対して様々な型が存在しうると
! 考えられるため, get_attr (gtdata_generic および an_generic)
! に err 属性を装備させ, 取得できない際にエラーを
! 返してもらわなければならないだろう.
allocate(varinfo(i) % dims(alldims))
do j = 1, alldims
call Open(var=dimvar, source_var=history % vars(i), dimord=j, count_compact=.true.)
call Inquire(dimvar, name=varinfo(i) % dims(j))
call Close(dimvar)
end do
varinfo(i) % initialized = .true.
end do
end if
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname)
end subroutine HistoryInquire1
| Subroutine : | |||
| history : | character(*), intent(in) | ||
| err : | logical, intent(out), optional | ||
| file : | character(*), intent(out), optional | ||
| title : | character(*), intent(out), optional | ||
| source : | character(*), intent(out), optional | ||
| dims(:) : | character(*), pointer, optional
| ||
| dimsizes(:) : | integer,pointer, optional
| ||
| longnames(:) : | character(*), pointer, optional
| ||
| units(:) : | character(*), pointer, optional
| ||
| xtypes(:) : | character(*), pointer, optional
| ||
| institution : | character(*), intent(out), optional | ||
| origin : | real,intent(out), optional | ||
| interval : | real,intent(out), optional | ||
| newest : | real,intent(out), optional | ||
| oldest : | real,intent(out), optional | ||
| conventions : | character(*), intent(out), optional | ||
| gt_version : | character(*), intent(out), optional | ||
| axes(:) : | type(GT_HISTORY_AXIS),
pointer, optional
| ||
| varinfo(:) : | type(GT_HISTORY_VARINFO),
pointer, optional
|
HistoryCreate で history を指定しなかった場合はこちらの サブルーチンで問い合わせを行います。 history には必ず "default" という文字列を与えてください。
HistoryInquire は 2 つのサブルーチンの総称名です。 各引数の情報に関しては下記のサブルーチンを参照してください。
subroutine HistoryInquire2(history, err, file, title, source, dims, dimsizes, longnames, units, xtypes, institution, origin, interval, newest, oldest, conventions, gt_version, axes, varinfo )
!
!== GT_HISTORY 型変数への問い合わせ
!
! HistoryCreate で *history* を指定しなかった場合はこちらの
! サブルーチンで問い合わせを行います。
! *history* には必ず "<tt>default</tt>" という文字列を与えてください。
!
! *HistoryInquire* は 2 つのサブルーチンの総称名です。
! 各引数の情報に関しては下記のサブルーチンを参照してください。
!
!
!
use dc_error, only: StoreError, DC_NOERR, NF_EINVAL
implicit none
character(*), intent(in):: history
logical, intent(out), optional :: err
character(*), intent(out), optional:: file, title, source, institution
real,intent(out), optional:: origin, interval, newest, oldest
character(*), intent(out), optional:: conventions, gt_version
character(*), pointer, optional:: dims(:) ! (out)
integer,pointer, optional:: dimsizes(:) ! (out)
character(*), pointer, optional:: longnames(:) ! (out)
character(*), pointer, optional:: units(:) ! (out)
character(*), pointer, optional:: xtypes(:) ! (out)
type(GT_HISTORY_AXIS), pointer, optional :: axes(:) ! (out)
type(GT_HISTORY_VARINFO), pointer, optional :: varinfo(:) ! (out)
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = "HistoryInquire2"
continue
call BeginSub(subname, "history=%c", c1=trim(history))
stat = DC_NOERR
cause_c = ''
if (trim(history) /= 'default') then
stat = NF_EINVAL
cause_c = 'history="' // trim(history) // '"'
goto 999
end if
call HistoryInquire1(default, err, file, title, source, dims, dimsizes, longnames, units, xtypes, institution, origin, interval, newest, oldest, conventions, gt_version, axes, varinfo )
999 continue
call StoreError(stat, subname, cause_c=cause_c)
call EndSub(subname)
end subroutine HistoryInquire2
| Subroutine : | |||
| varname : | character(*), intent(in)
| ||
| array(:) : | real(DP), intent(in)
| ||
| history : | type(GT_HISTORY),
intent(inout), optional, target
| ||
| err : | logical, intent(out), optional
|
MPI 使用時に, 各々のノード上のデータを単一ファイルに 集約して出力する場合には, このサブルーチンに領域全体の座標データを与えてください. また, HistoryCreate のオプショナル論理型引数 flag_mpi_gather に .true. を与えてください.
HistoryPut よりも後に使用してください HistoryAddVariable, HistoryAddAttr よりも前に使用してください.
When MPI is used, if data on each node is integrated and output to one file, give data of axes in whole area to this subroutine. And give .true. to optional logical argument flag_mpi_gather in "HistoryCreate".
Use this subroutine after "HistoryPut", and before "HistoryAddVariable", "HistoryAddAttr".
subroutine HistoryPutAxisMPIDouble( varname, array, history, err )
!
! MPI 使用時に, 各々のノード上のデータを単一ファイルに
! 集約して出力する場合には,
! このサブルーチンに領域全体の座標データを与えてください.
! また, HistoryCreate のオプショナル論理型引数 *flag_mpi_gather*
! に .true. を与えてください.
!
! HistoryPut よりも後に使用してください
! HistoryAddVariable, HistoryAddAttr よりも前に使用してください.
!
! When MPI is used, if data on each node is integrated and
! output to one file, give data of axes in whole area to
! this subroutine.
! And give .true. to optional logical argument *flag_mpi_gather*
! in "HistoryCreate".
!
! Use this subroutine after "HistoryPut", and
! before "HistoryAddVariable", "HistoryAddAttr".
!
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT, GT_EBADDIMNAME
use dc_url, only: UrlMerge
use gtdata_generic, only: Create, Put_Attr, Put
use dc_date, only: EvalByUnit
use dc_string, only: toChar, LChar, StrHead
use dc_message, only: MessageNotify
implicit none
character(*), intent(in):: varname
! 座標変数の名称.
!
! ここで指定するものは, HistoryCreate の
! 引数 *dims* で既に指定されてい
! なければなりません.
!
! Name of dimensional variable.
!
! This name must be specified by
! an argument *dims* in "HistoryCreate".
!
real(DP), intent(in):: array(:)
! 座標データ.
!
! Data of axes.
type(GT_HISTORY), intent(inout), optional, target:: history
! 出力ファイルの設定に関する情報を
! 格納した GT_HISTORY 型変数
!
! ここに指定するものは,
! HistoryCreate によって初期設定
! されていなければなりません.
!
! A "GT_HISTORY" type variable that
! stores information about configuration of
! an output file
!
! This must be initialized by
! "HistoryCreate".
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
#ifdef LIB_MPI
type(GT_HISTORY), pointer:: hst =>null()
integer:: dimord, dimsize, numdims, i, j, attr_size
type(GT_HISTORY_ATTR), pointer:: attrs(:) =>null()
type(GT_VARIABLE):: dimvar
character(STRING):: dimname
character(STRING):: name, longname, units, xtype, origin_str, url
real(DP):: origin_work
#endif
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = "HistoryPutAxisMPIDouble"
continue
call BeginSub(subname, 'varname=%c', c1 = trim(varname) )
stat = DC_NOERR
cause_c = ""
#ifndef LIB_MPI
call DbgMessage('This library is not built with MPI library')
goto 999
#else
if (present(history)) then
hst => history
else
hst => default
endif
if ( .not. hst % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY'
goto 999
end if
call DbgMessage( 'mpi_gather=<%b>', l = (/ hst % mpi_gather /) )
if ( .not. hst % mpi_gather ) then
goto 999
else
numdims = size( hst % dimvars )
dimord = -1
do i = 1, numdims
call HistoryAxisInquire( hst % mpi_fileinfo % axes(i), name = dimname ) ! (out)
if ( trim(varname) == trim(dimname) ) then
dimord = i
exit
end if
end do
if ( dimord < 1 ) then
stat = GT_EBADDIMNAME
cause_c = varname
goto 999
end if
dimsize = size( array )
if ( associated( hst % mpi_dimdata_all( dimord ) % a_Axis ) ) then
deallocate( hst % mpi_dimdata_all( dimord ) % a_Axis )
end if
allocate( hst % mpi_dimdata_all( dimord ) % a_Axis(dimsize) )
hst % mpi_dimdata_all( dimord ) % a_Axis = array
hst % mpi_dimdata_all( dimord ) % length = dimsize
end if
! 全ての (時刻以外の) 座標データが登録されたらファイル出力
! Output file if data of all axes (excluding time) are registered
!
numdims = size( hst % dimvars )
do i = 1, numdims
if ( hst % unlimited_index == i ) cycle
if ( hst % time_nv_index == i ) cycle
if ( hst % mpi_dimdata_all( i ) % length < 1 ) goto 999
end do
if ( hst % mpi_myrank /= 0 ) goto 2000
if ( hst % mpi_fileinfo % already_output ) goto 999
do i = 1, numdims
call HistoryAxisInquire( hst % mpi_fileinfo % axes(i), name, dimsize, longname, units, xtype ) ! (out)
url = UrlMerge(file = hst % mpi_fileinfo % file, var = name)
! 座標の長さを, このサブルーチンで取得したものに修正
! Length of axes is modified to one that is gotten by this subroutine
!
if ( hst % unlimited_index /= i ) then
dimsize = hst % mpi_dimdata_all( i ) % length
end if
! ファイル作成
! Create file
!
call Create( hst % dimvars(i), trim(url), dimsize, xtype = xtype, overwrite = hst % mpi_fileinfo % overwrite )
! 属性の付加
! Add attributes
!
call Put_Attr(hst % dimvars(i), '+Conventions', trim(hst % mpi_fileinfo % conventions ))
if ( hst % mpi_fileinfo % gtver_add ) then
call Put_Attr(hst % dimvars(i), '+gt_version', trim(hst % mpi_fileinfo % gt_version ))
endif
! title, source, institution, history, long_name, units 属性の付加
call Put_Attr(hst % dimvars(i), '+title', hst % mpi_fileinfo % title)
call Put_Attr(hst % dimvars(i), '+source', hst % mpi_fileinfo % source)
call Put_Attr(hst % dimvars(i), '+institution', trim(hst % mpi_fileinfo % institution))
call Put_Attr(hst % dimvars(i), '+history', trim(hst % mpi_fileinfo % nc_history))
call Put_Attr(hst % dimvars(i), 'long_name', longname)
call Put_Attr(hst % dimvars(i), 'units', units)
origin_work = EvalByUnit( hst % origin, '', hst % unlimited_units_symbol )
origin_str = trim( toChar( origin_work ) ) // ' [' // trim( hst % unlimited_units ) // ']'
! 座標データの出力
! Output data of axes
!
if ( hst % unlimited_index /= i ) then
call Put(hst % dimvars(i), hst % mpi_dimdata_all( i ) % a_Axis, dimsize )
hst % dim_value_written(i) = .true.
end if
! 座標の属性の付加
! Add attributes of axes
!
attrs => hst % mpi_dimdata_all(i) % attrs
if ( associated( attrs ) ) then
attr_size = size( attrs )
do j = 1, attr_size
if ( StrHead( 'char', trim(LChar(attrs(j)%attrtype))) ) then
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, trim( attrs(j) % Charvalue ) )
elseif ( StrHead( 'int', trim(LChar(attrs(j)%attrtype))) ) then
if ( attrs(j)%array ) then
call DbgMessage('Intarray(:) is selected.')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Intarray )
else
call DbgMessage('Intvalue is selected')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, (/attrs(j) % Intvalue/) )
endif
elseif ( StrHead( 'real', trim(LChar(attrs(j)%attrtype))) ) then
if ( attrs(j)%array ) then
call DbgMessage('Realarray(:) is selected.')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Realarray )
else
call DbgMessage('Realvalue is selected')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, (/attrs(j) % Realvalue/) )
endif
elseif ( StrHead( 'double', trim(LChar(attrs(j)%attrtype))) ) then
if ( attrs(j)%array ) then
call DbgMessage('Doublearray(:) is selected.')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Doublearray )
else
call DbgMessage('Doublevalue is selected')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, (/attrs(j) % Doublevalue/) )
endif
elseif ( StrHead( 'logical', trim(LChar(attrs(j)%attrtype))) ) then
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Logicalvalue )
else
call DbgMessage('attrtype=<%c>=<%c>is Invalid.' , c1=trim(attrs(j)%attrtype) , c2=trim(LChar(attrs(j)%attrtype)) )
endif
end do
! call HistoryAttrAdd( name, hst % mpi_dimdata_all(i) % attrs, hst )
end if
end do
if ( .not. hst % mpi_fileinfo % quiet ) then
call MessageNotify('M', subname, '"%c" is created (origin=%c)', c1 = trim( hst % mpi_fileinfo % file ), c2 = trim( origin_str ) )
end if
2000 continue
hst % mpi_fileinfo % already_output = .true.
#endif
! 終了処理, 例外処理
! Termination and Exception handling
!
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryPutAxisMPIDouble
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| err : | logical, intent(out), optional |
MPI 使用時に, 各々のノード上のデータを単一ファイルに 集約して出力する場合には, このサブルーチンに領域全体の座標データを与えてください. また, HistoryCreate のオプショナル論理型引数 flag_mpi_gather に .true. を与えてください.
HistoryPut よりも後に使用してください HistoryAddVariable, HistoryAddAttr よりも前に使用してください.
When MPI is used, if data on each node is integrated and output to one file, give data of axes in whole area to this subroutine. And give .true. to optional logical argument flag_mpi_gather in "HistoryCreate".
Use this subroutine after "HistoryPut", and before "HistoryAddVariable", "HistoryAddAttr".
subroutine HistoryPutAxisMPIInt( varname, array, history, err )
!
! MPI 使用時に, 各々のノード上のデータを単一ファイルに
! 集約して出力する場合には,
! このサブルーチンに領域全体の座標データを与えてください.
! また, HistoryCreate のオプショナル論理型引数 *flag_mpi_gather*
! に .true. を与えてください.
!
! HistoryPut よりも後に使用してください
! HistoryAddVariable, HistoryAddAttr よりも前に使用してください.
!
! When MPI is used, if data on each node is integrated and
! output to one file, give data of axes in whole area to
! this subroutine.
! And give .true. to optional logical argument *flag_mpi_gather*
! in "HistoryCreate".
!
! Use this subroutine after "HistoryPut", and
! before "HistoryAddVariable", "HistoryAddAttr".
!
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT, GT_EBADDIMNAME
use dc_url, only: UrlMerge
use gtdata_generic, only: Create, Put_Attr, Put
use dc_date, only: EvalByUnit
use dc_string, only: toChar, LChar, StrHead
use dc_message, only: MessageNotify
implicit none
character(*), intent(in):: varname
integer, intent(in):: array(:)
type(GT_HISTORY), intent(inout), optional, target:: history
logical, intent(out), optional:: err
#ifdef LIB_MPI
type(GT_HISTORY), pointer:: hst =>null()
integer:: dimord, dimsize, numdims, i, j, attr_size
type(GT_HISTORY_ATTR), pointer:: attrs(:) =>null()
type(GT_VARIABLE):: dimvar
character(STRING):: dimname
character(STRING):: name, longname, units, xtype, origin_str, url
real(DP):: origin_work
#endif
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = "HistoryPutAxisMPIInt"
continue
call BeginSub(subname, 'varname=%c', c1 = trim(varname) )
stat = DC_NOERR
cause_c = ""
#ifndef LIB_MPI
call DbgMessage('This library is not built with MPI library')
goto 999
#else
if (present(history)) then
hst => history
else
hst => default
endif
if ( .not. hst % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY'
goto 999
end if
call DbgMessage( 'mpi_gather=<%b>', l = (/ hst % mpi_gather /) )
if ( .not. hst % mpi_gather ) then
goto 999
else
numdims = size( hst % dimvars )
dimord = -1
do i = 1, numdims
call HistoryAxisInquire( hst % mpi_fileinfo % axes(i), name = dimname ) ! (out)
if ( trim(varname) == trim(dimname) ) then
dimord = i
exit
end if
end do
if ( dimord < 1 ) then
stat = GT_EBADDIMNAME
cause_c = varname
goto 999
end if
dimsize = size( array )
if ( associated( hst % mpi_dimdata_all( dimord ) % a_Axis ) ) then
deallocate( hst % mpi_dimdata_all( dimord ) % a_Axis )
end if
allocate( hst % mpi_dimdata_all( dimord ) % a_Axis(dimsize) )
hst % mpi_dimdata_all( dimord ) % a_Axis = array
hst % mpi_dimdata_all( dimord ) % length = dimsize
end if
! 全ての (時刻以外の) 座標データが登録されたらファイル出力
! Output file if data of all axes (excluding time) are registered
!
numdims = size( hst % dimvars )
do i = 1, numdims
if ( hst % unlimited_index == i ) cycle
if ( hst % time_nv_index == i ) cycle
if ( hst % mpi_dimdata_all( i ) % length < 1 ) goto 999
end do
if ( hst % mpi_myrank /= 0 ) goto 2000
if ( hst % mpi_fileinfo % already_output ) goto 999
do i = 1, numdims
call HistoryAxisInquire( hst % mpi_fileinfo % axes(i), name, dimsize, longname, units, xtype ) ! (out)
url = UrlMerge(file = hst % mpi_fileinfo % file, var = name)
! 座標の長さを, このサブルーチンで取得したものに修正
! Length of axes is modified to one that is gotten by this subroutine
!
if ( hst % unlimited_index /= i ) then
dimsize = hst % mpi_dimdata_all( i ) % length
end if
! ファイル作成
! Create file
!
call Create( hst % dimvars(i), trim(url), dimsize, xtype = xtype, overwrite = hst % mpi_fileinfo % overwrite )
! 属性の付加
! Add attributes
!
call Put_Attr(hst % dimvars(i), '+Conventions', trim(hst % mpi_fileinfo % conventions ))
if ( hst % mpi_fileinfo % gtver_add ) then
call Put_Attr(hst % dimvars(i), '+gt_version', trim(hst % mpi_fileinfo % gt_version ))
endif
! title, source, institution, history, long_name, units 属性の付加
call Put_Attr(hst % dimvars(i), '+title', hst % mpi_fileinfo % title)
call Put_Attr(hst % dimvars(i), '+source', hst % mpi_fileinfo % source)
call Put_Attr(hst % dimvars(i), '+institution', trim(hst % mpi_fileinfo % institution))
call Put_Attr(hst % dimvars(i), '+history', trim(hst % mpi_fileinfo % nc_history))
call Put_Attr(hst % dimvars(i), 'long_name', longname)
call Put_Attr(hst % dimvars(i), 'units', units)
origin_work = EvalByUnit( hst % origin, '', hst % unlimited_units_symbol )
origin_str = trim( toChar( origin_work ) ) // ' [' // trim( hst % unlimited_units ) // ']'
! 座標データの出力
! Output data of axes
!
if ( hst % unlimited_index /= i ) then
call Put(hst % dimvars(i), hst % mpi_dimdata_all( i ) % a_Axis, dimsize )
hst % dim_value_written(i) = .true.
end if
! 座標の属性の付加
! Add attributes of axes
!
attrs => hst % mpi_dimdata_all(i) % attrs
if ( associated( attrs ) ) then
attr_size = size( attrs )
do j = 1, attr_size
if ( StrHead( 'char', trim(LChar(attrs(j)%attrtype))) ) then
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, trim( attrs(j) % Charvalue ) )
elseif ( StrHead( 'int', trim(LChar(attrs(j)%attrtype))) ) then
if ( attrs(j)%array ) then
call DbgMessage('Intarray(:) is selected.')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Intarray )
else
call DbgMessage('Intvalue is selected')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, (/attrs(j) % Intvalue/) )
endif
elseif ( StrHead( 'real', trim(LChar(attrs(j)%attrtype))) ) then
if ( attrs(j)%array ) then
call DbgMessage('Realarray(:) is selected.')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Realarray )
else
call DbgMessage('Realvalue is selected')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, (/attrs(j) % Realvalue/) )
endif
elseif ( StrHead( 'double', trim(LChar(attrs(j)%attrtype))) ) then
if ( attrs(j)%array ) then
call DbgMessage('Doublearray(:) is selected.')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Doublearray )
else
call DbgMessage('Doublevalue is selected')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, (/attrs(j) % Doublevalue/) )
endif
elseif ( StrHead( 'logical', trim(LChar(attrs(j)%attrtype))) ) then
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Logicalvalue )
else
call DbgMessage('attrtype=<%c>=<%c>is Invalid.' , c1=trim(attrs(j)%attrtype) , c2=trim(LChar(attrs(j)%attrtype)) )
endif
end do
! call HistoryAttrAdd( name, hst % mpi_dimdata_all(i) % attrs, hst )
end if
end do
if ( .not. hst % mpi_fileinfo % quiet ) then
call MessageNotify('M', subname, '"%c" is created (origin=%c)', c1 = trim( hst % mpi_fileinfo % file ), c2 = trim( origin_str ) )
end if
2000 continue
hst % mpi_fileinfo % already_output = .true.
#endif
! 終了処理, 例外処理
! Termination and Exception handling
!
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryPutAxisMPIInt
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| err : | logical, intent(out), optional |
MPI 使用時に, 各々のノード上のデータを単一ファイルに 集約して出力する場合には, このサブルーチンに領域全体の座標データを与えてください. また, HistoryCreate のオプショナル論理型引数 flag_mpi_gather に .true. を与えてください.
HistoryPut よりも後に使用してください HistoryAddVariable, HistoryAddAttr よりも前に使用してください.
When MPI is used, if data on each node is integrated and output to one file, give data of axes in whole area to this subroutine. And give .true. to optional logical argument flag_mpi_gather in "HistoryCreate".
Use this subroutine after "HistoryPut", and before "HistoryAddVariable", "HistoryAddAttr".
subroutine HistoryPutAxisMPIReal( varname, array, history, err )
!
! MPI 使用時に, 各々のノード上のデータを単一ファイルに
! 集約して出力する場合には,
! このサブルーチンに領域全体の座標データを与えてください.
! また, HistoryCreate のオプショナル論理型引数 *flag_mpi_gather*
! に .true. を与えてください.
!
! HistoryPut よりも後に使用してください
! HistoryAddVariable, HistoryAddAttr よりも前に使用してください.
!
! When MPI is used, if data on each node is integrated and
! output to one file, give data of axes in whole area to
! this subroutine.
! And give .true. to optional logical argument *flag_mpi_gather*
! in "HistoryCreate".
!
! Use this subroutine after "HistoryPut", and
! before "HistoryAddVariable", "HistoryAddAttr".
!
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT, GT_EBADDIMNAME
use dc_url, only: UrlMerge
use gtdata_generic, only: Create, Put_Attr, Put
use dc_date, only: EvalByUnit
use dc_string, only: toChar, LChar, StrHead
use dc_message, only: MessageNotify
implicit none
character(*), intent(in):: varname
real, intent(in):: array(:)
type(GT_HISTORY), intent(inout), optional, target:: history
logical, intent(out), optional:: err
#ifdef LIB_MPI
type(GT_HISTORY), pointer:: hst =>null()
integer:: dimord, dimsize, numdims, i, j, attr_size
type(GT_HISTORY_ATTR), pointer:: attrs(:) =>null()
type(GT_VARIABLE):: dimvar
character(STRING):: dimname
character(STRING):: name, longname, units, xtype, origin_str, url
real(DP):: origin_work
#endif
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = "HistoryPutAxisMPIReal"
continue
call BeginSub(subname, 'varname=%c', c1 = trim(varname) )
stat = DC_NOERR
cause_c = ""
#ifndef LIB_MPI
call DbgMessage('This library is not built with MPI library')
goto 999
#else
if (present(history)) then
hst => history
else
hst => default
endif
if ( .not. hst % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY'
goto 999
end if
call DbgMessage( 'mpi_gather=<%b>', l = (/ hst % mpi_gather /) )
if ( .not. hst % mpi_gather ) then
goto 999
else
numdims = size( hst % dimvars )
dimord = -1
do i = 1, numdims
call HistoryAxisInquire( hst % mpi_fileinfo % axes(i), name = dimname ) ! (out)
if ( trim(varname) == trim(dimname) ) then
dimord = i
exit
end if
end do
if ( dimord < 1 ) then
stat = GT_EBADDIMNAME
cause_c = varname
goto 999
end if
dimsize = size( array )
if ( associated( hst % mpi_dimdata_all( dimord ) % a_Axis ) ) then
deallocate( hst % mpi_dimdata_all( dimord ) % a_Axis )
end if
allocate( hst % mpi_dimdata_all( dimord ) % a_Axis(dimsize) )
hst % mpi_dimdata_all( dimord ) % a_Axis = array
hst % mpi_dimdata_all( dimord ) % length = dimsize
end if
! 全ての (時刻以外の) 座標データが登録されたらファイル出力
! Output file if data of all axes (excluding time) are registered
!
numdims = size( hst % dimvars )
do i = 1, numdims
if ( hst % unlimited_index == i ) cycle
if ( hst % time_nv_index == i ) cycle
if ( hst % mpi_dimdata_all( i ) % length < 1 ) goto 999
end do
if ( hst % mpi_myrank /= 0 ) goto 2000
if ( hst % mpi_fileinfo % already_output ) goto 999
do i = 1, numdims
call HistoryAxisInquire( hst % mpi_fileinfo % axes(i), name, dimsize, longname, units, xtype ) ! (out)
url = UrlMerge(file = hst % mpi_fileinfo % file, var = name)
! 座標の長さを, このサブルーチンで取得したものに修正
! Length of axes is modified to one that is gotten by this subroutine
!
if ( hst % unlimited_index /= i ) then
dimsize = hst % mpi_dimdata_all( i ) % length
end if
! ファイル作成
! Create file
!
call Create( hst % dimvars(i), trim(url), dimsize, xtype = xtype, overwrite = hst % mpi_fileinfo % overwrite )
! 属性の付加
! Add attributes
!
call Put_Attr(hst % dimvars(i), '+Conventions', trim(hst % mpi_fileinfo % conventions ))
if ( hst % mpi_fileinfo % gtver_add ) then
call Put_Attr(hst % dimvars(i), '+gt_version', trim(hst % mpi_fileinfo % gt_version ))
endif
! title, source, institution, history, long_name, units 属性の付加
call Put_Attr(hst % dimvars(i), '+title', hst % mpi_fileinfo % title)
call Put_Attr(hst % dimvars(i), '+source', hst % mpi_fileinfo % source)
call Put_Attr(hst % dimvars(i), '+institution', trim(hst % mpi_fileinfo % institution))
call Put_Attr(hst % dimvars(i), '+history', trim(hst % mpi_fileinfo % nc_history))
call Put_Attr(hst % dimvars(i), 'long_name', longname)
call Put_Attr(hst % dimvars(i), 'units', units)
origin_work = EvalByUnit( hst % origin, '', hst % unlimited_units_symbol )
origin_str = trim( toChar( origin_work ) ) // ' [' // trim( hst % unlimited_units ) // ']'
! 座標データの出力
! Output data of axes
!
if ( hst % unlimited_index /= i ) then
call Put(hst % dimvars(i), hst % mpi_dimdata_all( i ) % a_Axis, dimsize )
hst % dim_value_written(i) = .true.
end if
! 座標の属性の付加
! Add attributes of axes
!
attrs => hst % mpi_dimdata_all(i) % attrs
if ( associated( attrs ) ) then
attr_size = size( attrs )
do j = 1, attr_size
if ( StrHead( 'char', trim(LChar(attrs(j)%attrtype))) ) then
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, trim( attrs(j) % Charvalue ) )
elseif ( StrHead( 'int', trim(LChar(attrs(j)%attrtype))) ) then
if ( attrs(j)%array ) then
call DbgMessage('Intarray(:) is selected.')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Intarray )
else
call DbgMessage('Intvalue is selected')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, (/attrs(j) % Intvalue/) )
endif
elseif ( StrHead( 'real', trim(LChar(attrs(j)%attrtype))) ) then
if ( attrs(j)%array ) then
call DbgMessage('Realarray(:) is selected.')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Realarray )
else
call DbgMessage('Realvalue is selected')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, (/attrs(j) % Realvalue/) )
endif
elseif ( StrHead( 'double', trim(LChar(attrs(j)%attrtype))) ) then
if ( attrs(j)%array ) then
call DbgMessage('Doublearray(:) is selected.')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Doublearray )
else
call DbgMessage('Doublevalue is selected')
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, (/attrs(j) % Doublevalue/) )
endif
elseif ( StrHead( 'logical', trim(LChar(attrs(j)%attrtype))) ) then
call Put_Attr(hst % dimvars(i), attrs(j) % attrname, attrs(j) % Logicalvalue )
else
call DbgMessage('attrtype=<%c>=<%c>is Invalid.' , c1=trim(attrs(j)%attrtype) , c2=trim(LChar(attrs(j)%attrtype)) )
endif
end do
! call HistoryAttrAdd( name, hst % mpi_dimdata_all(i) % attrs, hst )
end if
end do
if ( .not. hst % mpi_fileinfo % quiet ) then
call MessageNotify('M', subname, '"%c" is created (origin=%c)', c1 = trim( hst % mpi_fileinfo % file ), c2 = trim( origin_str ) )
end if
2000 continue
hst % mpi_fileinfo % already_output = .true.
#endif
! 終了処理, 例外処理
! Termination and Exception handling
!
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryPutAxisMPIReal
| Subroutine : | |
| varname : | character(*), intent(in) |
| value : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutDouble0( varname, value, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real(DP), intent(in):: value
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutDouble0"
continue
call BeginSub(subname)
call HistoryPutEx( varname, (/value/), 1, history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |||
| varname : | character(*), intent(in)
| ||
| array(:) : | real(DP), intent(in)
| ||
| history : | type(GT_HISTORY),
intent(inout), optional, target
| ||
| range : | character(*), intent(in), optional
| ||
| time : | real, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| difftime : | type(DC_DIFFTIME), intent(in), optional
| ||
| time_average_store : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
gtool4 データ内の変数へデータの出力を行います。 このサブルーチンを用いる前に、HistoryCreate による初期設定が必要です。
HistoryPut は複数のサブルーチンの総称名です。array には 0 〜 7 次元のデータを与えることが可能です。 (下記のサブルーチンを参照ください)。 ただし、0 次元のデータを与える際の引数キーワードは value を用いてください。
HistoryPut を最初に呼んだ時、時間次元の変数は HistoryCreate の origin の値に設定されます。
ある変数 varname に対して HistoryPut を複数回呼ぶと、 HistoryCreate の interval × HistoryPut を呼んだ回数、 の分だけ 時間次元の変数の値が増やされます。
これらの時間次元の変数の値を明示的に設定したい場合は HistorySetTime を用いるか、HistoryPut 自身で時間次元の変数へ値 を出力してください。
subroutine HistoryPutDouble1( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
!== データ出力
!
! gtool4 データ内の変数へデータの出力を行います。
! このサブルーチンを用いる前に、HistoryCreate
! による初期設定が必要です。
!
! *HistoryPut* は複数のサブルーチンの総称名です。*array* には
! 0 〜 7 次元のデータを与えることが可能です。
! (下記のサブルーチンを参照ください)。
! ただし、0 次元のデータを与える際の引数キーワードは
! *value* を用いてください。
!
! HistoryPut を最初に呼んだ時、時間次元の変数は HistoryCreate の
! origin の値に設定されます。
!
! ある変数 varname に対して HistoryPut を複数回呼ぶと、
! HistoryCreate の interval × HistoryPut を呼んだ回数、 の分だけ
! 時間次元の変数の値が増やされます。
!
! これらの時間次元の変数の値を明示的に設定したい場合は
! HistorySetTime を用いるか、HistoryPut 自身で時間次元の変数へ値
! を出力してください。
!
!
character(*), intent(in):: varname
! 変数の名前
!
! ただし、ここで指定するもの
! は、 HistoryCreateの *dims*
! または HistoryAddVariable や
! HistoryCopyVariable の
! *varname* で既に指定されてい
! なければなりません。
!
real(DP), intent(in):: array(:)
! 変数が出力するデータ
!
! 型は単精度実数型でも
! 倍精度実数型でもよいですが、
! HistoryAddVariable の
! *xtype* で指定した
! データ型と異なる
! 型を渡した場合、xtype で
! 指定した型に変換されます。
!
type(GT_HISTORY), intent(inout), optional, target:: history
! 出力ファイルの設定に関する情報を
! 格納した構造体
!
! ここに指定するものは、
! HistoryCreate によって初期設定
! されていなければなりません。
!
character(*), intent(in), optional:: range
! gtool4 のコンマ記法による
! データの出力範囲指定
!
! このオプションを用いる
! 際には、必ず *HistorySetTime*
! によって明示的に時刻の設定
! を行ってください。
! また、*HistoryGet* と異なり、
! 時刻に関する範囲指定は
! 行なえません。
!
! 書式に関する詳細は
! {gtool4 netCDF 規約}[link:../xref.htm#label-6]
! の「5.4 コンマ記法」を参照して
! ください。
real, intent(in), optional:: time
!
! 時刻.
!
! この引数を与える場合,
! 出力するかどうかをプログラムが
! 自動的に判断します.
! *time* に与えられた数値が
! HistoryCreate に与えた *interval*
! で割り切れる場合には出力が行われます.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えた場合には,
! *time*, *difftime*
! のどちらの引数も与えない場合に,
! プログラムはエラーを発生させます.
!
! この引数と *difftime*, *time_average_store*
! が同時に与えられた場合,
! *time_average_store* が優先されます.
!
! また, この引数と *range* は併用できません.
! 併用した場合には,
! プログラムはエラーを発生させます.
!
logical, intent(in), optional:: quiet
! .true. を与えた場合,
! メッセージ出力が抑制されます.
!
! If ".true." is given,
! messages are suppressed.
!
type(DC_DIFFTIME), intent(in), optional:: difftime
!
! 時刻 (dc_date_types#DC_DIFFTIME 型)
!
! この引数を与える場合,
! 出力するかどうかをプログラムが
! 自動的に判断します.
! *difftime* に与えられた時刻が
! HistoryCreate に与えた *interval*
! で割り切れる場合には出力が行われます.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えた場合には,
! *time*, *difftime*
! のどちらの引数も与えない場合に,
! プログラムはエラーを発生させます.
!
! この引数と *time* が与えられた場合,
! *difftime* が優先されます.
!
! この引数と *range* は併用できません.
! 併用した場合には,
! プログラムはエラーを発生させます.
!
logical, intent(in), optional:: time_average_store
!
! 平均値の出力フラグ.
! この値に .true. を与えた場合には,
! 出力せずに与えられた値を一旦蓄えます.
! .false. を与えた場合には,
! *time* もしくは *difftime* と
! HistoryCreate に与えた *interval* に
! 関わらず出力を行います.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えない場合は無効です.
!
! *time* と *difftime*
! のどちらかを同時に与える必要があります.
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
character(*), parameter:: subname = "HistoryPutDouble1"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutDouble2( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real(DP), intent(in):: array(:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutDouble2"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutDouble3( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real(DP), intent(in):: array(:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutDouble3"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutDouble4( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real(DP), intent(in):: array(:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutDouble4"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutDouble5( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real(DP), intent(in):: array(:,:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutDouble5"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutDouble6( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real(DP), intent(in):: array(:,:,:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutDouble6"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real(DP), intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutDouble7( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real(DP), intent(in):: array(:,:,:,:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutDouble7"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | recursive | ||
| varname : | character(*), intent(in) | ||
| array(arraysize) : | real(DP), intent(in) | ||
| arraysize : | integer, intent(in) | ||
| history : | type(GT_HISTORY), intent(inout), target, optional | ||
| range : | character(*), intent(in), optional
| ||
| time : | real, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| difftime : | type(DC_DIFFTIME), intent(in), optional
| ||
| time_average_store : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
こちらは配列サイズを指定する必要があるため、 HistoryPut を利用してください。
recursive subroutine HistoryPutDoubleEx( varname, array, arraysize, history, range, time, quiet, difftime, time_average_store, err )
!
!== データ出力
!
! こちらは配列サイズを指定する必要があるため、
! HistoryPut を利用してください。
!
use gtdata_generic, only: Put, GTVarSync, Slice, Inquire, Get_Slice, Get, PutLine, Open, Close
use dc_string, only: StoA, Printf, toChar, JoinChar
use dc_present, only: present_and_not_empty, present_select, present_and_false, present_and_true
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT, DC_EARGLACK, USR_ERRNO, GT_EARGSIZEMISMATCH
use dc_message, only: MessageNotify
use dc_url, only: UrlSplit, UrlMerge
use dc_date_types, only: DC_DIFFTIME
use dc_date, only: operator(==), DCDiffTimeCreate, mod, operator(-), EvalByUnit, operator(/), toChar
character(*), intent(in):: varname
integer, intent(in):: arraysize
real(DP), intent(in):: array(arraysize)
type(GT_HISTORY), intent(inout), target, optional:: history
character(*), intent(in), optional:: range
! gtool4 のコンマ記法による
! データの出力範囲指定
!
! このオプションを用いる
! 際には、必ず *HistorySetTime*
! によって明示的に時刻の設定
! を行ってください。
! また、*HistoryGet* と異なり、
! 時刻に関する範囲指定は
! 行なえません。
!
! 書式に関する詳細は
! {gtool4 netCDF 規約}[link:../xref.htm#label-6]
! の「5.4 コンマ記法」を参照して
! ください。
real, intent(in), optional:: time
!
! 時刻.
!
! この引数を与える場合,
! 出力するかどうかをプログラムが
! 自動的に判断します.
! *time* に与えられた数値が
! HistoryCreate に与えた *interval*
! で割り切れる場合には出力が行われます.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えた場合には,
! *time*, *difftime*
! のどちらの引数も与えない場合に,
! プログラムはエラーを発生させます.
!
! また, この引数と *range* は併用できません.
! 併用した場合には,
! プログラムはエラーを発生させます.
!
logical, intent(in), optional:: quiet
! .false. を与えた場合,
! このサブルーチンが呼ばれる毎に
! ファイル名と時刻が表示されます.
! デフォルトは .true. です.
!
! If ".false." is given,
! a filename and time is displayed
! when this subroutine is called.
! Default value is ".true.".
!
type(DC_DIFFTIME), intent(in), optional:: difftime
!
! 時刻 (dc_date_types#DC_DIFFTIME 型)
!
! この引数を与える場合,
! 出力するかどうかをプログラムが
! 自動的に判断します.
! *difftime* に与えられた時刻が
! HistoryCreate に与えた *interval*
! で割り切れる場合には出力が行われます.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えた場合には,
! *time*, *difftime*
! のどちらの引数も与えない場合に,
! プログラムはエラーを発生させます.
!
! この引数と *time* が与えられた場合,
! *difftime* が優先されます.
!
! この引数と *range* は併用できません.
! 併用した場合には,
! プログラムはエラーを発生させます.
!
logical, intent(in), optional:: time_average_store
!
! 平均値の出力フラグ.
! この値に .true. を与えた場合には,
! 出力せずに与えられた値を一旦蓄えます.
! .false. を与えた場合には,
! *time* もしくは *difftime* と
! HistoryCreate に与えた *interval* に
! 関わらず出力を行います.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えない場合は無効です.
!
! *time* と *difftime*
! のどちらかを同時に与える必要があります.
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
real(DP), target:: array_work(arraysize)
real(DP), pointer:: array_work2(:) =>null()
integer, allocatable:: array_overwrap(:)
integer:: arraysize_work2, new_index
type(GT_VARIABLE):: var, timevar
character(STRING):: url, file, time_str
real:: time_value(1:1)
type(GT_HISTORY), pointer:: hst =>null()
integer, allocatable:: start(:), count(:), stride(:)
integer :: i, dims, v_ord
character(STRING):: avr_msg
logical :: slice_err
character(STRING):: time_name
character(*), parameter:: bnds_suffix = '_bnds'
type(GT_VARIABLE):: bndsvar
integer:: bnds_ord, time_count, bnds_rank
integer:: stat
logical:: output_step
type(DC_DIFFTIME):: difftimew
real(DP):: avr_coef
#ifdef LIB_MPI
type(GT_VARIABLE):: dimvar
integer:: numdims, dimord, dimsize, dimsize_max, allcount, ra
character(STRING):: dimname
integer:: err_mpi, st_mpi(MPI_STATUS_SIZE)
real(DP), allocatable:: array_mpi_tmp(:)
real(DP), allocatable:: array_mpi_all(:,:)
#endif
character(STRING):: cause_c
character(*), parameter:: subname = "HistoryPutDoubleEx"
continue
call BeginSub(subname, 'varname=%a range=%a', ca=StoA(varname, present_select('', '(no-range)', range)))
stat = DC_NOERR
cause_c = ""
if (present(history)) then
hst => history
else
hst => default
endif
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( .not. hst % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY'
goto 999
end if
!-----------------------------------------------------------------
! time と range の同時使用の禁止
! Permit concurrent use of "time" and "range"
!-----------------------------------------------------------------
if ( ( present(time) .or. present(difftime) ) .and. present_and_not_empty(range) ) then
call MessageNotify('W', subname, '(varname=%c) "range" and "time" or "difftime" are not suppored at the same time', c1 = trim(varname) )
stat = USR_ERRNO
cause_c = '"range" and "time" or "difftime" are not suppored at the same time'
goto 999
end if
!-----------------------------------------------------------------
! hst 内の varname 変数の変数番号を取得
! Get variable number of "varname" in "hst"
!-----------------------------------------------------------------
#ifndef LIB_MPI
v_ord = lookup_variable_ord(hst, varname)
#else
if ( .not. hst % mpi_gather ) then
v_ord = lookup_variable_ord(hst, varname)
else
if ( hst % mpi_myrank == 0 ) then
v_ord = lookup_variable_ord(hst, varname)
end if
call MPI_Bcast( v_ord, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
end if
#endif
!-----------------------------------------------------------------
! 時間平均値のためのデータ格納
! Store data for time average value
!-----------------------------------------------------------------
if ( v_ord > 0 ) then
if ( hst % var_avr_count( v_ord ) > -1 ) then
if ( .not. present(time) .and. .not. present(difftime) ) then
call MessageNotify('W', subname, '(varname=%c) arguments "time" or "difftime" are needed ' // 'when "time_average=.true." is specified to "HistoryAddVariable"', c1 = trim(varname) )
stat = DC_EARGLACK
cause_c = 'time'
goto 999
end if
if ( arraysize /= hst % var_avr_data( v_ord ) % length ) then
call MessageNotify('W', subname, '(varname=%c) size of array should be (%d). size of array is (%d)', i = (/hst % var_avr_data( v_ord ) % length, arraysize/), c1 = trim(varname) )
stat = GT_EARGSIZEMISMATCH
cause_c = 'array'
goto 999
end if
if ( .not. present(difftime) ) then
call DCDiffTimeCreate( difftimew, time, '', hst % unlimited_units_symbol ) ! (in)
else
difftimew = difftime
end if
if ( hst % var_avr_firstput( v_ord ) ) then
if ( hst % var_avr_count( v_ord ) == 0 ) then
avr_coef = 1.0_DP
hst % var_avr_prevtime( v_ord ) = difftimew
else
hst % var_avr_baseint( v_ord ) = difftimew - hst % var_avr_prevtime( v_ord )
avr_coef = 1.0_DP
hst % var_avr_prevtime( v_ord ) = difftimew
hst % var_avr_firstput( v_ord ) = .false.
end if
else
if ( hst % var_avr_count( v_ord ) == 0 ) then
hst % var_avr_baseint( v_ord ) = difftimew - hst % var_avr_prevtime( v_ord )
avr_coef = 1.0_DP
hst % var_avr_prevtime( v_ord ) = difftimew
else
avr_coef = ( difftimew - hst % var_avr_prevtime( v_ord ) ) / hst % var_avr_baseint( v_ord )
hst % var_avr_prevtime( v_ord ) = difftimew
end if
end if
hst % var_avr_data( v_ord ) % a_DataAvr = hst % var_avr_data( v_ord ) % a_DataAvr + array * avr_coef
hst % var_avr_count( v_ord ) = hst % var_avr_count( v_ord ) + 1
hst % var_avr_coefsum( v_ord ) = hst % var_avr_coefsum( v_ord ) + avr_coef
if ( present(difftime) ) then
hst % time_bnds(2:2) = EvalByUnit( difftime, '', hst % unlimited_units_symbol )
else
hst % time_bnds(2:2) = time
end if
end if
end if
!-----------------------------------------------------------------
! 初期時刻の設定
! Configure initial time
!-----------------------------------------------------------------
if ( .not. hst % origin_setting ) then
if ( present(difftime) ) then
hst % origin = difftime
hst % time_bnds = EvalByUnit( difftime, '', hst % unlimited_units_symbol )
hst % origin_setting = .true.
elseif ( present(time) ) then
call DCDiffTimeCreate( hst % origin, time, '', hst % unlimited_units_symbol ) ! (in)
hst % time_bnds = time
hst % origin_setting = .true.
end if
end if
!-----------------------------------------------------------------
! 時刻の自動チェック
! Check time automatically
!-----------------------------------------------------------------
output_step = .true.
if ( present_and_false(time_average_store) ) then
output_step = .true.
elseif ( present_and_true(time_average_store) ) then
output_step = .false.
elseif ( present(difftime) .or. present(time) ) then
output_step = .false.
if ( hst % interval == 0 ) then
output_step = .true.
else
if ( .not. present(difftime) ) then
call DCDiffTimeCreate( difftimew, time, '', hst % unlimited_units_symbol ) ! (in)
else
difftimew = difftime
end if
if ( mod( difftimew - hst % origin, hst % interval ) == 0 ) then
output_step = .true.
end if
end if
end if
!-------------------------
! 時間平均値出力のための情報処理
! Information processing for output time-averaged value
if ( .not. output_step ) then
goto 999
else
array_work = array
avr_msg = ''
if ( v_ord > 0 ) then
if ( hst % var_avr_count( v_ord ) > -1 ) then
avr_msg = '(time average of ' // trim( toChar(hst % var_avr_count( v_ord )) ) // ' step data)'
!-------------------
! 蓄えた値の時間平均化
! Average stored value in time direction
array_work = ( hst % var_avr_data( v_ord ) % a_DataAvr ) / ( hst % var_avr_coefsum( v_ord ) )
hst % var_avr_data( v_ord ) % a_DataAvr = 0.0
hst % var_avr_count( v_ord ) = 0
hst % var_avr_coefsum( v_ord ) = 0.0_DP
hst % var_avr_firstput( v_ord ) = .false.
end if
end if
end if
#ifndef LIB_MPI
array_work2 => array_work
arraysize_work2 = arraysize
#else
if ( .not. hst % mpi_gather ) then
array_work2 => array_work
arraysize_work2 = arraysize
else
!-----------------------------------------------------------------
! MPI 使用時に, 座標軸のデータが与えられた場合には, そのデータを保管.
! If data of axis is given, the data is stored when MPI is used
!-----------------------------------------------------------------
numdims = size( hst % mpi_fileinfo % axes )
if ( hst % mpi_myrank == 0 ) then
dimord = 0
do i = 1, numdims
call HistoryAxisInquire( hst % mpi_fileinfo % axes(i), name = dimname ) ! (out)
if ( trim(varname) == trim(dimname) ) then
dimord = i
exit
end if
end do
call MPI_Bcast( dimord, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
else
call MPI_Bcast( dimord, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
end if
if ( dimord > 0 ) then
call HistoryAxisInquire( hst % mpi_fileinfo % axes(dimord), size = dimsize_max ) ! (out)
dimsize = size( array )
if ( dimsize > dimsize_max .and. hst % unlimited_index /= dimord ) then
call MessageNotify('W', subname, 'dim=<%c> data size (%d) exceeds size of the dim (%d) by HistoryCreate. ' // 'the data will be trancated. ', i = (/ dimsize, dimsize_max /), c1 = trim(varname) )
dimsize = dimsize_max
end if
if ( associated( hst % mpi_dimdata_each( dimord ) % a_Axis ) ) then
deallocate( hst % mpi_dimdata_each( dimord ) % a_Axis )
end if
allocate( hst % mpi_dimdata_each( dimord ) % a_Axis(dimsize) )
hst % mpi_dimdata_each( dimord ) % a_Axis = array(1:dimsize)
hst % mpi_dimdata_each( dimord ) % length = dimsize
end if
!-----------------------------------------------------------------
! MPI 使用時に, 従属変数のデータが与えられた場合, データ集約の情報を整理.
! If data of dependent variables is given,
! information for integration is arranged when MPI is used
!-----------------------------------------------------------------
if ( v_ord > 0 ) then
if ( .not. associated( hst % mpi_gthr_info ) ) then
call gtmpi_axis_register( hst, err ) ! (inout)
end if
if ( present_and_true( err ) ) goto 999
if ( .not. associated( hst % mpi_vars_index( v_ord ) % allcount ) ) then
call gtmpi_vars_mkindex( hst, v_ord, err ) ! (inout)
end if
if ( present_and_true( err ) ) goto 999
end if
!-----------------------------------------------------------------
! MPI 使用時は, 各ノードのデータを rank == 0 へ集約する.
! Data on each node is integrated when MPI is used
!-----------------------------------------------------------------
if ( v_ord > 0 ) then
arraysize_work2 = hst % mpi_vars_index(v_ord) % allcount_all
if ( arraysize_work2 < 1 ) arraysize_work2 = 1
if ( hst % mpi_myrank == 0 ) then
do ra = 1, hst % mpi_nprocs - 1
allcount = hst % mpi_vars_index(v_ord) % allcount(ra)
call MPI_Send( allcount, 1, MPI_INTEGER, ra, 0, MPI_COMM_WORLD, err_mpi )
end do
else
call MPI_Recv( allcount, 1, MPI_INTEGER, 0, 0, MPI_COMM_WORLD, st_mpi, err_mpi )
end if
if ( hst % mpi_myrank /= 0 ) then
call MPI_Send( array_work, allcount, MPI_DOUBLE_PRECISION, 0, 0, MPI_COMM_WORLD, err_mpi )
else
allocate( array_mpi_all(0: hst % mpi_nprocs - 1, arraysize_work2 ) )
allocate( array_mpi_tmp( arraysize_work2 ) )
array_mpi_all(:,:) = 0.0_DP
array_mpi_tmp(:) = 0.0_DP
allcount = hst % mpi_vars_index(v_ord) % allcount(0)
array_mpi_all(0,1:allcount) = array_work
do ra = 1, hst % mpi_nprocs - 1
allcount = hst % mpi_vars_index(v_ord) % allcount(ra)
call MPI_Recv( array_mpi_tmp(1:allcount), allcount, MPI_DOUBLE_PRECISION, ra, 0, MPI_COMM_WORLD, st_mpi, err_mpi )
array_mpi_all(ra,1:allcount) = array_mpi_tmp(1:allcount)
end do
allocate( array_work2( arraysize_work2 ) )
allocate( array_overwrap( arraysize_work2 ) )
array_work2 = 0.0_DP
array_overwrap(:) = 0
do ra = 0, hst % mpi_nprocs - 1
do i = 1, hst % mpi_vars_index(v_ord) % allcount(ra)
new_index = hst % mpi_vars_index(v_ord) % each2all(ra, i)
array_work2( new_index ) = array_work2( new_index ) + array_mpi_all( ra, i )
array_overwrap( new_index ) = array_overwrap( new_index ) + 1
end do
end do
where ( array_overwrap == 0 )
array_overwrap = 1
end where
array_work2(:) = array_work2(:) / array_overwrap(:)
deallocate( array_mpi_all, array_mpi_tmp, array_overwrap )
! array_work2 はデータ出力の後に割り付け解除される.
end if
else
array_work2 => array_work
arraysize_work2 = arraysize
end if
end if
#endif
!-----------------------------------------------------------------
! 時刻を1つ進めて, データ出力
! Progress one time, and output data
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 .and. hst % mpi_fileinfo % already_output) ) then
#endif
call TimeGoAhead( varname = varname, head = real(array_work2(1)), var = var, history = history, err = err ) ! (out)
call Inquire( var, alldims=dims ) ! (out)
if (present_and_not_empty(range) .and. (dims < 1)) then
call DbgMessage('varname=<%c> has no dimension. so range is ignoread.', c1=trim(varname))
end if
if (.not. (present_and_not_empty(range) .and. (dims > 0))) then
! range 無しの普通の出力の場合
call Put(var, array_work2, arraysize_work2)
else
! range があり, 且つ varname がちゃんと次元を持っている場合
!
! 元々の start, count, stride を保持. データを与えた後に復元する.
allocate(start(dims), count(dims), stride(dims))
do i = 1, dims
call Get_Slice(var, i, start(i), count(i), stride(i))
end do
slice_err = .false. ! 不要だが Slice の引用仕様として必要なため
call Slice(var, range, slice_err)
call Put(var, array_work2, arraysize_work2)
! 復元
do i = 1, dims
call Slice(var, i, start(i), count(i), stride(i))
end do
deallocate(start, count, stride)
end if
call GTVarSync(var)
if ( hst % mpi_gather .and. v_ord > 0 ) then
deallocate( array_work2 )
end if
#ifdef LIB_MPI
end if
#endif
!-----------------------------------------------------------------
! "time_bnds" 変数への出力
! Output to "time_bnds" variable
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 .and. hst % mpi_fileinfo % already_output ) ) then
#endif
if ( v_ord > 0 ) then
if ( hst % var_avr_count( v_ord ) > -1 ) then
!-------------------
! 時間次元の名前とファイル名を取得
! Get name of time dimension, and filename
timevar = hst % dimvars( hst % unlimited_index )
call Inquire( var = timevar, url = url, name = time_name ) ! (out)
call UrlSplit( fullname = url, file = file ) ! (out)
!-------------------
! "time_bnds" 変数の取得
! Get "time_bnds" variable
call Open( var = bndsvar, url = UrlMerge(file=file, var=trim(time_name) // bnds_suffix) )
bnds_ord = lookup_variable_ord( hst, trim(time_name) // bnds_suffix)
!-------------------
! "time_bnds" 変数への出力
! Output to "time_bnds" variable
call Inquire( var = bndsvar, rank = bnds_rank ) ! (out)
time_count = 1
if ( bnds_rank > 1 ) then
call Inquire( var = bndsvar, dimord = hst % growable_indices(bnds_ord), allcount = time_count ) ! (out)
end if
if ( (hst % time_bnds_output_count < 1) .or. (hst % time_bnds_output_count < time_count) ) then
call Slice(bndsvar, hst % growable_indices(bnds_ord), start=hst % time_bnds_output_count+1, count=1) ! (in)
call Put(bndsvar, hst % time_bnds, 2)
hst % time_bnds_output_count = hst % time_bnds_output_count + 1
end if
call Close( var = bndsvar ) ! (inout)
if ( present(difftime) ) then
hst % time_bnds(1:1) = EvalByUnit( difftime, '', hst % unlimited_units_symbol )
else
hst % time_bnds(1:1) = time
end if
end if
end if
#ifdef LIB_MPI
end if
#endif
!-----------------------------------------------------------------
! メッセージ出力
! Output messages
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 .and. hst % mpi_fileinfo % already_output ) ) then
#endif
if ( present_and_false(quiet) ) then
call Inquire( hst % dimvars(1), url = url ) ! (out)
call UrlSplit( fullname = url, file = file ) ! (out)
if ( hst % unlimited_index < 1 ) then
time_str = ''
else
timevar = hst % dimvars(hst % unlimited_index)
call Slice( timevar, 1, start = hst % count(v_ord), count = 1 ) ! (in)
call Get( timevar, time_value, 1, err ) ! (out)
time_str = '(time=' // trim( toChar( time_value(1) )) // ')'
end if
call MessageNotify('M', 'HistoryPut', '"%a" => "%a" %a %a', ca = StoA( varname, file, time_str, avr_msg ) )
end if
#ifdef LIB_MPI
end if
#endif
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryPutDoubleEx
| Subroutine : | |
| varname : | character(*), intent(in) |
| value : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutInt0( varname, value, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
integer, intent(in):: value
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutInt0"
continue
call BeginSub(subname)
call HistoryPutEx( varname, (/value/), 1, history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutInt1( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
integer, intent(in):: array(:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutInt1"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutInt2( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
integer, intent(in):: array(:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutInt2"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutInt3( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
integer, intent(in):: array(:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutInt3"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutInt4( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
integer, intent(in):: array(:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutInt4"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutInt5( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
integer, intent(in):: array(:,:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutInt5"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutInt6( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
integer, intent(in):: array(:,:,:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutInt6"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | integer, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutInt7( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
integer, intent(in):: array(:,:,:,:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutInt7"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | recursive | ||
| varname : | character(*), intent(in) | ||
| array(arraysize) : | integer, intent(in) | ||
| arraysize : | integer, intent(in) | ||
| history : | type(GT_HISTORY), intent(inout), target, optional | ||
| range : | character(*), intent(in), optional
| ||
| time : | real, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| difftime : | type(DC_DIFFTIME), intent(in), optional
| ||
| time_average_store : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
こちらは配列サイズを指定する必要があるため、 HistoryPut を利用してください。
recursive subroutine HistoryPutIntEx( varname, array, arraysize, history, range, time, quiet, difftime, time_average_store, err )
!
!== データ出力
!
! こちらは配列サイズを指定する必要があるため、
! HistoryPut を利用してください。
!
use gtdata_generic, only: Put, GTVarSync, Slice, Inquire, Get_Slice, Get, PutLine, Open, Close
use dc_string, only: StoA, Printf, toChar, JoinChar
use dc_present, only: present_and_not_empty, present_select, present_and_false, present_and_true
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT, DC_EARGLACK, USR_ERRNO, GT_EARGSIZEMISMATCH
use dc_message, only: MessageNotify
use dc_url, only: UrlSplit, UrlMerge
use dc_date_types, only: DC_DIFFTIME
use dc_date, only: operator(==), DCDiffTimeCreate, mod, operator(-), EvalByUnit, operator(/), toChar
character(*), intent(in):: varname
integer, intent(in):: arraysize
integer, intent(in):: array(arraysize)
type(GT_HISTORY), intent(inout), target, optional:: history
character(*), intent(in), optional:: range
! gtool4 のコンマ記法による
! データの出力範囲指定
!
! このオプションを用いる
! 際には、必ず *HistorySetTime*
! によって明示的に時刻の設定
! を行ってください。
! また、*HistoryGet* と異なり、
! 時刻に関する範囲指定は
! 行なえません。
!
! 書式に関する詳細は
! {gtool4 netCDF 規約}[link:../xref.htm#label-6]
! の「5.4 コンマ記法」を参照して
! ください。
real, intent(in), optional:: time
!
! 時刻.
!
! この引数を与える場合,
! 出力するかどうかをプログラムが
! 自動的に判断します.
! *time* に与えられた数値が
! HistoryCreate に与えた *interval*
! で割り切れる場合には出力が行われます.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えた場合には,
! *time*, *difftime*
! のどちらの引数も与えない場合に,
! プログラムはエラーを発生させます.
!
! また, この引数と *range* は併用できません.
! 併用した場合には,
! プログラムはエラーを発生させます.
!
logical, intent(in), optional:: quiet
! .false. を与えた場合,
! このサブルーチンが呼ばれる毎に
! ファイル名と時刻が表示されます.
! デフォルトは .true. です.
!
! If ".false." is given,
! a filename and time is displayed
! when this subroutine is called.
! Default value is ".true.".
!
type(DC_DIFFTIME), intent(in), optional:: difftime
!
! 時刻 (dc_date_types#DC_DIFFTIME 型)
!
! この引数を与える場合,
! 出力するかどうかをプログラムが
! 自動的に判断します.
! *difftime* に与えられた時刻が
! HistoryCreate に与えた *interval*
! で割り切れる場合には出力が行われます.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えた場合には,
! *time*, *difftime*
! のどちらの引数も与えない場合に,
! プログラムはエラーを発生させます.
!
! この引数と *time* が与えられた場合,
! *difftime* が優先されます.
!
! この引数と *range* は併用できません.
! 併用した場合には,
! プログラムはエラーを発生させます.
!
logical, intent(in), optional:: time_average_store
!
! 平均値の出力フラグ.
! この値に .true. を与えた場合には,
! 出力せずに与えられた値を一旦蓄えます.
! .false. を与えた場合には,
! *time* もしくは *difftime* と
! HistoryCreate に与えた *interval* に
! 関わらず出力を行います.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えない場合は無効です.
!
! *time* と *difftime*
! のどちらかを同時に与える必要があります.
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
integer, target:: array_work(arraysize)
integer, pointer:: array_work2(:) =>null()
integer, allocatable:: array_overwrap(:)
integer:: arraysize_work2, new_index
type(GT_VARIABLE):: var, timevar
character(STRING):: url, file, time_str
real:: time_value(1:1)
type(GT_HISTORY), pointer:: hst =>null()
integer, allocatable:: start(:), count(:), stride(:)
integer :: i, dims, v_ord
character(STRING):: avr_msg
logical :: slice_err
character(STRING):: time_name
character(*), parameter:: bnds_suffix = '_bnds'
type(GT_VARIABLE):: bndsvar
integer:: bnds_ord, time_count, bnds_rank
integer:: stat
logical:: output_step
type(DC_DIFFTIME):: difftimew
real(DP):: avr_coef
#ifdef LIB_MPI
type(GT_VARIABLE):: dimvar
integer:: numdims, dimord, dimsize, dimsize_max, allcount, ra
character(STRING):: dimname
integer:: err_mpi, st_mpi(MPI_STATUS_SIZE)
integer, allocatable:: array_mpi_tmp(:)
integer, allocatable:: array_mpi_all(:,:)
#endif
character(STRING):: cause_c
character(*), parameter:: subname = "HistoryPutIntEx"
continue
call BeginSub(subname, 'varname=%a range=%a', ca=StoA(varname, present_select('', '(no-range)', range)))
stat = DC_NOERR
cause_c = ""
if (present(history)) then
hst => history
else
hst => default
endif
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( .not. hst % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY'
goto 999
end if
!-----------------------------------------------------------------
! time と range の同時使用の禁止
! Permit concurrent use of "time" and "range"
!-----------------------------------------------------------------
if ( ( present(time) .or. present(difftime) ) .and. present_and_not_empty(range) ) then
call MessageNotify('W', subname, '(varname=%c) "range" and "time" or "difftime" are not suppored at the same time', c1 = trim(varname) )
stat = USR_ERRNO
cause_c = '"range" and "time" or "difftime" are not suppored at the same time'
goto 999
end if
!-----------------------------------------------------------------
! hst 内の varname 変数の変数番号を取得
! Get variable number of "varname" in "hst"
!-----------------------------------------------------------------
#ifndef LIB_MPI
v_ord = lookup_variable_ord(hst, varname)
#else
if ( .not. hst % mpi_gather ) then
v_ord = lookup_variable_ord(hst, varname)
else
if ( hst % mpi_myrank == 0 ) then
v_ord = lookup_variable_ord(hst, varname)
end if
call MPI_Bcast( v_ord, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
end if
#endif
!-----------------------------------------------------------------
! 時間平均値のためのデータ格納
! Store data for time average value
!-----------------------------------------------------------------
if ( v_ord > 0 ) then
if ( hst % var_avr_count( v_ord ) > -1 ) then
if ( .not. present(time) .and. .not. present(difftime) ) then
call MessageNotify('W', subname, '(varname=%c) arguments "time" or "difftime" are needed ' // 'when "time_average=.true." is specified to "HistoryAddVariable"', c1 = trim(varname) )
stat = DC_EARGLACK
cause_c = 'time'
goto 999
end if
if ( arraysize /= hst % var_avr_data( v_ord ) % length ) then
call MessageNotify('W', subname, '(varname=%c) size of array should be (%d). size of array is (%d)', i = (/hst % var_avr_data( v_ord ) % length, arraysize/), c1 = trim(varname) )
stat = GT_EARGSIZEMISMATCH
cause_c = 'array'
goto 999
end if
if ( .not. present(difftime) ) then
call DCDiffTimeCreate( difftimew, time, '', hst % unlimited_units_symbol ) ! (in)
else
difftimew = difftime
end if
if ( hst % var_avr_firstput( v_ord ) ) then
if ( hst % var_avr_count( v_ord ) == 0 ) then
avr_coef = 1.0_DP
hst % var_avr_prevtime( v_ord ) = difftimew
else
hst % var_avr_baseint( v_ord ) = difftimew - hst % var_avr_prevtime( v_ord )
avr_coef = 1.0_DP
hst % var_avr_prevtime( v_ord ) = difftimew
hst % var_avr_firstput( v_ord ) = .false.
end if
else
if ( hst % var_avr_count( v_ord ) == 0 ) then
hst % var_avr_baseint( v_ord ) = difftimew - hst % var_avr_prevtime( v_ord )
avr_coef = 1.0_DP
hst % var_avr_prevtime( v_ord ) = difftimew
else
avr_coef = ( difftimew - hst % var_avr_prevtime( v_ord ) ) / hst % var_avr_baseint( v_ord )
hst % var_avr_prevtime( v_ord ) = difftimew
end if
end if
hst % var_avr_data( v_ord ) % a_DataAvr = hst % var_avr_data( v_ord ) % a_DataAvr + array * avr_coef
hst % var_avr_count( v_ord ) = hst % var_avr_count( v_ord ) + 1
hst % var_avr_coefsum( v_ord ) = hst % var_avr_coefsum( v_ord ) + avr_coef
if ( present(difftime) ) then
hst % time_bnds(2:2) = EvalByUnit( difftime, '', hst % unlimited_units_symbol )
else
hst % time_bnds(2:2) = time
end if
end if
end if
!-----------------------------------------------------------------
! 初期時刻の設定
! Configure initial time
!-----------------------------------------------------------------
if ( .not. hst % origin_setting ) then
if ( present(difftime) ) then
hst % origin = difftime
hst % time_bnds = EvalByUnit( difftime, '', hst % unlimited_units_symbol )
hst % origin_setting = .true.
elseif ( present(time) ) then
call DCDiffTimeCreate( hst % origin, time, '', hst % unlimited_units_symbol ) ! (in)
hst % time_bnds = time
hst % origin_setting = .true.
end if
end if
!-----------------------------------------------------------------
! 時刻の自動チェック
! Check time automatically
!-----------------------------------------------------------------
output_step = .true.
if ( present_and_false(time_average_store) ) then
output_step = .true.
elseif ( present_and_true(time_average_store) ) then
output_step = .false.
elseif ( present(difftime) .or. present(time) ) then
output_step = .false.
if ( hst % interval == 0 ) then
output_step = .true.
else
if ( .not. present(difftime) ) then
call DCDiffTimeCreate( difftimew, time, '', hst % unlimited_units_symbol ) ! (in)
else
difftimew = difftime
end if
if ( mod( difftimew - hst % origin, hst % interval ) == 0 ) then
output_step = .true.
end if
end if
end if
!-------------------------
! 時間平均値出力のための情報処理
! Information processing for output time-averaged value
if ( .not. output_step ) then
goto 999
else
array_work = array
avr_msg = ''
if ( v_ord > 0 ) then
if ( hst % var_avr_count( v_ord ) > -1 ) then
avr_msg = '(time average of ' // trim( toChar(hst % var_avr_count( v_ord )) ) // ' step data)'
!-------------------
! 蓄えた値の時間平均化
! Average stored value in time direction
array_work = ( hst % var_avr_data( v_ord ) % a_DataAvr ) / ( hst % var_avr_coefsum( v_ord ) )
hst % var_avr_data( v_ord ) % a_DataAvr = 0.0
hst % var_avr_count( v_ord ) = 0
hst % var_avr_coefsum( v_ord ) = 0.0_DP
hst % var_avr_firstput( v_ord ) = .false.
end if
end if
end if
#ifndef LIB_MPI
array_work2 => array_work
arraysize_work2 = arraysize
#else
if ( .not. hst % mpi_gather ) then
array_work2 => array_work
arraysize_work2 = arraysize
else
!-----------------------------------------------------------------
! MPI 使用時に, 座標軸のデータが与えられた場合には, そのデータを保管.
! If data of axis is given, the data is stored when MPI is used
!-----------------------------------------------------------------
numdims = size( hst % mpi_fileinfo % axes )
if ( hst % mpi_myrank == 0 ) then
dimord = 0
do i = 1, numdims
call HistoryAxisInquire( hst % mpi_fileinfo % axes(i), name = dimname ) ! (out)
if ( trim(varname) == trim(dimname) ) then
dimord = i
exit
end if
end do
call MPI_Bcast( dimord, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
else
call MPI_Bcast( dimord, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
end if
if ( dimord > 0 ) then
call HistoryAxisInquire( hst % mpi_fileinfo % axes(dimord), size = dimsize_max ) ! (out)
dimsize = size( array )
if ( dimsize > dimsize_max .and. hst % unlimited_index /= dimord ) then
call MessageNotify('W', subname, 'dim=<%c> data size (%d) exceeds size of the dim (%d) by HistoryCreate. ' // 'the data will be trancated. ', i = (/ dimsize, dimsize_max /), c1 = trim(varname) )
dimsize = dimsize_max
end if
if ( associated( hst % mpi_dimdata_each( dimord ) % a_Axis ) ) then
deallocate( hst % mpi_dimdata_each( dimord ) % a_Axis )
end if
allocate( hst % mpi_dimdata_each( dimord ) % a_Axis(dimsize) )
hst % mpi_dimdata_each( dimord ) % a_Axis = array(1:dimsize)
hst % mpi_dimdata_each( dimord ) % length = dimsize
end if
!-----------------------------------------------------------------
! MPI 使用時に, 従属変数のデータが与えられた場合, データ集約の情報を整理.
! If data of dependent variables is given,
! information for integration is arranged when MPI is used
!-----------------------------------------------------------------
if ( v_ord > 0 ) then
if ( .not. associated( hst % mpi_gthr_info ) ) then
call gtmpi_axis_register( hst, err ) ! (inout)
end if
if ( present_and_true( err ) ) goto 999
if ( .not. associated( hst % mpi_vars_index( v_ord ) % allcount ) ) then
call gtmpi_vars_mkindex( hst, v_ord, err ) ! (inout)
end if
if ( present_and_true( err ) ) goto 999
end if
!-----------------------------------------------------------------
! MPI 使用時は, 各ノードのデータを rank == 0 へ集約する.
! Data on each node is integrated when MPI is used
!-----------------------------------------------------------------
if ( v_ord > 0 ) then
arraysize_work2 = hst % mpi_vars_index(v_ord) % allcount_all
if ( arraysize_work2 < 1 ) arraysize_work2 = 1
if ( hst % mpi_myrank == 0 ) then
do ra = 1, hst % mpi_nprocs - 1
allcount = hst % mpi_vars_index(v_ord) % allcount(ra)
call MPI_Send( allcount, 1, MPI_INTEGER, ra, 0, MPI_COMM_WORLD, err_mpi )
end do
else
call MPI_Recv( allcount, 1, MPI_INTEGER, 0, 0, MPI_COMM_WORLD, st_mpi, err_mpi )
end if
if ( hst % mpi_myrank /= 0 ) then
call MPI_Send( array_work, allcount, MPI_INTEGER, 0, 0, MPI_COMM_WORLD, err_mpi )
else
allocate( array_mpi_all(0: hst % mpi_nprocs - 1, arraysize_work2 ) )
allocate( array_mpi_tmp( arraysize_work2 ) )
array_mpi_all(:,:) = 0
array_mpi_tmp(:) = 0
allcount = hst % mpi_vars_index(v_ord) % allcount(0)
array_mpi_all(0,1:allcount) = array_work
do ra = 1, hst % mpi_nprocs - 1
allcount = hst % mpi_vars_index(v_ord) % allcount(ra)
call MPI_Recv( array_mpi_tmp(1:allcount), allcount, MPI_INTEGER, ra, 0, MPI_COMM_WORLD, st_mpi, err_mpi )
array_mpi_all(ra,1:allcount) = array_mpi_tmp(1:allcount)
end do
allocate( array_work2( arraysize_work2 ) )
allocate( array_overwrap( arraysize_work2 ) )
array_work2 = 0
array_overwrap(:) = 0
do ra = 0, hst % mpi_nprocs - 1
do i = 1, hst % mpi_vars_index(v_ord) % allcount(ra)
new_index = hst % mpi_vars_index(v_ord) % each2all(ra, i)
array_work2( new_index ) = array_work2( new_index ) + array_mpi_all( ra, i )
array_overwrap( new_index ) = array_overwrap( new_index ) + 1
end do
end do
where ( array_overwrap == 0 )
array_overwrap = 1
end where
array_work2(:) = array_work2(:) / array_overwrap(:)
deallocate( array_mpi_all, array_mpi_tmp, array_overwrap )
! array_work2 はデータ出力の後に割り付け解除される.
end if
else
array_work2 => array_work
arraysize_work2 = arraysize
end if
end if
#endif
!-----------------------------------------------------------------
! 時刻を1つ進めて, データ出力
! Progress one time, and output data
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 .and. hst % mpi_fileinfo % already_output) ) then
#endif
call TimeGoAhead( varname = varname, head = real(array_work2(1)), var = var, history = history, err = err ) ! (out)
call Inquire( var, alldims=dims ) ! (out)
if (present_and_not_empty(range) .and. (dims < 1)) then
call DbgMessage('varname=<%c> has no dimension. so range is ignoread.', c1=trim(varname))
end if
if (.not. (present_and_not_empty(range) .and. (dims > 0))) then
! range 無しの普通の出力の場合
call Put(var, array_work2, arraysize_work2)
else
! range があり, 且つ varname がちゃんと次元を持っている場合
!
! 元々の start, count, stride を保持. データを与えた後に復元する.
allocate(start(dims), count(dims), stride(dims))
do i = 1, dims
call Get_Slice(var, i, start(i), count(i), stride(i))
end do
slice_err = .false. ! 不要だが Slice の引用仕様として必要なため
call Slice(var, range, slice_err)
call Put(var, array_work2, arraysize_work2)
! 復元
do i = 1, dims
call Slice(var, i, start(i), count(i), stride(i))
end do
deallocate(start, count, stride)
end if
call GTVarSync(var)
if ( hst % mpi_gather .and. v_ord > 0 ) then
deallocate( array_work2 )
end if
#ifdef LIB_MPI
end if
#endif
!-----------------------------------------------------------------
! "time_bnds" 変数への出力
! Output to "time_bnds" variable
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 .and. hst % mpi_fileinfo % already_output ) ) then
#endif
if ( v_ord > 0 ) then
if ( hst % var_avr_count( v_ord ) > -1 ) then
!-------------------
! 時間次元の名前とファイル名を取得
! Get name of time dimension, and filename
timevar = hst % dimvars( hst % unlimited_index )
call Inquire( var = timevar, url = url, name = time_name ) ! (out)
call UrlSplit( fullname = url, file = file ) ! (out)
!-------------------
! "time_bnds" 変数の取得
! Get "time_bnds" variable
call Open( var = bndsvar, url = UrlMerge(file=file, var=trim(time_name) // bnds_suffix) )
bnds_ord = lookup_variable_ord( hst, trim(time_name) // bnds_suffix)
!-------------------
! "time_bnds" 変数への出力
! Output to "time_bnds" variable
call Inquire( var = bndsvar, rank = bnds_rank ) ! (out)
time_count = 1
if ( bnds_rank > 1 ) then
call Inquire( var = bndsvar, dimord = hst % growable_indices(bnds_ord), allcount = time_count ) ! (out)
end if
if ( (hst % time_bnds_output_count < 1) .or. (hst % time_bnds_output_count < time_count) ) then
call Slice(bndsvar, hst % growable_indices(bnds_ord), start=hst % time_bnds_output_count+1, count=1) ! (in)
call Put(bndsvar, hst % time_bnds, 2)
hst % time_bnds_output_count = hst % time_bnds_output_count + 1
end if
call Close( var = bndsvar ) ! (inout)
if ( present(difftime) ) then
hst % time_bnds(1:1) = EvalByUnit( difftime, '', hst % unlimited_units_symbol )
else
hst % time_bnds(1:1) = time
end if
end if
end if
#ifdef LIB_MPI
end if
#endif
!-----------------------------------------------------------------
! メッセージ出力
! Output messages
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 .and. hst % mpi_fileinfo % already_output ) ) then
#endif
if ( present_and_false(quiet) ) then
call Inquire( hst % dimvars(1), url = url ) ! (out)
call UrlSplit( fullname = url, file = file ) ! (out)
if ( hst % unlimited_index < 1 ) then
time_str = ''
else
timevar = hst % dimvars(hst % unlimited_index)
call Slice( timevar, 1, start = hst % count(v_ord), count = 1 ) ! (in)
call Get( timevar, time_value, 1, err ) ! (out)
time_str = '(time=' // trim( toChar( time_value(1) )) // ')'
end if
call MessageNotify('M', 'HistoryPut', '"%a" => "%a" %a %a', ca = StoA( varname, file, time_str, avr_msg ) )
end if
#ifdef LIB_MPI
end if
#endif
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryPutIntEx
| Subroutine : | |
| varname : | character(*), intent(in) |
| value : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutReal0( varname, value, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real, intent(in):: value
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutReal0"
continue
call BeginSub(subname)
call HistoryPutEx( varname, (/value/), 1, history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutReal1( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real, intent(in):: array(:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutReal1"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutReal2( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real, intent(in):: array(:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutReal2"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutReal3( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real, intent(in):: array(:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutReal3"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutReal4( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real, intent(in):: array(:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutReal4"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutReal5( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real, intent(in):: array(:,:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutReal5"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutReal6( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real, intent(in):: array(:,:,:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutReal6"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | |
| varname : | character(*), intent(in) |
| array(:,:,:,:,:,:,:) : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| range : | character(*), intent(in), optional |
| time : | real, intent(in), optional |
| quiet : | logical, intent(in), optional |
| difftime : | type(DC_DIFFTIME), intent(in), optional |
| time_average_store : | logical, intent(in), optional |
| err : | logical, intent(out), optional |
subroutine HistoryPutReal7( varname, array, history, range, time, quiet, difftime, time_average_store, err )
!
!
character(*), intent(in):: varname
real, intent(in):: array(:,:,:,:,:,:,:)
type(GT_HISTORY), intent(inout), optional, target:: history
character(*), intent(in), optional:: range
real, intent(in), optional:: time
logical, intent(in), optional:: quiet
type(DC_DIFFTIME), intent(in), optional:: difftime
logical, intent(in), optional:: time_average_store
logical, intent(out), optional:: err
character(*), parameter:: subname = "HistoryPutReal7"
continue
call BeginSub(subname)
call HistoryPutEx( varname, pack(array, .true.), size(array), history = history, range = range, time = time, quiet = quiet, difftime = difftime, time_average_store = time_average_store, err = err ) ! (out) optional
call EndSub(subname)
end subroutine
| Subroutine : | recursive | ||
| varname : | character(*), intent(in) | ||
| array(arraysize) : | real, intent(in) | ||
| arraysize : | integer, intent(in) | ||
| history : | type(GT_HISTORY), intent(inout), target, optional | ||
| range : | character(*), intent(in), optional
| ||
| time : | real, intent(in), optional
| ||
| quiet : | logical, intent(in), optional
| ||
| difftime : | type(DC_DIFFTIME), intent(in), optional
| ||
| time_average_store : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
こちらは配列サイズを指定する必要があるため、 HistoryPut を利用してください。
recursive subroutine HistoryPutRealEx( varname, array, arraysize, history, range, time, quiet, difftime, time_average_store, err )
!
!== データ出力
!
! こちらは配列サイズを指定する必要があるため、
! HistoryPut を利用してください。
!
use gtdata_generic, only: Put, GTVarSync, Slice, Inquire, Get_Slice, Get, PutLine, Open, Close
use dc_string, only: StoA, Printf, toChar, JoinChar
use dc_present, only: present_and_not_empty, present_select, present_and_false, present_and_true
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT, DC_EARGLACK, USR_ERRNO, GT_EARGSIZEMISMATCH
use dc_message, only: MessageNotify
use dc_url, only: UrlSplit, UrlMerge
use dc_date_types, only: DC_DIFFTIME
use dc_date, only: operator(==), DCDiffTimeCreate, mod, operator(-), EvalByUnit, operator(/), toChar
character(*), intent(in):: varname
integer, intent(in):: arraysize
real, intent(in):: array(arraysize)
type(GT_HISTORY), intent(inout), target, optional:: history
character(*), intent(in), optional:: range
! gtool4 のコンマ記法による
! データの出力範囲指定
!
! このオプションを用いる
! 際には、必ず *HistorySetTime*
! によって明示的に時刻の設定
! を行ってください。
! また、*HistoryGet* と異なり、
! 時刻に関する範囲指定は
! 行なえません。
!
! 書式に関する詳細は
! {gtool4 netCDF 規約}[link:../xref.htm#label-6]
! の「5.4 コンマ記法」を参照して
! ください。
real, intent(in), optional:: time
!
! 時刻.
!
! この引数を与える場合,
! 出力するかどうかをプログラムが
! 自動的に判断します.
! *time* に与えられた数値が
! HistoryCreate に与えた *interval*
! で割り切れる場合には出力が行われます.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えた場合には,
! *time*, *difftime*
! のどちらの引数も与えない場合に,
! プログラムはエラーを発生させます.
!
! また, この引数と *range* は併用できません.
! 併用した場合には,
! プログラムはエラーを発生させます.
!
logical, intent(in), optional:: quiet
! .false. を与えた場合,
! このサブルーチンが呼ばれる毎に
! ファイル名と時刻が表示されます.
! デフォルトは .true. です.
!
! If ".false." is given,
! a filename and time is displayed
! when this subroutine is called.
! Default value is ".true.".
!
type(DC_DIFFTIME), intent(in), optional:: difftime
!
! 時刻 (dc_date_types#DC_DIFFTIME 型)
!
! この引数を与える場合,
! 出力するかどうかをプログラムが
! 自動的に判断します.
! *difftime* に与えられた時刻が
! HistoryCreate に与えた *interval*
! で割り切れる場合には出力が行われます.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えた場合には,
! *time*, *difftime*
! のどちらの引数も与えない場合に,
! プログラムはエラーを発生させます.
!
! この引数と *time* が与えられた場合,
! *difftime* が優先されます.
!
! この引数と *range* は併用できません.
! 併用した場合には,
! プログラムはエラーを発生させます.
!
logical, intent(in), optional:: time_average_store
!
! 平均値の出力フラグ.
! この値に .true. を与えた場合には,
! 出力せずに与えられた値を一旦蓄えます.
! .false. を与えた場合には,
! *time* もしくは *difftime* と
! HistoryCreate に与えた *interval* に
! 関わらず出力を行います.
!
! HistoryAddVariable で
! *time_average* (または *average*)
! に .true. を与えない場合は無効です.
!
! *time* と *difftime*
! のどちらかを同時に与える必要があります.
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
real, target:: array_work(arraysize)
real, pointer:: array_work2(:) =>null()
integer, allocatable:: array_overwrap(:)
integer:: arraysize_work2, new_index
type(GT_VARIABLE):: var, timevar
character(STRING):: url, file, time_str
real:: time_value(1:1)
type(GT_HISTORY), pointer:: hst =>null()
integer, allocatable:: start(:), count(:), stride(:)
integer :: i, dims, v_ord
character(STRING):: avr_msg
logical :: slice_err
character(STRING):: time_name
character(*), parameter:: bnds_suffix = '_bnds'
type(GT_VARIABLE):: bndsvar
integer:: bnds_ord, time_count, bnds_rank
integer:: stat
logical:: output_step
type(DC_DIFFTIME):: difftimew
real(DP):: avr_coef
#ifdef LIB_MPI
type(GT_VARIABLE):: dimvar
integer:: numdims, dimord, dimsize, dimsize_max, allcount, ra
character(STRING):: dimname
integer:: err_mpi, st_mpi(MPI_STATUS_SIZE)
real, allocatable:: array_mpi_tmp(:)
real, allocatable:: array_mpi_all(:,:)
#endif
character(STRING):: cause_c
character(*), parameter:: subname = "HistoryPutRealEx"
continue
call BeginSub(subname, 'varname=%a range=%a', ca=StoA(varname, present_select('', '(no-range)', range)))
stat = DC_NOERR
cause_c = ""
if (present(history)) then
hst => history
else
hst => default
endif
!-----------------------------------------------------------------
! 初期設定のチェック
! Check initialization
!-----------------------------------------------------------------
if ( .not. hst % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY'
goto 999
end if
!-----------------------------------------------------------------
! time と range の同時使用の禁止
! Permit concurrent use of "time" and "range"
!-----------------------------------------------------------------
if ( ( present(time) .or. present(difftime) ) .and. present_and_not_empty(range) ) then
call MessageNotify('W', subname, '(varname=%c) "range" and "time" or "difftime" are not suppored at the same time', c1 = trim(varname) )
stat = USR_ERRNO
cause_c = '"range" and "time" or "difftime" are not suppored at the same time'
goto 999
end if
!-----------------------------------------------------------------
! hst 内の varname 変数の変数番号を取得
! Get variable number of "varname" in "hst"
!-----------------------------------------------------------------
#ifndef LIB_MPI
v_ord = lookup_variable_ord(hst, varname)
#else
if ( .not. hst % mpi_gather ) then
v_ord = lookup_variable_ord(hst, varname)
else
if ( hst % mpi_myrank == 0 ) then
v_ord = lookup_variable_ord(hst, varname)
end if
call MPI_Bcast( v_ord, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
end if
#endif
!-----------------------------------------------------------------
! 時間平均値のためのデータ格納
! Store data for time average value
!-----------------------------------------------------------------
if ( v_ord > 0 ) then
if ( hst % var_avr_count( v_ord ) > -1 ) then
if ( .not. present(time) .and. .not. present(difftime) ) then
call MessageNotify('W', subname, '(varname=%c) arguments "time" or "difftime" are needed ' // 'when "time_average=.true." is specified to "HistoryAddVariable"', c1 = trim(varname) )
stat = DC_EARGLACK
cause_c = 'time'
goto 999
end if
if ( arraysize /= hst % var_avr_data( v_ord ) % length ) then
call MessageNotify('W', subname, '(varname=%c) size of array should be (%d). size of array is (%d)', i = (/hst % var_avr_data( v_ord ) % length, arraysize/), c1 = trim(varname) )
stat = GT_EARGSIZEMISMATCH
cause_c = 'array'
goto 999
end if
if ( .not. present(difftime) ) then
call DCDiffTimeCreate( difftimew, time, '', hst % unlimited_units_symbol ) ! (in)
else
difftimew = difftime
end if
if ( hst % var_avr_firstput( v_ord ) ) then
if ( hst % var_avr_count( v_ord ) == 0 ) then
avr_coef = 1.0_DP
hst % var_avr_prevtime( v_ord ) = difftimew
else
hst % var_avr_baseint( v_ord ) = difftimew - hst % var_avr_prevtime( v_ord )
avr_coef = 1.0_DP
hst % var_avr_prevtime( v_ord ) = difftimew
hst % var_avr_firstput( v_ord ) = .false.
end if
else
if ( hst % var_avr_count( v_ord ) == 0 ) then
hst % var_avr_baseint( v_ord ) = difftimew - hst % var_avr_prevtime( v_ord )
avr_coef = 1.0_DP
hst % var_avr_prevtime( v_ord ) = difftimew
else
avr_coef = ( difftimew - hst % var_avr_prevtime( v_ord ) ) / hst % var_avr_baseint( v_ord )
hst % var_avr_prevtime( v_ord ) = difftimew
end if
end if
hst % var_avr_data( v_ord ) % a_DataAvr = hst % var_avr_data( v_ord ) % a_DataAvr + array * avr_coef
hst % var_avr_count( v_ord ) = hst % var_avr_count( v_ord ) + 1
hst % var_avr_coefsum( v_ord ) = hst % var_avr_coefsum( v_ord ) + avr_coef
if ( present(difftime) ) then
hst % time_bnds(2:2) = EvalByUnit( difftime, '', hst % unlimited_units_symbol )
else
hst % time_bnds(2:2) = time
end if
end if
end if
!-----------------------------------------------------------------
! 初期時刻の設定
! Configure initial time
!-----------------------------------------------------------------
if ( .not. hst % origin_setting ) then
if ( present(difftime) ) then
hst % origin = difftime
hst % time_bnds = EvalByUnit( difftime, '', hst % unlimited_units_symbol )
hst % origin_setting = .true.
elseif ( present(time) ) then
call DCDiffTimeCreate( hst % origin, time, '', hst % unlimited_units_symbol ) ! (in)
hst % time_bnds = time
hst % origin_setting = .true.
end if
end if
!-----------------------------------------------------------------
! 時刻の自動チェック
! Check time automatically
!-----------------------------------------------------------------
output_step = .true.
if ( present_and_false(time_average_store) ) then
output_step = .true.
elseif ( present_and_true(time_average_store) ) then
output_step = .false.
elseif ( present(difftime) .or. present(time) ) then
output_step = .false.
if ( hst % interval == 0 ) then
output_step = .true.
else
if ( .not. present(difftime) ) then
call DCDiffTimeCreate( difftimew, time, '', hst % unlimited_units_symbol ) ! (in)
else
difftimew = difftime
end if
if ( mod( difftimew - hst % origin, hst % interval ) == 0 ) then
output_step = .true.
end if
end if
end if
!-------------------------
! 時間平均値出力のための情報処理
! Information processing for output time-averaged value
if ( .not. output_step ) then
goto 999
else
array_work = array
avr_msg = ''
if ( v_ord > 0 ) then
if ( hst % var_avr_count( v_ord ) > -1 ) then
avr_msg = '(time average of ' // trim( toChar(hst % var_avr_count( v_ord )) ) // ' step data)'
!-------------------
! 蓄えた値の時間平均化
! Average stored value in time direction
array_work = ( hst % var_avr_data( v_ord ) % a_DataAvr ) / ( hst % var_avr_coefsum( v_ord ) )
hst % var_avr_data( v_ord ) % a_DataAvr = 0.0
hst % var_avr_count( v_ord ) = 0
hst % var_avr_coefsum( v_ord ) = 0.0_DP
hst % var_avr_firstput( v_ord ) = .false.
end if
end if
end if
#ifndef LIB_MPI
array_work2 => array_work
arraysize_work2 = arraysize
#else
if ( .not. hst % mpi_gather ) then
array_work2 => array_work
arraysize_work2 = arraysize
else
!-----------------------------------------------------------------
! MPI 使用時に, 座標軸のデータが与えられた場合には, そのデータを保管.
! If data of axis is given, the data is stored when MPI is used
!-----------------------------------------------------------------
numdims = size( hst % mpi_fileinfo % axes )
if ( hst % mpi_myrank == 0 ) then
dimord = 0
do i = 1, numdims
call HistoryAxisInquire( hst % mpi_fileinfo % axes(i), name = dimname ) ! (out)
if ( trim(varname) == trim(dimname) ) then
dimord = i
exit
end if
end do
call MPI_Bcast( dimord, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
else
call MPI_Bcast( dimord, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
end if
if ( dimord > 0 ) then
call HistoryAxisInquire( hst % mpi_fileinfo % axes(dimord), size = dimsize_max ) ! (out)
dimsize = size( array )
if ( dimsize > dimsize_max .and. hst % unlimited_index /= dimord ) then
call MessageNotify('W', subname, 'dim=<%c> data size (%d) exceeds size of the dim (%d) by HistoryCreate. ' // 'the data will be trancated. ', i = (/ dimsize, dimsize_max /), c1 = trim(varname) )
dimsize = dimsize_max
end if
if ( associated( hst % mpi_dimdata_each( dimord ) % a_Axis ) ) then
deallocate( hst % mpi_dimdata_each( dimord ) % a_Axis )
end if
allocate( hst % mpi_dimdata_each( dimord ) % a_Axis(dimsize) )
hst % mpi_dimdata_each( dimord ) % a_Axis = array(1:dimsize)
hst % mpi_dimdata_each( dimord ) % length = dimsize
end if
!-----------------------------------------------------------------
! MPI 使用時に, 従属変数のデータが与えられた場合, データ集約の情報を整理.
! If data of dependent variables is given,
! information for integration is arranged when MPI is used
!-----------------------------------------------------------------
if ( v_ord > 0 ) then
if ( .not. associated( hst % mpi_gthr_info ) ) then
call gtmpi_axis_register( hst, err ) ! (inout)
end if
if ( present_and_true( err ) ) goto 999
if ( .not. associated( hst % mpi_vars_index( v_ord ) % allcount ) ) then
call gtmpi_vars_mkindex( hst, v_ord, err ) ! (inout)
end if
if ( present_and_true( err ) ) goto 999
end if
!-----------------------------------------------------------------
! MPI 使用時は, 各ノードのデータを rank == 0 へ集約する.
! Data on each node is integrated when MPI is used
!-----------------------------------------------------------------
if ( v_ord > 0 ) then
arraysize_work2 = hst % mpi_vars_index(v_ord) % allcount_all
if ( arraysize_work2 < 1 ) arraysize_work2 = 1
if ( hst % mpi_myrank == 0 ) then
do ra = 1, hst % mpi_nprocs - 1
allcount = hst % mpi_vars_index(v_ord) % allcount(ra)
call MPI_Send( allcount, 1, MPI_INTEGER, ra, 0, MPI_COMM_WORLD, err_mpi )
end do
else
call MPI_Recv( allcount, 1, MPI_INTEGER, 0, 0, MPI_COMM_WORLD, st_mpi, err_mpi )
end if
if ( hst % mpi_myrank /= 0 ) then
call MPI_Send( array_work, allcount, MPI_REAL, 0, 0, MPI_COMM_WORLD, err_mpi )
else
allocate( array_mpi_all(0: hst % mpi_nprocs - 1, arraysize_work2 ) )
allocate( array_mpi_tmp( arraysize_work2 ) )
array_mpi_all(:,:) = 0.0
array_mpi_tmp(:) = 0.0
allcount = hst % mpi_vars_index(v_ord) % allcount(0)
array_mpi_all(0,1:allcount) = array_work
do ra = 1, hst % mpi_nprocs - 1
allcount = hst % mpi_vars_index(v_ord) % allcount(ra)
call MPI_Recv( array_mpi_tmp(1:allcount), allcount, MPI_REAL, ra, 0, MPI_COMM_WORLD, st_mpi, err_mpi )
array_mpi_all(ra,1:allcount) = array_mpi_tmp(1:allcount)
end do
allocate( array_work2( arraysize_work2 ) )
allocate( array_overwrap( arraysize_work2 ) )
array_work2 = 0.0
array_overwrap(:) = 0
do ra = 0, hst % mpi_nprocs - 1
do i = 1, hst % mpi_vars_index(v_ord) % allcount(ra)
new_index = hst % mpi_vars_index(v_ord) % each2all(ra, i)
array_work2( new_index ) = array_work2( new_index ) + array_mpi_all( ra, i )
array_overwrap( new_index ) = array_overwrap( new_index ) + 1
end do
end do
where ( array_overwrap == 0 )
array_overwrap = 1
end where
array_work2(:) = array_work2(:) / array_overwrap(:)
deallocate( array_mpi_all, array_mpi_tmp, array_overwrap )
! array_work2 はデータ出力の後に割り付け解除される.
end if
else
array_work2 => array_work
arraysize_work2 = arraysize
end if
end if
#endif
!-----------------------------------------------------------------
! 時刻を1つ進めて, データ出力
! Progress one time, and output data
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 .and. hst % mpi_fileinfo % already_output) ) then
#endif
call TimeGoAhead( varname = varname, head = real(array_work2(1)), var = var, history = history, err = err ) ! (out)
call Inquire( var, alldims=dims ) ! (out)
if (present_and_not_empty(range) .and. (dims < 1)) then
call DbgMessage('varname=<%c> has no dimension. so range is ignoread.', c1=trim(varname))
end if
if (.not. (present_and_not_empty(range) .and. (dims > 0))) then
! range 無しの普通の出力の場合
call Put(var, array_work2, arraysize_work2)
else
! range があり, 且つ varname がちゃんと次元を持っている場合
!
! 元々の start, count, stride を保持. データを与えた後に復元する.
allocate(start(dims), count(dims), stride(dims))
do i = 1, dims
call Get_Slice(var, i, start(i), count(i), stride(i))
end do
slice_err = .false. ! 不要だが Slice の引用仕様として必要なため
call Slice(var, range, slice_err)
call Put(var, array_work2, arraysize_work2)
! 復元
do i = 1, dims
call Slice(var, i, start(i), count(i), stride(i))
end do
deallocate(start, count, stride)
end if
call GTVarSync(var)
if ( hst % mpi_gather .and. v_ord > 0 ) then
deallocate( array_work2 )
end if
#ifdef LIB_MPI
end if
#endif
!-----------------------------------------------------------------
! "time_bnds" 変数への出力
! Output to "time_bnds" variable
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 .and. hst % mpi_fileinfo % already_output ) ) then
#endif
if ( v_ord > 0 ) then
if ( hst % var_avr_count( v_ord ) > -1 ) then
!-------------------
! 時間次元の名前とファイル名を取得
! Get name of time dimension, and filename
timevar = hst % dimvars( hst % unlimited_index )
call Inquire( var = timevar, url = url, name = time_name ) ! (out)
call UrlSplit( fullname = url, file = file ) ! (out)
!-------------------
! "time_bnds" 変数の取得
! Get "time_bnds" variable
call Open( var = bndsvar, url = UrlMerge(file=file, var=trim(time_name) // bnds_suffix) )
bnds_ord = lookup_variable_ord( hst, trim(time_name) // bnds_suffix)
!-------------------
! "time_bnds" 変数への出力
! Output to "time_bnds" variable
call Inquire( var = bndsvar, rank = bnds_rank ) ! (out)
time_count = 1
if ( bnds_rank > 1 ) then
call Inquire( var = bndsvar, dimord = hst % growable_indices(bnds_ord), allcount = time_count ) ! (out)
end if
if ( (hst % time_bnds_output_count < 1) .or. (hst % time_bnds_output_count < time_count) ) then
call Slice(bndsvar, hst % growable_indices(bnds_ord), start=hst % time_bnds_output_count+1, count=1) ! (in)
call Put(bndsvar, hst % time_bnds, 2)
hst % time_bnds_output_count = hst % time_bnds_output_count + 1
end if
call Close( var = bndsvar ) ! (inout)
if ( present(difftime) ) then
hst % time_bnds(1:1) = EvalByUnit( difftime, '', hst % unlimited_units_symbol )
else
hst % time_bnds(1:1) = time
end if
end if
end if
#ifdef LIB_MPI
end if
#endif
!-----------------------------------------------------------------
! メッセージ出力
! Output messages
!-----------------------------------------------------------------
#ifdef LIB_MPI
if ( .not. hst % mpi_gather .or. ( hst % mpi_gather .and. hst % mpi_myrank == 0 .and. hst % mpi_fileinfo % already_output ) ) then
#endif
if ( present_and_false(quiet) ) then
call Inquire( hst % dimvars(1), url = url ) ! (out)
call UrlSplit( fullname = url, file = file ) ! (out)
if ( hst % unlimited_index < 1 ) then
time_str = ''
else
timevar = hst % dimvars(hst % unlimited_index)
call Slice( timevar, 1, start = hst % count(v_ord), count = 1 ) ! (in)
call Get( timevar, time_value, 1, err ) ! (out)
time_str = '(time=' // trim( toChar( time_value(1) )) // ')'
end if
call MessageNotify('M', 'HistoryPut', '"%a" => "%a" %a %a', ca = StoA( varname, file, time_str, avr_msg ) )
end if
#ifdef LIB_MPI
end if
#endif
!-----------------------------------------------------------------
! 終了処理, 例外処理
! Termination and Exception handling
!-----------------------------------------------------------------
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryPutRealEx
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | character(*), intent(in)
| ||
| err : | logical, intent(out), optional
|
GT_HISTORY_VARINFO 型の変数 varinfo へ属性を付加します。
HistoryVarinfoAddAttr は複数のサブルーチンの総称名です。 value には様々な型の引数を与えることが可能です。 下記のサブルーチンを参照ください。
subroutine HistoryVarinfoAddAttrChar0( varinfo, attrname, value, err )
!
!
!== GT_HISTORY_VARINFO 型変数への属性付加
!
! GT_HISTORY_VARINFO 型の変数 *varinfo* へ属性を付加します。
!
! *HistoryVarinfoAddAttr* は複数のサブルーチンの総称名です。
! value には様々な型の引数を与えることが可能です。
! 下記のサブルーチンを参照ください。
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(GT_HISTORY_VARINFO),intent(inout) :: varinfo
character(*), intent(in):: attrname ! 属性の名前
character(*), intent(in):: value
! 属性に与えられる値
!
! 配列の場合でも、数値型以外
! では配列の 1 つ目の要素のみ
! 値として付加されます。
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num, stat
character(STRING) :: name, cause_c
character(*), parameter:: subname = "HistoryVarinfoAddAttrChar0"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(value))
stat = DC_NOERR
cause_c = ''
if ( .not. varinfo % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
call HistoryVarinfoInquire1( varinfo, name )
call DbgMessage('varinfo name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(varinfo % attrs) ) then
allocate( varinfo % attrs(1) )
attrs_num = 1
else
attrs_num = size( varinfo % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = varinfo % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( varinfo % attrs )
allocate( varinfo % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = varinfo % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
varinfo % attrs(attrs_num) % attrname = attrname
varinfo % attrs(attrs_num) % attrtype = 'Char'
varinfo % attrs(attrs_num) % array = .false.
varinfo % attrs(attrs_num) % Charvalue = value
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryVarinfoAddAttrChar0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real(DP), intent(in) | ||
| err : | logical, intent(out), optional
|
subroutine HistoryVarinfoAddAttrDouble0( varinfo, attrname, value, err )
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(GT_HISTORY_VARINFO),intent(inout) :: varinfo
character(*), intent(in):: attrname ! 属性の名前
real(DP), intent(in):: value
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num, stat
character(STRING) :: name, cause_c
character(*), parameter:: subname = "HistoryVarinfoAddAttrDouble0"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
if ( .not. varinfo % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
call HistoryVarinfoInquire1( varinfo, name )
call DbgMessage('varinfo name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(varinfo % attrs) ) then
allocate( varinfo % attrs(1) )
attrs_num = 1
else
attrs_num = size( varinfo % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = varinfo % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( varinfo % attrs )
allocate( varinfo % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = varinfo % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
varinfo % attrs(attrs_num) % attrname = attrname
varinfo % attrs(attrs_num) % attrtype = 'Double'
varinfo % attrs(attrs_num) % array = .false.
varinfo % attrs(attrs_num) % Doublevalue = value
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryVarinfoAddAttrDouble0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real(DP), intent(in) | ||
| err : | logical, intent(out), optional
|
subroutine HistoryVarinfoAddAttrDouble1( varinfo, attrname, value, err )
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(GT_HISTORY_VARINFO),intent(inout) :: varinfo
character(*), intent(in):: attrname ! 属性の名前
real(DP), intent(in):: value(:)
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num, stat
character(STRING) :: name, cause_c
character(*), parameter:: subname = "HistoryVarinfoAddAttrDouble1"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
if ( .not. varinfo % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
call HistoryVarinfoInquire1( varinfo, name )
call DbgMessage('varinfo name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(varinfo % attrs) ) then
allocate( varinfo % attrs(1) )
attrs_num = 1
else
attrs_num = size( varinfo % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = varinfo % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( varinfo % attrs )
allocate( varinfo % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = varinfo % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
varinfo % attrs(attrs_num) % attrname = attrname
varinfo % attrs(attrs_num) % attrtype = 'Double'
varinfo % attrs(attrs_num) % array = .true.
allocate( varinfo % attrs(attrs_num) % Doublearray( size(value) ) )
varinfo % attrs(attrs_num) % Doublearray = value
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryVarinfoAddAttrDouble1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | integer, intent(in) | ||
| err : | logical, intent(out), optional
|
subroutine HistoryVarinfoAddAttrInt0( varinfo, attrname, value, err )
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(GT_HISTORY_VARINFO),intent(inout) :: varinfo
character(*), intent(in):: attrname ! 属性の名前
integer, intent(in):: value
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num, stat
character(STRING) :: name, cause_c
character(*), parameter:: subname = "HistoryVarinfoAddAttrInt0"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
if ( .not. varinfo % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
call HistoryVarinfoInquire1( varinfo, name )
call DbgMessage('varinfo name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(varinfo % attrs) ) then
allocate( varinfo % attrs(1) )
attrs_num = 1
else
attrs_num = size( varinfo % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = varinfo % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( varinfo % attrs )
allocate( varinfo % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = varinfo % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
varinfo % attrs(attrs_num) % attrname = attrname
varinfo % attrs(attrs_num) % attrtype = 'Int'
varinfo % attrs(attrs_num) % array = .false.
varinfo % attrs(attrs_num) % Intvalue = value
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryVarinfoAddAttrInt0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | integer, intent(in) | ||
| err : | logical, intent(out), optional
|
subroutine HistoryVarinfoAddAttrInt1( varinfo, attrname, value, err )
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(GT_HISTORY_VARINFO),intent(inout) :: varinfo
character(*), intent(in):: attrname ! 属性の名前
integer, intent(in):: value(:)
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num, stat
character(STRING) :: name, cause_c
character(*), parameter:: subname = "HistoryVarinfoAddAttrInt1"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
if ( .not. varinfo % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
call HistoryVarinfoInquire1( varinfo, name )
call DbgMessage('varinfo name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(varinfo % attrs) ) then
allocate( varinfo % attrs(1) )
attrs_num = 1
else
attrs_num = size( varinfo % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = varinfo % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( varinfo % attrs )
allocate( varinfo % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = varinfo % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
varinfo % attrs(attrs_num) % attrname = attrname
varinfo % attrs(attrs_num) % attrtype = 'Int'
varinfo % attrs(attrs_num) % array = .true.
allocate( varinfo % attrs(attrs_num) % Intarray( size(value) ) )
varinfo % attrs(attrs_num) % Intarray = value
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryVarinfoAddAttrInt1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | logical, intent(in) | ||
| err : | logical, intent(out), optional
|
subroutine HistoryVarinfoAddAttrLogical0( varinfo, attrname, value, err )
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(GT_HISTORY_VARINFO),intent(inout) :: varinfo
character(*), intent(in):: attrname ! 属性の名前
logical, intent(in):: value
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num, stat
character(STRING) :: name, cause_c
character(*), parameter:: subname = "HistoryVarinfoAddAttrLogical0"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
if ( .not. varinfo % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
call HistoryVarinfoInquire1( varinfo, name )
call DbgMessage('varinfo name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(varinfo % attrs) ) then
allocate( varinfo % attrs(1) )
attrs_num = 1
else
attrs_num = size( varinfo % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = varinfo % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( varinfo % attrs )
allocate( varinfo % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = varinfo % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
varinfo % attrs(attrs_num) % attrname = attrname
varinfo % attrs(attrs_num) % attrtype = 'Logical'
varinfo % attrs(attrs_num) % array = .false.
varinfo % attrs(attrs_num) % Logicalvalue = value
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryVarinfoAddAttrLogical0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value : | real, intent(in) | ||
| err : | logical, intent(out), optional
|
subroutine HistoryVarinfoAddAttrReal0( varinfo, attrname, value, err )
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(GT_HISTORY_VARINFO),intent(inout) :: varinfo
character(*), intent(in):: attrname ! 属性の名前
real, intent(in):: value
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num, stat
character(STRING) :: name, cause_c
character(*), parameter:: subname = "HistoryVarinfoAddAttrReal0"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
if ( .not. varinfo % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
call HistoryVarinfoInquire1( varinfo, name )
call DbgMessage('varinfo name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(varinfo % attrs) ) then
allocate( varinfo % attrs(1) )
attrs_num = 1
else
attrs_num = size( varinfo % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = varinfo % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( varinfo % attrs )
allocate( varinfo % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = varinfo % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
varinfo % attrs(attrs_num) % attrname = attrname
varinfo % attrs(attrs_num) % attrtype = 'Real'
varinfo % attrs(attrs_num) % array = .false.
varinfo % attrs(attrs_num) % Realvalue = value
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryVarinfoAddAttrReal0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| attrname : | character(*), intent(in)
| ||
| value(:) : | real, intent(in) | ||
| err : | logical, intent(out), optional
|
subroutine HistoryVarinfoAddAttrReal1( varinfo, attrname, value, err )
!
!
use gtdata_generic, only: Put_Attr
use dc_string , only: toChar, JoinChar
use dc_url , only: GT_PLUS
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(GT_HISTORY_VARINFO),intent(inout) :: varinfo
character(*), intent(in):: attrname ! 属性の名前
real, intent(in):: value(:)
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
type(GT_HISTORY_ATTR), pointer:: attrs_tmp(:)
integer:: attrs_num, stat
character(STRING) :: name, cause_c
character(*), parameter:: subname = "HistoryVarinfoAddAttrReal1"
continue
call BeginSub(subname, 'attrname=<%c>, value=<%c>', c1=trim(attrname), c2=trim(toChar(value)))
stat = DC_NOERR
cause_c = ''
if ( .not. varinfo % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
call HistoryVarinfoInquire1( varinfo, name )
call DbgMessage('varinfo name=<%c>', c1=trim(name))
! これまでの属性を保持しつつ配列を1つ増やす
if ( .not. associated(varinfo % attrs) ) then
allocate( varinfo % attrs(1) )
attrs_num = 1
else
attrs_num = size( varinfo % attrs ) + 1
! 配列データの領域確保
allocate( attrs_tmp(attrs_num - 1) )
call HistoryAttrCopy( from = varinfo % attrs(1:attrs_num - 1), to = attrs_tmp(1:attrs_num - 1))
deallocate( varinfo % attrs )
allocate( varinfo % attrs(attrs_num) )
call HistoryAttrCopy( from = attrs_tmp(1:attrs_num - 1), to = varinfo % attrs(1:attrs_num - 1))
deallocate( attrs_tmp )
endif
varinfo % attrs(attrs_num) % attrname = attrname
varinfo % attrs(attrs_num) % attrtype = 'Real'
varinfo % attrs(attrs_num) % array = .true.
allocate( varinfo % attrs(attrs_num) % Realarray( size(value) ) )
varinfo % attrs(attrs_num) % Realarray = value
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryVarinfoAddAttrReal1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| err : | logical, intent(out), optional
|
varinfo で与えられた変数を HistoryVarinfoCreate による初期設定よりも さらに前の状態に初期化します。
Destructor of GT_HISTORY_VARINFO
subroutine HistoryVarinfoClear0(varinfo, err)
!
!== GT_HISTORY_VARINFO 型変数初期化
!
! *varinfo* で与えられた変数を HistoryVarinfoCreate による初期設定よりも
! さらに前の状態に初期化します。
!
! Destructor of GT_HISTORY_VARINFO
!
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(GT_HISTORY_VARINFO),intent(inout) :: varinfo
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
integer:: stat
character(STRING):: cause_c
character(len = *), parameter:: subname = "HistoryVarinfoClear1"
continue
call BeginSub(subname)
stat = DC_NOERR
cause_c = ''
if ( .not. varinfo % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
varinfo % name = ""
varinfo % longname = ""
varinfo % units = ""
varinfo % xtype = ""
if (associated(varinfo % attrs)) then
deallocate(varinfo % attrs)
end if
varinfo % initialized = .false.
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryVarinfoClear0
| Subroutine : | |||
| varinfo_dest : | type(GT_HISTORY_VARINFO),intent(out) | ||
| varinfo_src : | type(GT_HISTORY_VARINFO),intent(in) | ||
| err : | logical, intent(out), optional | ||
| name : | character(*) , intent(in), optional
| ||
| dims(:) : | character(*) , intent(in), optional, target
| ||
| longname : | character(*) , intent(in), optional
| ||
| units : | character(*) , intent(in), optional
| ||
| xtype : | character(*) , intent(in), optional
|
GT_HISTORY_VARINFO 型の変数 varinfo_src を varinfo_dest にコピーします。 varinfo_src は HistoryVarinfoCreate によって初期設定されている必要が あります。 さらに属性を付加する場合には HistoryVarinfoAddAttr を用いてください。
err を与えておくと、コピーの際何らかの不具合が生じても 終了せずに err が真になって返ります。
err 以降の引数は、コピーの際に上書きする値です。
subroutine HistoryVarinfoCopy1(varinfo_dest, varinfo_src, err, name, dims, longname, units, xtype )
!
!== GT_HISTORY_VARINFO 型変数コピー
!
! GT_HISTORY_VARINFO 型の変数 *varinfo_src* を
! *varinfo_dest* にコピーします。
! *varinfo_src* は HistoryVarinfoCreate によって初期設定されている必要が
! あります。
! さらに属性を付加する場合には HistoryVarinfoAddAttr
! を用いてください。
!
! *err* を与えておくと、コピーの際何らかの不具合が生じても
! 終了せずに err が真になって返ります。
!
! *err* 以降の引数は、コピーの際に上書きする値です。
!
use dc_trace, only: BeginSub, EndSub, DbgMessage
use dc_present,only: present_select
use dc_string, only: JoinChar
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT, DC_EALREADYINIT
implicit none
type(GT_HISTORY_VARINFO),intent(out) :: varinfo_dest
type(GT_HISTORY_VARINFO),intent(in) :: varinfo_src
logical, intent(out), optional :: err
character(*) , intent(in), optional:: name ! 次元変数名
character(*) , intent(in), optional, target:: dims(:) ! 依存する次元
character(*) , intent(in), optional:: longname ! 次元変数の記述的名称
character(*) , intent(in), optional:: units ! 次元変数の単位
character(*) , intent(in), optional:: xtype ! 次元変数の型
integer:: i, stat
character(STRING):: cause_c
character(TOKEN), pointer :: srcdims(:) =>null() ! 依存する次元
character(*), parameter:: subname = "HistoryVarinfoCopy1"
continue
call BeginSub(subname)
stat = DC_NOERR
cause_c = ''
if ( .not. varinfo_src % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
if ( varinfo_dest % initialized ) then
stat = DC_EALREADYINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
varinfo_dest % name = present_select('', varinfo_src % name, name)
varinfo_dest % longname = present_select('', varinfo_src % longname, longname)
varinfo_dest % units = present_select('', varinfo_src % units, units)
varinfo_dest % xtype = present_select('', varinfo_src % xtype, xtype)
if (present(dims)) then
srcdims => dims
else
srcdims => varinfo_src % dims
endif
call DbgMessage('srcdims=<%c>', c1=trim(JoinChar(srcdims)))
allocate( varinfo_dest % dims( size( srcdims ) ) )
do i = 1, size(srcdims)
varinfo_dest % dims(i) = srcdims(i)
end do
call DbgMessage('varinfo_dest %% dims=<%c>', c1=trim(JoinChar(varinfo_dest % dims)))
if (associated( varinfo_src % attrs ) ) then
allocate( varinfo_dest % attrs( size( varinfo_src % attrs) ) )
call HistoryAttrCopy( from = varinfo_src % attrs, to = varinfo_dest % attrs, err = err)
end if
varinfo_dest % initialized = .true.
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryVarinfoCopy1
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(inout) | ||
| name : | character(*), intent(in)
| ||
| dims(:) : | character(*), intent(in)
| ||
| longname : | character(*), intent(in)
| ||
| units : | character(*), intent(in)
| ||
| xtype : | character(*), intent(in), optional
| ||
| time_average : | logical, intent(in), optional
| ||
| average : | logical, intent(in), optional
| ||
| err : | logical, intent(out), optional
|
GT_HISTORY_VARINFO 型変数を作成します。 このサブルーチンによる設定の後、 HistoryAddVariable の varinfo に与えます。 さらに属性を付加する場合には HistoryVarinfoAddAttr を用いてください。
Constructor of GT_HISTORY_VARINFO
subroutine HistoryVarinfoCreate1( varinfo, name, dims, longname, units, xtype, time_average, average, err )
!
!== GT_HISTORY_VARINFO 型変数作成
!
! GT_HISTORY_VARINFO 型変数を作成します。
! このサブルーチンによる設定の後、
! HistoryAddVariable の *varinfo* に与えます。
! さらに属性を付加する場合には HistoryVarinfoAddAttr
! を用いてください。
!
! Constructor of GT_HISTORY_VARINFO
!
use dc_types, only: STRING, TOKEN, DP
use dc_trace, only: BeginSub, EndSub, DbgMessage
use dc_message, only: MessageNotify
use dc_error, only: StoreError, DC_NOERR, DC_EALREADYINIT
implicit none
type(GT_HISTORY_VARINFO),intent(inout) :: varinfo
character(*), intent(in):: name ! 変数名
character(*), intent(in):: dims(:) ! 依存する次元
character(*), intent(in):: longname ! 変数の記述的名称
character(*), intent(in):: units ! 変数の単位
character(*), intent(in), optional:: xtype
! 変数の型
logical, intent(in), optional:: time_average
! 時間平均
logical, intent(in), optional:: average
! 時間平均 (後方互換用)
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
! Internal Work
integer:: i, numdims, stat
character(STRING):: cause_c
character(*), parameter:: subname = "HistoryVarinfoCreate1"
continue
call BeginSub(subname)
stat = DC_NOERR
cause_c = ''
if ( varinfo % initialized ) then
stat = DC_EALREADYINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
varinfo % name = name
varinfo % longname = longname
varinfo % units = units
if ( present(xtype) ) varinfo % xtype = xtype
if ( present(time_average) ) varinfo % time_average = time_average
if ( present(average) ) varinfo % time_average = average
numdims = size(dims)
allocate(varinfo % dims(numdims))
do i = 1, numdims
varinfo % dims(i) = dims(i)
if (len(trim(dims(i))) > TOKEN) then
call MessageNotify('W', subname, 'dimension name <%c> is trancated to <%c>', c1=trim(dims(i)), c2=trim(varinfo % dims(i)))
end if
end do
varinfo % initialized = .true.
999 continue
call StoreError( stat, subname, err, cause_c )
call EndSub(subname)
end subroutine HistoryVarinfoCreate1
| Function : | |
| result : | logical |
| varinfo : | type(GT_HISTORY_VARINFO),intent(in) |
varinfo が初期設定されている場合には .true. が, 初期設定されていない場合には .false. が返ります.
If varinfo is initialized, .true. is returned. If varinfo is not initialized, .false. is returned.
logical function HistoryVarinfoInitialized0( varinfo ) result(result)
!
! *varinfo* が初期設定されている場合には .true. が,
! 初期設定されていない場合には .false. が返ります.
!
! If *varinfo* is initialized, .true. is returned.
! If *varinfo* is not initialized, .false. is returned.
!
implicit none
type(GT_HISTORY_VARINFO),intent(in) :: varinfo
continue
result = varinfo % initialized
end function HistoryVarinfoInitialized0
| Subroutine : | |||
| varinfo : | type(GT_HISTORY_VARINFO),intent(in) | ||
| name : | character(*), intent(out), optional
| ||
| dims(:) : | character(*), pointer, optional
| ||
| longname : | character(*), intent(out), optional
| ||
| units : | character(*), intent(out), optional
| ||
| xtype : | character(*), intent(out), optional
| ||
| time_average : | logical, intent(out), optional
| ||
| average : | logical, intent(out), optional
| ||
| err : | logical, intent(out), optional
|
(out) optional
GT_HISTORY_VARINFO 型の変数内の各情報を参照します。
dims はポインタ配列です。空状態にして与えてください。
subroutine HistoryVarinfoInquire1( varinfo, name, dims, longname, units, xtype, time_average, average, err ) ! (out) optional
!
!== GT_HISTORY_VARINFO 型変数への問い合わせ
!
! GT_HISTORY_VARINFO 型の変数内の各情報を参照します。
!
! dims はポインタ配列です。空状態にして与えてください。
!
use dc_types, only: STRING, TOKEN, DP
use dc_trace, only: BeginSub, EndSub, DbgMessage
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
implicit none
type(GT_HISTORY_VARINFO),intent(in) :: varinfo
character(*), intent(out), optional:: name ! 変数名
character(*), pointer, optional:: dims(:) !(out) 依存する次元
character(*), intent(out), optional:: longname ! 変数の記述的名称
character(*), intent(out), optional:: units ! 変数の単位
character(*), intent(out), optional:: xtype ! 変数の型
logical, intent(out), optional:: time_average ! 時間平均
logical, intent(out), optional:: average ! 時間平均 (後方互換用)
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.
! Internal Work
integer:: i, numdims, stat
character(STRING):: cause_c
character(*), parameter:: subname = "HistoryVarinfoInquire1"
continue
call BeginSub(subname)
stat = DC_NOERR
cause_c = ''
if ( .not. varinfo % initialized ) then
stat = DC_ENOTINIT
cause_c = 'GT_HISTORY_VARINFO'
goto 999
end if
if (present(name)) name = varinfo % name
if (present(dims)) then
numdims = size(varinfo % dims)
allocate(dims(numdims))
do i = 1, numdims
dims(i) = varinfo % dims(i)
end do
end if
if ( present(longname) ) longname = varinfo % longname
if ( present(units) ) units = varinfo % units
if ( present(xtype) ) xtype = varinfo % xtype
if ( present(time_average) ) time_average = varinfo % time_average
if ( present(average) ) average = varinfo % time_average
999 continue
call StoreError(stat, subname, err, cause_c=cause_c)
call EndSub(subname)
end subroutine HistoryVarinfoInquire1
| Subroutine : | |
| varname : | character(len = *), intent(in) |
| var : | type(GT_VARIABLE), intent(out) |
| head : | real, intent(in) |
| history : | type(GT_HISTORY), intent(inout), optional, target |
| err : | logical, intent(out), optional |
history 内の (省略された場合は gtool_history 内に内包 される GT_HISTORY 変数) の変数名 varname の時間を1つ分 進め、その最新の時間断面で切り取った変数 ID を var に返します。
subroutine TimeGoAhead( varname, var, head, history, err )
!
! *history* 内の (省略された場合は gtool_history 内に内包
! される GT_HISTORY 変数) の変数名 *varname* の時間を1つ分
! 進め、その最新の時間断面で切り取った変数 ID を *var* に返します。
!
!
use gtdata_generic, only: Slice, Get_Slice, Put, Get, Get_Attr
use dc_types, only: STRING
use dc_error, only: StoreError, NF_ENOTVAR, DC_NOERR
use dc_date, only: EvalByUnit, operator(+), operator(*), DCDiffTimeCreate, min, max, EvalSec, DCDiffTimePutLine
character(len = *), intent(in) :: varname
type(GT_VARIABLE), intent(out) :: var
real, intent(in):: head
type(GT_HISTORY), intent(inout), optional, target:: history
logical, intent(out), optional :: err
!
type(GT_HISTORY), pointer:: hst =>null()
type(GT_VARIABLE) :: timevar
real, pointer:: time(:) =>null()
integer:: v_ord ! varname の history における次元添字番号
integer:: d_ord
integer:: timestart, rest
integer:: stat
logical:: get_err
real(DP):: curtime
type(DC_DIFFTIME):: headdiff
character(STRING):: cause_c, subname_r
character(*), parameter:: subname = "TimeGoAhead"
continue
call BeginSub(subname, 'varname=%c head=%r', c1=trim(varname), r=(/head/))
stat = DC_NOERR
cause_c = ''
subname_r = subname
if (present(history)) then
hst => history
else
hst => default
endif
! hst 内での変数 varname の変数 ID を var に、
! hst における変数添字を v_ord に取得
var = lookup_variable( hst, varname, ord = v_ord ) ! (out)
if (v_ord == 0) goto 1000
! 変数 v_ord に時間次元が無い場合は終了
if (hst % growable_indices(v_ord) == 0) then
goto 999
endif
if (hst % dim_value_written(hst % unlimited_index)) then
!-----------------------
! HistorySetTime を利用する場合
!
! 時間次元に既に値が書き込まれている場合は count を増やさない
!
call Slice(var, hst % growable_indices(v_ord), start=hst % count(1), count=1) ! (in)
else
!-----------------------
! HistorySetTime を利用しない場合
!
! 時間次元に値が書き込まれていない場合, count を増やす
! (history % interval を利用する)
!
hst % count(v_ord) = hst % count(v_ord) + 1
call Slice(var, hst % growable_indices(v_ord), start=hst % count(v_ord), count=1) ! (in)
!-----------------------
! 時間次元変数へのデータ出力
!
! 変数の count と時間次元変数の count を比較し,
! 変数の count が大きい場合, 時間次元変数の count も
! 同値になるようデータを出力する.
!
timevar = hst % dimvars(hst % unlimited_index)
call Get_Slice(timevar, 1, start=timestart)
call DbgMessage('map(timevar)start is <%d>. map(%c)start is <%d>', i=(/timestart, hst % count(v_ord)/), c1=trim(varname) )
call Get(timevar, time, get_err)
call DbgMessage('time(%d)=<%*r>, err=<%b>', i=(/size(time)/), r=(/time(:)/), l=(/get_err/), n=(/size(time)/) )
if (get_err .or. hst % count(v_ord) == 1 .and. timestart == 1) then
!---------------------
! 時間次元のデータの初期値作成
!
! 時間次元のデータがまだ作成されていない場合、
! 初期値となるデータを作成
call Slice(timevar, 1, start=1, count=1)
curtime = EvalByUnit( hst % origin, '', hst % unlimited_units_symbol )
call Put(timevar, (/curtime/), 1) ! (in)
elseif (hst % count(v_ord) > timestart) then
!---------------------
! 時間次元のデータの初期値以外を作成
!
! 変数の count が時間次元の start より大きい場合、
! hst % interval でその間を埋める。
rest = timestart + 1
do
call Slice(timevar, 1, start=rest, count=1)
curtime = EvalByUnit( hst % origin + hst % interval * (rest - 1), '', hst % unlimited_units_symbol )
call Put(timevar, (/curtime/), 1 ) ! (in)
rest = rest + 1
if ( rest > hst % count(v_ord) ) exit
enddo
endif
nullify(time)
endif
goto 999
1000 continue
!-----------------------------------------------------------------
! hst 内に次元以外の変数 ID が見つからない場合
!-----------------------------------------------------------------
!
! 次元 ID を探査
var = lookup_dimension(hst, varname, ord=d_ord)
!-------------------------
! 次元も含めた変数の中に varname が無い場合は stat に
! NF_ENOTVAR (Variable not Found) を返す.
! (上のサブルーチンが停止させることを想定)
if (d_ord == 0) then
subname_r = 'HistoryPut'
stat = NF_ENOTVAR
cause_c = 'varname="' // trim(varname) // '" is not found'
goto 999
endif
hst % dim_value_written(d_ord) = .TRUE.
if (d_ord /= hst % unlimited_index) then
goto 999
endif
!-------------------------
! ややトリッキーだが、count の2番目以降の要素にも時刻を入れて
! おくことで、HistorySetTime による巻き戻し後にも値を保持する。
hst % count(:) = maxval(hst % count(:)) + 1
call DCDiffTimeCreate( headdiff, head, '', hst % unlimited_units_symbol ) ! (in)
hst % newest = max(hst % newest, headdiff)
hst % oldest = min(hst % oldest, headdiff)
call Slice(var, 1, start=hst % count(1), count=1)
999 continue
call StoreError(stat, trim(subname_r), err, cause_c)
call EndSub(subname)
end subroutine TimeGoAhead
| Subroutine : | |
| hst : | type(GT_HISTORY), intent(inout) |
| err : | logical, intent(out), optional |
hst % mpi_gthr_info に情報の登録を行う.
subroutine gtmpi_axis_register(hst, err)
!
! hst % mpi_gthr_info に情報の登録を行う.
!
use dc_error, only: StoreError, DC_NOERR, HST_EMPINOAXISDATA
use dc_message, only: MessageNotify
use gtdata_generic, only: Inquire
use dc_url, only: UrlSplit
implicit none
type(GT_HISTORY), intent(inout):: hst
logical, intent(out), optional:: err
integer:: i, j, k, ra, numdims
integer:: err_mpi, st_mpi(MPI_STATUS_SIZE)
integer, allocatable:: index_all_buf(:)
character(STRING):: url, dimname
real:: accuracy
real(DP):: zero_limit
logical:: flag_hit
real(DP), pointer:: large =>null(), small =>null()
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = 'gtmpi_axis_register'
character(*), parameter:: subnameup = 'HistoryPut'
continue
call BeginSub(subname)
cause_c = ""
stat = DC_NOERR
numdims = size( hst % dimvars )
accuracy = 1.0e-3
zero_limit = 1.0e-6_DP
allocate( hst % mpi_gthr_info(numdims) )
! 未登録の座標データ (時刻以外) がある場合にはエラー
! Error is occurred when non registered data of axes (excluding time)
!
do i = 1, numdims
if ( hst % unlimited_index == i ) cycle
if ( hst % time_nv_index == i ) cycle
if ( hst % mpi_myrank == 0 ) then
call Inquire( hst % dimvars(i), url = url ) ! (out)
call UrlSplit( url, var = dimname ) ! (out)
call MPI_Bcast( dimname, STRING, MPI_CHARACTER, 0, MPI_COMM_WORLD, err_mpi )
else
call MPI_Bcast( dimname, STRING, MPI_CHARACTER, 0, MPI_COMM_WORLD, err_mpi )
end if
if ( hst % mpi_myrank == 0 ) then
if ( hst % mpi_dimdata_all(i) % length < 0 ) then
call MessageNotify('W', subnameup, 'data of axis (%c) in whole area is lack. ' // 'Specify the data by "HistoryPutAxisMPI" explicitly.', c1 = trim(dimname) )
stat = HST_EMPINOAXISDATA
cause_c = dimname
goto 999
end if
end if
if ( hst % mpi_dimdata_each(i) % length < 0 ) then
call MessageNotify('W', subnameup, 'data of axis (%c) on node (%d) is lack. ' // 'Specify the data by "HistoryPut" explicitly.', c1 = trim(dimname), i = (/ hst % mpi_myrank /) )
stat = HST_EMPINOAXISDATA
cause_c = dimname
goto 999
end if
end do
! mpi_gthr_info へ情報を登録
! Register information to "mpi_gthr_info"
!
do i = 1, numdims
if ( hst % unlimited_index == i ) cycle
if ( hst % time_nv_index == i ) cycle
allocate( hst % mpi_gthr_info(i) % length( 0: hst % mpi_nprocs - 1 ) )
allocate( hst % mpi_gthr_info(i) % index_all( 0: hst % mpi_nprocs - 1, hst % mpi_dimdata_all(i) % length ) )
hst % mpi_gthr_info(i) % index_all(:,:) = -1
hst % mpi_gthr_info(i) % length( hst % mpi_myrank ) = hst % mpi_dimdata_each(i) % length
k = 1
do j = 1, hst % mpi_dimdata_all(i) % length
flag_hit = .false.
if ( abs( hst % mpi_dimdata_all(i) % a_Axis(j) ) > abs( hst % mpi_dimdata_each(i) % a_Axis(k) ) ) then
large => hst % mpi_dimdata_all(i) % a_Axis(j)
small => hst % mpi_dimdata_each(i) % a_Axis(k)
else
large => hst % mpi_dimdata_each(i) % a_Axis(k)
small => hst % mpi_dimdata_all(i) % a_Axis(j)
end if
if ( large > 0.0_DP .and. small < 0.0_DP .or. large < 0.0_DP .and. small > 0.0_DP ) then
cycle
end if
if ( abs( large ) < zero_limit .and. abs( small ) < zero_limit ) then
flag_hit = .true.
end if
if ( .not. flag_hit .and. abs( ( large / small ) - 1.0_DP ) < accuracy ) then
flag_hit = .true.
end if
if ( flag_hit ) then
hst % mpi_gthr_info(i) % index_all ( hst % mpi_myrank, k ) = j
k = k + 1
end if
if ( k > hst % mpi_gthr_info(i) % length( hst % mpi_myrank ) ) exit
end do
end do
! rank == 0 で情報を受け取る.
! Receive information by rank == 0
!
if ( hst % mpi_myrank == 0 ) then
do i = 1, numdims
if ( hst % unlimited_index == i ) cycle
if ( hst % time_nv_index == i ) cycle
allocate( index_all_buf( hst % mpi_dimdata_all(i) % length ) )
do ra = 1, hst % mpi_nprocs - 1
call MPI_Recv( index_all_buf, hst % mpi_dimdata_all(i) % length, MPI_INTEGER, ra, 0, MPI_COMM_WORLD, st_mpi, err_mpi )
hst % mpi_gthr_info(i) % index_all (ra,:) = index_all_buf(:)
end do
deallocate( index_all_buf )
do ra = 1, hst % mpi_nprocs - 1
call MPI_Recv( hst % mpi_gthr_info(i) % length (ra), 1, MPI_INTEGER, ra, 0, MPI_COMM_WORLD, st_mpi, err_mpi )
end do
end do
else
do i = 1, numdims
if ( hst % unlimited_index == i ) cycle
if ( hst % time_nv_index == i ) cycle
allocate( index_all_buf( hst % mpi_dimdata_all(i) % length ) )
index_all_buf(:) = hst % mpi_gthr_info(i) % index_all (hst % mpi_myrank,:)
call MPI_Send( index_all_buf, hst % mpi_dimdata_all(i) % length, MPI_INTEGER, 0, 0, MPI_COMM_WORLD, err_mpi )
deallocate( index_all_buf )
call MPI_Send( hst % mpi_gthr_info(i) % length (hst % mpi_myrank), 1, MPI_INTEGER, 0, 0, MPI_COMM_WORLD, err_mpi )
end do
end if
! 情報に不足が無いかチェック
! Check lack of information
!
if ( hst % mpi_myrank == 0 ) then
do ra = 0, hst % mpi_nprocs - 1
do i = 1, numdims
if ( hst % unlimited_index == i ) cycle
if ( hst % time_nv_index == i ) cycle
end do
end do
do ra = 0, hst % mpi_nprocs - 1
do i = 1, numdims
if ( hst % unlimited_index == i ) cycle
if ( hst % time_nv_index == i ) cycle
do j = 1, hst % mpi_gthr_info(i) % length (ra)
if ( hst % mpi_gthr_info(i) % index_all (ra,j) < 1 ) then
call Inquire( hst % dimvars(i), url = url ) ! (out)
call UrlSplit( url, var = dimname ) ! (out)
call MessageNotify('W', subnameup, 'data of axis (%c) on node (%d) or ' // 'in whole area are lack. ' // 'Specify the data by "HistoryPut" or "HistoryPutAxisMPI" explicitly.', c1 = trim(dimname), i = (/ ra /) )
stat = HST_EMPINOAXISDATA
cause_c = dimname
goto 999
end if
end do
end do
end do
end if
999 continue
call StoreError(stat, subname, err, cause_c)
call EndSub(subname)
end subroutine gtmpi_axis_register
| Subroutine : | |||
| hst : | type(GT_HISTORY), intent(inout) | ||
| v_ord : | integer, intent(in)
| ||
| err : | logical, intent(out), optional |
hst % mpi_vars_index に配列添字情報の登録を行う.
subroutine gtmpi_vars_mkindex(hst, v_ord, err)
!
! hst % mpi_vars_index に配列添字情報の登録を行う.
!
use dc_error, only: StoreError, DC_NOERR, HST_EMPINOAXISDATA
use dc_message, only: MessageNotify
use gtdata_generic, only: Inquire
use dc_url, only: UrlSplit
implicit none
type(GT_HISTORY), intent(inout):: hst
integer, intent(in):: v_ord ! 変数 ID
logical, intent(out), optional:: err
character(TOKEN), pointer:: dims(:) =>null(), dims_space(:) =>null()
integer, pointer:: dimsizes_each(:,:) =>null(), dimsizes_all(:) =>null()
type(GT_VARIABLE):: dimvar
integer:: i, j, ra, numdims, time_dimord
integer, pointer:: dimord(:) =>null()
integer:: each_index
integer, pointer:: idx(:) =>null()
integer:: moveup
integer:: check_dimsizes_all, check_dimsizes_each
character(STRING):: check_varname
integer:: err_mpi
integer:: stat
character(STRING):: cause_c
character(*), parameter:: subname = 'gtmpi_vars_mkindex'
character(*), parameter:: subnameup = 'HistoryPut'
continue
call BeginSub(subname)
cause_c = ""
stat = DC_NOERR
! rank/=0 は何もせずに終了.
! Finish without actions if rank/=0
!
! * 以降の割り付け動作をプロセス 0 でのみ行うと,
! なぜか Cray XT 上で並列計算する際に
! 「異常な数値を ALLOCATE しようとしている」
! というエラーが生じるため, (無駄だが) 全プロセスで以降の
! 割り付け動作を行う.
!
!!! if ( hst % mpi_myrank /= 0 ) goto 999
! 変数が依存する座標軸情報を取得
! Information of axes depended from the variable
!
call HistoryVarinfoInquire( hst % mpi_varinfo( v_ord ), dims = dims ) ! (out)
! 時刻次元の排除
! Ignore time dimension
!
numdims = size( dims )
time_dimord = -1
allocate( dimord(1) )
if ( hst % unlimited_index > 0 ) then
do i = 1, numdims
if ( hst % mpi_myrank == 0 ) then
dimvar = lookup_dimension( hst, dims(i), dimord(1) )
end if
call MPI_Bcast( dimord(1), 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
if ( hst % unlimited_index == dimord(1) ) time_dimord = i
end do
end if
if ( time_dimord > 0 ) then
allocate( dims_space(numdims - 1) )
j = 1
do i = 1, numdims
if ( i == time_dimord ) cycle
dims_space(j) = dims(i)
j = j + 1
end do
numdims = numdims - 1
deallocate( dims )
else
dims_space => dims
nullify( dims )
end if
deallocate( dimord )
! スカラーの場合は例外処理
! Exception handling for scalar value
!
if ( numdims < 1 ) then
allocate( hst % mpi_vars_index(v_ord) % each2all( 0: hst % mpi_nprocs - 1, 1 ) )
allocate( hst % mpi_vars_index(v_ord) % allcount( 0: hst % mpi_nprocs - 1 ) )
hst % mpi_vars_index(v_ord) % each2all(:,:) = 1
hst % mpi_vars_index(v_ord) % allcount(:) = 1
goto 999
end if
! 配列の割付
! Allocate array
!
allocate( dimord( numdims ) )
allocate( dimsizes_all( numdims ) )
allocate( dimsizes_each( 0:hst % mpi_nprocs - 1, numdims ) )
! 個々の次元のサイズの取得
! Get size of each dimension
!
do i = 1, numdims
if ( hst % mpi_myrank == 0 ) then
dimvar = lookup_dimension( hst, dims_space(i), dimord(i) )
end if
call MPI_Bcast( dimord(i), 1, MPI_INTEGER, 0, MPI_COMM_WORLD, err_mpi )
dimsizes_all(i) = hst % mpi_dimdata_all ( dimord(i) ) % length
do ra = 0, hst % mpi_nprocs - 1
dimsizes_each(ra, i) = hst % mpi_gthr_info( dimord(i) ) % length( ra )
end do
end do
allocate( hst % mpi_vars_index(v_ord) % each2all( 0: hst % mpi_nprocs - 1, product(dimsizes_all) ) )
allocate( hst % mpi_vars_index(v_ord) % allcount( 0: hst % mpi_nprocs - 1 ) )
hst % mpi_vars_index(v_ord) % each2all(:,:) = -1
do ra = 0, hst % mpi_nprocs - 1
hst % mpi_vars_index(v_ord) % allcount(ra) = product( dimsizes_each(ra,:) )
end do
hst % mpi_vars_index(v_ord) % allcount_all = product( dimsizes_all(:) )
! rank/=0 はこの時点で終了
! Finish at this point if rank/=0
!
if ( hst % mpi_myrank /= 0 ) goto 999
allocate( idx(numdims) )
do ra = 0, hst % mpi_nprocs - 1
idx(:) = 1
idx(1) = 0
do i = 1, product( dimsizes_each(ra, :) )
idx(1) = idx(1) + 1
moveup = 0
do j = 1, numdims
if ( moveup > 0 ) then
idx(j) = idx(j) + moveup
moveup = 0
end if
if ( idx(j) > dimsizes_each(ra,j) ) then
idx(j) = 1
moveup = 1
end if
end do
each_index = hst % mpi_gthr_info(dimord(1)) % index_all (ra,idx(1))
do j = 2, numdims
each_index = each_index + ( hst % mpi_gthr_info(dimord(j)) % index_all (ra,idx(j)) - 1 ) * product( dimsizes_all(1:j-1) )
end do
hst % mpi_vars_index(v_ord) % each2all(ra, i) = each_index
end do
end do
deallocate( idx )
! 不足データが無いかチェック
! Check lack of data
!
check_dimsizes_all = product( dimsizes_all(:) )
check_dimsizes_each = sum( hst % mpi_vars_index(v_ord) % allcount(:) )
if ( check_dimsizes_all > check_dimsizes_each ) then
call Inquire( hst % vars(v_ord), name = check_varname ) ! (out)
call MessageNotify('W', subnameup, 'collected data (%c) from each node is lack. ' // 'collected data size=<%d>, but needed whole data size=<%d>.', c1 = trim(check_varname), i = (/ check_dimsizes_each, check_dimsizes_all /) )
end if
999 continue
call StoreError(stat, subname, err, cause_c)
call EndSub(subname)
end subroutine gtmpi_vars_mkindex
| Function : | |
| result : | type(GT_VARIABLE) |
| history : | type(GT_HISTORY), intent(in) |
| dimname : | character(len = *), intent(in) |
| ord : | integer, intent(out), optional |
history 内の dimname という変数名を持つ次元の GT_VARIABLE 変数を返す. dimname 末尾の空白は無視される.
type(GT_VARIABLE) function lookup_dimension(history, dimname, ord) result(result)
!
! history 内の dimname という変数名を持つ次元の GT_VARIABLE
! 変数を返す. dimname 末尾の空白は無視される.
!
use gtdata_generic, only: Inquire
use dc_types, only: STRING
use dc_error, only: StoreError, GT_EBADDIMNAME, DC_NOERR
type(GT_HISTORY), intent(in):: history
character(len = *), intent(in):: dimname
integer, intent(out), optional:: ord
integer:: ordwork
character(len = STRING):: name, cause_c
integer:: i, stat
character(len = *), parameter:: subname = 'lookup_dimension'
continue
call BeginSub(subname, 'dimname=%c', c1=trim(dimname))
stat = DC_NOERR
if (present(ord)) ord = 0
ordwork = 0
if (associated(history % dimvars)) then
do, i = 1, size(history % dimvars)
call Inquire(history % dimvars(i), name=name)
if (name == trim(dimname)) then
result = history % dimvars(i)
if (present(ord)) ord = i
stat = DC_NOERR
cause_c = ""
goto 999
endif
enddo
endif
if (present(ord)) then
ord = 0
else
stat = GT_EBADDIMNAME
cause_c = dimname
endif
999 continue
call StoreError(stat, subname, cause_c=cause_c)
if (present(ord)) ordwork = ord
call EndSub(subname, 'ord=%d (0:not found)', i=(/ordwork/))
end function
| Subroutine : | |
| history : | type(GT_HISTORY), intent(in) |
| name : | character(len = *), intent(in) |
| var : | type(GT_VARIABLE), intent(out) |
| err : | logical, intent(out) |
history 内から, name という名前の次元または変数を探査し, var に GT_VARIABLE 変数を返す. 見つかって正常に var が返る場合は stat には DC_NOERR が返り, history 内から name が発見されない場合には, stat に NF_ENOTVAR が返る.
subroutine lookup_var_or_dim(history, name, var, err)
!
! history 内から, name という名前の次元または変数を探査し,
! var に GT_VARIABLE 変数を返す. 見つかって正常に
! var が返る場合は stat には DC_NOERR が返り,
! history 内から name が発見されない場合には, stat に
! NF_ENOTVAR が返る.
!
use dc_error, only: StoreError, DC_NOERR, NF_ENOTVAR
use dc_types, only: STRING
type(GT_HISTORY), intent(in):: history
character(len = *), intent(in):: name
type(GT_VARIABLE), intent(out):: var
logical, intent(out):: err
integer:: stat, ord
character(STRING) :: cause_c
character(len = *), parameter:: subname = 'lookup_var_or_dim'
continue
call BeginSub(subname, 'name=<%c>', c1=trim(name))
cause_c = ""
stat = DC_NOERR
var = lookup_variable(history, name, ord)
if (ord /= 0) then
stat = DC_NOERR
goto 999
endif
var = lookup_dimension(history, name, ord)
if (ord /= 0) then
stat = DC_NOERR
goto 999
endif
stat = NF_ENOTVAR
cause_c = "Any vars and dims are not found"
999 continue
call StoreError(stat, subname, err, cause_c)
call EndSub(subname, 'ord=%d (0:not found)', i=(/ord/))
end subroutine lookup_var_or_dim
| Function : | |
| result : | type(GT_VARIABLE) |
| history : | type(GT_HISTORY), intent(in) |
| varname : | character(len = *), intent(in) |
| ord : | integer, intent(out), optional |
history 内での変数 varname の ID を取得 ID を取得できた場合, 返り値 result と ord にそれぞれ その ID が返される。 ID を取得できない場合、ord が渡されていなければその場で終了 ord が渡されている場合は ord に 0 が返される。
type(GT_VARIABLE) function lookup_variable(history, varname, ord) result(result)
!
! history 内での変数 varname の ID を取得
! ID を取得できた場合, 返り値 result と ord にそれぞれ
! その ID が返される。
! ID を取得できない場合、ord が渡されていなければその場で終了
! ord が渡されている場合は ord に 0 が返される。
!
use dc_types, only: STRING
use dc_error, only: StoreError, NF_ENOTVAR, DC_NOERR
type(GT_HISTORY), intent(in):: history
character(len = *), intent(in):: varname
character(len = STRING) :: cause_c
integer, intent(out), optional:: ord
integer:: ordwork
integer:: i, stat
character(len = *), parameter:: subname = 'lookup_variable'
continue
call BeginSub(subname, '%c', c1=trim(varname))
stat = DC_NOERR
cause_c = ''
if (present(ord)) ord = 0
ordwork = 0
i = lookup_variable_ord(history, varname)
if (i > 0) then
result = history % vars(i)
if (present(ord)) ord = i
goto 999
endif
if (present(ord)) then
ord = 0
else
stat = NF_ENOTVAR
cause_c = varname
i = 0
endif
999 continue
call StoreError(stat, subname, cause_c=cause_c)
if (present(ord)) ordwork = ord
call EndSub(subname, "ord=%d (0: not found)", i=(/ordwork/))
end function
| Subroutine : | |
| history : | type(GT_HISTORY), intent(inout) |
| dimord : | integer, intent(in) |
次元 history % dimvars(dimord) に値が設定されていない場合、 「とりあえず」値を設定する。ただし、無制限次元 (時間次元) に関しては history % origin, history % interval, history % count から「まっとうな」値が設定される。
subroutine set_fake_dim_value(history, dimord)
!
! 次元 history % dimvars(dimord) に値が設定されていない場合、
! 「とりあえず」値を設定する。ただし、無制限次元 (時間次元)
! に関しては history % origin, history % interval, history % count
! から「まっとうな」値が設定される。
!
use gtdata_generic, only: Inquire, Slice, Put
use dc_error, only: DumpError
use dc_date, only: EvalByUnit
type(GT_HISTORY), intent(inout):: history
integer, intent(in):: dimord
integer:: length, i
real, allocatable:: value(:)
logical:: err
continue
if (dimord == history % unlimited_index) then
if (.not. associated(history % count)) return
length = maxval(history % count(:))
else
call Inquire(history % dimvars(dimord), size=length)
endif
if (length == 0) return
allocate(value(length))
if (dimord == history % unlimited_index) then
value(:) = (/(real(i), i = 1, length)/)
value(:) = EvalByUnit( history % origin, '', history % unlimited_units_symbol ) + (value(:) - 1.0) * EvalByUnit( history % interval, '', history % unlimited_units_symbol )
call Slice(history % dimvars(dimord), 1, start=1, count=length)
else
value(:) = (/(real(i), i = 1, length)/)
endif
call Put(history % dimvars(dimord), value, size(value), err)
if (err) call DumpError
deallocate(value)
end subroutine set_fake_dim_value
| Constant : | |
| version = ’$Name: gtool5-20090217 $’ // ’$Id: gtool_history.F90,v 1.15 2009-01-29 15:12:05 morikawa Exp $’ : | character(*), parameter |