You are on page 1of 51

About this Macro

INFORMATION
(click in the box to make the vertical scroll bar appear)
The code for this Macro was taken directly from Ernie Lewis' "CO2SYS.BAS" Basic Program. (See the "INFO" sheet in the macro for contact information).

What it Does &

From two known CO2 parameters (TA, TCO2, pH, pCO2 or fCO2), the program will calculate the other 3,as well as other quantities such as Omega, Revelle Factor, Carbonate species concentrations &(referred to as "Auxiliary Data" in the macro).The quantities can calculated at 2 different sets of T and P conditions

What it Doesn't do &

Unlike CO2Sys.BAS, this macro does not calculate the sensitivity of the output on the input(referred to as "Partials" in the original program).

HOW TO RUN THE CO2Sys MACRO.

In Sheet "INFO": -- You can select which section of the program you want information on by selecting the appropriate option from the top drop-down list. The information will be listed in the text box below. + Chr$(13) -- Single click on the text box to make the vertical scroll bar appear and scroll down the text.

In Sheet "INPUT": -- Select the set of CO2 constants you want to use for the calculations -- Select the KHSO4 -- Select the pH scale of your data.

In Sheet "Data": -- If copying from another Excel file, it is suggested to only paste the VALUES in the cells. -- Input your data in the appropriate columns for Salinity, Temperature (oC) and Pressure (dbars). Total Si and Total P (in mol/kg SW) are optional. -- Input the CO2 parameters in their respective columns. If more than two are entered, the FIRST TWO from the left will be used. You may use different sets of parameters in different rows. -- Set the output conditions at which you want your results. -- Click the red "Start" Button located on the top left part of the "Data" sheet. -- Calculations will stop when an entire row of data (columns "A" to "L") is empty. -- You can either clear your data (columns "A" to "L") or clear the results (columns "L" to the end) by clicking on the appropriate button located on top of the column "M" in this sheet.

After the program starts: -- You will be asked if you entered your data properly &this gives you a chance to cancel your action. -- You will be asked if you want to calculate the "Auxiliary Data". This corresponds to Omega, Revelle Factor &etc &any column right of the pCO2 column in both the

Set of Constants KHSO4 pH Scale

K1, K2 from Mehrbach et al, 1973 refit by Dickson and Millero, 1987

Dickson

Seawater scale (mol/kg-SW)

Millero, 1987

START

START

START

START

START

START

START

START

START

START

STAR

INPUT CONDITIONS
Salinity 40.000 40.000 40.000 t(oC) 25.00 25.00 25.00 Total P Total Si P (dbars) (mol/kgSW (mol/kgSW ) ) 10 10 10 0.032 0.032 0.032 0.679 0.679 0.679

OUTPUT CONDITIONS
t(oC) 25 25 25 P (dbars) 10 10 10

RT

START

START

START

START

START

START

START

DATA (leave empty if no data)


TA TCO2 (mol/kgSW (mol/kgSW ) ) 2300 8.47 8.68 pH (Chosen Scale) 8.148 8.129 8.321 fCO2 (atm)

Clear pCO2 Data (atm)

SCALES and CONSTANTS


DO NOT MODIFY...THE PROGRAM WILL DO IT!

<--pH Scale:
Constants: KSO4 Source:

Clear Results --->

ALES and CONSTANTS

RESULTS (Input Conditions)


Salinity 40 40 40 t(oC) in 25 25 25 Total P Total Si P (dbars) in (mol/kgSW (mol/kgSW) ) 10 10 10 0.03 0.03 0.03 0.68 0.68 0.68

DO NOT MODIFY...THE ROGRAM WILL DO IT! Seawater scale (mol/kg-SW) K1, K2 from Mehrbach et al, 1973 refit by Dickson Dickson and Millero, 1987

TCO2 in TA in (mol/kgSW (mol/kgSW) ) 2772.3 147.0 198.1 2300.0 8.5 8.7

pH in 8.148 8.129 8.321

fCO2 in (atm) 332.5 1.3 0.8

pCO2 in (atm) 333.5 1.3 0.8

CO3 in HCO3 in (mol/kgSW (mol/kgSW) ) 1951.2 7.2 6.9 339.6 1.2 1.8

CO2 in B Alk in OH in P Alk in Si Alk in (mol/kgSW (mol/kgSW (mol/kgSW (mol/kgSW Revelle in (mol/kgSW) ) ) ) ) 9.2 0.0 0.0 132.4 128.3 173.6 9.4 9.0 14.0 0.0 0.0 0.0 0.0 0.0 0.1 8.400 0.974 0.972

Ca in 7.81 0.03 0.04

RESULTS (Output Conditions)


Ar in 5.17 0.02 0.03 xCO2 in (dry at 1 atm) (ppm) 344.0 1.3 0.8 t(oC) out 25.000 25.000 25.000 P (dbars) out 10.0 10.0 10.0 pH out 8.148 8.129 8.321 fCO2 out pCO2 out (atm) (atm) 332.5 1.3 0.8 333.5 1.3 0.8

HCO3 out B Alk out CO3 out CO2 out OH out P Alk out (mol/kgSW (mol/kgSW (mol/kgSW) (mol/kgSW) (mol/kgSW) (mol/kgSW) ) ) 1951.2 7.2 6.9 339.6 1.2 1.8 9.2 0.0 0.0 132.4 128.3 173.6 9.4 9.0 14.0 0.0 0.0 0.0

Si Alk out xCO2 out (dry (mol/kgSW Revelle out Ca out Ar out at 1 atm) (ppm) ) 0.0 0.0 0.1 8.400 0.974 0.972 7.81 0.03 0.04 5.17 0.02 0.03 344.0 1.3 0.8

SubFlag

You might also like