Next: , Previous: nc_rename_var, Up: Variables


6.35 Copy a Variable from One File to Another: nc_copy_var

This function will copy a variable from one file to another.

It works even if the files are different formats, (i.e. classic vs. netCDF-4/HDF5.)

If you're copying into a netcdf-3 file, from a netcdf-4 file, you must be copying a var of one of the six netcdf-3 types. Similarly for the attributes.

Usage

     nc_copy_var(int ncid_in, int varid_in, int ncid_out)

Return Codes

Example