Monterey Bay Aquarium Research Institute
Edward T. Peltzer
How it is done: Using Excel®

Oceanographic Calculations

Please note: These files are in text format. To use with Excel® you will need to change the filename extension from txt to bas. Then they can be loaded as modules in the Visual Basic Editor. Use the <Alt+F11> key to start the Visual Basic Editor followed by <Ctrl+M> to import the file into the worksheet.

  • VB-scripts adapted from the MATLAB® scripts that I have written:
    Text Filename            Function Name        Calculation
SwDensity.txtDENSITY(S,T)  Density of seawater for a given S & T at 1 atm total pressure.  
STP2Dens.txtDENSATP(S,T,P)  Density of seawater at a given S, T & P-hydrostatic (dbar).  
N2sat_v1.txtN2SAT(S,T)  Nitrogen saturation as a function of S & T from Weiss (1970).  
N2sat_v2.txtN2SAT_V2(S,T)  Nitrogen saturation as a function of S & T from H & E (2004).
Cond2Sal.txtSAL(CON,T,P)  Salinity (pss) of seawater from CONductivity (S/m), T & P.  
SbeC2Sal.txtSBE(CON,T,P)  Salinity (pss) of seawater from CONductivity (mS/cm), T & P.  

  • VB-scripts adapted from the MATLAB® scripts that I have collected and modified/optimized for use on a PC:  (see note below)
    Text Filename                Function Name            Calculation
Adiabat.txtADIABAT(S,T,P)  Computes the adiabatic temperature gradient.  
DLat2Prs.txtPRESS(D,LAT)  Pressure given the depth at some latitude.  
PLat2Dep.txtDEPTH(P,LAT)  Depth given the pressure at some latitude.  
Potentmp.txtPOTENTMP(S,T0,P0,PR)  Potential temperature from in-situ measurements.  
  Requires adiabat.  
  • Note: These algorithms were originally part of the oceanography toolbox [v1.4] compiled by R. Pawlowicz @ WHOI.
Last updated: May 18, 2009
Questions? Comments? Please contact Edward Peltzer.