NETCDF_SLICE(3F)

Date: TOYODA Eizi
Source: 2000-03-02

名前

netcdf_slice, netcdf_limit - netcdf の変数の部分入出力の抽象化

書式

use netcdf

type(NC_DIMENSION):: dim type(NC_VARIABLE):: variable type(NC_LIMIT):: limit character(len = ...):: dimname integer:: start, count, stride integer:: starts(7), counts(7), strides(7)

! limit の生成と廃棄 type(NC_LIMIT) function WholeVariable(variable) subroutine Dispose(limit)

! limit の利用

subroutine Next(limit) ! イテレータ (利用例参照) logical function Slice(limit, dimname, start [, count [, stride]]) integer function Size(limit) starts = Start(limit) counts = Count(limit) strides = Stride(limit)

! limit について再定義された演算子・代入 ! limit = WholeVariable(variable) と等価 limit = variable if (.error. limit) ... ! 論理型を与える単項演算子

! 変数入力 character, pointer:: cpointer(:, :, :, :, :, :, :) integer, pointer:: ipointer(:, :, :, :, :, :, :) real, pointer:: rpointer(:, :, :, :, :, :, :)

cpointer => get_text(variable [, limit]) ipointer => get_int(variable [, limit]) rpointer => get_real(variable [, limit])

character:: cbuffer(任意, 任意, 任意, 任意, 任意, 任意, 任意) integer:: ibuffer(任意, 任意, 任意, 任意, 任意, 任意, 任意) real:: rbuffer(任意, 任意, 任意, 任意, 任意, 任意, 任意)

subroutine put_text(variable, cbuffer [, limit]) subroutine put_int(variable, ibuffer [, limit]) subroutine put_real(variable, rbuffer [, limit)

説明

NC_LIMIT 構造体は netCDF 変数の部分入出力の抽象化です。

備考

NC_LIMIT 構造体は netcdf_slice モジュールで定義されています。 入出力関数は netcdf_io モジュールで定義されています。 通常は netcdf モジュールを呼び出すべきです。

利用例

ループ

real, pointer:: varptr(:, :, :, :, :, :, :)
 ...
limit = WholeVariable(variable)
if (.error. Slice(limit, 'longitude', 1)) stop 'slice'
do
	varptr => get_real(variable, limit)
	if (.not.associated(varptr)) call NetcdfAssert
	...
	deallocate(varptr)
	call Next(limit)
	if (.error. limit) exit
enddo

作者

豊田英司 toyoda@gfd-dennou.org

参照

dc_string(3f), netcdf_error(3f), netcdf_file(3f), netcdf_dimension(3f), netcdf_variable(3f), netcdf_v3(3f) netcdf(3f),
HTML generated using htroff at 7 March 2000 17:14:27.