Home
User's Guide to Model for Aquatic Chemical Speciation Software
Contents
1. Scientific Excellence Resource Protection 8 Conservation Benefits for Canadians Excellence scientifique Protection et conservation des ressources B n fices aux Canadiens User s Guide to Model for Aquatic Chemical Speciation Software Package MACS80 Version 5 1990 and MS DOS edition R Wagemann and G Regehr Arctic Red Department of Fisheries and Oceans Winnipeg Manitoba R3T 2N6 1992 Canadian Technical Report of Fisheries and Aquatic 1848 Fisheries P ches 1 1 and Oceans Oc ans Canadian Technical Report of Fisheries and Aquatic Sciences Technical reports contain scientific and technical information that contributes to existing knowledge but which is not normally appropriate for primary literature Technical reports are directed primarily toward a worldwide audience and have an international distribution No restriction is placed on subject matter and the series reflects the broad interests and policies of the Department of Fisheries and Oceans namely fisheries and aquatic sciences Technical reports may be cited as full publications The correct citation appears above the abstract of each report Each report is abstracted in Aquatic Sciences and Fisheries Abstracts and indexed in the Department s annual index to scientific and technical publications Numbers 1 456 in this series were issued as Technical Reports of the Fisheries Research Board of
2. input and default parameters ALPHAC GAMMA values INSPEC controls TDIC flag pCO value and K ALPHA ratios NWMTLS Specified metal solids K ALPHA ratios NWANIN Specified anion solids pCO controls TDIC flag and K ALPHA ratios SPCALC pH K ALPHA ratios anion and metal concentrations and number of pH points for which the system has been successfully evaluated OUTPUT Report flags ALPHA GAMMA species concentrations anion and metal conversion tables calculated total dissolved anions and metals and the pH points successfully evaluated SETDAT None WDEFNS K ALPHA GAMMA values Wxxx Number of pH points successfully evaluated pH values evaluated equilibrium and total dissolved concentrations of species and conversion factors as well as calculated total dissolved xxx WHEAD date current page number and input title WFOOT number The date and current page 8 3 PROCESSING The algorithm solves positive root reiteratively polynomial equations for each free anion and metal ion in the system and then uses these to calculate the various species The coefficients of the polynomial are comprised of the products and ratios of the equilibrium constants of all the species that contain the anion or metal in question The variable in the polynomial is the concentration of the free anion or metal The constant part of the equation is the inputted total d
3. negative concentration or the concentration of a particular species is approaching zero then the concentration 15 set to 0 When the computation is completed the program prints out the reports requested 2 0 FILE INFORMATION 2 1 PROGRAM FILE The directory MACS contains the file MACS80 EXE which is executable program file The source file exists as MACS80 FOR Updating of the source can be done through the VAX editor EVE or any other compatible ASCII editor The source must then be recompiled and linked to generate a new executable program The program 15 executed under VMS entering the command RUN MACS80 or under DOS by entering MACS80 after entering data into the input file MACS80 INPUT or MACS80 INP see Table 1 which must be present in the MACS directory 4 Table 1 Data input MACS80 INPUT or MACS80 INP TITLE LAKE 382 AT EP July 18 1991 RUN 20C 20 0 2 000350 CONTROLS IC T IONIC STRENGTH 0 0036 CONDUCTIVITY 24 0 pH RANGE MIN 4 5 8 1 0 2 pH SPECIFIC SEDIMENT CD CONSTANT 3 18660D 9 10 1 1593 PH OUTPUT UNITS MOLES L MG L CONCENTRATION F F LOG CONC F F DEFINITIONS F Table 1 continued ANION and METAL parameters O2UTPUT FILE gt MACS lt ID gt R20C lt A SULFATE 2 3 3 A EDTA 3 0 4 0 A INORGANIC CARBON 5 9 1 5 CHLORIDE 6 0 3 ORGANIC CARBON 7 7 2066 SELENITE 8 204 SILICATE 9
4. 0 527 10 0 112 ORTHO PHOSPHATE 20 3 12 0 SULFIDE 13 0 00 2 SEDIMENT 14 2 0 FLUORIDE 15 0 0 M SODIUM 1 0 95 M MAGNESIUM 2 0 66 M CALCIUM 3 2 11 M 4 0 040 M MERCURYQ 5 0 M MERCURY I 6 1 5 M CADMIUM 7 104 M COPPER 8 2 3 M IRON 9 0 M MANGANESE M 10 0 01 MG L M ZINC 11 1 5D 3 M POTASSIUM 12 0 44 M COBALT 13 0 M ALUMINIUM 14 00 00 00 MOLES L MG L MG L MG L MG L MG L MG L MG L MG L MG L MG L MG L 8 8 2 2 8 8 8 8 8 8 8 8 5 8 8 MG L MG L MG L MG L MG L 8 8 8 8 8 8 8 MG L FILENAME gt lt gt lt gt lt gt lt gt lt gt lt gt lt gt lt gt lt lt gt lt gt lt gt SED lt gt lt gt lt gt lt gt lt gt lt gt lt gt lt gt lt CU lt gt lt gt lt gt lt gt lt gt lt gt lt 2 2 DATA INPUT FILE The input file Table 1 is called MACS80 INPUT MACSSO INP under DOS and can be edited directly using any ASCII editor 2 2 1 Input procedure ification Data input is done through the separate input MACS80 INPUT or MACS80 INP containing system parameters and options for units and reports The layout of the input file Table 1 is inflexible and the data must be typed in
5. 00 F AMMONIA 7 99600D 06 1 12000D 01 00 F ORTHO PHOSPHATE 6 77988D 06 2 10000D 01 00 F ACETATE eee 0 000000 00 0 00000D 00 00 F SULFIDE SIS 6 23752D 08 2 00000D 03 00 F e SEDIMENT 2 00000D 00 2 00000D 00 00 F FLUORIDE 0 00000D 00 0 00000D 00 00 F SODIUM 050 255 se Sieg it 5 219660 04 1 20000D 01 00 F MAGNESIUM 3 08490D 04 7 50000D 00 00 F CALCIUM 3 043910 04 1 22000D 01 00 F IRONQI 1 25342D 07 7 00000D 03 00 F 0 00000D 00 0 00000D 00 00 F 4 98529D 11 1 00000D 05 00 F CADMIUM 8 89680D 10 1 00000 04 00 F COPPER 2250 550 sun ES 7 869060 09 5 00000 04 00 T CURUNO IRON ID ikea se ee 2 68591D 07 1 50000D 02 00 F MANGANESE I 8 00903D 08 4 40000D 03 00 F ZINC 7 49465D 09 4 90000D 04 00 F POTASSIUM 3 58075D 05 1 40000D 00 00 F COBALT 0 00000D 00 0 00000D 00 00 F ALUMINUM 7 41235D 07 2 00000D 02 00 F NOTE T D MEANS TOTAL DISSOLVED NOTE ALL MOLES L AND MG L VALUES ARE CONCENTRATIONS AS OPPOSED TO ACTIVITIES CONCENTRATION WAS 0 OR THE SPECIES CONCENTRATION WAS APPROACHING 0 NOTE A CONCENTRATION OF 0 CAN MEAN EITHER THE T D PAGE 2 11 12 1991 DEPARTMENT OF FI
6. 11 0 REFERENCES MANOV G G R G BATES W J HAMER and S F ACREE 1943 Values of the constants in the Debye H ckel equation for activity coefficients J Am Chem Soc 65 1765 1767 PONNAMPERUMA F N E M TIANCO nd T A LOY 1966 Ionic strength of solutions of flooded soils and other natural aqueous solutions from specific conductance Soil Sci 102 408 413 SMITH R M and A E MARTELL 1976 ritical stability constants Volume 4 Inorganic complexes Plenum Press New York NY xiii 257 p WAGEMANN R G REGEHR and R 1990 Compiler listing for chemical speciation program MACS80 VERS 4 1 for Microsoft Fortran Version 5 for MS DOS Can Data Rep Fish Aquat Sci 818 x 190 p 21 APPENDIX I Parameters and Options Format of Input File All records have one field in common the command field The command field starts in column 1 ends in column 24 and contains character data 1 TITLE 25 48 character 2 Temperature 25 10 3 2 25 10 numeric CONTROLS TDIC 53 1 1 1 1 4 Ionic Strength 25 10 numeric 5 Conductivity 25 10 numeric 6 pH Range MAX 25 6 numeric MIN 36 6 numeric INC 47 6 numeric 7 pH Specific 25 6 Output Units 9 Moles 1 25 1 logical Mg l 32 1 logical 22 APPENDIX I continued Parameters and Options Format of Input File Output Units Cont d Line Field Name Length Data Type 10 Log moles l 25 1 logical Log mg l 3
7. 1788D 18 1 5134D 17 6 4891D 17 2 5065D 16 8 7939D 16 2 83730 15 6 99640 14 1 58330 12 4 9231D 06 3 9293D 12 4 89520 06 9 65740 12 4 84320 06 2 3310D 11 4 74840 06 5 44150 11 4 5781D 06 1 1969D 10 4 28450 06 2 38650 10 3 81760 06 4 1153D 10 3 16340 06 5 88570 10 2 38720 06 6 8271D 10 1 62230 06 6 42670 10 9 93230 07 4 99150 10 5 52330 07 3 27840 10 2 82450 07 4 3613D 11 2 52960 08 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 00000 00 0 0000D 00 NOTE ALL MOLES L AND MG L VALUES ARE CONCENTRATIONS AS OPPOSED TO ACTIVITIES CONCENTRATION WAS 0 OR THE SPECIES CONCENTRATION WAS APPROACHING 0 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 6 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 00000 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 NOTE A CONCENTRATION OF 0 CAN MEAN EITHER THE T D PAGE 5 11 12 1991 5 00 5 20 5 40 5 60 5 80 6 00 6 20 6 40 6 60 6 80 7 00 7 20 7 40 8 01 NOTE T D MEANS TOTAL DISSOLVED DEPARTMENT OF FISHERIES amp OCEANS WESTERN REGION STANDARD RIVER WATER TEST DATA CuNTA Cu NTA 2 4 CuOHN
8. 7692D 03 2 84020 02 3 5253D 05 1 39060 06 7 8149D 08 7 20 1 1841D 02 1 3031D 01 1 6967D 00 1 6464D 03 2 5865D 02 2 9877D 03 3 0263D 02 3 31380 05 8 2477D 07 1 24190 07 7 40 1 9582D 02 1 3597D 01 1 1171D 00 2 7204D 03 2 6965D 02 4 9356D 03 3 1544D 02 2 8024D 05 4 4008D 07 1 73690 07 8 01 8 4090D 02 1 4333D 01 2 8904D 01 1 1639D 02 2 8321D 02 2 1078D 02 3 3068D 02 1 0774D 05 4 15330 08 2 8675D 07 NOTE T D MEANS TOTAL DISSOLVED NOTE ALL MOLES L AND MG L VALUES ARE CONCENTRATIONS AS OPPOSED TO ACTIVITIES NOTE CONCENTRATION OF 0 CAN MEAN EITHER THE T D CONCENTRATION WAS 0 OR THE SPECIES CONCENTRATION WAS APPROACHING 0 PAGE 3 11 12 1991 pH 5 00 5 20 5 40 5 60 5 80 6 00 6 20 6 40 6 60 6 80 7 00 7 20 7 40 8 01 DEPARTMENT OF FISHERIES amp OCEANS WESTERN REGION STANDARD RIVER WATER TEST DATA INORGANIC CARBON SYSTEM IN IN TERMS OF CARBON SOLID AICO3 2 65370 06 6 43990 05 4 09120 06 7 02800 05 6 21370 06 6 65290 05 9 22740 06 5 58840 05 1 3300D 05 4 20860 05 1 8431D 05 2 84780 05 2 43620 05 1 7351D 05 3 05670 05 9 56940 06 3 6419D 05 4 82010 06 4 14180 05 2 24270 06 4 53370 05 9 74840 07 4 82010 05 3 99210 07 5 01780 05 1 54670 07 5 26640 05 6 03090 09 1 47830 01 1 47920 01 1 4802D 01 1 4800D 01 1 4800D 01 1 4800D 01 1 4800D 01 1 4800D 01 1 4800D 01 1 4800D 01 1 4800D 01 1 4800D 01 1 4800D 01
9. Canada Numbers 457 714 were issued as Department of the Environment Fisheries and Marine Service Research and Development Directorate Technical Reports Numbers 715 924 were issued as Department of Fisheries and the Environment Fisheries and Marine Service Technical Reports The current series name was changed with report number 925 Technical reports are produced regionally but are numbered nationally Requests for individual reports will be filled by the issuing establishment listed on the front cover and title page Out of stock reports will be supplied for a fee by commercial agents Rapport technique canadien des sciences halieutiques et aquatiques Les rapports techniques contiennent des renseignements scientifiques et techni ques qui constituent une contribution aux connaissances actuelles mais qui ne sont pas normalement appropri s pour la publication dans un journal scientifique Les rapports techniques sont destin s essentiellement un public international et ils sont distribu s cet chelon 1 n y a aucune restriction quant au sujet de fait la s rie refl te la vaste gamme des int r ts et des politiques du minist re des P ches et des Oc ans c est dire les sciences halieutiques et aquatiques Les rapports techniques peuvent tre cit s comme des publications compl tes Le titre exact para t au dessus du r sum de chaque rapport Les rapports techniques sont r sum s dans la revue R sum s des sciences aquat
10. calculated into the constant would be entered into SPSUM 3 4 The equation for the species FeHEDTA containing two ions of anion 3 and two of metal 4 would be entered into SPSUM 3 4 5 A pictorial presentation of SPSUM array is given in APPENDIX When two species same index into SPSUM e g CuCO3 and CuHCO3 the entry should be the sum of the equations for the two species The species with only an anion and hydrogen ion are stored in HSP if the anion is linear term and in HSPQ if the anion is quadratic term species containing only hydrogen and cubic term are included in the 5 analysis For the purposes of discussion here hydroxide ion is considered anion 1 even though its concentration is calculated instead of being entered so no special arrays are used for this anion INSPEC subroutine 3 The conversion factor for the ion mg mole will have to be added to CONVTA anion or metal The sizes of these arrays must be increased as necessary Mainline 4 new species can then be added to the output routines of existing anions and metals as described in section 10 4 5 The new species report for the new anions and metals can also be added to the system as described in section 10 5 6 If there any new solids they can be added as described in section 10 2 7 The K ALPHA and GAMMA values must then be added to the defini
11. en outre quelques l ments l intention des programmateurs sur la fa on d largir le programme de mani re incorporer un nombre accru de m taux et d anions Mots cl s programmes d ordinateur algorithmes d termination d esp ces chimiques eau douce cadmium 10 ACKNOWLEDGMENTS AND OVERVIEW The 80 speciation program has an extensive history of development becoming through necessity larger and more complex at each stage We sincerely thank Messrs D Abrams W Elliot M Judd D Bayomi and R Lypka for their programming contributions at various stages of development We particularly thank Mr D Abrams who was the first to undertake the programming task and Mr D Costin Head of the Freshwater Institute Computer Section at that time for their cooperation and generosity with their time We also thank Ms P V Cassidy for typing One of us G Regehr adapted modified and enhanced the program for use on a MICRO VAX II computer as well as microcomputers under MS DOS 1 1 OVERVIEW This manual is intended only to facilitate the use of the program explain its various options and provide brief description of the algorithm The source code for the program has been published separately Wagemann et al 1990 The data base used by this program will be published as a separate compilation of equilibrium constants with their sources and the corresponding chemical equations However the user can obt
12. file MACS80 INPUT or MACS80 INP for the microcomputer set of chemical and physical parameter values which defines the aquatic system All parameters must be specified in this input file If total dissolved concentration of an anion or metal is not specified it is set to zero by default and the calculation proceeds on that basis No seed values or guessed starting values need be entered to start the calculation The program itself generates the appropriate starting values for all the variables If there is an error on input in the parameter sets the system is not analyzed nor are any reports printed The program prints out an error message and stops If there are no errors in the set of input parameters the program proceeds to analyze the system The species concentrations calculated equilibrium conditions are assumed by the solution of the polynomial equations by iteration between the anion metal mass balance equations and utilizing the initial inputs of total concentrations of anions and metals and the physical input parameters defining the aquatic system The program calculates the concentration of each species at each pH increment specified pH range For the actual processing of the analysis see section 8 3 If the calculations do not converge after 100 reiterations the analysis is stopped no reports are written for this pH value and an error message is written If there are no positive roots i e
13. 0D 00 0 0000D 00 0 0000D 00 5 0000D 04 6 40 1 0769D 12 6 95320 18 0 00000 00 0 0000D 00 0 0000 00 0 0000 00 5 0000 04 6 60 2 0379D 12 2 0838D 17 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 5 0000D 04 6 80 3 4700 12 5 6164D 17 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 5 0000D 04 7 00 5 3149D 12 1 3607D 16 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 5 0000D 04 7 20 7 3776 12 2 98430 16 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 5 0000D 04 7 40 9 3836D 12 5 98650 16 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 5 0000D 04 8 01 1 2872D 11 3 21450 15 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 5 0000D 04 NOTE T D MEANS TOTAL DISSOLVED NOTE ALL MOLES L AND MG L VALUES ARE CONCENTRATIONS AS OPPOSED TO ACTIVITIES CONCENTRATION WAS 0 OR THE SPECIES CONCENTRATION WAS APPROACHING 0 CHEMICAL METHODOLOGY R WAGEMANN NOTE CONCENTRATION OF 0 EITHER THE 7
14. 1 4800D 01 NOTE T D MEANS TOTAL DISSOLVED NOTE ALL MOLES L AND MG L VALUES ARE CONCENTRATIONS AS OPPOSED TO ACTIVITIES CONCENTRATION WAS 0 OR THE SPECIES CONCENTRATION WAS APPROACHING 0 CHEMICAL METHODOLOGY R WAGEMANN 8 NOTE CONCENTRATION OF 0 THE PAGE 4 11 12 1991 DEPARTMENT OF FISHERIES amp WESTERN REGION STANDARD RIVER WATER TEST DATA COPPER SYSTEM IN MG L IN TERMS SOLID CHEMICAL METHODOLOGY R WAGEMANN pH Cu 2 CuOH Cu OH 2 0 Cu OH 3C Cu OH 4 2 Cu2 0H 2 2 CuSO4 0 CuEDTA C2 CuHEDTA CuOHEDTA 3 5 00 4 90730 04 8 2055D 07 7 96490 08 6 4490D 16 5 20 4 8778 04 1 2927D 06 1 9887D 07 2 5519 15 5 40 4 8250D 04 2 0265D 06 4 9412D 07 1 0049D 14 5 60 4 7298D 04 3 1485D 06 1 2167D 06 3 9218D 14 5 80 4 5596D 04 4 8104D 06 2 9462D 06 1 5051D 13 6 00 4 2668D 04 7 1345D 06 6 9253D 06 5 6072D 13 6 20 3 8015D 04 1 0074D 05 1 5498D 05 1 9888D 12 6 40 3 1497D 04 1 32290 05 3 22560 05 6 5602D 12 6 60 2 3766D 04 1 5821D 05 6 1136D 05 1 9707D 11 6 80 1 6150D 04 1 7039D 05 1 0436D 04 5 3313D 11 7 00 9 88690 05 1 65320 05 1 6047D 04 1 2993D 10 7 20 5 49770 05 1 4569D 05 2 24140 04 2 8763D 10 7 40 2 8112D 05 1 1807D 05 2 8789D 04 5 8552D 10 8 01 2 5170D 06 4 3066D 06 4 2777D 04 3 54420 09 NOTE MEANS TOTAL DISSOLVED 1 2441D 23 7 8024D 23 4 8696D 22 3 0119D 21 1 8320D 20 1 0817D 19 6 0807D 19 3
15. 2 1 logical 11 1 5 1 25 1 logical mg l 32 1 logical 12 Definitions 25 logical 13 Output file 18 4 character Output file ID 33 4 character 14 Species type 1 1 character Species number 25 2 Concentration 30 10 Units 45 2 character Solid number 50 2 Species report 60 1 logical Data file name 66 4 character Note The titles under field name are only a description of the fields APPENDIX II 23 Listing of Anions and Metals Name Hydroxide Sulfate EDTA NTA Inorganic carbon Chloride Organic carbon Selenite Silicate Ammonia Ortho phosphate Acetate Sulfide Suspended sediment Flouride 10 11 12 13 14 Name Sodium Magnesium Calcium Iron Mercury 1 Mercury Cadmium Copper Iron 11 Manganese Zinc Potassium Cobalt Aluminum 24 APPENDIX Illustration of SPSUM Array METAL 25 APPENDIX System Flowcharts 26 MAINLINE INITCM ALPHAC SYSTEM OUTPUT 27 Init Counter Flags and Report Tags Read System Parameters Read data for Anion or Metal RETURN 28 SYSTEM 7 7 6 76x10 Assign PH the inputed minimum value Assign A 7 its saved value INSPEC Analysis errors occurred Equilbrium reached NWMTLS SPCALC Increment pH 29 NWMTLS Get first metal Err
16. 5 3787D 08 6 8046D 12 2 9909D 08 3 7837D 12 1 5294D 08 1 9348D 12 1 3693D 09 1 7323D 13 NOTE ALL MOLES L AND MG L VALUES ARE CONCENTRATIONS AS OPPOSED TO ACTIVITIES CONCENTRATION WAS 0 OR THE SPECIES CONCENTRATION WAS APPROACHING 0 CHEMICAL METHODOLOGY R WAGEMANN CuA2 CuNH3 42 6 18050 07 2 3345D 09 1 1707D 06 3 6775D 09 2 1470D 06 5 7651D 09 3 8000D 06 8 9560D 09 6 4538D 06 1 3682D 08 1 0408D 05 2 0288D 08 Or 1 5677D 05 2 8638D 08 2 1602D 05 3 7588D 08 2 6737D 05 4 4917D 08 2 9464D 05 4 8316D 08 2 8979D 05 4 6786D 08 2 5691D 05 4 1104D 08 2 0816D 05 3 3149D 08 7 3877D 06 1 1617D 08 NOTE A CONCENTRATION OF 0 CAN MEAN EITHER THE T D PAGE 6 11 12 1991 DEPARTMENT FISHERIES amp OCEANS WESTERN REGION STANDARD RIVER WATER TEST DATA COPPER SYSTEM IN MG L IN TERMS OF COPPER SOLID pH Cu NH3 2 2 Cu NH3 3 2 CuAc CuAc2 0 SSCu CuF T D Cu 5 00 2 6660 15 6 8618D 22 0 00000 00 0 0000D 00 0 0000D 00 0 0000D 00 5 0000D 04 5 20 6 6561D 15 2 7151D 21 0 0000 00 0 0000D 00 0 0000D 00 0 0000D 00 5 0000D 04 5 40 1 6537D 14 1 0690 20 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 5 0000D 04 5 60 4 0712D 14 4 1709D 20 0 0000D 00 0 00000 00 0 0000D 00 0 0000D 00 5 0000D 04 5 80 9 8559D 14 1 6001D 19 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 5 0000D 04 6 00 2 3158D 13 5 95760 19 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 5 0000D 04 6 20 5 1794D 13 2 1111D 18 0 0000D 00 0 000
17. 80 Version 5 1990 VAX and MS DOS 3rd edition Can Tech Rep Fish Aquat Sci 1848 iv 41 The manual is guide to running the 80 chemical speciation program program calculates the equilibrium concentration of chemical species as function of pH in fresh water aquatic systems from the given total dissolved concentration of metals and anions either in the presence or absence of one or more of over sixty solids takes into account fifteen anions and fourteen metals commonly found in fresh waters including the interaction of metals Cu Cd with humic dissolved substances and the adsorption of cadmium on suspended particulate matter The program provides the option of performing these calculations on closed or open system with respect to atmospheric carbon dioxide step by step description of the various input requirements and output options is given program calculate results at different temperatures The manual provides an overview of the algorithm including flow charts and explains the process of how results are calculated their precision and dependence on temperature in terms of equilibrium constants and activity coefficients The manual also provides some guidance to programmers on how to expand the program to encompass larger number of metals and anions Key words computer programs algorithms chemical speciation fresh water cadmium iv R SUM Wagemann R and G Reg
18. AL TO THE SYSTEM 1 Assign the species number if it is an anion and or number if it is metal If there is no more room in the or MTL array increment its size and assign the variable 5 or NMVALS the new size If the array is incremented then increase the number of rows of SPSUM to this size Also increase the arrays HSP and HSP2 to this size If the MTL array is incremented then increase the number of columns of SPSUM to this size Mainline of program 2 Place the equation to calculate the constants of the mass balance equation in the array SPSUM 3 dimensional array see Appendix The first dimension 15 indexed by the anion the second dimension is indexed by the metal and the third is indexed by the exponents of the anion and metal concentrations in the mass balance equation If the species contains 1 of the metal and 1 of the anion use index 1 1 of the metal 2 of anion use index 2 1 of the metal and 3 of the anion use index 3 2 of the metal and 1 of the anion use index 4 2 of the metal and 2 of the anion use index 5 2 of the metal and 3 of the anion use index 6 3 of the metal and 1 of the anion use index 7 3 of the metal and 2 of the anion use index 8 3 of the metal and 3 of the anion use index 9 18 As an example the equation for the species FeHEDTA containing one ion of anion 3 and one ion of metal 4 the H is determined by pH and is
19. D field are non blank a separate file will be generated for each selected unit The file name is created by combining the entries from these two fields and adding the extension DA followed by a code number of 1 to 6 to specify the units reported 1 M 2 logM 3 M 4 mg L 5 log mg L 6 mg L The file names are created automatically including the extension from the entries in the respective fields Note that all plotting files may be suppressed by setting the FILE ID field to blank even if some FILENAME fields are filled The plotting file will not be paged as the main data file is but may be up to 400 characters wide The file will contain one record listing the column headings for the report intended to help identify the contents of the file followed by the data records as listed in the main output file 4 0 ERROR PROCESSING AND MESSAGES To keep error processing under complete program control the program checks for two types of errors input errors and calculation errors As records are input the program checks for errors and issues 12 messages to indicate where and why records are invalid When an error is detected an error report is produced listing the invalid records along with the appropriate error messages Processing of the data set is then aborted Although the frequency of calculation errors is much less than that for input errors a number of checks are nevertheless made Such check
20. D IC the given value is ignored and the program uses the specified total dissolved inorganic carbon concentration entered under INORGANIC CARBON The pCO value must be entered in units of atmospheres in the example in Table 1 0 00035 3 5x10 Atm 4 IONIC STRENGTH Parameter This parameter defines the ionic strength of the aquatic system moles L and is used to calculate activity coefficients If in addition the CONDUCTIVITY parameter is also specified the program will use the given ionic strength and will omit the calculation of ionic strength from conductivity 5 CONDUCTIVITY Parameter This parameter defines the conductivity of the system in terms of uSiemens cm and is used to calculate the ionic strength if the latter is not specified If the ionic strength is specified this parameter is ignored 6 pH RANGE Parameters These specify the pH range over which species calculations at each pH increment are to be performed The range is given by minimum maximum and pH increment values and be adjusted automatically by the program if the size of the range is not divisible by the increment Up to 41 pH increments may be accommodated within any given range i e pHMIN pHINC I lt 41 Note If the minimum value is specified the maximum value and increment must also be specified and vice versa 7 pH SPECIFIC Parameter By specifying this parameter and omitting specifyin
21. ENDENCE IONIC STRENGTH FROM CONDUCTIVITY PROGRAM INFORMATION 2 2 2 9 9 c c f 8 1 Narrative on function 8 4 Output of Routines 9 0 9 1 Quadratic coefficient test 9 2 Cubic coefficient test 10 0 11 0 9 9 of routines 8 3 Processing eee ee ee eee EQUATION COEFFICIENT SIGNIFICANCE TESTS PROGRAM UPDATING 10 1 Adding an anion or metal to the system 10 2 Adding a solid to the system 10 3 Adding an input parameter 10 4 Adding chemical species to output routines 10 5 Adding a chemical report to the system REFERENCES 4 4 9 9 9 9 ss ss 11 12 12 13 13 13 iii Table Page 1 Data input file MACS80 INPUT MACS80 INP 4 1 continued ANION and METAL parameter 5 2 Listing of solids and their numbers 9 LIST OF APPENDICES Appendix Page I Parameters and options format of input file 21 II Listing of anions and metals 23 Isometric illustration of SPSUM 2 21 a Dies em 24 IV System flow charts 25 Sample run of MACS80 34 LIST OF TABLES ABSTRACT Wagemann R and Regehr 1992 User s guide to model for aquatic chemical speciation software package MACS
22. SHERIES 4 OCEANS WESTERN REGION CHEMICAL METHODOLOGY R WAGEMANN STANDARD RIVER WATER TEST DATA INORGANIC CARBON SYSTEM IN MG L IN TERMS OF CARBON SOLID pH CO3 2 HCO3 H2CO3X0 MgCO3 0 MgHCO3 CaCO3 0 CaHCO3 CuCO3 CuHCO3 Cu CO3 2 2 5 00 3 9166D 06 6 8311D 01 1 4097D 01 5 4933D 07 1 3678D 03 9 9786D 07 1 6019D 03 9 7840D 08 3 85940 07 1 21280 13 5 20 9 5840D 06 1 0547D 00 1 3733D 01 1 3439D 06 2 1114D 03 2 4412D 06 2 4727D 03 2 3798D 07 5 92300 07 7 2187 13 5 40 2 3122D 05 1 6055D 00 1 3190D 01 3 2412D 06 3 2129D 03 5 8873D 06 3 7626D 03 5 6791D 07 8 91840 07 4 15600 12 5 60 5 45910 05 2 3917D 00 1 23980 01 7 6492D 06 4 7841D 03 1 3893D 05 5 6023D 03 1 3144D 06 1 30240 06 2 2710D 11 5 80 1 2524D 04 3 4620D 00 1 1323D 01 1 7537D 05 6 9205D 03 3 18490 05 8 1034D 03 2 9069D 06 1 8173D 06 1 1522 10 6 00 2 7658D 04 4 8239D 00 9 9547D 00 3 8697D 05 9 6352D 03 7 0269D 05 1 1281D 02 6 0074D 06 2 36970 06 5 2586 10 LE 6 20 5 8307D 04 6 4166D 00 8 3548D 00 8 1499D 05 1 2804D 02 1 4797D 04 1 4989D 02 1 1283D 0S 2 8083D 06 2 0822D 09 6 40 1 1672D 03 8 1048D 00 6 6584D 00 1 6297D 04 1 6155D 02 2 9586D 04 1 8909D 02 1 8715D 05 2 9390D 06 6 9139D 09 6 60 2 2181D 03 9 7176D 00 5 0372D 00 3 0935D 04 1 9348D 02 5 6153D 04 2 2644D 02 2 6835D 05 2 65900 06 1 88390 08 6 80 4 0198D 03 1 1112D 01 3 6343D 00 5 6002D 04 2 2100D 02 1 0165D 03 2 5863D 02 3 3049D 05 2 0662D 06 4 20480 08 7 00 7 0042D 03 1 2216D 01 2 52100 00 9 7481D 04 2 4272D 02 1
23. TA 2 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000 00 COPPER SYSTEM IN MG L IN TERMS OF COPPER SOLID 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 0 0000D 00 CuCO3 0 2 2 CuHCO3 CuCK4 12 0 5 1759D 07 1 2589D 06 3 0044D 06 6 9534D 06 1 5378D 05 3 17800 05 5 96900 05 9 90060 05 1 41960 04 1 74840 04 1 86490 04 1 7531D 04 1 4825D 04 5 6997D 05 3 2080D 13 1 90940 12 1 09930 11 6 00710 11 3 0478D 10 1 3909 09 5 50770 09 1 82880 08 4 98310 08 1 11220 07 2 0671D 07 3 2849D 07 4 5941D 07 7 5848D 07 2 0417D 06 3 1334D 06 4 7180D 06 6 8897D 06 9 6139D 06 1 2536D 05 1 4856D 05 1 5548D 05 1 4066D 05 1 0930D 05 7 3563D 06 4 3632D 06 2 3281D 06 2 1971D 07 2 6697D 07 3 3774D 11 2 6536D 07 3 3571D 11 2 6249D 07 3 3207D 11 2 5731D 07 3 2552D 11 2 4805D 07 3 1381D 11 2 3212D 07 2 93660 11 2 0681D 07 2 6163D 11 1 7135D 07 2 1677D 11 1 2929D 07 1 6357D 11 8 7861D 08 1 1115D 11
24. ain a hard copy of the equilibrium constants and activity coefficients used by the program as explained later see section 2 2 2 10 The equations used in this program and referred to in this manual can be found in any physical chemistry text The equilibrium constants used by this program have been obtained whenever possible from a critically assessed compendium of constants Smith and Martell 1976 To verify the validity of the calculations as such a published standard river water data set was used as the input and the calculated results were compared with the published results from 14 other well known speciation programs using the same input Jenne 1979 The results obtained by this program were comparable to those obtained by the other programs that had the temperature variation option as this programs has Nevertheless there are numerous modelling pitfalls which can be more or less severe depending on the type of aquatic system being analysed and the specific aim of these calculations The user must have some knowledge of physical chemistry to be able to properly assess the significance insignificance of the shortcomings of chemical modelling in general in relation to the particular aquatic system being analysed in particular and in relation to the specific goals under consideration The ease of use of the program cannot absolve the user from excercising enlightened caution the interpretation of results based on
25. alcomenite 33 MgSeO 34 Mg HSiO 35 Mn OH 36 MnCO 37 5 pink 38 green Table 2 Cont d Solid Number Chemical Formula Mineral Name 39 MnSeO 40 Zn OH 41 ZnO 42 ZnCO 43 Zn PO 2 4H 0 44 ZnS 45 CaSiO 46 Hg CO 47 Fe PO 2H 0 48 Hg HPO 49 Hg SO 50 Hg Cl 51 52 Fe OH 53 FejO 54 CoCO 55 56 57 5 58 AI OH Gibbsite 59 Al OH Amorphous 60 61 AIH PO OH 62 63 2 2 3 Specifying input values The input file contains all data required to specify the system to be analysed Data is read from the file by position so the user in editting the data should not re arrange the file Certain features are present in the file to aid in this In the first half of the file most data values begin in column 25 In the latter portion of the file headings and titles are provided in order to remind the user where data must reside In few cases the 5 and lt symbols are used to mark the locations of fields In order to avoid moving data fields it is recommended that the input file be editted in overstrike mode It is also recommended that a backup copy of the original file be kept in case the working copy is damaged beyond repair The only instance where records may be deleted or rearranged is in the specification of anions and metals Table 1 These records are recognized by the progra
26. anion involved in such a complex The coefficient of the linear term is similarly defined except that the summation includes only mono nuclear complexes of copper The processing begins by calculating the coefficients of the metal equations as described above and solving the metal equation for the free metal concentrations The initial metal ion concentration estimate is obtained from the metal mass balance polynomials containing initially only known anion concentrations defined by the hydroxide ion and in the case of a system open to the atmosphere carbonate ion Once the initial free metal ion concentration estimates been calculated the coefficients of the anion equations are calculated and the free anion concentrations are estimated These in turn are used to calculate new more accurate free metal ion concentrations This iteration process continues between the anion and metal ion polynomials see APPENDIX until the free metal concentrations change by less than 0 01 Each chemical species concentration is then simply calculated using the appropriate equilibrium constant activity coefficients and the free ion concentrations For example the concentration of the species CuCO and Cu CO would then be calculated as shown CuCO Cu Ka 18 CO and Cu CO3 Cu Ka 19 CO where Ka 18 and Ka 19 are the respective equilibrium constant for these species with the activity coefficien
27. ation is held constant The species concentrations calculated in the presence of as many solids as are specified but the same solid cannot be entered at the same time under both the cation and the anion positions since this would make the system indeterminate A species report for any particular metal or anion is obtained by entering a for true on the appropriate line in the REPORT column Table 1 The species report may also be output to a separate text file as input for a plotting program by filling in the filename parameter in the FILENAME column consisting of at most 3 characters The 4 characters at most entered in the ID field make up the rest of the file name See section 3 for a description of reports available 9 Table 2 Listing of solids and their numbers Solid Number Chemical Formula Mineral Name 1 Cd OH 2 CuO Tenorite 3 Cu OH 4 Cu SO OH Brochantite 5 MgCa CQ Dolomite 6 CaCo Calcite 7 4 8 9 Cu CO OH Malachite 10 Cu CO OH Azurite 11 Cu CL OH Atacamite 12 Mgs PO OH 14 8 15 Mg PO H 16 Ca PO OH 17 CaHPO 18 19 20 Cd PO 21 22 CdS 23 CuS Covellite 24 FeS Mackinawite 25 Fe OH 26 8 Vivianite 27 Siderite 28 HgO Montroydite 29 red Cinnabar 30 black Metacinnabar 31 5 32 CuSeO 2H 0 Ch
28. centration each for either moles l or mg l units depending on which of the six options are selected by placing for true in the required position 10 DEFINITIONS Option Setting this option to true will cause the program to print report of the numerical values of the equilibrium constants activity coefficients y coefficients values and solid numbers which identify the type of solid 11 ANION and METAL Parameters These parameters represent the concentration moles litre or mg L of total anions and metals in the aquatic system which must be specified Table 1 and are used to calculate the concentrations of the various free ions and complexes Also various solids in equilibrium with solution may be specified here under the SOLID column as number see Table 2 which then determines the free metal or anion concentrations in solution in equilibrium with each solid When SOLID two digit number is entered after the anion of that solid the total anion concentration in solution is allowed to vary as function of pH i e the system is open with respect to that anion and the corresponding metal concentration is held constant over the entire pH range When the SOLID number is entered after the metal of that solid that total metal concentration in solution is allowed to vary with pH in order to maintain equilibrium between solid and solution and metal ion at all pH values and the anion concentr
29. control structure of the routines It shows the routines controlled by each routine MAINLINE INITCM INPUT WPARMS ALPHAC INSPEC NWMTLS NWANIN SPCALC OUTPUT WDEFNS Wxxx WHEAD WFOOT Note Wxxx refers to output routines which are specific to each species e g WSO4 8 1 NARRATIVE FUNCTION OF ROUTINES INITCM Initializes C and M values to calculate K constants INPUT Inputs syntax checks and decodes a set of parameters WPARMS Writes the input parameters report to output file ALPHAC Computes ALPHA values for the current set of parameters INSPEC Initializes the species table and various other values which are dependent upon pH NWMTLS Calculates new concentrations for metals upon each iteration NWANIN Calculates new concentration for anions upon each iteration SPCALC Calculates concentrations of species and total dissolved concentrations in system when equilibrium is reached OUTPUT Calls all output report routines that were requested by the input parameters SETDAT Library routine which assigns current date WDEFNS Writes the constants definition tables to output file Wxxx Writes aqueous xxx species report WHEAD Writes a header at the top of each new page WFOOT Writes a footer and notes at the 14 bottom of each page 8 2 INPUT REQUIREMENTS OF ROUTINES INITCM None INPUT Data file with input parameters WPARMS
30. ehr 1992 User s guide to model for aquatic chemical speciation software package MACS80 Version 5 1990 VAX and MS DOS 3rd edition Can Tech Rep Fish Aquat Sci 1848 iv 41 p Le manuel est un guide d exploitation du programme de d termination des esp ces chimiques MACS80 Ce programme permet le calcul de la concentration l quilibre d esp ces chimiques en fonction du pH dans des syst mes d eau douce partir de la concentration totale en m taux dissous et en anions en pr sence ou non d une ou plusieurs mati res solides parmi soixante Le programme tient compte de quinze anions et quatorze m taux commun ment trouv s en eau douce ainsi que des interactions de m taux Cu Cd avec des substances humiques dissoutes et de l adsorption du cadmium sur les particules en suspension Le programme offre la possibilit d effectuer ces calculs en syst me ferm ou en syst me ouvert avec le gaz carbonique atmosph rique Une description des diff rents param tres d entr e et des options de pr sentation des r sultats est fournie Le programme peut calculer les r sultats diff rentes temp ratures Le manuel donne un aper u de l algorithme notamment avec des graphiques de cheminement et il explique de quelle facon les r sultats sont calcul s indique leur pr cision ainsi que leur d pendance par rapport la temp rature en termes de constantes d quilibre et de coefficients d activit Le manuel fournit
31. er of activity constants to NKVALS and increase the size of KA C M and ALPHA to this value 2 Assign values to the new entries M 7 and 0 Code the equations to calculate the new ALPHA value in subroutine ALPHAC and the new SPSUM value subroutine INSPEC 3 The species concentration should be calculated at each pH in the routine SPCALC and placed in the array indexed by the species number 4 The species concentrations stored in array X should be placed in the appropriate output routines Wxxx i e the metal and anion output routines The appropriate format statements should also be updated to print the chemical formula for the species 5 If the species is an organic carbon species being placed in the organic carbon output routine WOC then it should be divided by another conversion factor The factor is 3 36 10 if there is an and 6 72 x 102 if there is an A 10 5 ADDING A CHEMICAL REPORT TO THE SYSTEM 1 Create an output routine called Wxxx where xxx is the chemical formula of the new chemical 5 CI Cu Write the routine with the same structure as the other output routines Wxxx 2 The species that will be printed out will be the new species added in section 10 4 3 Place a call to this new routine in the OUTPUT routine in the case structure for anions or the case structure for 20 metals depending on whether new species is an anion or metal
32. g the pH range reports can be obtained for single pH value only namely the specified pH pH range is also specified reports will be obtained at each pH increment over the entire pH range followed by the report for the specific pH even if the specific pH value is within the pH range 8 SEDIMENT CD CONSTANT major application of the program pertained to whole lake cadmium experiments where suspended matter was found to scavange much of the added cadmium The partition coefficent for this particular suspended matter and lake water was determined The program takes therefore full account of the interaction between suspended matter and cadmium but does not currently have the same capability with respect to other ions Because the adsorptive capacity of suspended matter for cadmium can vary from system to system and the variation is function of pH suspended matter is hitherto treated in the program individually rather than generally Provision has therefore been made for the user to specify different partition coefficient from that presently in the program together with different constants a and b in the exponential function 10 as shown in the example input Table 1 No other constant can be similarly specified by the user without modification of the source code 9 OUTPUT UNITS Options Reports can be obtained in terms of concentration log of concentration or percentage of total dissolved con
33. in species or elements The program is available in versions compiled under VAX FORTRAN 77 to run on MICRO VAX II and under Microsoft FORTRAN Version 5 to run on MS DOS computers Differences between the two versions are minor consisting mainly of different file naming conventions e g MACS80 INPUT for the VAX and MACS80 INP for MS DOS The source code for the MS DOS version has been published Wagemann et al 1990 Source code and executables for both versions are available from the authors The algorithm of the MACS80 program is based on the equilibrium and mass balance approach resulting in set of polynomial equations The coefficients of the terms in these equations are stored in three dimensional array APPENDIX The coefficients are indexed by the anion metal and the power of the term in the equation i e linear quadratic cubic see sections 8 3 and 10 1 This program is easily expanded by enlarging the array that contains the terms of the coefficients and by adding the necessary equilibrium constants The basic principle underlying this approach is that the chemical equations are expressed for each ion as polynomial and the solutions are provided by the positive roots of the polynomial The program can and does deal with mixed ligand complexes and can calculate the concentration of such mixed ligand species 1 2 NARRATIVE The program starts computing by reading in from separate input
34. ion ax bx c 0 wba b 4ac 2a However when b becomes insignificant compared to 4ac in the equation then the computer cannot solve the equation Similarly when 4 is insignificant compared to b a computational problem 17 arises in gt 1019 An upper limit of 10 on size of the ratio was put in place the term 4 15 considered negligibly small and discarded if this ratio is exceeded 10 9 is used because the calculations are done to 14 significant digits and at least 4 significant figures in the calculations are then assured 9 2 CUBIC COEFFICIENT TEST The solution to the cubic equation bx d 0 is obtained by a method of successive approximations Starting with d c as an estimate of the root the program performs 100 iterations of adding or subtracting small correction to the root The initial correction is d 2c and is divided by 2 on each iteration The process is stopped when the root becomes consistent to one part in 10 000 1 0 01 10 0 PROGRAM UPDATING The program was designed to be expandable in terms of adding new anions and metals new species of existing anions and metals and new solids to the system Such upgrading requires a text editor and a FORTRAN compiler compatible with the source code The following sections describe the places in the program where changes must be made to accomodate additional ions 10 1 ADDING OR MET
35. iques et halieutiques et ils sont class s dans l index annual des publications scientifiques et techniques du Minist re Les num ros 456 de cette s rie ont t publi s titre de rapports techniques de l Office des recherches sur les p cheries du Canada Les num ros 457 714 sont parus titre de rapports techniques de la Direction g n rale de la recherche et du d veloppe ment Service des p ches et de la mer minist re de l Environnement Les num ros 7 15 924 ont t publi s titre de rapports techniques du Service des p ches et de la mer minist re des P ches et de l Environnement Le nom actuel de la s rie a t tabli lors de la parution du num ro 925 Les rapports techniques sont produits l chelon r gional mais num rot s l chelon national Les demandes de rapports seront satisfaites par l tablissement auteur dont le nom figure sur la couverture et la page du titre Les rapports puis s seront fournis contre r tribution par des agents commerciaux Wagemann R 1992 User s guide to model for aquatic chemical speciation software package 580 Version 5 1990 VAX and MS DOS 3rd edition Can Tech Rep Fish Aquat Sci 1848 iv 41 p Page 5 Manganese line columns 2 3 and 4 are misaligned The 10 after Manganese should be in column 2 and 0 01 MG L should be in columns 3 and 4 respectively Page 9 Solid Number 15 the formula
36. issolved concentration of the anion or metal For example the carbonate ion concentration would be obtained from the mass balance equation for total dissolved inorganic carbon TDIC TDIC 1 EL CO 2 Q CO P The coefficient of the quadratic term of this polynomial is K ZQZ M is metal ion involved the formation of metal dicarbonate species K is the corresponding equilibrium constant and is comprised of the products and ratios of the activity coefficients of the ions involved in such a complex The coefficient of the linear term XL is similarly defined as except it involves only mono carbonate 15 species The summation in the quadratic term extends over all di carbonate complexes and in the linear term over all mono carbonate complexes Thus equilibrium constants activity coefficients and either an anion or metal ion of the mono di and tri nuclear species make up the coefficients of the linear quadratic and cubic terms respectively of the polynomial and these are stored in the SPSUM array APPENDIX Similar polynomials represent the mass balance for each metal and anion For example the cupric ion concentration would be calculated from the total dissolved copper mass balance equation TDCu 1 ZD Cu 2 34 The coefficient of the quadratic term is K summation over all di nuclear complexex is any
37. m by the combination of an or in column one together with the code number in columns 25 26 Note that the species name is not read by the program but appears for the user s information only 3 0 REPORTING The following reports may be produced by specifying the report options discussed earlier All reports are written out to text files which may be viewed through an editor or copied to a printer The first three types of reports if requested are combined into one file the name of which is created by combining the entries in the FILENAME and ID fields specified in the input file Table 1 The main output file is formatted to a width of 132 columns and contains control codes for form feed 11 This must be taken into account when file is printed or viewed 1 Model Parameters and Options Report This report is always generated by the program and it lists the various parameters and options that are used to define the current aquatic system 2 Equilibrium Constants Activity Coefficients Report This report lists the numerical values of the equilibrium constants ALPHA values i e the ratio of activity coefficients as they appear the chemical equilibrium equation GAMMA values i e activity coefficients values see section 5 0 used by the program to compute the concentrations involved in the chemical equilibria This report also includes the solids table which lists the c
38. ode number recognized by the program for all solids and the names and formulas of the solids This report 15 generated when the DEFINITIONS value is set to true Table 1 3 Species Report A species report lists the concentrations at each pH increment of all the calculated species in solution of the particular metal or anion specified in the data input file The last column in the report lists the calculated total dissolved value for the anion or metal at each increment analysis has gone properly this number should be the same at each pH increment and be nearly identical to the inputted total dissolved concentration except when the system is open with respect to an anion or metal because of the presence of solid or when the system is open with respect to atmospheric in which case dissolved inorganic carbon will not remain constant as a function of When reports requested in percentage units the species concentrations are always reported as a percentage of the calculated total dissolved concentration at each pH increment One report will be generated for each of the units specified Note that each report may consist of up to three pages in the file 4 ASCII File Report The program can output copies of the species reports to data files which can then be read by external plotting routines The program reads the FILENAME field of each anion or metal If this field and the FILE I
39. or or last metal RETURN TD 0 or 50114 specified Save current concentration of metal Get next metal Calculate Solid metal specified concentration Sum contrib to metal equation Anion gt 30 NWANIN Get second anion Error or last anion RETURN TD 0 or solid specified Save current concentration of anion Get next anion Calculate Solid anion specified concentration Sum contrib to anion equation 31 ROOTS 2 Bx Cx D START R D C RETURN N N lt gt R SQRT D B RETURN N lt gt Computation Limit RETURN N DISC SQRT C 48D 015 gt c Y Rs 015 an DISC 10 28 R D C RETURN 32 ROOTS cont 3 2 Cx D Bx 5 2 gt 5 R CUBEROOT D A ABS Z R lt 001 5 1 gt 5 2 N N lt 100 RETURN N RETURN START Definitions table request Y WDEFNS Get first metal Get first anion Get first units Get first units Get next units Get next units Report Report requested requested Get next anion Get next metal Y RETURN 34 APPENDIX Sample Run of 80 Output 11 12 1991 DEPARTMENT FISHERIES am
40. p WESTERN REGION CHEMICAL METHODOLOGY R WAGEMANN STANDARD RIVER WATER TEST DATA TEMPERATURE 25 000000 DEG C 2 000350 ATM CONTROLS T D IC F IONIC STRENGTH 003600 MOLES L CONDUCTIVITY 000000 UMHOS CM pH RANGE MINIMUM 5 00 MAXIMUM 7 50 INCREMENT 20 pH SPECIFIC 8 01 SEDIMENT CD CONSTANT 5435150D 04 10 5064000 PH OUTPUT OPTIONS UNITS MG L SE TABLES DEFINITIONS OUTPUT FILE MACSRUNO DAT NOTE T D MEANS TOTAL DISSOLVED NOTE ALL MOLES L AND MG L VALUES ARE CONCENTRATIONS AS OPPOSED TO ACTIVITIES NOTE A CONCENTRATION OF 0 CAN MEAN EITHER THE T D CONCENTRATION WAS 0 OR THE SPECIES CONCENTRATION WAS APPROACHING 0 PAGE 1 11 12 1991 DEPARTMENT FISHERIES amp OCEANS WESTERN REGION CHEMICAL METHODOLOGY R WAGEMANN STANDARD RIVER WATER TEST DATA TOTAL DISSOLVED VALUES SOLID SPECIES ASCII MOLES L MG L NUMBER REPORT FILE NAME 8 01522D 05 2 57000D 00 00 F EDTA H r feat 0 00000D 00 0 00000 00 00 NTA 0 00000D 00 0 00000 00 00 F INORGANIC CARBON 1 23220 03 1 48000D 01 00 T ICRUNO CHLORIDE 4 kr 2 79243D 04 9 90000D 00 00 F ORGANIC CARBON 2 08143D 04 2 500000 00 00 F SELENITE 2 53293D 09 2 00000D 04 00 F 5 3 033540 04 8 52000D 00
41. s include ensuring that the roots of quadratic and cubic equations fall within an allowable range e g if a root x should lie between a and b and that the maximum number of iterations is not exceeded in the iterative calculations Reiteration stops when the last calculated species concentration value differs from the previous iteration only by a ratio of 1 X 10 or less for all calculated species Included with each error message is a listing of the values of variables which were involved with the error as well as an indication of where in the program the error occurred When an error occurs during the calculation of a system at a particular pH value the program after signalling the error aborts further calculations at that pH increment and attempts to continue with the next pH increment in the range Calculations are performed in double precision to 16 decimal digits The smallest and largest numbers calculated are 0 5 X 107 and 0 7 X 10775 respectively 5 0 TEMPERATURE DEPENDENCE OF K s The familiar van t Hoff equation is used in the program to calculate the equilibrium constants at various temperatures K etc m 273 15 0 ll 1 688X10 2 3021 0 5032 t temperature in degrees Celsius calories mole the standard enthalpy change for the reaction The expression is valid for the approximate temperature range from 0 to 30 C and is based on the assumption tha
42. should read Mg Page 17 Quadratic Coefficient Test quadratic equation formula the square root should encompass both terms i e Vb 4ac Canadian Technical Report of Fisheries and Aquatic Sciences 1848 1992 USER S GUIDE TO MODEL FOR AQUATIC CHEMICAL SPECIATION SOFTWARE PACKAGE MACS30 Version 5 1990 and MS DOS 3rd edition by R Wagemann and G Regehr Central and Arctic Region Department of Fisheries and Oceans Winnipeg Manitoba R3T 2N6 This is the 44th Technical Report from the Central and Arctic Region Minister of Supply and Services Canada 1992 Cat no Fs 97 6 1848E ISSN 0706 6457 Correct citation for this publication is Wagemann R and Regehr 1992 User s guide to model for aquatic chemical speciation software package 80 Version 5 1990 VAX and MS DOS 3rd edition Can Tech Rep Fish Aquat Sci 1848 iv 41 p 1 0 2 0 2 1 Program file 2 2 Data input file 3 0 4 0 5 0 6 0 7 0 8 0 5 ACKNOWLEDGMENTS AND OVERVIEW sm 9 9 9 55 5 FILE INFORMATION 9 c 9 9 2 2 1 Input procedure and specifications Model parameters and options 2 2 3 Specifying input values REPORTING ERROR PROCESSING AND MESSAGES TEMPERATURE DEPENDENCE OF K s TEMPERATURE DEP
43. some understanding of ion associations ion activity ionic strength thermodynamic constants chemical equilibria chemical kinetics metastable equilibria and the limitations that these concepts may impose to a greater or lesser degree on the results Equally important is an understanding of what constitutes an appropriate definition of the physico chemical system in relation to the goals sought The situation is not unlike that engendered by the availability of very user friendly statistical programs where results can be obtained easily and quickly even by novices but the correct assessment and interpretation of results still requires an understanding of the subject matter The program MACS80 Model for Aquatic Chemical Speciation 1980 is designed to calculate the concentration of chemical species in equilibrated freshwater systems It requires specification of parameters such as the total dissolved concentration of chemical species in the aquatic system The program can generate different reports by allowing the user to define outputs for specific metals and anions Since the program requires the use of only one input file and performs all of the input error checking calculations and report generation without auxiliary programs it is relatively simple and straight forward to use The input for the program consists of a definition of the physical system and a specification of the total dissolved concentration of the ma
44. t the standard enthalpy of the reaction is constant within this temperature range Whenever sufficient information is not available i e m 0 to calculate K t the equilibrium constant for 25 is used regardless of the temperature specified Equilibrium constants which are presently calculable as function of temperature are marked by an asterisk in the DEFINITIONS table i e table of K values 6 0 TEMPERATURE DEPENDENCE OF y s Activity coefficients y s were calculated from ionic strength with the Bjernum equation valid up to approximately 0 1M VI 1 108 224 z and are charge and ionic radius respectively of ion 1 0 4875 109 178 0 3239 100 00059339 is the temperature C A and B were obtained as a function of temperature by curve fitting published B vs temperature data Manov et al 1943 7 0 IONIC STRENGTH FROM CONDUCTIVITY The following expression is used in the program to calculate the ionic strength from conductivity Ionic strength Conductivity 1 8 10 Ionic strength is expressed in moles L and conductivity mSiemens cm The expression is valid in the ionic strength range of 0 0 2 moles L i e for fresh waters The constant in the above equation was obtained by curve fitting of published data of ionic strength vs conductivity Ponnamperuma et al 1966 8 0 PROGRAM INFORMATION The following is the
45. tialized C and m values for calculation of K values INPUT messages Parameter report and or error INSPEC Species table initialized iteration counter and equilibrium flag bomb flag and inorganic carbon concentration if Pco is specified NWANIN Anion concentration and or errors NWMILS New metal concentrations and or errors and previous metal concentrations Requested reports SETDAT Date in character form SPCALC Species concentrations to be output calculated total dissolved values and the current number of pH points successfully evaluated WDEFNS Definitions report WFOOT Footer and notes at bottom of the current page of output WHEAD Header at top of new page of output WPARMS Input parameters report Wxxx species report of all species containing XXX 9 0 EQUATION COEFFICIENT SIGNIFICANCE TESTS Tests were introduced to the program to determine the significance of the coefficients used in solving a polynomial since some terms in the calculation of the roots of the quadratic and cubic could become insignificant in relation to others The tests eliminate insignificant coefficients simplify the equation 1 a cubic could become a quadratic equation and a quadratic could become a linear equation and produce a more accurate solution 9 1 QUADRATIC COEFFICIENT TEST An exact solution of the quadratic equation provides the free ion concentration in quest
46. tions report 8 Add statements to the INPUT routine to read and to WPARMS routine to write the total dissolved concentration of the ion Modify the MACS80 INPUT file to provide space for the new entry 10 2 ADDING A SOLID TO THE SYSTEM 1 Increment the size of the arrays KA ALPHA and and insert the new alpha equation and c and m values required ALPHAC INITCM subroutines 2 Set the variable NKVALS to the size of KA which should also be equal to the size of ALPHA C and M Mainline 3 The formula for calculating the concentration of the anion from the solid should be placed in the routine NWANIN The formula for calculating the concentration of the metal from the solid should be placed in the routine NWMTL 10 3 ADDING AN INPUT PARAMETER 1 Code read statement in the INPUT subroutine and update the accompanying FORMAT statement MACS80 INPUT to provide space for entry of the parameter 2 Code write statement in the routine WPARMS and update the accompanying format statement 3 Update the appropriate common statements depending on where the parameter is needed Initialize the parameter in the routine MAIN 4 Implement the new parameter in the program 10 4 ADDING CHEMICAL SPECIES TO OUTPUT ROUTINES 1 Assign the new total number of 19 species to NGVALS and increase the size of SPSUM X Z and to this value Assign the new total numb
47. to the designated fields When values are changed their positions in the file must remain constant Records for metal or anion concentrations may be re arranged or deleted however removing a species from consideration is more easily done by setting its concentration to zero in the specified field or leaving the particular field empty in which case a zero concentration for that ion is assumed by the program 2 2 2 Model parameters and options A variety of model or system parameters and report generation options may be specified A brief description of these follows for a description of the associated record formats consult APPENDIX I 1 TITLE Parameter A record containing this parameter marks the start of the file The actual parameter consists of a title to be printed in the ENVIRONMENT heading of the reports 2 TEMPERATURE Parameter Since the equilibrium constants and activity coefficients are temperature dependent the desired temperature may be specified for these calculations If no temperature is specified the calculations are automatically performed for the derfault setting namely 25 3 Parameter When this parameter is set to 1 CONTROLS T D IC the total dissolved inorganic carbon in the system is determined equilibration with atmospheric CO at any pH Any value entered under INORGANIC CARBON Table 1 is then ignored When this parameter is reset to CONTROLS T
48. ts incorporated and the quantities in square brackets are the corresponding free ion concentrations The numbers in parentheses following Ka are the indices for the equilibrium constants as defined within the program Species containing hydrogen or hydroxide ions are incorporated into the constant e g CuHCO Cu k CO where 27 The total dissolved concentrations constants the polynomial and stored the arrays and MTL Total anion concentrations are stored in the array A while total metal concentrations stored in MTL The variables 1 free anion and metal concentrations are stored in the arrays XANIN and respectively The various coefficients of the terms in the polynomial are stored in the arrays SPSUM HSP and HSPQ The constants for calculating the species in which 16 there is an anion and metal are stored in SPSUM The first row of SPSUM is reserved for storing the constants for calculating the species which contain only metals and hydroxide constants for calculating the species which are determined by multiplying an anion by constant only where the only cation is hydrogen ion are stored in the arrays HSP and HSPQ The species comprised of only 1 of the anion of interest are in HSP and those comprised of 2 of the anion of interest are in HSPQ 8 4 OUTPUT OF ROUTINES ALPHAC ALPHA values INITCM Ini
Download Pdf Manuals
Related Search
Related Contents
Brother 4234D 自己宣言のための CE マーキング適合対策実務 アンジェス MG(4563) ACTI CHlORe CHOC - SoPool Samsung Frittstående mikro 23 liter MW872 Bruksanvisning HP LaserJet Pro CP1020 Color Printer Series Installation i.Trek BT GPS User Manual お客様へ 二軍墓雪量軍軍墓置軍軍導き言實毒麦管掌量養してください~ Copyright © All rights reserved.
Failed to retrieve file