1NCRENAME(1)                 General Commands Manual                NCRENAME(1)
2
3
4

NAME

6       ncrename - netCDF Renamer
7

SYNTAX

9       ncrename  [-a old_name,new_name] [-a  ... ] [-D] [-d old_name,new_name]
10       [-d  ... ] [-g old_name,new_name] [-g  ... ] [--glb att_name= att_val]]
11       [-h]  [--hdr_pad sz_byt][--hpss_try] [-l path] [-O] [-p path] [-R] [-r]
12       [--ram_all]  [--uio] [-v old_name,new_name]  [-v   ... ]  input-file  [
13       output-file]
14

DESCRIPTION

16       ncrename  renames  dimensions,  variables,  and  attributes in a netCDF
17       file.  Each object that has a name in the list of old names is  renamed
18       using  the  corresponding  name  in the list of new names.  All the new
19       names must be unique.  Every old name must exist in the input file, un‐
20       less  the name is preceded by the character ..  The validity of the old
21       names is not checked prior to the renaming.  Thus, if an  old  name  is
22       specified  without  the the .  prefix and is not present in input-file,
23       ncrename will abort.
24
25       ncrename is the exception to the normal rules that the user will be in‐
26       teractively  prompted  before  an  existing file is changed, and that a
27       temporary copy of an output file is constructed during  the  operation.
28       If only input-file is specified, then ncrename will change the names of
29       the input-file in place without prompting and without creating a tempo‐
30       rary  copy  of  input-file.   This is because the renaming operation is
31       considered reversible if the user makes a mistake.   The  new_name  can
32       easily be changed back to old_name by using ncrename one more time.
33
34       Note  that renaming a dimension to the name of a dependent variable can
35       be used to invert the relationship between  an  independent  coordinate
36       variable  and  a dependent variable.  In this case, the named dependent
37       variable must be one-dimensional and should  have  no  missing  values.
38       Such a variable will become a coordinate variable.
39
40       According  to  the  netCDF  Users  Guide, renaming properties in netCDF
41       files does not incur the penalty of recopying the entire file when  the
42       new_name is shorter than the old_name.
43

OPTIONS

45       -a     old_name, new_name Attribute renaming.  The old and new names of
46              the attribute are  specified  by  the  associated  old_name  and
47              new_name  values.   Global attributes are treated no differently
48              than variable attributes.  This option  may  be  specified  more
49              than once.  You cannot change the attribute name for one partic‐
50              ular variable (unless it is uniquely named); all occurrences  of
51              the  attribute of a given name will be renamed.  This is consid‐
52              ered an oversight and will be addressed in a future  version  of
53              NCO.
54
55       -d     old_name, new_name Dimension renaming.  The old and new names of
56              the dimension are  specified  by  the  associated  old_name  and
57              new_name values.  This option may be specified more than once.
58
59       -g     old_name, new_name Group renaming.  The old and new names of the
60              group are specified by the associated old_name and new_name val‐
61              ues.  This option may be specified more than once.
62
63       -v     old_name,  new_name Variable renaming.  The old and new names of
64              the variable  are  specified  by  the  associated  old_name  and
65              new_name values.  This option may be specified more than once.
66
67       -i     Interactive.  ncrename will prompt for confirmation before over‐
68              writing an existing file.
69

EXAMPLES

71       Rename the variable p to pressure and t to temperature in netCDF in.nc.
72       In  this  case p must exist in the input file (or ncrename will abort),
73       but the presence of t is optional:
74              ncrename -v p,pressure -v .t,temperature in.nc
75       ncrename does not automatically attach dimensions to variables  of  the
76       same  name.  If you want to rename a coordinate variable so that it re‐
77       mains a coordinate variable, you must separately rename both the dimen‐
78       sion and the variable:
79              ncrename -d lon,longitude -v lon,longitude in.nc
80
81       Create netCDF out.nc identical to in.nc except the attribute _FillValue
82       is changed to missing_value (in all variables which possess it) and the
83       global attribute Zaire is changed to Congo:
84              ncrename -a _FillValue,missing_value -a Zaire,Congo in.nc out.nc
85
86

AUTHOR

88       NCO  manual pages written by Charlie Zender and originally formatted by
89       Brian Mays.
90
91

REPORTING BUGS

93       Report bugs to <http://sf.net/bugs/?group_id=3331>.
94
95
97       Copyright © 1995-2018 Charlie Zender
98       This is free software; see the source for copying conditions.  There is
99       NO  warranty;  not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
100       PURPOSE.
101
102

SEE ALSO

104       The full documentation for NCO is maintained as a Texinfo manual called
105       the  NCO Users Guide.  Because NCO is mathematical in nature, the docu‐
106       mentation includes TeX-intensive portions not  viewable  on  character-
107       based  displays.  Hence the only complete and authoritative versions of
108       the NCO Users Guide are the PDF (recommended), DVI, and Postscript ver‐
109       sions  at <http://nco.sf.net/nco.pdf>, <http://nco.sf.net/nco.dvi>, and
110       <http://nco.sf.net/nco.ps>, respectively.  HTML and  XML  versions  are
111       available          at          <http://nco.sf.net/nco.html>         and
112       <http://nco.sf.net/nco.xml>, respectively.
113
114       If the info and NCO programs are properly installed at your  site,  the
115       command
116
117              info nco
118
119       should  give  you access to the complete manual, except for the TeX-in‐
120       tensive portions.
121
122       ncap(1), ncap2(1), ncatted(1), ncbo(1), ncclimo(1), nces(1), ncecat(1),
123       ncflint(1),  ncks(1), nco(1), ncpdq(1), ncra(1), ncrcat(1), ncremap(1),
124       ncrename(1), ncwa(1)
125
126

HOMEPAGE

128       The NCO homepage at <http://nco.sf.net> contains more information.
129
130
131
132                                                                   NCRENAME(1)
Impressum