f



NCDF_OPEN: Unable to open the file "(null)". (NC_ERROR=-31)

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


0
Therese
1/14/2014 9:07:52 AM
comp.lang.idl-pvwave 12260 articles. 4 followers. Post Follow

1 Replies
5034 Views

Similar Articles

[PageSpeed] 41

Okay,
it was really silly. Problem is solved: filelist[ii] was no expression but an array[1]. Just saved the filename in tmp=filelist[ii] and then opened the file by id=ncdf_open(tmp[0]) ...
0
therese
1/14/2014 9:25:32 AM
Reply: