Difference between revisions of "MEXNC"

From WikiROMS
Jump to navigationJump to search
Line 6: Line 6:
You have to download the MEXNC version that matches BOTH, your specific Matlab version and your operating system.
You have to download the MEXNC version that matches BOTH, your specific Matlab version and your operating system.


* First determine what Matlab version you have by typing on the Matlab command line:<div class="box"><span class="red">version('-release') </span></div><br><br>
(1) First determine what Matlab version you have by typing on the Matlab command line:<div class="box"><span class="red">version('-release') </span></div><br><br>


* Then, go to the [http://mexcdf.sourceforge.net/downloads/ download] area, scroll down and <span style="color:red">click</span> on your Matlab version (verify that you operating system is listed as an option).<br><br>
(2) Then, go to the [http://mexcdf.sourceforge.net/downloads/ download] area, scroll down and <span style="color:red">click</span> on your Matlab version (verify that you operating system is listed as an option).<br><br>


* Download the latest release<br><br>
(3) Download the latest release<br><br>


* Extract (i.e. unzip or unpack) the file in a location where it can stay indefinitely<br><br>
(4) Extract (i.e. unzip or unpack) the file in a location where it can stay indefinitely<br><br>


* In Matlab, add the path of your recently extracted mexnc directory. To do this...
(5) In Matlab, add the path of your recently extracted mexnc directory. To do this...
# Click on <span style="color:red"> File > Set Path...</span> (a GUI will pop-up)
* Click on <span style="color:red"> File > Set Path...</span> (a GUI will pop-up)
# Click on the <span style="color:red"> Add with Subfolders...</span> button, and add the path to your new mexnc folder
* Click on the <span style="color:red"> Add with Subfolders...</span> button, and add the path to your new mexnc folder
# Click on the <span style="color:red">Save</span> button, and close the GUI<br><br>
* Click on the <span style="color:red">Save</span> button, and close the GUI<br><br>


* If you are using WINDOWS operating system (I don't know if other too), you will have to add the netcdf.dll file to your Matlab system directory. To do this...
(6) If you are using WINDOWS operating system (I don't know if other too), you will have to add the netcdf.dll file to your Matlab system directory. To do this...
# Go to your recently extracted mexnc directory and go inside the win32 folder...
* Go to your recently extracted mexnc directory and go inside the win32 folder...
# Copy the <span style="color:red">netcdf.dll</span> file and PASTE it in on (or both) or the following directories:<div class="box"><span class="red">C:\MATLAB\bin <br><br><span class="black">and/or</span><br><br><span class="red">C:\MATLAB\bin\win32</span></div>
* Copy the <span style="color:red">netcdf.dll</span> file and PASTE it in on (or both) or the following directories:<div class="box"><span class="red">C:\MATLAB\bin <br><br><span class="black">and/or</span><br><br><span class="red">C:\MATLAB\bin\win32</span></div>
::{{warning}} <small>In the example above, <span class="red">C:\MATLAB</span> is the location where matlab is located, but this '''may be different''' in your computer.</small>
:{{warning}} <small>In the example above, <span class="red">C:\MATLAB</span> is the location where matlab is located, but this '''may be different''' in your computer.</small><br><br>
# Add the path to the directory(ies) above (i.e. C:\MATLAB\bin and C:\MATLAB\bin\win32) to  
* Similarly as in (5), add the path to the directory(ies) above (i.e. <span class="red">C:\MATLAB\bin</span> and <span class="red">C:\MATLAB\bin\win32</span>) to the Matlab search path.
<br><br>
::{{note}} <small>NOTE: In some cases, it will be important to have <span class="red">C:\MATLAB\bin</span> and <span class="red">C:\MATLAB\bin\win32</span> at the '''TOP''' of the searching path.</small>
* Done! However, you may need have to download SNCTOOLS and the matlab tool-kit to be fully operational... read below.


*
=How to install SNCTOOLS?=
# Go to the [http://sourceforge.net/project/showfiles.php?group_id=119464&package_id=130914 download] page and get the latest release.
# Extract the file in a location where it can stay indefinitely
# Similarly as in (5), add the path to the recently extracted directory to the Matlab search path.
 
=How to install ROMS Matlab tool-kit?=
# Go to the [http://www.myroms.org/index.php?page=Processing download] page and get the latest release.
# Extract the file in a location where it can stay indefinitely
# Similarly as in (5), add the path to the recently extracted directory to the Matlab search path.

Revision as of 17:42, 11 April 2008

MEXNC is a mex-file interface to NetCDF files for MATLAB. In simple terms, it is a set of files (mex and .m files) that allows Matlab to read and write NetCDF files, which are the standard input and output files of ROMS.

HERE is a link to the MEXNC project page.

How to install MEXNC?

You have to download the MEXNC version that matches BOTH, your specific Matlab version and your operating system.

(1) First determine what Matlab version you have by typing on the Matlab command line:

version('-release')



(2) Then, go to the download area, scroll down and click on your Matlab version (verify that you operating system is listed as an option).

(3) Download the latest release

(4) Extract (i.e. unzip or unpack) the file in a location where it can stay indefinitely

(5) In Matlab, add the path of your recently extracted mexnc directory. To do this...

  • Click on File > Set Path... (a GUI will pop-up)
  • Click on the Add with Subfolders... button, and add the path to your new mexnc folder
  • Click on the Save button, and close the GUI

(6) If you are using WINDOWS operating system (I don't know if other too), you will have to add the netcdf.dll file to your Matlab system directory. To do this...

  • Go to your recently extracted mexnc directory and go inside the win32 folder...
  • Copy the netcdf.dll file and PASTE it in on (or both) or the following directories:
    C:\MATLAB\bin

    and/or

    C:\MATLAB\bin\win32
Warning In the example above, C:\MATLAB is the location where matlab is located, but this may be different in your computer.

  • Similarly as in (5), add the path to the directory(ies) above (i.e. C:\MATLAB\bin and C:\MATLAB\bin\win32) to the Matlab search path.
Note NOTE: In some cases, it will be important to have C:\MATLAB\bin and C:\MATLAB\bin\win32 at the TOP of the searching path.
  • Done! However, you may need have to download SNCTOOLS and the matlab tool-kit to be fully operational... read below.

How to install SNCTOOLS?

  1. Go to the download page and get the latest release.
  2. Extract the file in a location where it can stay indefinitely
  3. Similarly as in (5), add the path to the recently extracted directory to the Matlab search path.

How to install ROMS Matlab tool-kit?

  1. Go to the download page and get the latest release.
  2. Extract the file in a location where it can stay indefinitely
  3. Similarly as in (5), add the path to the recently extracted directory to the Matlab search path.