[CDO] chname: change variable name

Let’s go,

 

<1> prepare any netcdf file.

if you don’t have any, follow the “ferret” script (if you installed this program.).

$ ferret -nojnl

yes? use coads_climatology

yse? save/file=yi_sst.nc SST

yes? quit

캡처

 

<2> check variable name by ncdump

$ ncdump -h yi_sst.nc

you can find that the style of its variable is an uppercase.

캡처

<3> change variable name, “SST” to “new_sst” using CDO

$ cdo chname,SST,new_sst yi_sst.nc yi_sst_2.nc

캡처

Cool?

 

So, Simple 🙂

 

also, you can change multiple variables in once by using CDO~!

cdo chname,u_gr_p,U,precip_g,RAINNC,latitude,lat temp_j1.nc temp_j2.nc

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s