[Thread Prev][Thread Next][Index]

Re: [ferret_users] rename the variable



Hi Muyin,

On Thu, Jul 2, 2020 at 9:03 AM Muyin Wang - NOAA Affiliate <muyin.wang@xxxxxxxx> wrote:

I download the air temperature from ERA5 reanalysis. But unfortunately, the
variable name for Tair is named as "T". Then if I do
sh grid T
I got the following information, which apparently are wrong. How do I change the variable names once for all?

With a little Ferret script, you can do that.  You'll find examples in our mailing list archive.

Having said that, I would use the "ncrename" command from the NCO package.  Probably

ncrename -d T,Tair input.nc

or something along the lines.  This will overwrite the original file.  You loop over your files as

for file in *.nc; do
    ncrename -d T,Tair "$file"
done

on your shell command line.

Cheers,
Ryo


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement