NCL Home > Documentation > Functions > Printing

printVarSummary

Prints a summary of a variable's information.

Prototype

	procedure printVarSummary (
		data       
	)

Arguments

data

A variable of any type and dimensionality.

Description

The printVarSummary procedure displays the information associated with a variable. The information includes type, attributes, dimensions sizes, named dimensions (if present), and a summary of coordinate data (if present).

printVarSummary is often used in scripts to minimize printed output, because it does not print out individual values like the print procedure.

Note: if you want to print information about a variable on a file, do not use this procedure, as it will copy the whole variable into memory. Instead, use printFileVarSummary.

See Also

print, printFileVarSummary

Examples

Example 1

Assume "T2m.nc" is a netCDF file with a variable called T, and that T has attributes and some coordinate variables called time, lat, and lon. Then:

  f = addfile ("T2m.nc", "r")
  T = f->T
  printVarSummary (T)

would yield the following output:

Variable: T
Type: float
Total Size: 72192 bytes
            18048 values
Number of Dimensions: 3
Dimensions and sizes:   [time | 1] x [lat | 94] x [lon | 192]
Coordinates: 
            time: [197901..197901]
            lat: [-88.54195..88.54195]
            lon: [ 0..358.125]
Number Of Attributes: 4
  units :       K
  short_name :  T2m
  long_name :   Temperature (2m)
  _FillValue :  1e+36