NCL Website header
NCL Home > Documentation > Functions > File I/O

getfilevarchunkdimsizes

Returns the chunk dimension sizes of variable on a given file which has chunk dimensions.

Prototype

	function getfilevarchunkdimsizes (
		thefile [1] : file,    
		varname [1] : string   
	)

	return_val [*] :  long

Arguments

thefile

A reference to a file created from a call to addfile or addfiles. Thus, the file referenced must be one in the supported file format list.

varname

The string name of the variable whose chunk dimension sizes are desired.

Return value

Returns a one-dimensional array of chunk dimension sizes for a file variable.

Description

The getfilevarchunkdimsizes function should be used exclusively when querying the dimensionality of variables in files.

See Also

filechunkdimdef, filevarchunkdef, getfilevarchunkdimsizes

Functions marked with * indicate ones added in NCL V6.5.0.

Variable query functions:

getvaratts
getvardimsizes*
getvardimnames*
getvardims

File query functions:

getfiledimsizes
getfiledimnames*
getfiledims*
getfileatts*

Variable on file query functions:

getfilevarnames
getfilevardimsizes
getfilevardimnames*
getfilevardims
getfilevartypes
isfilevardim
isfilevaratt
isfilevarcoord
isfilevardim

Examples

Example 1 Consider a netCDF file where "ncl_filedump nc4uvt.nc" yields:

Variable: f
Type: file
filename:       nc4uvt
path:   nc4uvt.nc
Number of Attributes:3
    Conventions :       None
    source_file :       nc4uvt.nc
    title       :       NCL generated netCDF file

dimensions:
    time        = 1 // unlimited
    lev = 14
    lat = 64
    lon = 128

chunk dimensions:
    time        = 1 // unlimited
    lev = 7
    lat = 32
    lon = 64

variables:
......
  a    = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/nc4uvt.nc","r")
  dimt = getfilevarchunkdimsizes(a,"t")  
  print(dimt)
This produces the following output:
Variable: dimt
Type: long
Total Size: 32 bytes
            4 values
Number of Dimensions: 1
Dimensions and sizes:   [4]
Coordinates: 
(0)     1
(1)     7
(2)     32
(3)     64