nc_copyΒΆ

nc_copy copies all variables and attributes of an NC file to a new NC file.

ret = nc_copy(ncid, ncid_out)

Return Value

If the function succeeds, the return value is not equal to -1. If the function fails, the return value is -1.

Parameters

ncid

ncid is the handle of the source NC file returned by nc_create or nc_open.

ncid_out

ncid_out is the handle of the target netCDF file.

Example

ncid = nc_open("d:/test.nc", NC_NOWRITE);
ncid_out = nc_create("d:/test-out.nc", NC_CLOBBER|NC_FORMAT_CLASSIC);
ret = nc_copy(ncid, ncid_out);
nc_close(ncid_out);
nc_close(ncid);

History

Version Description
5.3.2 New.

id-329784