egion6  

 

SWCO2 is a computer program for computing the equilibrium composition of seawater under specified conditions of temperature, salinity and pressure using any 2 of the normal CO2 system parameters: total dissolved CO2 (CT), total alkalinity (AT), pH (free, total or seawater H+ scales), CO2 fugacity f(CO2) or the concentrations of the individual species H2CO3, HCO3- or CO32-. The program computes the values of all the system parameters, including equilibrium constants, using an internal database for the latter. A choice of different sets of H2CO3 acid dissociation constants K1 and K2 is provided. Also calculated are a number of useful parameters such as the degree of saturation Ω for calcite and aragonite.

This is an upgrade of the SWCO2 program posted several years ago. The code has been completely re-written, and scrupulously checked against CO2SYS written by Ernie Lewis and Doug Wallace. The output results of the two programs are now identical within numerical roundoff error.

SWCO2 version 2 is supplied as a Windows dynamic link library (DLL) which provides the calculation engine for computing CO2 speciation. This will allow simple extensions and upgrading of the software in the future. It also means that all applications share the same calculation engine.

The package includes CO2Calc.EXE, a small Windows programme that calculates the composition of a single solution given appropriate input information. This is useful for small jobs and also for learning what the package is capable of doing. However, most users will use the Excel interface. This is supplied as an Excel addin XLCO2_V2.XLA, together with an example workbook XLCO2_V2.XLA. This provides a Visual Basic interface to the DLL and a number of useful user-defined functions for calculating CO2 species composition.

The programming interface for the DLL is described in the supplied documentation, allowing users to write their own interface functions involving any application that can interface with a standard DLL, for example Microsoft Office applications, Visual Basic, Visual C++, Borland Delphi or MatLab.

Click here to download the SWCO2 package (standard .ZIP file).

Copyright Notice

The use of this application is released into the public domain under the following conditions:

  1. Users may make use of the software for any purpose, provided that due acknowledgement of the author is made in any scientific publication or article, educational document or instruction manual for which it has been used.
  2. The software may be freely distributed by any means, provided that no charge is made other than a reasonable charge for the cost of media involved.
  3. The copyright of this application and its source code remains vested with the author, Keith A Hunter.
  4. The author accepts no responsibility, expressed or implicit, for any damage or loss of earnings that may arise through use of the software or results calculated using the software.
 
Site Created and Maintained by Kath McGilbert
Last Modified: 12 February, 2009
All contents © Department of Chemistry, University of Otago