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

isfilevarcoord

Checks if a coordinate variable is defined in a file.

Prototype

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

	return_val [1] :  logical

Arguments

thefile

A reference to a file created using addfile. Thus, it must be a supported file format.

varname

The name of the file variable.

coordname

The name of the coordinate variable.

Description

If a given dimension has a coordinate variable this function will return True. If the variable or dimension name do not exist then this function returns a missing value. It returns False only when no coordinate variable exists for the variable.

See Also

iscoord

Examples

Example 1

    f = addfile ("foo.nc" , "r")     ; create a file reference

; check to see if the variable "TEMP" has a coordinate array named "lev"

    print( isfilevarcoord( f, "TEMP", "lev") )