Matlab routines for the Ocean Scientist (1.2) --------------------------------------- This directory contains a number of Matlab routines that may be useful for anyone dealing with the ocean. Many of the routines have been converted from existing fortran routines, but have been changed to allow the passing of vectors and matrices in the usual Matlab style. Loops have been avoided as much as possible in favour of vectorization. All routines have been made into .m files rather than fmex/cmex files because the fmex/cmex interface is crummy - You can't get help information, argument passing is obscure, and it is messy. Currently available functions: adiabattempgrad : adiabatic temperature gradient (used by potentialtemp, bvfreq, and soundspeed) bvfreq : Bouyancy (Brunt-Vaisala) frequency coasts.mat : Coastline database for map (1 degree resolution). depth : Depth given pressure at some latitude dist : Range/bearing of points on the earth using various ellipsoids (wsg84, clarke66, etc.). Can also compute points along geodesics. geodesics : A fun demo for map and dist map : Draws a map of the world (uses the coasts.mat datafile) potentialtemp : Potential temperature (also used by bvfreq) pressure : Pressure at given depth at some latitude soundspeed : Speed of sound using various standard equations (del grosso, chen and millero, etc.) stickplot : Standard stickplot graph for vector time series (illustrates a handy "feature" of Matlab). swcp : Heat capacity for sea water swfreezetemp : Freezing point of sea water swstate : Equation of state for sea water (returns density and specific volume anomalies or derivatives of same w.r.t. S,T,P). Also used by bvfreq and soundspeed. tsdiagram : Draws a TS diagram, with density contours and freezing point (will not work properly in Matlab V4.0). whoi : Draws the WHOI logo in the bottom corner of a plot whoilogo.mat : Bitmap info for WHOI logo. Feel free to (ab)use these routines. If you find any bugs, please tell me. Likewise if you have "improved" the routines. Installation Notes ------------------ When ftp'ing the files, don't forget to set binary mode to get the whoilogo.mat and coasts.mat files! The easiest thing to do is to copy everything into ~/matlab. On the other hand, a more permanent home may be underneath /usr/local/matlab/toolbox/oceans. If you put them there, change MATLABPATH (either in the matlab script or in .login). Changes since Version 1.0 -------------------------- -swstate.m can now also compute first derivatives w.r.t to S,T,P. -soundspeed.m can now also compute ssp using a direct evaluation of derivatives of the equation of state. Changes since Version 1.1 ------------------------- -geodesics computations in dist. -world map program and coastline database added. -demo program "geodesics" added. -tsdiagram...another little demo (which may even be useful). -whoi logo program (for that professional look!) Rich Pawlowicz - Woods Hole Oceanographic Institution rich@boreas.whoi.edu (508) 540-1400 x3316