use netcdftype(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 変数の部分入出力の抽象化です。
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