NCDF_OPEN: Unable to open the file "(null)". (NC_ERROR=-31) [message #87173] |
Tue, 14 January 2014 01:07  |
Therese
Messages: 5 Registered: May 2013
|
Junior Member |
|
|
Hey all,
I'm trying to open netCDF-files I created by myself. In idl I have a list which contains the filenames but when I try to open the netCDF with one of those list elements it does not work:
NCDF_OPEN: Unable to open the file "(null)". (NC_ERROR=-31)
The specific file exists and is readable. The funny thing is when I just type the name of the file into the ncdf_open routine idl is able to open my file.
I'm using netcdf library version 4.2 on IDL Version 6.4 (linux x86_64 m64).
+++ short example start +++
filelist=findfile("MODIS*.nc") ; n_elements(filelist) > 0
id=ncdf_open(filelist[ii]) ; error occurs
ncdf_varget,id,0,lat
ncdf_close,id
id=ncdf_open('MODIS_GRID_h05v13.nc') ; works
ncdf_varget,id,0,lat
ncdf_close,id
+++ short example end +++
I often need to open and close those files so unfortunately typing by hand is no option...
Probably, it's a very silly problem with a simple solution but I can't get it. Please help!
Best,
Therese
|
|
|
|