Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NetCDF: Unknown file format"

298 views
Skip to first unread message

Jonathan W Smith

unread,
Feb 2, 2011, 5:32:03 PM2/2/11
to
I wrote a netcdf file with the following .m script but unable to open the file. The error follows the script:

script:

ncid = netcdf.create('wrflightningchemi_d01','NC_FORMAT_CLASSIC');

timedimID = netcdf.defDim(ncid, 'Time', 1009);

time_stringdimID = netcdf.defDim(ncid, 'DateStrLen', 19);

londimID = netcdf.defDim(ncid,'west_east', 332);

latdimID = netcdf.defDim(ncid,'south_north', 165);

etadimID = netcdf.defDim(ncid,'bottom_top', 28);

lnoxID = netcdf.defVar(ncid,'lnox','float',londimID);


error:
??? Error using ==> netcdflib
Unable to open netCDF file, library error message "NetCDF: Unknown
file format"

Error in ==> open at 54
[varargout{:}] = netcdflib ( 'open', filename, mode );


NETCDF version 3.6.2 is installed on the Linux machine I am using.

Any ideas?

Thanks,
Jonathan

Jonathan W Smith

unread,
Feb 3, 2011, 9:20:09 AM2/3/11
to
"Jonathan W Smith" wrote in message <iicm13$k8g$1...@fred.mathworks.com>...


Hello,

Do I need an additional folder besides the netcdf_toolbox in the MATLAB path in order for netcdf files to be in the correct format?

I am using version 2009a.

Jonathan

TideMan

unread,
Feb 3, 2011, 2:23:20 PM2/3/11
to
On Feb 4, 3:20 am, "Jonathan W Smith" <jwsmi...@gmail.com> wrote:
> "Jonathan W Smith" wrote in message <iicm13$k8...@fred.mathworks.com>...

I don't have this version of Matlab, but in my version (2006a) that
uses mexCDF, I get a similar somewhat cryptic message if the filename
is wrong.

You can check the validity of the file outside of Matlab using
ncdump(filename).


Jonathan W Smith

unread,
Feb 3, 2011, 3:09:04 PM2/3/11
to
TideMan <mul...@gmail.com> wrote in message <0ad2ffca-f308-4806...@8g2000prt.googlegroups.com>...

Hello,

When I issue the command: ncdump(wrflightningchemi_d01)
this error follows
??? Undefined function or variable 'wrflightningchemi_d01'.

With this I get command
ncdump('wrflightningchemi_d01')

This error follows:
??? Undefined function or method 'ncdump' for input arguments of type 'char'.

When I issue the command outside of matlab:

ncdump wrflightningchemi_d01
ncdump: wrflightningchemi_d01: NetCDF: Unknown file format

The wrflightningchemi_d01 file was created in matlab.

All other netcdf files I have created outside of matlab can be read by matlab and opened with ncdump.

Any ideas from anyone would be helpful

Thanks,
Jonathan

Ashish Uthama

unread,
Feb 3, 2011, 4:08:34 PM2/3/11
to
A shot, could you try: 'CLOBBER' instead of 'NC_FORMAT_CLASSIC'

Jonathan W Smith

unread,
Feb 3, 2011, 6:40:10 PM2/3/11
to
Ashish Uthama <first...@mathworks.com> wrote in message <iif5gi$92e$1...@fred.mathworks.com>...

> A shot, could you try: 'CLOBBER' instead of 'NC_FORMAT_CLASSIC'

The file has to be closed to be completely written and formatted.

netcdf.close(ncid)

Jonathan

0 new messages