netCDF operator (nco, cdo)
ncrename - netCDF Renamer
Options > -a old_name, new_name Attribute renaming. The old and new names of the attribute are specified by the associated old_name and new_name values. Global attributes are treated no differently than variable attributes. This option may be specified more than once. You cannot change the attribute name for one particular variable (unless it is uniquely named); all occurrences of the attribute of a given name will be renamed. This is considered an oversight and will be addressed in a future version of NCO. -d old_name, new_name Dimension renaming. The old and new names of the dimension are specified by the associated old_name and new_name values. This option may be specified more than once. -v old_name, new_name Variable renaming. The old and new names of the variable are specified by the associated old_name and new_name values. This option may be specified more than once. -i >Interactive. ncrename will prompt for confirmation before overwriting an existing file.
Examples Rename the variable p to pressure and t to temperature in netCDF in.nc. In this case p must exist in the input file (or ncrename will abort), but the presence of t is optional: 1
$ ncrename -v p,pressure -v .t,temperature in.nc
1
$ ncrename -d lon,longitude -v lon,longitude in.nc
ncrcat - netCDF Record Concatenator
ncrcat concatenates record variables across an arbitrary number of input files. The final record dimension is by default the sum of the lengths of the record dimensions in the input files. 1
2
3$ ncrcat -O "diag*.nc" ${path_out}
$ ncrcat 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
$ ncrcat 8[56789].nc 8589.nc
Appending variables
This puts the contents yyy of bbb.nc into aaa.nc. 1
$ ncks -A -v yyy bbb.nc aaa.nc
ncdiff - netCDF Differencer
1 |
|
cdo sub
1 |
|