[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing type of a variable



> Organization: NOAA / CDC
> Keywords: 199412021800.AA00704

Cathy,

> Russ- I don't mind if the file gets rewritten,as long as I don't have
> to copy each and every variable and attribute to the new file myself.
> It's fairly easy to add variables, add attribute values (even ones with
> increased lengths)because all you have to do is write a few lines of code.
> But- it seems to change a variable type, you have to have very,very long code
> that essentailly creates a new file. this is what I want to avoid.
> 
> Is there any kludge to get around this?

One possibility, if you don't have lots of files to change and the file is
not too huge, would be to use ncdump to convert the file to an ASCII CDL
file, edit the resulting file to change the type of the variable, and then
use "ncgen -b" to convert the result back to a netCDF file.

--
Russ Rew                                                UCAR Unidata Program
address@hidden                                          P.O. Box 3000
http://www.unidata.ucar.edu/                          Boulder, CO 80307-3000