APPENDIX A: FORTRAN LISTING OF THE FREZCHEM2 PROGRAM
PROGRAM READWRITE
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
CHARACTER *40 NMC,NEL,NM,NMCOMP,TITLE
DIMENSION
BAL(10),NEL(10),G0(40,6),G(40),GIN(40),BALS(10)
DIMENSION
BALL(10),ACT(20)
DIMENSION
BC(10,20),A(10,40),EX(40),NMC(20),NM(40),AIN(10,40)
DIMENSION
IZC(20),IZ(20),NUM(40),NUMC(20),NUMIN(40),NMM(40)
COMMON
/COMPNT/ NUR(10),IP,NUL(10),IPNUL,KCOMP
COMMON
/NUMBER/ NCAT,NANI,NNEI,NMM
COMMON
/MASS1/ A,G,NUM,X(40)
COMMON
/MASS2/ NM
COMMON
/INTGER/ NL,N,N1
COMMON
/MATRIX/ ACT,UM,PHI,AH2O,IZ,IPP,NMV
COMMON
/AIN/ AIN,GIN,T,NUMIN,IV
COMMON
/OUTPUT/ JOPEN(10),IOPEN
10
FORMAT(A40)
11
FORMAT(A40/)
12
FORMAT(I3/)
13
FORMAT(A15,I3,1X,I2,A40,F12.6)
14
FORMAT(` THE CHARGE OF 1 KG OF THE SOLUTION IS EQUAL TO
$,F8.5)
15
FORMAT(/13X,'Temperature `,F7.2,' C (`,F7.2,' K)')
16
FORMAT (` WATER AMOUNT `,F7.2,' GRAM'/
$
` --------------------------')
17
FORMAT(25X,'SOLID PHASES'/1X,'N
Phase `,
$
16X,' Moles
-G/RT')
18
FORMAT(I2,1X,A23,F9.5,2X,F12.4)
19
FORMAT(21X,'Ionic strength `,F8.4/
$
21X,'Osmotic coefficient `,F7.4)
20
FORMAT(1X,'N',2X,'Species
`,4X,'Moles',7X,
$
`Molality `,3X,'Activity `,'Act.coef.
-G/RT')
21
FORMAT(I2,1X,A16,3D12.5,2X,F8.4,F10.4)
22
FORMAT(I2,1X,A16,D12.5,12X,D12.5,8X,F10.4,)
23
FORMAT (26X,'BALANCE'/
$
13X,'Total',9X,'Solids',8X,'Solution',5X,'Total computed')
24
FORMAT(1X,A8,4(2X,E12.6))
25
FORMAT(` Number of iterations `,I3)
26
FORMAT(` THE PROGRAM CANNOT CALCULATE THIS CHEMICAL
$EQUILIBRIUM')
OPEN(1,FILE='DBASE')
OPEN(9,FILE='INPUT')
OPEN(10,FILE='RESULT')
XW=55.50837
READ(9,10) TITLE
WRITE(10,11) TITLE
11