help-octave
[Top][All Lists]
Advanced

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

How to append new variables to existing netcdf?


From: zs1992
Subject: How to append new variables to existing netcdf?
Date: Tue, 29 Oct 2019 07:21:24 -0500 (CDT)

Hi everyone, I'm using Octave 5.1 and I'd like to do the following: Create a
netcdf with plenty of variables. If new variables are founded in the future,
append them to existing netcdf.variables.

I created a netcdf with ncwriteschema('mynetcdf.nc',Var), where known
variables are stored in Var.variables. Now I have come across a new
variable, and I've stored it in a new group NewVar.Variables. I tried to do
ncwriteschema('mynetcdf.nc',NewVar), but it failed with a message "error,
netcdf, File exist && NC_noclobber".

I noticed that there's not other input argument for 'ncwriteschema',
therefore I can't define nc mode as clobber with this command. So I did the
following:
ncid=netcdf_create('mynetcdf','CLOBBER');
netcdf_reDef(ncid);
ncwriteschema('mynetcdf',Var);
This time, another error popped up, saying 'error, netcdf, operation not
allowed in define mode'.

Now I'm out of options. Is there any way to append new variables to exising
netcdf file?



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]