1NCCOPY(1) UNIDATA UTILITIES NCCOPY(1)
2
3
4
6 nccopy - Copy a netCDF file to specified variant of netCDF format
7
9 nccopy [-k n] infile outfile
10
12 nccopy copies an input netCDF file (in any of the four format variants)
13 to an output netCDF file, in any of the four format variants, if possi‐
14 ble. For example, if built with the netCDF-3 library, a netCDF classic
15 file may be copied to a netCDF 64-bit offset file, permitting larger
16 variables. If built with the netCDF-4 library, a netCDF classic file
17 may be copied to a netCDF-4 file or to a netCDF-4 classic model file as
18 well, permitting later efficient schema changes, larger variable sizes,
19 adding variables that use compressed or chunked storage, and use of
20 other netCDF-4 features in case the output uses the enhanced netCDF
21 model.
22
23 nccopy also serves as an example of a generic netCDF-4 program, with
24 its ability to read any valid netCDF file and handle nested groups,
25 strings, and any user-defined types, including arbitrarily nested com‐
26 pound types, variable-length types, and data of any valid netCDF-4
27 type. Other generic utility programs can make use of parts of nccopy
28 for more complex operations on netCDF data.
29
30 As of NetCDF version 4.1, and if DAP support was enabled when nccopy
31 was built, the file name may specify a DAP URL. This allows nccopy to
32 convert data on DAP servers to local netCDF files.
33
35 -k file_format
36 Specifies the kind of file to be created and, by inference, the
37 data model (i.e. netcdf-3 (classic) versus netcdf-4 (enhanced)).
38 The possible arguments are as follows.
39
40 '1', 'classic' => netcdf classic file format, netcdf-3
41 type model.
42
43 '2', '64-bit-offset', '64-bit offset' => netcdf 64 bit
44 classic file format, netcdf-3 type model.
45
46 '3', 'hdf5', 'netCDF-4', 'enhanced' => netcdf-4 file for‐
47 mat, netcdf-4 type model.
48
49 '4', 'hdf5-nc3', 'netCDF-4 classic model', 'enhanced-nc3'
50 => netcdf-4 file format, netcdf-3 type model.
51 If no value for -k is specified, then the output will use the same for‐
52 mat as the input. Note that attempting some kinds of format conversion
53 will result in an error, if the conversion is not possible. For exam‐
54 ple, an attempt to copy a netCDF-4 file that uses features of the en‐
55 hanced model to any of the other kinds of netCDF formats that use the
56 classic model will result an error.
57
58 -m copy_buffer_size
59 Specifies the size, in bytes, of the copy buffer used to to copy
60 large variables, by copying them in smaller pieces, each no
61 larger than copy_bufer_size. The default is 5,000,000 bytes,
62 but will be increased if necessary to hold at least one chunk of
63 netCDF-4 chunked variables. You may want to make it larger than
64 the default for OPeNDAP copies of large files over high latency
65 networks.
66
68 Make a copy of foo1.nc, a netCDF file of any type, to foo2.nc, a netCDF
69 file of the same type:
70
71 nccopy foo1.nc foo2.nc
72 Note that the above copy will not be as fast as use of a simple copy
73 utility, because the file is copied structurally, using only the netCDF
74 API. This means, for example, that if the input file has extra bytes
75 after the end of the netCDF data, those will not be copied, because
76 they are not accessible through the netCDF interface. If the original
77 file was generated in `No fill' mode so that fill values are not stored
78 for padding for data alignment, the output file may have different pad‐
79 ding bytes.
80
81 Convert a netCDF-4 classic model file, compressed.nc, that uses com‐
82 pression, to a netCDF-3 file classic.nc:
83
84 nccopy -k classic compressed.nc classic.nc
85 Note that `1' could be used instead of `classic'.
86
87 Download the variable `time_bnds' and it's associated attributes from
88 an OPeNDAP server and copy the result to a netCDF file named `tb.nc':
89
90 nccopy 'http://test.opendap.org/opendap/data/nc/sst.mn‐
91 mean.nc.gz?time_bnds' tb.nc
92 Note that URLs that name specific variables as command-line arguments
93 should generally be quoted, to avoid the shell interpreting special
94 characters such as `?'.
95
97 ncdump(1),ncgen[1m(1), netcdf(3)
98
99
100
101
102Printed: 119-6-22 $Date: 2009/12/09 13:49:31 $ NCCOPY(1)