.. highlightlang:: us .. _nc_copy: nc_copy ======= .. index:: nc_copy .. us.tag nc_copy ENGLISH NC New532 :ref:`nc_copy` copies all variables and attributes of an NC file to a new NC file. .. function:: ret = nc_copy(ncid, ncid_out) .. us.return **Return Value** If the function succeeds, the return value is not equal to -1. If the function fails, the return value is -1. .. us.params **Parameters** .. uparam:: ncid *ncid* is the handle of the source NC file returned by :ref:`nc_create` or :ref:`nc_open`. .. uparam:: ncid_out *ncid_out* is the handle of the target netCDF file. .. us.example **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); .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.3.2 - New. .. seealso:: :ref:`overview-netcdf-files`, :ref:`nc_open`, :ref:`nc_create`, :ref:`nc_inquire_format`, :ref:`nc_close` :sub:`id-329784`