I am releasing few Matlab
pre- and post-processing scripts for ROMS. These scripts are well documented. Notice that each sub-directory has their own Contents.m
which briefly describe each m-file
within. It is highly recommended for you to use the provided startup.m
or modify your starting workspaced script and include these paths so Matlab
can find them.
Currently, the matlab
) have the following sub-directory structure:
matlab/ Main repository directorySome Remarks:
/bathymetry Bathymetry extracting tools
/coastlines Coastline extracting tools
/landmask ROMS Land/Sea mask tools and GUIs
/seagrid/ Charles Denham grid generation GUI
/@seagrid SeaGrid internal utility functions
/test_data SeaGrid test data
/seawater Phillip Morgan (CSIRO) SeaWater library
/utility Generic pre- and post-processing library
/startup.m Workspace configuration script
- To check-out the files from the matlab repository (latest version), enter (notice https instead of http):
svn checkout https://www.myroms.org/svn/src/matlab MyDir
svn checkout --username joe_roms https://www.myroms.org/svn/src/matlab MyDir
- The script utility/depths.m is the official Matlab script to compute ROMS depths for any 3D-variable. I highly recommend to you to use this script. Recall, that the depths (z_r and z_w) in ROMS change at each time step because of its dependency on the time-varying free-surface. See WikiROMS description of ROMS Vertical S-coordinate.
- The script utility/scoord.m can be used to select the optimal set of vertical stretching parameters, vertical transformation equation, and vertical stretching function for a particular applications. See WikiROMS for more details. This script was used to produce the plots shown in this wiki page.
- The NetCDF interface to Matlab is via the MEXNC developed by John Evans. MEXNC is a mex-file interface very similar to the NetCDF C-library. John Evans developed a very clever design (starting with version 2.9.1) for this interface. It performs a series of internal checks to either use Matlab native interface (available in version R2008b) or the MEXNC library. MEXNC It is possible to compile MEXNC to support both NetCDF-3 and NetCDF4/HDF5 type files.
- It is possible to build an OpenDAP enabled MEXNC. There are notes online here. Unfortunately, you won't be able read NetCDF4/HDF5 files though. We are investigating whether MEXNC can be modified to use the NetCDF-Java library for reading OpenDAP URLs.
Mark Hadfield remind me that there is an experimental version of OpenDAP in the latest version of the NetCDF4 library. It has the ncdump/ncgen utilility that can read files from an OpenDAP server and read/write NetCDF-4 files. He also adds:
The only problem, a fairly big one, is that the OpenDAP interface is written in C++, which means that programs (like MEXNC, Fortran programs, etc) that use this library must be linked with the C++ linker. This just isn't worth the bother to me, so I haven't tried to link to it with ROMS. However the netCDF developers plan to reqrite the OpenDAP code in C for version 4.1. I don't know when they plan to release 4.1, but it won't be soon.