-
Notifications
You must be signed in to change notification settings - Fork 1
/
ctsfg6.for
2607 lines (2312 loc) · 102 KB
/
ctsfg6.for
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
PROGRAM CTSFG6
* **** versione 21 marzo 2022
* based on the simplified polymeric approach of
* Ottonello et al. (2001) and Moretti (2005)
* for the evaluation of redox conditions
* on Moretti & Ottonello (2003, 2005) for S solubility
* and spciation
* DECLARATIONS
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
REAL*8 mnom,mgom,nao05m,ko05m
parameter (ndi=300)
common /setmod/kansw
COMMON
1/DATINT/ Z(13), Y(13) , X(26), ZCAT(13), XX(26),
& voxm(13),eoxm(13),coxm(13),radi(13),noxy(13)
2/DATEXT/ TCENT(ndi), PBAR(ndi), POSS(ndi,13), IAUT(ndi),
& SO2(ndi), XOSSI(ndi), FS2(ndi), NCOMP,wt(ndi)
3/PARINT/ TKELV(ndi), RAPPOX(ndi),REDOX(ndi), BOSSI(ndi),
& SIO2F(ndi), PO25F(ndi), ALO15F(ndi), FEO15F(ndi),
& TIO2M(ndi), PO25M(ndi), ALO15M(ndi), FEO15M(ndi),
& CRO15M(ndi),FEOM(ndi), MNOM(ndi), CAOM(ndi),
& MGOM(ndi), NAO05M(ndi),KO05M(ndi), HO05M(ndi),
& REG(ndi), XSO2(ndi), KFLAG(ndi), SPPM(ndi),
& D(ndi), DD(ndi), BEPPE(ndi), REG2(ndi),
& REDOZ(ndi), XFETOT(ndi),SCAT(5), XCAT(13),
& S1,HO05f(ndi), O2, A,foga(ndi), XFOR,
& XFE2O3, XALLU, RAPMED, SUMFE(ndi),
& REG3(ndi), xftot, jflag, BEPPI(ndi),
& regg(ndi), SPPB(ndi), reg4(ndi), regg3(ndi),
& xh2o(ndi), a3a2(ndi), ca3ca2(ndi),refirst(ndi),
& som(ndi),somm(ndi),xcat0(ndi),xw(ndi),basdif(ndi),
& volion(ndi),volm(ndi),por(ndi),xmol(ndi,13),xxcat(ndi,13),
$ ffeo2m(ndi),ffe2(ndi),ffe3m(ndi),ffo2m(ndi),fa3fa2(ndi),
$ fa3f2a(ndi),a3a2z(ndi),ca3c2a(ndi),fcox(ndi),focz(ndi),
$ petra(ndi)
4/DATOUT/ ACIDIC(ndi),POLCOS(ndi),STRUCT(ndi), TOTOLD(ndi),
& TOTANI(ndi),totali(ndi),TOTCAT(ndi),O4(ndi), O(ndi),
& O1(ndi), O3(ndi), S,sii(ndi), STOT(ndi),
& AOSSI(ndi),aozzi(ndi), sobs(ndi), AFE2(ndi),AFE3(ndi),
& CSCAL, CSOBS, CSC, CSO,
& AFEO2(ndi), STOTT(ndi), CSTART(ndi), CSTAR(ndi),
& CSCAL2, CSOBS2, CSC2, CSO2,
& S2MENO(ndi),SO4(ndi), OXSOLF(ndi), TOTS(ndi),CS(ndi),
& s2k(ndi),so4k(ndi),afeo22(ndi),afeo2m(ndi),
& afe32(ndi),afe3m(ndi),afe22(ndi),sulf(ndi),wmol(ndi),
& aossiz(ndi),xh(ndi),xoh(ndi),xohz(ndi),xwd(ndi),ah(ndi),
& ana(ndi),aprot(ndi),ak(ndi),amg(ndi),amn(ndi),aca(ndi),
& acr(ndi),ati(ndi),ap(ndi),dv(ndi),delv(ndi),root(ndi)
5/UNIT/ ISYSRD, ISYSWR, ISYSPU, IVIDEO, ISYSQZ,
& ISYSPR, ISYSIN, ISYSCK, ISYSWZ,ISYSMF,isysvo,
& isysho,isysfe
6/COUNT/ I, kj,jk,iter
7/FLAG/ kir(ndi),jwflag
8/WASSER/ partwa,partwb
* UNIT NUMBERS
ISYSRD = 17 ! Read unit
IVIDEO = 6
ISYSWR = 8
ISYSIN = 9
ISYSCK = 12
ISYSQZ = 13
ISYSWZ = 14
ISYSPR = 15
ISYSPU = 16
ISYSMF = 19
ISYSTT= 21
ISYSVO = 18
ISYSHO = 11
ISYSFE = 10
open(File='INPUT.txt' ,unit=ISYSRD,status='OLD')
open(File='ctsfg6.jet' ,unit=ISYSPU,status='UNKNOWN')
open(File='ctsfg6.s2' ,unit=ISYSWR,status='UNKNOWN')
open(File='ctsfg6.inp' ,unit=ISYSIN,status='UNKNOWN')
open(File='ctsfg6.so4' ,unit=ISYSWZ,status='UNKNOWN')
write (*,*) ' Do you want to fix fSO2 and fO2 ? (y=1) '
write (*,*) 'Option is still in progress; PLEASE TYPE 0'
read (*,*) kansw
CALL NEWSULF
c write(ivideo,*)
c write(IVIDEO,*) 'data have been correctly read'
c write(ivideo,*)
c pause
call SULPHIDE
call SULPHATE
END
BLOCK DATA
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
REAL*8 mnom,mgom,nao05m,ko05m
parameter (ndi=300)
COMMON
1/DATINT/ Z(13), Y(13) , X(26), ZCAT(13), XX(26),
& voxm(13),eoxm(13),coxm(13),radi(13),noxy(13)
2/DATEXT/ TCENT(ndi), PBAR(ndi), POSS(ndi,13), IAUT(ndi),
& SO2(ndi), XOSSI(ndi), FS2(ndi), NCOMP,wt(ndi)
3/PARINT/ TKELV(ndi), RAPPOX(ndi),REDOX(ndi), BOSSI(ndi),
& SIO2F(ndi), PO25F(ndi), ALO15F(ndi), FEO15F(ndi),
& TIO2M(ndi), PO25M(ndi), ALO15M(ndi), FEO15M(ndi),
& CRO15M(ndi),FEOM(ndi), MNOM(ndi), CAOM(ndi),
& MGOM(ndi), NAO05M(ndi),KO05M(ndi), HO05M(ndi),
& REG(ndi), XSO2(ndi), KFLAG(ndi), SPPM(ndi),
& D(ndi), DD(ndi), BEPPE(ndi), REG2(ndi),
& REDOZ(ndi), XFETOT(ndi),SCAT(5), XCAT(13),
& S1,HO05f(ndi), O2, A,foga(ndi),XFOR,
& XFE2O3, XALLU, RAPMED, sumfe(ndi),
& REG3(ndi), xftot, jflag, BEPPI(ndi),
& REGG(ndi), SPPB(ndi), reg4(ndi), regg3(ndi),
& xh2o(ndi), a3a2(ndi), ca3ca2(ndi),refirst(ndi),
& som(ndi),somm(ndi),xcat0(ndi),xw(ndi),basdif(ndi),
& volion(ndi),volm(ndi),por(ndi),xmol(ndi,13),xxcat(ndi,13),
$ ffeo2m(ndi),ffe2(ndi),ffe3m(ndi),ffo2m(ndi),fa3fa2(ndi),
$ fa3f2a(ndi),a3a2z(ndi),ca3c2a(ndi),fcox(ndi),fcoz(ndi),
$ petra(ndi)
4/DATOUT/ ACIDIC(ndi),POLCOS(ndi),STRUCT(ndi), TOTOLD(ndi),
& TOTANI(ndi),totali(ndi),TOTCAT(ndi),O4(ndi), O(ndi),
& O1(ndi), O3(ndi), S,sii(ndi), STOT(ndi),
& AOSSI(ndi),aozzi(ndi), SOBS(ndi), AFE2(ndi),AFE3(ndi),
& CSCAL, CSOBS, CSC, CSO,
& AFEO2(ndi), STOTT(ndi), CSTART(ndi), CSTAR(ndi),
& CSCAL2, CSOBS2, CSC2, CSO2,
& S2MENO(ndi),SO4(ndi), OXSOLF(ndi), TOTS(ndi),CS(ndi),
& s2k(ndi),so4k(ndi),afeo22(ndi),afeo2m(ndi),
& afe32(ndi),afe3m(ndi),afe22(ndi),sulf(ndi),wmol(ndi),
& aossiz(ndi),xh(ndi),xoh(ndi),xohz(ndi),xwd(ndi),ah(ndi),
& ana(ndi),aprot(ndi),ak(ndi),amg(ndi),amn(ndi),aca(ndi),
& acr(ndi),ati(ndi),ap(ndi),dv(ndi),delv(ndi),root(ndi)
5/UNIT/ ISYSRD, ISYSWR, ISYSPU, IVIDEO, ISYSQZ,
& ISYSPR, ISYSIN, ISYSCK,ISYSWZ, ISYSMF,isysvo,
& isysho,isysfe
6/COUNT/ I, kj,jk,iter
7/FLAG/ kir(ndi),jwflag
8/WASSER/ partwa,partwb
DATA Z/2.09,1.54,2.5,1.67,2.09,1.82,1.354,1.40,1.,1.28,.87,
& .71,2.50/
c
DATA Y/60.0848,79.899,141.94,101.96,159.69,151.99,71.846,
& 70.937,56.079,40.311,61.979,94.203,18.015/
DATA Zcat/1.,1.,2.,2.,2.,2.,1.,1.,1.,1.,2.,2.,2./
c VERY IMPORTANT: Verify x27 and x227 (i.e. the annealing term -alfaV must be zeroed)
c OXIDE-SULFIDE disproportions
DATA X/12.9576967,-4.8017622,2.15696154,7.81050803,6.66128037,0.,
$8.41324988,-1.0201951,-4.2289568,-5.0761932,11.253287,10.6606042,
* Below best value fo H2O using Papale et al model (only without P effect)
$ 0.781537236943571,
* Below best value fo H2O using Burnham model (only without P effect)
* $ 11.7851076580539,
$-36418.,-16575.9,-24786.,-28926.,-20000.,0.,-15265.,-8391.7,
$-6804.2,-15181.,-16396.,-16432.,-18764./
c OXIDE_SULFATE disproportions: new values 13 August 2004 for all ox except H2O
c GCA paper revision followoin reviewers
c REVISED ON 7 APRIL 2005
DATA XX/-26.883627,-22.661437,0.,-31.095548,-31.927338,
$ 0.,-42.051629,-51.400798,-43.517305,
$ -36.371917,-21.612439,14.8139739,
* Below best value fo H2O using Papale et al model (only without P effect)
$-60.3993819146732,
* Below best value fo H2O using Burnham model (only without P effect)
* $-56.3439946571902,
$77291.1,98230.0,0.,85879.800,85879.800,0.,99540.800,106414.10,
$107754.894,95831.,100934.,100741.,67292./
****************************************************************************
c NEW VOLUMES Expansivities for SiO2 and Al2O3
c They have been adjusted on the basis of the OptBas correlation. Water Expansivity obtained
c by considering H2O estimated V at 1673K and Richet Volume at room T (12 cc/mol).
data voxm/26.9,23.16,82.16,37.11,42.13,36.36,13.65,11.62,16.57,
$ 11.45,28.78,45.84,16.79/
data eoxm/0.10,7.24,2.62,2.62,9.09,8.22,2.92,2.73,2.92,2.62,7.41,
$ 11.91,3.48/
data coxm/-1.89,-2.31,-8.93,-2.26,-2.53,-1.96,-0.45,-0.37,-1.34,
$ -0.40,-2.4,-6.75,-1.88/
***********************************************************************
c segue per calcolo porosit� ionica (de-activated option)
data noxy/2,2,5,3,3,3,1,1,1,1,1,1,1/
data radi/0.26,0.605,0.17,0.39,0.49,0.615,0.78,0.67,1.,0.72,1.02,
$ 1.37,0./
END
SUBROUTINE NEWSULF
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* this is the main program, disguised as a subroutine for *
* reasons of compatibility between systems. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
REAL*8 mnom,mgom,nao05m,ko05m
parameter (ndi=300)
common/setmod/kansw
COMMON
1/DATINT/ Z(13), Y(13) , X(26), ZCAT(13), XX(26),
& voxm(13),eoxm(13),coxm(13),radi(13),noxy(13)
2/DATEXT/ TCENT(ndi), PBAR(ndi), POSS(ndi,13), IAUT(ndi),
& SO2(ndi), XOSSI(ndi), FS2(ndi), NCOMP,wt(ndi)
3/PARINT/ TKELV(ndi), RAPPOX(ndi),REDOX(ndi), BOSSI(ndi),
& SIO2F(ndi), PO25F(ndi), ALO15F(ndi), FEO15F(ndi),
& TIO2M(ndi), PO25M(ndi), ALO15M(ndi), FEO15M(ndi),
& CRO15M(ndi),FEOM(ndi), MNOM(ndi), CAOM(ndi),
& MGOM(ndi), NAO05M(ndi),KO05M(ndi), HO05M(ndi),
& REG(ndi), XSO2(ndi), KFLAG(ndi), SPPM(ndi),
& D(ndi), DD(ndi), BEPPE(ndi), REG2(ndi),
& REDOZ(ndi), XFETOT(ndi),SCAT(5), XCAT(13),
& S1,HO05f(ndi), O2, A,foga(ndi), XFOR,
& XFE2O3, XALLU, RAPMED, SUMFE(ndi),
& reg3(ndi), xftot, jflag, BEPPI(ndi),
& REGG(ndi), SPPB(ndi), reg4(ndi), regg3(ndi),
& xh2o(ndi), a3a2(ndi), ca3ca2(ndi),refirst(ndi),
& som(ndi),somm(ndi),xcat0(ndi),xw(ndi),basdif(ndi),
& volion(ndi),volm(ndi),por(ndi),xmol(ndi,13),xxcat(ndi,13),
$ ffeo2m(ndi),ffe2(ndi),ffe3m(ndi),ffo2m(ndi),fa3fa2(ndi),
$ fa3f2a(ndi),a3a2z(ndi),ca3c2a(ndi),fcox(ndi),fcoz(ndi),
$ petra(ndi)
4/DATOUT/ ACIDIC(ndi),POLCOS(ndi),STRUCT(ndi), TOTOLD(ndi),
& TOTANI(ndi),totali(ndi),TOTCAT(ndi),O4(ndi), O(ndi),
& O1(ndi), O3(ndi), S,sii(ndi), STOT(ndi),
& AOSSI(ndi),aozzi(ndi), SOBS(ndi), AFE2(ndi), AFE3(ndi),
& CSCAL, CSOBS, CSC, CSO,
& AFEO2(ndi), STOTT(ndi), CSTART(ndi), CSTAR(ndi),
& CSCAL2, CSOBS2, CSC2, CSO2,
& S2MENO(ndi),SO4(ndi), OXSOLF(ndi), TOTS(ndi),CS(ndi),
& s2k(ndi),so4k(ndi),afeo22(ndi),afeo2m(ndi),
& afe32(ndi),afe3m(ndi),afe22(ndi),sulf(ndi),wmol(ndi),
& aossiz(ndi),xh(ndi),xoh(ndi),xohz(ndi),xwd(ndi),ah(ndi),
& ana(ndi),aprot(ndi),ak(ndi),amg(ndi),amn(ndi),aca(ndi),
& acr(ndi),ati(ndi),ap(ndi),dv(ndi),delv(ndi),root(ndi)
5/UNIT/ ISYSRD, ISYSWR, ISYSPU, IVIDEO, ISYSQZ,
& ISYSPR, ISYSIN, ISYSCK,ISYSWZ, ISYSMF,isysvo,
$ isysho,isysfe
6/COUNT/ I, kj,jk,iter
7/FLAG/ kir(ndi),jwflag
8/WASSER/ partwa,partwb
Read (isysrd,*) ncomp
Read (isysrd,*) ! empty line to skip header in input.txt
write (isysin,*) 'SiO2 TiO2 Al2O3 Fe2O3 Cr2O3 FeO MnO MgO CaO Na2O
& K2O P2O5 H2O'
C rapmed=0.0
do 111 i=1,ncomp
C jflag(i)=0
Read (isysrd,*) poss(i,1),poss(i,2),poss(i,4),poss(i,5),poss(i,6),
&poss(i,7),poss(i,8),poss(i,10),
&poss(i,9),poss(i,11),poss(i,12),poss(i,3), poss(i,13),
&stot(i),so2(I),tcent(i),pbar(i),xossi(i),fs2(i),iaut(I),kflag(i),
&wmol(i),kir(i)
if (wmol(i).eq.0.) then
wmol(i)=0.1*poss(i,13)
endif
wmol(i)=wmol(i)/18.015 ! this is molecular water in moles
c write (*,*) wmol(i)
c pause
c pbar(i)=1.
c poss(i,13)=0.
c Nota Bene:
c kflag=0 il programma itera per Fe2+/Fe3+
c kflag=2 il programma accetta Fe2+/Fe3+ di input e log fO2
c kflag(i)=2
if (kansw.eq.1.) then
write (*,*)
write (*,*) '-------------------------------------------------'
write (*,*) 'set fSO2 (bar) @ T = ',tcent(i),' P = ',pbar(i),
& ' for composition n. ',i
write (*,*)
read (*,*) fso2
c fso2=0.021
fso2=dlog10(fso2)
798 write (*,*) 'will you set dNNO or dFMQ or logfo2 (1/2/3)?'
write (*,*) 'IF YOU GET HERE IT MEANS YOU ARE GOING NOWHERE: PL
&EASE ABORT, OPTION IS STILL IN PROGRESS'
write (*,*)
read (*,*) kans
if (kans.eq.1) then
write (*,*) 'set deltaNNO '
read (*,*) dnno
xossi(i)=8.951-24556/(tcent(i)+273.15)
$ +0.046*(pbar(i)-1)/tkelv(i)+dnno
endif
if (kans.eq.2) then
write (*,*) 'set deltaFMQ '
read (*,*) dfmq
xossi(i)=10.50-26913/(tcent(i)+273.15)+dfmq
endif
if (kans.eq.3) then
write(*,*)'set log fO2 '
read (*,*) xossi(i)
endif
if (kans.ne.1.and.kans.ne.2.and.kans.ne.3) go to 798
cost=18896.92/(tcent(i)+273.15)-3.82
fS2(i)=2.*fso2-2.*xossi(i)-2.*cost
write (*,*) fsO2,fS2(i),xossi(i)
c pause
endif
write(6,*)'ho letto ',i
sulf(i)=stot(i)
stotT(i)=stot(i)/(10000*32.064)
tkelv(i)=tcent(i)+273.15
FSS2=10.**FS2(I)
FOO2=10.**XOSSI(I)
CSTART(I)=STOTT(I)*32.064*DSQRT(FOO2/FSS2)
cstar(I)=STOTT(I)*32.064/(FOO2**1.5*FSS2**0.5)
WRITE (*,*) ' '
WRITE (*,*)'---------------- COMPOSITION ',I,'-------------------'
if (poss(i,5).ne.0.or.poss(i,7).ne.0) then
write (*,*) 'Composition n. ',i,' holds Iron !!!'
write (*,*) 'Fe2O3 =',poss(i,5)
write (*,*) 'FeO =',poss(i,7)
endif
jflag=0.
c calcola le proporzioni molari a 100% catione e ossido
c poi si assume acqua misurata indipendentemente (tipo FT-IR)
c per cui non entra nella normalizzazione.....
summa = 0.
summb = 0.
do 961 lk=1,12
summa=poss(i,lk)+summa
961 continue
do 871 lk=1,12
poss(i,lk)=poss(i,lk)*100./summa
871 continue
wt(i)=summa
summc=0.
do 9623 lh = 1,12
poss(i,lh)= poss(i,lh)*(1.-poss(i,13)/100.)
write (*,*) poss(i,lh)
summc=summc+poss(i,lh)
9623 continue
c write (*,*) poss(i,13),summc+poss(i,13)
c pause
sumfe(i)=poss(i,5)+poss(i,7)
NIT = 50
do 686 kj=1,NIT
write (*,*) 'Poss 5 = ',poss(i,5)
write (*,*) 'Poss 7 = ',poss(i,7)
if (poss(i,5).ne.0.or.poss(i,7).ne.0) then
write (*,*) 'Iteration N. ',kj,' @ composition ',i
write (ISYSPR,*) 'Iteration N. ',kj,' @ composition ',i
endif
c Procedura di normalizzazione su FeOtotale (somma degli ossidi wt%)
if (sumfe(i).ne.0) then
summb=poss(i,5)+poss(i,7)
poss(i,5)=poss(i,5)*sumfe(i)/summb
poss(i,7)=poss(i,7)*sumfe(i)/summb
endif
write (*,878) poss(i,1),poss(i,2),poss(i,3),poss(i,4),poss(i,5),
&poss(i,6),poss(i,7),poss(i,8),poss(i,9),poss(i,10),poss(i,11),
&poss(i,12),poss(i,13),summa,summb
878 format (x,13(f5.2,x),/,x,f6.2,x,f6.2)
c
c write (*,*)'jwflag = ',jwflag
c pause
c if (jwflag.gt.1) go to 519
d(i)=0
dd(i)=0
do 100 j=1,13
c write(*,*) j,poss(i,j),zcat(j),y(j)
xcat(j)=poss(i,j)*zcat(j)/y(j)
c pause
d(i) = d(i)+ xcat(j)
dd(i)=dd(i)+poss(i,j)/y(j)
100 continue
som(i)=d(i)
dd(i)=dd(i)+stotT(i)
xcat0(i)=xcat(13)
c write (*,*) wmol(i),xcat0(i)
c wmol(i)=(xcat0(i)/2.-wmol(i))*2. ! moli di OH IR-like
c write (*,*) wmol(i),xcat0(i)
c pause
c considero tutto H2O come OH (o H!)
dd(i)=dd(i)-poss(i,13)/y(13)
xw(i)=2.*poss(i,13)/y(13)
dd(i)=dd(i)+xw(i)
somm(i)=dd(i)
do 200 j=1,13
xcat(j)=xcat(j)/d(i)
200 continue
xfetot(i)=xcat(5)+xcat(7)
if (kj.eq.1) xftot=xfetot(i)
if (xftot.ne.0.) then
write(*,*) 'xfetot-xftot = ',xfetot(i)-xftot
c write(15,*) 'xfetot-xftot = ',xfetot(i)-xftot
endif
stot(i)=stott(i)/dd(i)
CCC if (xcat(5).ne.0.and.xcat(7).ne.0.and.kj.eq.1) jflag=2
IF (KFLAG(I).EQ.2) JFLAG=2
if (xcat(5).ne.0.or.xcat(7).ne.0) then
write (*,*) 'Fe3 = ',xcat(5),' Fe2 = ',xcat(7)
write (*,*) 'Fetot = ',xftot,' newFetot = ',xfetot(i)
endif
if (xcat(5).ne.0.and.xcat(7).ne.0.) then
write (*,*) 'redoz is = ',dlog10(xcat(7)/xcat(5))
redoz(i)=dlog10(xcat(7)/xcat(5))
endif
if (xcat(5).ne.0.and.xcat(7).eq.0.) then
write (*,*) 'redoz is UNDEFINED'
redoz(i)=1.0
endif
if (xcat(5).eq.0.and.xcat(7).ne.0.) then
write (*,*) 'redoz is UNDEFINED'
redoz(i)=1.00
endif
if (xfetot(i).eq.0) then
write (*,*) 'redoz is UNDEFINED'
xcat(5)=0.0000000001
xcat(7)=0.0000000001
endif
if (kj.eq.1) then
refirst(i)=redoz(i)
endif
519 continue
c
c Verifica la consistenza.
FRIT=0.
KWFLAG=0
jwflag=0
ITER=50
if (poss(I,13).eq.0.) then
iter=1
kwflag=3
endif
do 789 jk=1,iter
jwflag=jwflag+1
CALL CALCOMP
CALL BASOPT
CALL TOOPSAMIS
CALL ACTION
frit=dabs(aossi(i)-aossiz(i))
if (poss(i,13).ne.0.and.frit.lt.0.00001.and.jk.gt.1) then
kwflag = 3
endif
if (kwflag.eq.3) goto 790
if (jk.eq.iter) then
pause
goto 790
endif
write (*,*) 'ESCO DA ',i,jk,' nOH-= ',xoh(i),' nH+= ',xh(i),
$'ITERATION VALUE = ',frit
c pause
789 continue
790 CALL TOOPSAMIS2
CALL ACTION2
CALL FEREDOX
if (xfetot(i).eq.0.or.jflag.eq.1.) then
goto 696
endif
write (*,*) 'redox last (redoX) = ',redox(i)
write (*,*) 'redox before (redoZ) = ',redoz(i)
zxf3=(xfetot(i)/(10**redoz(i)+1))
zxf2=(xfetot(i)/(10**redoz(i)+1))*(10**redoz(i))
xf3=(xfetot(i)/(10**redox(i)+1))
xf2=(xfetot(i)/(10**redox(i)+1))*(10**redox(i))
c xff3=xf3*d(i)
c xff2=xf2*d(i)
xff3=xf3*d(i)
xff2=xf2*d(i)
pfe3=xff3*y(5)/zcat(5)
pfe2=xff2*y(7)
if (poss(i,5).eq.0.) then
poss(i,5)=0.01
poss(i,7)=poss(i,7)-0.01
endif
if (poss(i,7).eq.0.) then
poss(i,7)=0.01
poss(i,5)=poss(i,5)-0.01
endif
c l'ho spostato sotto!!!
c poss(i,5)=dsqrt(pfe3*poss(i,5))
c poss(i,7)=dsqrt(pfe2*poss(i,7))
c
write (*,*) 'Fe2/Fetot calc = ', xf2/(xf2+xf3)
write (*,*) 'Fe2/Fetot before= ', zxf2/(zxf2+zxf3)
chi=dabs(bossi(i)-xossi(i))
chio=dabs(xf2/(xf2+xf3)-zxf2/(zxf2+zxf3))
write (*,*) 'bossi = ',bossi(i), 'xossi = ',xossi(i)
write (*,*) 'REMINDER: bossi � ricalcolato da redox!'
write (*,*) 'REMINDER: bossi = xossi se INPUT logfO2 = 0'
write (*,*) ' JFLAG is ',jflag
c pause
if (jflag.eq.2) then
write (*,*)' !!! I HAVE USED DEFAULT FeO/Fe2O3 AND INPUT fO2 !!!'
write (*,*)' !!! I MADE NO ITERATIONS !!!'
c pause
go to 696
endif
c L'ho spostato qua ma stava sopra!!!!!
poss(i,5)=dsqrt(pfe3*poss(i,5))
poss(i,7)=dsqrt(pfe2*poss(i,7))
if (chi.lt.0.0001.and.chio.lt.0.0001) then
jflag=1
write (*,*) 'JFLAG= ',jflag
c write (15,*) 'JFLAG= ',jflag
c pause
endif
if (kj.eq.nit) then
write (*,*) 'This was the last iteration. '
c pause
endif
c if (i.lt.ncomp) pause
686 continue
696 continue
C rapmed=dlog10(cstart(i))+rapmed
*********************************************************************
write(ISYSIN,888) poss(i,1),poss(i,2),poss(i,4),poss(i,5),
&POSS(I,6),poss(i,7),poss(i,8),poss(i,10),
&poss(i,9),poss(i,11),poss(i,12),poss(i,3), poss(i,13)
888 format(13(F9.5,1x))
CALL IONPOR
c calcola le proporzioni molari a 100% catione e ossido
summit = 0.
do 991 lk=1,13
summit=poss(i,lk)/y(lk)+summit
991 continue
xh2o(i)=(poss(i,13)/y(13))/summit
***************************************************************************
CALL CALCPROP
CALL DATAOUT
111 CONTINUE
END
SUBROUTINE CALCOMP
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* computes stoichiometric amounts *
* charge balance for melt complexes *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
REAL*8 mnom,mgom,nao05m,ko05m
parameter (ndi=300)
common/setmod/kansw
COMMON
1/DATINT/ Z(13), Y(13) , X(26), ZCAT(13), XX(26),
& voxm(13),eoxm(13),coxm(13),radi(13),noxy(13)
2/DATEXT/ TCENT(ndi), PBAR(ndi), POSS(ndi,13), IAUT(ndi),
& SO2(ndi), XOSSI(ndi), FS2(ndi), NCOMP,wt(ndi)
3/PARINT/ TKELV(ndi), RAPPOX(ndi),REDOX(ndi), BOSSI(ndi),
& SIO2F(ndi), PO25F(ndi), ALO15F(ndi), FEO15F(ndi),
& TIO2M(ndi), PO25M(ndi), ALO15M(ndi), FEO15M(ndi),
& CRO15M(ndi),FEOM(ndi), MNOM(ndi), CAOM(ndi),
& MGOM(ndi), NAO05M(ndi),KO05M(ndi), HO05M(ndi),
& REG(ndi), XSO2(ndi), KFLAG(ndi), SPPM(ndi),
& D(ndi), DD(ndi), BEPPE(ndi), REG2(ndi),
& REDOZ(ndi), XFETOT(ndi),SCAT(5), XCAT(13),
& S1,HO05f(ndi), O2, A,foga(ndi),XFOR,
& XFE2O3, XALLU, RAPMED, SUMFE(ndi),
& reg3(ndi), xftot, jflag, BEPPI(ndi),
& REGG(ndi), SPPB(ndi), reg4(ndi), regg3(ndi),
& xh2o(ndi), a3a2(ndi), ca3ca2(ndi),refirst(ndi),
& som(ndi),somm(ndi),xcat0(ndi),xw(ndi),basdif(ndi),
& volion(ndi),volm(ndi),por(ndi),xmol(ndi,13),xxcat(ndi,13),
$ ffeo2m(ndi),ffe2(ndi),ffe3m(ndi),ffo2m(ndi),fa3fa2(ndi),
$ fa3f2a(ndi),a3a2z(ndi),ca3c2a(ndi),fcox(ndi),fcoz(ndi),
$ petra(ndi)
4/DATOUT/ ACIDIC(ndi),POLCOS(ndi),STRUCT(ndi), TOTOLD(ndi),
& TOTANI(ndi),totali(ndi),TOTCAT(ndi),O4(ndi), O(ndi),
& O1(ndi), O3(ndi), S,sii(ndi), STOT(ndi),
& AOSSI(ndi),aozzi(ndi), SOBS(ndi), AFE2(ndi), AFE3(ndi),
& CSCAL, CSOBS, CSC, CSO,
& AFEO2(ndi), STOTT(ndi), CSTART(ndi), CSTAR(ndi),
& CSCAL2, CSOBS2, CSC2, CSO2,
& S2MENO(ndi),SO4(ndi), OXSOLF(ndi), TOTS(ndi),CS(ndi),
& s2k(ndi),so4k(ndi),afeo22(ndi),afeo2m(ndi),
& afe32(ndi),afe3m(ndi),afe22(ndi),sulf(ndi),wmol(ndi),
& aossiz(ndi),xh(ndi),xoh(ndi),xohz(ndi),xwd(ndi),ah(ndi),
& ana(ndi),aprot(ndi),ak(ndi),amg(ndi),amn(ndi),aca(ndi),
& acr(ndi),ati(ndi),ap(ndi),dv(ndi),delv(ndi),root(ndi)
5/UNIT/ ISYSRD, ISYSWR, ISYSPU, IVIDEO, ISYSQZ,
& ISYSPR, ISYSIN, ISYSCK,ISYSWZ, ISYSMF,isysvo,
$ isysho,isysfe
6/COUNT/ I, kj,jk,iter
7/FLAG/ kir(ndi),jwflag
8/WASSER/ partwa,partwb
c if (poss(i,13).ne.0) then
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c NOTA BENE............ c
c INIZIA DA QUI IL RICALCOLO DI H2O SPECIATA SECONDO MORETTI & OTTONELLO c
c (2003) IN PREP. TRA H+ E OH-. OH- � ANIONE LIBERO SULLA MATRICE ANIONICA c
c MENTRE H+ CONTRIBUISCE ALLA MATRICE W CON QUANTO NE CONSEGUE. c
c QUINDI H+ ENTRA NEL COMPUTO DELLA DEPOLIMERIZZAZIONE SECONDO QUANTO EVINTO c
c DA FRASER.I RUOLI STRUTTURALI NON CI INTERESSANO (CHIUSURA TERMINAZIONI c
c POLIMERICHE O QUANT'ALTRO....) c
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
xcat(1)=poss(i,1)*zcat(1)/y(1)
xcat(3)=poss(i,3)*zcat(3)/y(3)
xcat(4)=poss(i,4)*zcat(4)/y(4)
xcat(5)=poss(i,5)*zcat(5)/y(5)
xcat(6)=poss(i,6)*zcat(6)/y(6)
xcat(7)=poss(i,7)*zcat(7)/y(7)
xcat(2)=poss(i,2)*zcat(2)/y(2)
xcat(13)=poss(i,13)*zcat(13)/y(13)
xcat(8)=poss(i,8)*zcat(8)/y(8)
xcat(9)=poss(i,9)*zcat(9)/y(9)
xcat(10)=poss(i,10)*zcat(10)/y(10)
xcat(11)=poss(i,11)*zcat(11)/y(11)
xcat(12)=poss(i,12)*zcat(12)/y(12)
xcat(1)=xcat(1)/som(i)
xcat(3)=xcat(3)/som(i)
xcat(4)=xcat(4)/som(i)
xcat(5)=xcat(5)/som(i)
xcat(6)=xcat(6)/som(i)
xcat(2)=xcat(2)/som(i)
xcat(7)=xcat(7)/som(i)
xcat(8)=xcat(8)/som(i)
xcat(9)=xcat(9)/som(i)
xcat(10)=xcat(10)/som(i)
xcat(11)=xcat(11)/som(i)
xcat(12)=xcat(12)/som(i)
xcat(13)=xcat(13)/som(i)
aossiz(i)=aossi(i)
if (jk.eq.1.and.iter.gt.1.) then
aossiz(i)=1.
xoh(i)=xcat0(i)
endif
xh(i)=xcat0(i)-xoh(i)
xohz(i)=xoh(i)
xcat(13)=xh(i)/som(i)
xwd(i)=xoh(i)/som(i)
c endif
w=3.0*xcat(6)+2.0*(xcat(7)+xcat(8)+xcat(9)+xcat(10))+xcat(11)+
& xcat(12)+xcat(13)+xcat(3)+4.0*xcat(2)
WRITE(*,*) ' W (charges due to modifiers) = ',W
c WRITE(ISYSPR,*) ' W (charges due to modifiers) = ',W
IF (Xcat(4).GT.W) GO TO 540
xfor=xcat(1)+xcat(4)/2.0
w=w-xcat(4)
xallu=xcat(4)/2.0
xcat(4)=0.
GO TO 590
540 u=xcat(4)-w
xfor=xcat(1)+w/2.0
xcat(4)=u
XALLU=W/2.0
w=0.
GO TO 680
590 IF (xcat(5).GT.W) GO TO 640
xfor=xfor+xcat(5)/2.0
w=w-xcat(5)
xfe2o3=xcat(5)/2.0
c feo2m=xcat(5)
afeo2(i)=xcat(5)/2.
afeo22(i)=xcat(5)/2.0
c fe3p=0
xcat(5)=0.
GO TO 680
640 v=xcat(5)-w
xfor=xfor+w/2.0
afeo2(i)=w/2.
afeo22(i)=w/2.0
xcat(5)=v
xfe2o3=w/2.0
c feo2m=w
c fe3p=v
w=0.
c pause
680 xfor=xfor+xcat(3)/2.0
c afeo2(i)=afeo2(i)/xfor
1691 CONTINUE
END
SUBROUTINE BASOPT
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* computes optical basicity of network formers and network *
* modifiers; *
* defines oxides stoichiometric proportions for oxide-sulfide *
* reactions *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
REAL*8 k,mnom,mgom,nao05m,ko05m
PARAMETER (ndi=300)
COMMON
1/DATINT/ Z(13), Y(13) , X(26), ZCAT(13), XX(26),
& voxm(13),eoxm(13),coxm(13),radi(13),noxy(13)
2/DATEXT/ TCENT(ndi), PBAR(ndi), POSS(ndi,13), IAUT(ndi),
& SO2(ndi), XOSSI(ndi), FS2(ndi), NCOMP,wt(ndi)
3/PARINT/ TKELV(ndi), RAPPOX(ndi),REDOX(ndi), BOSSI(ndi),
& SIO2F(ndi), PO25F(ndi), ALO15F(ndi), FEO15F(ndi),
& TIO2M(ndi), PO25M(ndi), ALO15M(ndi), FEO15M(ndi),
& CRO15M(ndi),FEOM(ndi), MNOM(ndi), CAOM(ndi),
& MGOM(ndi), NAO05M(ndi),KO05M(ndi), HO05M(ndi),
& REG(ndi), XSO2(ndi), KFLAG(ndi), SPPM(ndi),
& D(ndi), DD(ndi), BEPPE(ndi), REG2(ndi),
& REDOZ(ndi), XFETOT(ndi),SCAT(5), XCAT(13),
& S1,HO05f(ndi), O2, A,foga(ndi),XFOR,
& XFE2O3, XALLU, RAPMED, SUMFE(ndi),
& REG3(ndi), xftot, jflag, BEPPI(ndi),
& REGG(ndi), SPPB(ndi), reg4(ndi), regg3(ndi),
& xh2o(ndi), a3a2(ndi), ca3ca2(ndi),refirst(ndi),
& som(ndi),somm(ndi),xcat0(ndi),xw(ndi),basdif(ndi),
& volion(ndi),volm(ndi),por(ndi),xmol(ndi,13),xxcat(ndi,13),
$ ffeo2m(ndi),ffe2(ndi),ffe3m(ndi),ffo2m(ndi),fa3fa2(ndi),
$ fa3f2a(ndi),a3a2z(ndi),ca3c2a(ndi),fcox(ndi),fcoz(ndi),
$ petra(ndi)
4/DATOUT/ ACIDIC(ndi),POLCOS(ndi),STRUCT(ndi), TOTOLD(ndi),
& TOTANI(ndi),totali(ndi),TOTCAT(ndi),O4(ndi), O(ndi),
& O1(ndi), O3(ndi), S,sii(ndi), STOT(ndi),
& AOSSI(ndi),aozzi(ndi), SOBS(ndi), AFE2(ndi), AFE3(ndi),
& CSCAL, CSOBS, CSC, CSO,
& AFEO2(ndi), STOTT(ndi), CSTART(ndi), CSTAR(ndi),
& CSCAL2, CSOBS2, CSC2, CSO2,
& S2MENO(ndi),SO4(ndi), OXSOLF(ndi), TOTS(ndi),CS(ndi),
& s2k(ndi),so4k(ndi),afeo22(ndi),afeo2m(ndi),
& afe32(ndi),afe3m(ndi),afe22(ndi),sulf(ndi),wmol(ndi),
& aossiz(ndi),xh(ndi),xoh(ndi),xohz(ndi),xwd(ndi),ah(ndi),
& ana(ndi),aprot(ndi),ak(ndi),amg(ndi),amn(ndi),aca(ndi),
& acr(ndi),ati(ndi),ap(ndi),dv(ndi),delv(ndi),root(ndi)
5/UNIT/ ISYSRD, ISYSWR, ISYSPU, IVIDEO, ISYSQZ,
& ISYSPR, ISYSIN, ISYSCK, ISYSWZ, ISYSMF,isysvo,
$ isysho,isysfe
6/COUNT/ I, kj,jk,iter
7/FLAG/ kir(ndi),jwflag
8/WASSER/ partwa,partwb
C
basfor=xcat(1)*z(1)/xfor+xcat(3)*z(3)/xfor+xallu*z(4)/xfor+
& xfe2o3*z(5)/xfor
c
scat(1)=xcat(1)
scat(3)=xcat(3)
scat(2)=0.0
scat(4)=xallu
scat(5)=xfe2o3
c write (isysck,*)
c write (isysck,*) 'BASOPT Composition: ',i
c write (isysck,*) 'BASOPT Iteration; ',kj
c write (isysck,*) 'BASOPT XFe2O3:', xfe2o3
c write (isysck,*) 'BASOPT Xfor: ', xfor
c write (isysck,*) 'BASOPT Scat(5): ',scat(5)
c write (isysck,*) 'BASOPT Redox: ' ,redox(i)
c write (isysck,*) 'BASOPT Redoz: ',redoz(i)
c write (isysck,*)
c write (isyspr,*) ' + + + INCIDENTAL S CAPACITIES LOG BLOCK + + +'
c write (isyspr,*) 'F&G elect. equiv. frac. per Fe3+ = ',scat(5)
xmod=0.0
do 6969 ij=2,13
xmod=xmod+xcat(ij)/zcat(ij)
6969 continue
basmod=0.0
do 6996 ij=2,13
xcat(ij)=xcat(ij)/(zcat(ij)*xmod)
basmod=basmod+xcat(ij)*z(ij)
6996 continue
c write (isyspr,*) 'F&G elect. equiv. frac. per Fe2+ = ',xcat(7)
c write (isyspr,*) ' + + + INCIDENTAL S CAPACITIES LOG BLOCK + + +'
afe2(i)=xcat(7)
afe22(i)=xcat(7)
c afe2(i)=xcat(7)/xcat(10) ! usato solo per fornire [Fe]/[Mg]
afe3(i)=xcat(5)
afe32(i)=xcat(5)
ana(i)=xcat(11)
ak(i)=xcat(12)
amg(i)=xcat(10)
amn(i)=xcat(8)
aca(i)=xcat(9)
acr(i)=xcat(6)
ati(i)=xcat(2)
aprot(i)=xcat(13)
ap(i)=xcat(3)
k=dexp(((basmod-basfor)/0.2145)-1.1445)
polcos(i)=k
basdif(i)=basmod-basfor
a=1.0-4.0*k
xcat(1)=xfor/(xfor+xmod)
acidic(i)=xcat(1)
e=1.0-xcat(1)
totcat(i)=e
afe22(i)=afe22(i)/(xfor+xmod)
afe32(i)=afe32(i)/(xfor+xmod)
afe22(i)=afe22(i)/totcat(i)*xmod
afe32(i)=afe32(i)/totcat(i)*xmod
afeo2(i)=afeo2(i)/(xfor+xmod)
afeo22(i)=afeo22(i)/(xfor+xmod)
END
SUBROUTINE TOOPSAMIS
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* polymeric aproach to melt structure (see Ottonello et al., 2001; *
* Moretti, 2005; for details) *
* computes singly bonded, doubly bonded and free oxygen ion on a *
* 1-mole of melt basis and furnishes structural details such as *
* mean extension of polymeric units, acidity etc. etc. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
REAL*8 mnom,mgom,nao05m,ko05m
parameter (ndi=300)
COMMON
1/DATINT/ Z(13), Y(13) , X(26), ZCAT(13), XX(26),
& voxm(13),eoxm(13),coxm(13),radi(13),noxy(13)
2/DATEXT/ TCENT(ndi), PBAR(ndi), POSS(ndi,13), IAUT(ndi),
& SO2(ndi), XOSSI(ndi), FS2(ndi), NCOMP,wt(ndi)
3/PARINT/ TKELV(ndi), RAPPOX(ndi),REDOX(ndi), BOSSI(ndi),
& SIO2F(ndi), PO25F(ndi), ALO15F(ndi), FEO15F(ndi),
& TIO2M(ndi), PO25M(ndi), ALO15M(ndi), FEO15M(ndi),
& CRO15M(ndi),FEOM(ndi), MNOM(ndi), CAOM(ndi),
& MGOM(ndi), NAO05M(ndi),KO05M(ndi), HO05M(ndi),
& REG(ndi), XSO2(ndi), KFLAG(ndi), SPPM(ndi),
& D(ndi), DD(ndi), BEPPE(ndi), REG2(ndi),
& REDOZ(ndi), XFETOT(ndi),SCAT(5), XCAT(13),
& S1,HO05f(ndi), O2, A,foga(ndi), XFOR,
& XFE2O3, XALLU, RAPMED, SUMFE(ndi),
& REG3(ndi), xftot, jflag, BEPPI(ndi),
& REGG(ndi), SPPB(ndi), reg4(ndi), regg3(ndi),
& xh2o(ndi), a3a2(ndi), ca3ca2(ndi),refirst(ndi),
& som(ndi),somm(ndi),xcat0(ndi),xw(ndi),basdif(ndi),
& volion(ndi),volm(ndi),por(ndi),xmol(ndi,13),xxcat(ndi,13),
$ ffeo2m(ndi),ffe2(ndi),ffe3m(ndi),ffo2m(ndi),fa3fa2(ndi),
$ fa3f2a(ndi),a3a2z(ndi),ca3c2a(ndi),fcox(ndi),fcoz(ndi),
$ petra(ndi)
4/DATOUT/ ACIDIC(ndi),POLCOS(ndi),STRUCT(ndi), TOTOLD(ndi),
& TOTANI(ndi),totali(ndi),TOTCAT(ndi),O4(ndi), O(ndi),
& O1(ndi), O3(ndi), S,sii(ndi), STOT(ndi),
& AOSSI(ndi),aozzi(ndi), SOBS(ndi), AFE2(ndi),AFE3(ndi),
& CSCAL, CSOBS, CSC, CSO,
& AFEO2(ndi), STOTT(ndi), CSTART(ndi), CSTAR(ndi),
& CSCAL2, CSOBS2, CSC2, CSO2,
& S2MENO(ndi),SO4(ndi), OXSOLF(ndi), TOTS(ndi),CS(ndi),
& s2k(ndi),so4k(ndi),afeo22(ndi),afeo2m(ndi),
& afe32(ndi),afe3m(ndi),afe22(ndi),sulf(ndi),wmol(ndi),
& aossiz(ndi),xh(ndi),xoh(ndi),xohz(ndi),xwd(ndi),ah(ndi),
& ana(ndi),aprot(ndi),ak(ndi),amg(ndi),amn(ndi),aca(ndi),
& acr(ndi),ati(ndi),ap(ndi),dv(ndi),delv(ndi),root(ndi)
5/UNIT/ ISYSRD, ISYSWR, ISYSPU, IVIDEO, ISYSQZ,
& ISYSPR, ISYSIN, ISYSCK, ISYSWZ, ISYSMF,isysvo,
$ isysho,isysfe
6/COUNT/ I, kj,jk,iter
7/FLAG/ kir(ndi),jwflag
8/WASSER/ partwa,partwb
atoop=-a
btoop=2.0+2.0*xcat(1)
ctoop=8.0*xcat(1)*(xcat(1)-1.0)
o(i)=(-btoop+dsqrt(btoop**2.-4.0*atoop*ctoop))/(2.0*atoop)
o1(i)=1.0-xcat(1)-o(i)/2.0
o3(i)=(4.0*xcat(1)-o(i))/2.0
o4(i)=o(i)/(o(i)+o3(i)+xcat(1))
c write (*,*) o1(i)+o3(i)+o(i)
c pause
s=dexp(-1.7165*dlog(o4(i))+2.8776)
s1=acidic(i)/s
o2=o1(i)/(o1(i)+s1+stot(i)+xwd(i)) ! o2 � attivit� di O=!
c aossi(i)=o2
totani(i)=o1(i)+s1+stot(i)+xwd(i)
c pause
totali(i)=totani(i)
sobs(i)=stot(i)/totani(i)
c afeo2(i)=afeo2(I)/s
c aFeO2(i)=afeo2(i)/totani(i)
c afeo22(i)=afeo22(i)/s
c afeo22(i)=afeo22(i)/totani(i)
ah(i)=totcat(i)/totani(i)
END
SUBROUTINE ACTION
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* computes the activity of sulphide and of iron ionic species *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
REAL*8 mnom,mgom,nao05m,ko05m
parameter (ndi=300)
COMMON
1/DATINT/ Z(13), Y(13) , X(26), ZCAT(13), XX(26),
& voxm(13),eoxm(13),coxm(13),radi(13),noxy(13)
2/DATEXT/ TCENT(ndi), PBAR(ndi), POSS(ndi,13), IAUT(ndi),
& SO2(ndi), XOSSI(ndi), FS2(ndi), NCOMP,wt(ndi)
3/PARINT/ TKELV(ndi), RAPPOX(ndi),REDOX(ndi), BOSSI(ndi),
& SIO2F(ndi), PO25F(ndi), ALO15F(ndi), FEO15F(ndi),
& TIO2M(ndi), PO25M(ndi), ALO15M(ndi), FEO15M(ndi),
& CRO15M(ndi),FEOM(ndi), MNOM(ndi), CAOM(ndi),
& MGOM(ndi), NAO05M(ndi),KO05M(ndi), HO05M(ndi),
& REG(ndi), XSO2(ndi), KFLAG(ndi), SPPM(ndi),
& D(ndi), DD(ndi), BEPPE(ndi), REG2(ndi),
& REDOZ(ndi), XFETOT(ndi),SCAT(5), XCAT(13),
& S1,HO05f(ndi), O2, A,foga(ndi), XFOR,
& XFE2O3, XALLU, RAPMED, SUMFE(ndi),
& REG3(ndi), xftot, jflag, BEPPI(ndi),
& REGG(ndi), SPPB(ndi), reg4(ndi), regg3(ndi),
& xh2o(ndi), a3a2(ndi), ca3ca2(ndi),refirst(ndi),
& som(ndi),somm(ndi),xcat0(ndi),xw(ndi),basdif(ndi),
& volion(ndi),volm(ndi),por(ndi),xmol(ndi,13),xxcat(ndi,13),
$ ffeo2m(ndi),ffe2(ndi),ffe3m(ndi),ffo2m(ndi),fa3fa2(ndi),
$ fa3f2a(ndi),a3a2z(ndi),ca3c2a(ndi),fcox(ndi),fcoz(ndi),
$ petra(ndi)
4/DATOUT/ ACIDIC(ndi),POLCOS(ndi),STRUCT(ndi), TOTOLD(ndi),
& TOTANI(ndi),totali(ndi),TOTCAT(ndi),O4(ndi), O(ndi),
& O1(ndi), O3(ndi), S,sii(ndi), STOT(ndi),
& AOSSI(ndi),aozzi(ndi), SOBS(ndi), AFE2(ndi), AFE3(ndi),
& CSCAL, CSOBS, CSC, CSO,
& AFEO2(ndi), STOTT(ndi), CSTART(ndi), CSTAR(ndi),
& CSCAL2, CSOBS2, CSC2, CSO2,
& S2MENO(ndi),SO4(ndi), OXSOLF(ndi), TOTS(ndi),CS(ndi),
& s2k(ndi),so4k(ndi),afeo22(ndi),afeo2m(ndi),
& afe32(ndi),afe3m(ndi),afe22(ndi),sulf(ndi),wmol(ndi),
& aossiz(ndi),xh(ndi),xoh(ndi),xohz(ndi),xwd(ndi),ah(ndi),
& ana(ndi),aprot(ndi),ak(ndi),amg(ndi),amn(ndi),aca(ndi),
& acr(ndi),ati(ndi),ap(ndi),dv(ndi),delv(ndi),root(ndi)
5/UNIT/ ISYSRD, ISYSWR, ISYSPU, IVIDEO, ISYSQZ,
& ISYSPR, ISYSIN, ISYSCK, ISYSWZ, ISYSMF,isysvo,
$ isysho,isysfe
6/COUNT/ I, kj,jk,iter
7/FLAG/ kir(ndi),jwflag
8/WASSER/ partwa,partwb
C
c sobs(i)=stot(i)/totani(i)
totold(i)=o1(i)+s1
struct(i)=s1
aossi(i)=o2
aozzi(i)=aossi(i)
c I volumi sotto sono in joule/bar ...fattore 0.1...
c Raggi ionici di Shannon
c voh=(8.28528253/3.)*3.14159*(1.6066-0.38+0./10000*
c $ (tkelv(i)-298.15))**3
c voh=(4./3.)*3.14159*(1.6066+0./10000*(tkelv(i)-298.15))**3
voh=(4./3.)*3.14159*(1.40+0./10000*(tkelv(i)-298.15))**3
voh=voh*0.6022045
c vo2=(4./3.)*3.14159*(1.6066+0./10000*(Tkelv(i)-298.15))**3
vo2=(4./3.)*3.14159*(1.40+0./10000*(Tkelv(i)-298.15))**3
vo2=vo2*0.6022045
c vh=(4./3.)*3.14159*(-0.38+0./10000*(tkelv(i)-298.15))**3
vh=(4./3.)*3.14159*(0.+0./10000*(tkelv(i)-298.15))**3
vh=vh*0.6022045
if (VH.LT.0) vh=0.
c Calcolo delv assumendo espansione termica = 0.
delv0=vh+vo2-voh+0./1000.*(tkelv(i)-298.15)
delv(i)=delv0
delv0=delv0*0.1/(8.3147*2.303)
delv0=delv0*(pbar(i)-1)/tkelv(i)
c INSERISCO I LAST VALUES
c change with respect to from Moretti 2005; as in Moretti and Ottonello (2005); no sann
c In future to be implemented as in Moretti et al. (2014)
partwa=0.
partwb=-440.261
sann=0.
partw=10.**(partwa+partwb/tkelv(i)+0.5*sann*(pbar(i)-1.)-delv0)
c partw=10.**(38.)
ratius=(aossi(i)/ah(i))/partw
xoh(i)=xcat0(i)*ratius/(ratius+1)
xh(I)=XCAT0(I)-XOH(I)
xoh(i)=dsqrt(xohz(i)*xoh(i))
END