anvarinquire-ia.f90

Path: src/anvarinquire-ia.f90
Last Update: Wed Jul 20 18:22:22 JST 2005

Copyright (C) GFD Dennou Club, 2000. All rights reserved.

Methods

Included Modules

an_types an_vartable netcdf_f77

Public Instance methods

var :type(AN_VARIABLE), intent(in)
dimlen(:) :integer, intent(out)

引数は ndims 個でなければならない。

[Source]

subroutine ANVarInquireIA(var, dimlen)

!    use an_vartable, only: an_variable_entry

    type(AN_VARIABLE), intent(in):: var
    integer, intent(out):: dimlen(:)
    type(an_variable_entry):: ent
    integer:: stat, i

    dimlen(:) = -1

    stat = vtable_lookup(var, ent)
    if (stat /= nf_noerr) return

    if (ent%varid > 0) then
        if (.not. associated(ent%dimids)) return
        do, i = 1, min(size(dimlen), size(ent%dimids))
            stat = nf_inq_dimlen(ent%fileid, ent%dimids(i), dimlen(i))
            if (stat /= nf_noerr) exit
        enddo
    else
        stat = nf_inq_dimlen(ent%fileid, ent%dimid, dimlen(1))
        if (stat /= nf_noerr) dimlen(1) = -1
    endif
end subroutine

[Validate]