Re: deleting a variable from a netcdf file

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 10 Apr 2008 07:38:59 -0600

To my knowledge, the answer is "no".

If you have the netCDF operators available, you can use ncrcat
or ncks with the -x and -v option to copy the file excluding the
variable [ "var" ]

     ncrcat -v var -x in.nc out.nc

If you want to create some new variable, (say) VAR, then you
could use NCL to create "VAR", on a new netCDF file [NEW.nc]
and then append [add] it to the 'old.nc' file.

      ncrcat -C -A NEW.nc out.nc

Good luck.

ozan mert gokturk wrote:
> Hi All,
>
> I would like to change a variable in a NetCDF file
> completely (dimensions etc.)
>
> Is it possible to delete a variable from a NetCDF
> file, first by opening the file with
>
> f = addfile("filename.nc","w")
>
> and then doing something like
>
> delete(f->var)
>
> when "var" is an existing variable?
>
> Thanks in advance
>
> --Ozan
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 10 2008 - 07:38:59 MDT

This archive was generated by hypermail 2.2.0 : Fri Apr 11 2008 - 11:01:25 MDT