Skip to content
Prev 304387 / 398503 Next

[netcdfgroup] [ncdf4] error converting GEIA data to netCDF

Pascal Oettli: MERCI BEAUCOUP! (though I would have thanked you
earlier if I hadn't had to dig through the r-help digest first :-)

Tom Roche Mon, 27 Aug 2012 23:31:23 -0400
https://stat.ethz.ch/pipermail/r-help/2012-August/322576.html
* > nc <- nc_open("~/GEIA_N2O_oceanic.nc")
And that appears to have been the problem, since when I

-nc_open(netcdf.fp,
-  write=FALSE,
-  readunlim=TRUE)
+netcdf.file <- nc_open(netcdf.fp,
+  write=FALSE,
+  readunlim=TRUE)

I don't get the error when I subsequently ncvar_get, and the code @

https://github.com/TomRoche/GEIA_to_NetCDF

now works.

Dave Pierce: I assert that the current error is waaay too subtle:

- I don't get an error when I nc_open without assigning.

- I don't get an error when I ncvar_put to that file's datavar.

- I only get an error when I ncvar_get from the datavar.

- Nothing about the error text (IMHO) would lead one to the fix.

(Note also that neither ncvar_put or nc_close appear to require
assignment, which is probably what made me think I could nc_open
without assignment.)

Can ncdf4 be made to fail more helpfully? E.g., to fail immediately on
nc_open without assignment?

thanks again! Tom Roche <Tom_Roche at pobox.com>