Checks if specified file variables are defined in a file.
function isfilevar ( thefile  : file, varnames : string ) return_val [dimsizes(varnames)] : logical
An array of strings of any dimensionality.
The output is a logical array with the same dimensions as the varnames parameter.
For each element in the varnames parameter, isfilevar returns True if the variable is present on the file referenced by thefile and False if not. If the parameter thefile is not a valid file, then a single missing value is returned.
Example 1: If a variable named X resides in the file referenced by f, read it to memory using:
f = addfile ("dummy.hdf", "r") if (isfilevar(f, "X")) then x = f->X end ifExample 2: Loop through a series of possible variable names and read the first occurrence of that variable name. Use the NCL break keyword to exit the loop. The '$' character is used to allow string substitution in the variable name: