MexNC, NetCDF and Matlab?

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
bberx
Posts: 9
Joined: Thu Oct 11, 2007 1:33 pm
Location: Marine Scotland - Science

MexNC, NetCDF and Matlab?

#1 Post by bberx » Thu Mar 27, 2008 1:32 pm

Hi,

I was just wondering if anyone has any tips to get matlab to make netcdf files on version 7.0.0 R14? I have tried mexnc, but keep getting the same error:

Code: Select all

Mex file entry point is missing.  Please check the (case-sensitive) 
spelling of mexFunction (for C MEX-files), or the (case-insensitive) 
spelling of MEXFUNCTION (for FORTRAN MEX-files).
??? Invalid MEX-file 'C:\mexnc\win32\netcdf.dll': The specified module could not be found.

.

Error in ==> seagrid2roms at 142
Before I just extracted my results from the netcdf files using octave as it has a built in netcdf functionality which worked. I realised at the time it was probably not my best solution, but so far it is the only one I managed to get to work. Now though, seagrid2roms doesn't work in octave, so I am proper stuck.

When I try to test my mexnc installation it doesn't work either, although it is included in my system path and matlab path. Also, from their install information it seems win32 is not a very well supported option. Could someone maybe point me in a good direction?

I realise my questions are very basic and related to OS and IT skills, but I'm very new to having to do my own sysadmin, let alone doing it under Windows. Also I don't really have support from an IT department and no one else I work with does this type of work (or has even heard of netcdf). So I thought the ROMS community might be able to point me in a new direction as I keep going round in circles.

Thanks in advance for your help,
Bee

rsignell
Posts: 123
Joined: Fri Apr 25, 2003 9:22 pm
Location: USGS

#2 Post by rsignell » Fri Mar 28, 2008 1:00 am

seagrid2roms uses the NetCDF Toolbox, which in turn uses mexnc. It works fine on win32 with any version of matlab, but you need to get the right mexnc mex file. Then you just need:
  • The mex file in a directory that is in your Matlab path
    The netcdf.dll in a directory that is in your Windows system path
    The NetCDF toolbox directories (netcdf, netcdf\nctype, and netcdf\ncutility) in your Matlab path

bberx
Posts: 9
Joined: Thu Oct 11, 2007 1:33 pm
Location: Marine Scotland - Science

#3 Post by bberx » Fri Mar 28, 2008 10:12 am

Thank you very much for this. I managed to get it working now. I was confused about the different tools and libraries and their locations, but now it is all good.

Bee

Post Reply