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(:, :, :, :, :, :, :)

subroutine Get(variable, cpointer [, limit] [, fail]) subroutine Get(variable, ipointer [, limit] [, fail]) subroutine Get(variable, rpointer [, limit] [, fail])

! 当然配列寸法は引用時に確定していなければならない character, pointer:: cbuffer(:, :, :, :, :, :, :) integer, pointer:: ibuffer(:, :, :, :, :, :, :) real, pointer:: rbuffer(:, :, :, :, :, :, :)

subroutine Put(variable, cbuffer [, limit]) subroutine Put(variable, ibuffer [, limit]) subroutine Put(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 22 March 2000 19:40:49.