NCL Website header
NCL Home > Documentation > Functions > Metadata routines

copy_VarCoords

Copies all named dimensions and coordinate variables from one variable to another.

Prototype

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"  ; This library is automatically loaded
                                                             ; from NCL V6.2.0 onward.
                                                             ; No need for user to explicitly load.

	procedure copy_VarCoords (
		var_from  ,    
		var_to         
	)

Arguments

var_from

An array of any dimensionality. Must have named dimensions and coordinate variables. An array of any dimensionality.

Description

This procedure copies all named dimensions and coordinate variables from one variable to another.

See Also

copy_VarMeta, copy_VarAtts, copy_VarCoords, copy_VarCoords_1, copy_VarCoords_2

There are many other metadata tools

Examples

Example 1

;---read in netCDF file and read in data
  cdf_file = addfile("slp.1963.nc","r") 
  slp      = cdf_file->slp(:,::-1,:)                     ; slp has coordinate arrays

  newslp = ((slp*slp@scale_factor)+slp@add_offset)*.01   ; newslp won't have any coordinate arrays
  copy_VarCoords(slp,newslp)                             ; copy coordinate arrays from slp to newslp