Re: How to change global attributes in a netCDF file

From: Kate Hedstrom <kate_at_nyahnyahspammersnyahnyah>
Date: Tue, 7 Mar 2006 13:19:10 -0900

On Tue, Mar 07, 2006 at 03:09:07PM -0700, Yongxin Zhang wrote:
> Hello,
> I need to make changes in START_DATE in my netCDF file and then
> write back to this file. Specifically, I need to do the following:
> Change from:
> :START_DATE = "2005-05-01_00:00:00"
> to:
> :START_DATE = "2005-06-01_00:00:00"
> Please let me know how I can do this or where I can find an
> example to do this.

I would do this with the NCO package, which contains ncatted:

% ncatted -h
ncatted [-a ...] [-D dbg_lvl] [-h] [-l path] [-O] [-o] [-p path] [-R] [-r] [[]]

-a, --attribute att_nm,var_nm,mode,att_typ,att_val Attribute specification:
                        mode = a,c,d,m,o and att_typ = f,d,l,s,c,b
-D, --dbg_lvl, --debug-level dbg_lvl Debugging level
-h, --hst, --history Do not append to "history" global attribute
-l, --lcl, --local path Local storage path for remotely-retrieved files
-o, --output, --fl_out fl_out Output file name (or use last positional argument)
-O, --ovr, --overwrite Overwrite existing output file, if any
-p, --pth, --path path Path prefix for all input filenames
-R, --rtn, --retain Retain remotely-retrieved files after use
-r, --revision, --vrs, --version Program version and copyright
notice Input file name(s)
[] Output file name (or use -o switch)
Where to find more help on ncatted and/or NCO:
1. User's Guide/Reference Manual:
2. On-line reference manual for ncatted:
3. UNIX man page: 'man ncatted'
4. Known problems:
5. Help Forum:
Post questions, suggestions, patches at

Kate Hedström       Arctic Region Supercomputing Center       University of Alaska, Fairbanks
Phone: 907-450-8678
ncl-talk mailing list
Received on Tue Mar 07 2006 - 15:19:10 MST

This archive was generated by hypermail 2.2.0 : Tue Mar 07 2006 - 16:44:45 MST