This notebook runs the StatGeochem.jl package, which implements an interface for interacting with MELTS from the Julia programming language, including from Jupyter notebooks such as this.
StatGeochem.jl also includes some of the codes and utilities used in Keller & Schoene 2012, Keller et al. 2015 and Keller & Schoene 2018.
If running this notebook as an online Binder notebook and the webpage times out, click the badge at left to relaunch (refreshing will not work). Note that any changes will be lost!
Hint: shift
-enter
to run a single cell, or from the Cell
menu select Run All
to run the whole file. Any code from this notebook can be copied and pasted into the Julia REPL or a .jl
script.
## --- Load the StatGeochem package
using StatGeochem
using Plots
# Download precompiled executable from caltech
alphameltsversion = "linux_alphamelts_1-9"
download("https://magmasource.caltech.edu/alphamelts/zipfiles/$alphameltsversion.zip","./$alphameltsversion.zip")
run(`unzip -o $alphameltsversion.zip`);
run(`mv $alphameltsversion/alphamelts_linux64 $alphameltsversion/alphamelts`);
# The absolute path to the alphamelts perl script must be input here:
# meltspath = "/usr/local/bin/run_alphamelts.command"
meltspath = abspath("/$alphameltsversion/run_alphamelts.command");
# The absolute or relative path to a direcory where you want to run MELTS -
# A number of configuration and output files will be written here.
scratchdir = "scratch/";
## --- # # # # # # # # # # # equilibrium batch crystallization # # # # # # # # # # # #
# Conditions
P_range = (5800,5800) # bar
T_range = (1700,450) # C
# Elements to include in simulation
elements = ["SiO2","TiO2","Al2O3","Fe2O3","Cr2O3", "FeO", "MnO", "MgO", "CaO","Na2O", "K2O","P2O5", "H2O",]
# Starting composition (must correspond directly with elements above)
composition = [61.437, 0.380, 14.864, 3.383, 0, 0, 0.067, 1.606, 3.286, 3.435, 3.494, 0.228, 8.0,]
# Run simulation
melts_configure(meltspath, scratchdir, composition, elements, T_range, P_range,
batchstring="1\nsc.melts\n10\n1\n3\n1\nliquid\n1\n1.0\n0\n10\n0\n4\n0\n",
dT=-7, dP=0, index=1, version="pMELTS",mode="isobaric",fo2path="FMQ")
# Read results
melt = melts_query_liquid(scratchdir, index=1)
solid = melts_query_solid(scratchdir, index=1)
modes = melts_clean_modes(scratchdir, index=1)
ALPHAMELTS_DELTAP 0.0 ALPHAMELTS_MODE isobaric ALPHAMELTS_CELSIUS_OUTPUT true ALPHAMELTS_DELTAT -7.0 ALPHAMELTS_MAXT 3000.0 ALPHAMELTS_MINT 450.0 ALPHAMELTS_MINP 2.0 ALPHAMELTS_MAXP 90000.0 ALPHAMELTS_VERSION pMELTS Checking for updates... *** alphaMELTS 1.2 -- pMELTS isobar w/ or w/o liquid *** This front end is the work of Paul Asimow and Paula Antoshechkina (nee Smith) and it uses the MELTS and pMELTS algorithms developed by Mark Ghiorso & co-workers. You are welcome to use and distribute this program, under the condition that you acknowledge all the contributors by citing the appropriate references with any results: Smith & Asimow (2005) -- front end Ghiorso et al (2002) -- pMELTS thermodynamic model Asimow & Ghiorso (1998) -- subsolidus calculations (if used) There may be others, depending on the exact calculation performed and the source and / or partition coefficients (e.g. D(P,T,X)) used. See Smith & Asimow (2005), documentation and the forum for details. Unable to automatically check for updates; check for updates at http://magmasource.caltech.edu/alphamelts/ and http://magmasource.caltech.edu/forum/ Choose: 1. Read MELTS file to set composition of system 2. Twiddle starting or continuation parameters 3. Single (batch) calculation 4. Execute (follow path, mineral isograd or melt contour) 5. Set fO2 buffer 6. Set H2O (ppm) or aH2O 7. Impose initial entropy, enthalpy or volume 8. Adjust solid phase setting(s) 9. Turn liquid on / off 10. Turn phase diagram mode on / off 11. Update state using restart file 12. Update composition using MELTS file 13. Write out restart file 14. Write out MELTS file 15. Write thermodynamic output for all phases 16. Calculate integrated melt and output file(s) 17. Fit parental melt composition (amoeba) 18. Cumulate Invertor (not yet implemented) -1. Turn off menu display for options 1-18 0. QUIT Your choice: MELTS filename: input file open Successfully read 'initial composition: sio2 61.3266' Successfully read 'initial composition: tio2 0.3793' Successfully read 'initial composition: al2o3 14.8372' Successfully read 'initial composition: fe2o3 3.3769' Successfully read 'initial composition: cr2o3 0.0' Successfully read 'initial composition: feo 0.0' Successfully read 'initial composition: mno 0.0668' Successfully read 'initial composition: mgo 1.6031' Successfully read 'initial composition: nio 0.0' Successfully read 'initial composition: coo 0.0' Successfully read 'initial composition: cao 3.28' Successfully read 'initial composition: na2o 3.4288' Successfully read 'initial composition: k2o 3.4877' Successfully read 'initial composition: p2o5 0.2275' Successfully read 'initial composition: h2o 7.9856' Successfully read 'initial temperature: 1700.0' Successfully read 'initial pressure: 5800.0' Successfully read 'log fo2 path: fmq' Choose: 1. Read MELTS file to set composition of system 2. Twiddle starting or continuation parameters 3. Single (batch) calculation 4. Execute (follow path, mineral isograd or melt contour) 5. Set fO2 buffer 6. Set H2O (ppm) or aH2O 7. Impose initial entropy, enthalpy or volume 8. Adjust solid phase setting(s) 9. Turn liquid on / off 10. Turn phase diagram mode on / off 11. Update state using restart file 12. Update composition using MELTS file 13. Write out restart file 14. Write out MELTS file 15. Write thermodynamic output for all phases 16. Calculate integrated melt and output file(s) 17. Fit parental melt composition (amoeba) 18. Cumulate Invertor (not yet implemented) -1. Turn off menu display for options 1-18 0. QUIT Your choice: Turn phase diagram mode on (1) or off (0)? Choose: 1. Read MELTS file to set composition of system 2. Twiddle starting or continuation parameters 3. Single (batch) calculation 4. Execute (follow path, mineral isograd or melt contour) 5. Set fO2 buffer 6. Set H2O (ppm) or aH2O 7. Impose initial entropy, enthalpy or volume 8. Adjust solid phase setting(s) 9. Turn liquid on / off 10. Turn phase diagram mode on / off 11. Update state using restart file 12. Update composition using MELTS file 13. Write out restart file 14. Write out MELTS file 15. Write thermodynamic output for all phases 16. Calculate integrated melt and output file(s) 17. Fit parental melt composition (amoeba) 18. Cumulate Invertor (not yet implemented) -1. Turn off menu display for options 1-18 0. QUIT Your choice: Superliquidus (1) or subsolidus (0) initial guess ? Phase to track boundary of (by name, lower case): Type of melt contour to track: 0. Phi (melt fraction by volume) 1. F (melt fraction by mass) 2. aH2O (activity of water in the melt) Choose: Type the F value to set (or < 0.0 for default): Use special monotonic search for troublesome phases (1) or quick search (0)? Initial Guess (not an isograd solution): P 5800.000000, T 1700.000000 liquid: 99.702 g 61.51 0.38 14.88 0.41 2.68 0.07 1.61 3.29 3.44 3.50 0.23 8.01 Activity of H2O = 0.561749 Melt fraction = 1 ...Adding the solid phase biotite to the assemblage. ...Dropping phase biotite from the assemblage. ...Adding the solid phase biotite to the assemblage. ...Dropping phase biotite from the assemblage. Isograd solution at: P 5800.000000, T 1016.507813 liquid: 99.707 g 61.51 0.38 14.88 0.46 2.64 0.07 1.61 3.29 3.44 3.50 0.23 8.01 Activity of H2O = 0.776445 Melt fraction = 1 Choose: 1. Read MELTS file to set composition of system 2. Twiddle starting or continuation parameters 3. Single (batch) calculation 4. Execute (follow path, mineral isograd or melt contour) 5. Set fO2 buffer 6. Set H2O (ppm) or aH2O 7. Impose initial entropy, enthalpy or volume 8. Adjust solid phase setting(s) 9. Turn liquid on / off 10. Turn phase diagram mode on / off 11. Update state using restart file 12. Update composition using MELTS file 13. Write out restart file 14. Write out MELTS file 15. Write thermodynamic output for all phases 16. Calculate integrated melt and output file(s) 17. Fit parental melt composition (amoeba) 18. Cumulate Invertor (not yet implemented) -1. Turn off menu display for options 1-18 0. QUIT Your choice: Turn phase diagram mode on (1) or off (0)? Choose: 1. Read MELTS file to set composition of system 2. Twiddle starting or continuation parameters 3. Single (batch) calculation 4. Execute (follow path, mineral isograd or melt contour) 5. Set fO2 buffer 6. Set H2O (ppm) or aH2O 7. Impose initial entropy, enthalpy or volume 8. Adjust solid phase setting(s) 9. Turn liquid on / off 10. Turn phase diagram mode on / off 11. Update state using restart file 12. Update composition using MELTS file 13. Write out restart file 14. Write out MELTS file 15. Write thermodynamic output for all phases 16. Calculate integrated melt and output file(s) 17. Fit parental melt composition (amoeba) 18. Cumulate Invertor (not yet implemented) -1. Turn off menu display for options 1-18 0. QUIT Your choice: Initial alphaMELTS calculation at: P 5800.000000, T 1016.507813 liquid: 99.707 g 61.51 0.38 14.88 0.46 2.64 0.07 1.61 3.29 3.44 3.50 0.23 8.01 Activity of H2O = 0.776445 Melt fraction = 1 ...Adding the solid phase biotite to the assemblage. alphaMELTS at: P 5800.000000, T 1009.507813 liquid: 99.276 g 61.59 0.38 14.89 0.46 2.64 0.07 1.49 3.30 3.45 3.46 0.23 8.03 Activity of H2O = 0.780322 Melt fraction = 0.995674 biotite: 0.431308 g, composition K(Fe''0.01Mg0.99)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 1002.507813 liquid: 98.876 g 61.66 0.38 14.90 0.47 2.65 0.07 1.38 3.32 3.47 3.43 0.23 8.04 Activity of H2O = 0.784258 Melt fraction = 0.991663 biotite: 0.831234 g, composition K(Fe''0.01Mg0.99)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 995.507813 liquid: 98.503 g 61.73 0.39 14.91 0.47 2.66 0.07 1.28 3.33 3.48 3.40 0.23 8.05 Activity of H2O = 0.788257 Melt fraction = 0.987921 biotite: 1.204323 g, composition K(Fe''0.01Mg0.99)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 988.507813 liquid: 98.156 g 61.80 0.39 14.92 0.48 2.66 0.07 1.18 3.34 3.49 3.38 0.23 8.07 Activity of H2O = 0.792322 Melt fraction = 0.984431 biotite: 1.552335 g, composition K(Fe''0.01Mg0.99)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 981.507813 liquid: 97.831 g 61.86 0.39 14.93 0.48 2.67 0.07 1.09 3.35 3.50 3.35 0.23 8.08 Activity of H2O = 0.796458 Melt fraction = 0.981175 biotite: 1.876965 g, composition K(Fe''0.01Mg0.99)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 974.507813 liquid: 97.529 g 61.92 0.39 14.94 0.48 2.67 0.07 1.00 3.36 3.52 3.32 0.23 8.09 Activity of H2O = 0.800668 Melt fraction = 0.978138 biotite: 2.179847 g, composition K(Fe''0.01Mg0.99)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 967.507813 liquid: 97.246 g 61.97 0.39 14.95 0.49 2.67 0.07 0.92 3.37 3.53 3.30 0.23 8.10 Activity of H2O = 0.804958 Melt fraction = 0.975302 biotite: 2.462567 g, composition K(Fe''0.01Mg0.99)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 960.507813 liquid: 96.982 g 62.02 0.39 14.96 0.49 2.67 0.07 0.85 3.38 3.54 3.28 0.23 8.11 Activity of H2O = 0.809331 Melt fraction = 0.972654 biotite: 2.726670 g, composition K(Fe''0.01Mg0.99)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 953.507813 liquid: 96.735 g 62.07 0.39 14.96 0.49 2.67 0.07 0.78 3.39 3.54 3.26 0.24 8.12 Activity of H2O = 0.813791 Melt fraction = 0.970177 biotite: 2.973673 g, composition K(Fe''0.01Mg0.99)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 946.507813 liquid: 96.504 g 62.12 0.39 14.97 0.50 2.67 0.07 0.72 3.40 3.55 3.24 0.24 8.13 Activity of H2O = 0.818342 Melt fraction = 0.967856 biotite: 3.205078 g, composition K(Fe''0.02Mg0.98)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 939.507813 liquid: 96.287 g 62.16 0.39 14.98 0.50 2.67 0.07 0.66 3.41 3.56 3.22 0.24 8.14 Activity of H2O = 0.822987 Melt fraction = 0.965676 biotite: 3.422385 g, composition K(Fe''0.02Mg0.98)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 932.507813 liquid: 96.083 g 62.20 0.39 14.98 0.51 2.67 0.07 0.60 3.41 3.57 3.21 0.24 8.15 Activity of H2O = 0.827731 Melt fraction = 0.963623 biotite: 3.627111 g, composition K(Fe''0.02Mg0.98)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 925.507813 liquid: 95.889 g 62.24 0.40 14.99 0.51 2.66 0.07 0.55 3.42 3.58 3.19 0.24 8.16 Activity of H2O = 0.832576 Melt fraction = 0.961681 biotite: 3.820812 g, composition K(Fe''0.03Mg0.97)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 918.507813 liquid: 95.705 g 62.28 0.40 15.00 0.51 2.65 0.07 0.51 3.43 3.58 3.17 0.24 8.16 Activity of H2O = 0.837527 Melt fraction = 0.959833 biotite: 4.005108 g, composition K(Fe''0.03Mg0.97)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 911.507813 liquid: 95.529 g 62.32 0.40 15.00 0.52 2.64 0.07 0.46 3.43 3.59 3.16 0.24 8.17 Activity of H2O = 0.842588 Melt fraction = 0.958061 biotite: 4.181724 g, composition K(Fe''0.03Mg0.97)3AlSi3O10(OH)2 alphaMELTS at: P 5800.000000, T 904.507813 liquid: 95.358 g 62.36 0.40 15.01 0.52 2.63 0.07 0.42 3.44 3.60 3.15 0.24 8.18 Activity of H2O = 0.847761 Melt fraction = 0.956348 biotite: 4.352531 g, composition K(Fe''0.04Mg0.96)3AlSi3O10(OH)2 ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 897.507813 liquid: 95.191 g 62.39 0.40 15.01 0.52 2.62 0.07 0.38 3.45 3.60 3.13 0.24 8.19 Activity of H2O = 0.853052 Melt fraction = 0.954673 biotite: 4.519606 g, composition K(Fe''0.04Mg0.96)3AlSi3O10(OH)2 ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase feldspar to the assemblage. ...Dropping phase feldspar from the assemblage. ...Adding the solid phase feldspar to the assemblage. ...Dropping phase feldspar from the assemblage. ...Adding the solid phase clinopyroxene to the assemblage. ...Adding the solid phase apatite to the assemblage. alphaMELTS at: P 5800.000000, T 890.507813 liquid: 94.983 g 62.45 0.39 15.02 0.52 2.60 0.07 0.35 3.44 3.61 3.12 0.23 8.20 Activity of H2O = 0.858716 Melt fraction = 0.952588 clinopyroxene: 0.036804 g, composition cpx Na0.06Ca0.92Fe''0.25Mg0.33Fe'''0.07Ti0.40Al0.74Si1.23O6 biotite: 4.679182 g, composition K(Fe''0.05Mg0.95)3AlSi3O10(OH)2 apatite: 0.012 g, composition Ca5(PO4)3OH ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase feldspar to the assemblage. alphaMELTS at: P 5800.000000, T 883.507813 liquid: 93.581 g 62.54 0.36 14.98 0.52 2.59 0.07 0.32 3.41 3.64 3.01 0.24 8.32 Activity of H2O = 0.869644 Melt fraction = 0.938524 clinopyroxene: 0.343151 g, composition cpx Na0.06Ca0.92Fe''0.26Mg0.32Fe'''0.07Ti0.40Al0.73Si1.24O6 biotite: 4.756278 g, composition K(Fe''0.06Mg0.94)3AlSi3O10(OH)2 feldspar: 1.015215 g, composition K0.83Na0.16Ca0.01Al1.01Si2.99O8 apatite: 0.015 g, composition Ca5(PO4)3OH ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 876.507813 liquid: 91.556 g 62.61 0.32 14.92 0.53 2.60 0.07 0.31 3.41 3.68 2.81 0.24 8.50 Activity of H2O = 0.883285 Melt fraction = 0.918208 clinopyroxene: 0.648666 g, composition cpx Na0.07Ca0.92Fe''0.27Mg0.32Fe'''0.07Ti0.39Al0.72Si1.25O6 biotite: 4.807883 g, composition K(Fe''0.06Mg0.94)3AlSi3O10(OH)2 feldspar: 2.684726 g, composition K0.82Na0.17Ca0.01Al1.01Si2.99O8 apatite: 0.014 g, composition Ca5(PO4)3OH ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 869.507813 liquid: 89.683 g 62.67 0.29 14.85 0.53 2.60 0.07 0.29 3.41 3.72 2.63 0.25 8.67 Activity of H2O = 0.896833 Melt fraction = 0.89943 clinopyroxene: 0.929735 g, composition cpx Na0.07Ca0.92Fe''0.27Mg0.31Fe'''0.07Ti0.39Al0.71Si1.26O6 biotite: 4.866644 g, composition K(Fe''0.07Mg0.93)3AlSi3O10(OH)2 feldspar: 4.217472 g, composition K0.81Na0.18Ca0.01Al1.01Si2.99O8 apatite: 0.014 g, composition Ca5(PO4)3OH ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 862.507813 liquid: 87.940 g 62.73 0.26 14.80 0.54 2.60 0.08 0.28 3.41 3.75 2.46 0.25 8.84 Activity of H2O = 0.910372 Melt fraction = 0.881942 clinopyroxene: 1.190842 g, composition cpx Na0.07Ca0.91Fe''0.28Mg0.31Fe'''0.07Ti0.38Al0.70Si1.27O6 biotite: 4.932307 g, composition K(Fe''0.08Mg0.92)3AlSi3O10(OH)2 feldspar: 5.633933 g, composition K0.80Na0.19Ca0.01Al1.01Si2.99O8 apatite: 0.015 g, composition Ca5(PO4)3OH ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 855.507813 liquid: 86.302 g 62.79 0.23 14.74 0.54 2.60 0.08 0.26 3.42 3.78 2.30 0.26 9.01 Activity of H2O = 0.924002 Melt fraction = 0.865522 clinopyroxene: 1.437056 g, composition cpx Na0.08Ca0.91Fe''0.29Mg0.31Fe'''0.07Ti0.37Al0.69Si1.28O6 biotite: 5.004499 g, composition K(Fe''0.09Mg0.91)3AlSi3O10(OH)2 feldspar: 6.951835 g, composition K0.79Na0.20Ca0.01Al1.01Si2.99O8 apatite: 0.016 g, composition Ca5(PO4)3OH ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase leucite ss to the assemblage. alphaMELTS at: P 5800.000000, T 848.507813 liquid: 82.903 g 63.07 0.20 14.53 0.54 2.62 0.08 0.25 3.45 3.61 2.17 0.25 9.22 Activity of H2O = 0.942133 Melt fraction = 0.831431 clinopyroxene: 1.727847 g, composition cpx Na0.08Ca0.91Fe''0.30Mg0.30Fe'''0.08Ti0.36Al0.66Si1.31O6 biotite: 5.123926 g, composition K(Fe''0.10Mg0.90)3AlSi3O10(OH)2 feldspar: 8.216228 g, composition K0.80Na0.20Ca0.01Al1.01Si2.99O8 leucite ss: 1.689022 g, composition K0.01Na0.99AlSi2O5.12(OH)1.76 apatite: 0.051 g, composition Ca5(PO4)3OH ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 841.507813 liquid: 79.665 g 63.37 0.18 14.32 0.55 2.63 0.08 0.23 3.49 3.43 2.04 0.24 9.43 Activity of H2O = 0.960138 Melt fraction = 0.798963 clinopyroxene: 2.031540 g, composition cpx Na0.08Ca0.91Fe''0.32Mg0.30Fe'''0.08Ti0.34Al0.63Si1.34O6 biotite: 5.248428 g, composition K(Fe''0.11Mg0.89)3AlSi3O10(OH)2 feldspar: 9.300912 g, composition K0.80Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 3.378858 g, composition K0.01Na0.99AlSi2O5.11(OH)1.78 apatite: 0.086 g, composition Ca5(PO4)3OH ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...One of the solid phases has undergone phase separation. alphaMELTS at: P 5800.000000, T 834.507813 liquid: 76.474 g 63.68 0.16 14.17 0.54 2.60 0.09 0.22 3.43 3.26 1.94 0.23 9.68 Activity of H2O = 0.981413 Melt fraction = 0.766963 clinopyroxene: 2.002338 g, composition cpx Na0.08Ca0.91Fe''0.32Mg0.30Fe'''0.08Ti0.34Al0.63Si1.34O6 clinopyroxene: 0.674243 g, composition cpx Na0.08Ca0.87Fe''0.37Mg0.46Fe'''0.08Ti0.09Al0.26Si1.78O6 biotite: 5.229945 g, composition K(Fe''0.13Mg0.87)3AlSi3O10(OH)2 feldspar: 10.279334 g, composition K0.81Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 4.935999 g, composition K0.01Na0.99AlSi2O5.11(OH)1.79 apatite: 0.114 g, composition Ca5(PO4)3OH ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase water to the assemblage. alphaMELTS at: P 5800.000000, T 827.507813 liquid: 73.367 g 64.03 0.15 14.05 0.53 2.54 0.09 0.20 3.35 3.09 1.84 0.23 9.90 Activity of H2O = 1.00016 Melt fraction = 0.735811 clinopyroxene: 1.883447 g, composition cpx Na0.08Ca0.91Fe''0.33Mg0.29Fe'''0.08Ti0.34Al0.63Si1.34O6 clinopyroxene: 1.538316 g, composition cpx Na0.08Ca0.87Fe''0.38Mg0.45Fe'''0.08Ti0.09Al0.25Si1.79O6 biotite: 5.164668 g, composition K(Fe''0.14Mg0.86)3AlSi3O10(OH)2 feldspar: 11.212812 g, composition K0.81Na0.18Ca0.01Al1.01Si2.99O8 leucite ss: 6.368844 g, composition K0.01Na0.99AlSi2O5.10(OH)1.80 apatite: 0.140 g, composition Ca5(PO4)3OH water: 0.034 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 820.507813 liquid: 69.333 g 64.64 0.14 14.02 0.51 2.45 0.10 0.19 3.13 2.92 1.74 0.23 9.95 Activity of H2O = 1.00013 Melt fraction = 0.695353 clinopyroxene: 1.582366 g, composition cpx Na0.08Ca0.91Fe''0.33Mg0.28Fe'''0.08Ti0.35Al0.64Si1.34O6 clinopyroxene: 3.144754 g, composition cpx Na0.09Ca0.87Fe''0.39Mg0.45Fe'''0.08Ti0.09Al0.25Si1.80O6 biotite: 4.823611 g, composition K(Fe''0.15Mg0.85)3AlSi3O10(OH)2 feldspar: 12.571806 g, composition K0.81Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 7.780767 g, composition K0.01Na0.99AlSi2O5.10(OH)1.80 apatite: 0.167 g, composition Ca5(PO4)3OH water: 0.306 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 813.507813 liquid: 65.967 g 65.20 0.14 14.00 0.48 2.35 0.10 0.19 2.93 2.75 1.64 0.22 10.00 Activity of H2O = 1.00011 Melt fraction = 0.661595 clinopyroxene: 1.373531 g, composition cpx Na0.08Ca0.90Fe''0.34Mg0.28Fe'''0.08Ti0.35Al0.64Si1.33O6 clinopyroxene: 4.434305 g, composition cpx Na0.09Ca0.86Fe''0.40Mg0.45Fe'''0.08Ti0.08Al0.24Si1.80O6 biotite: 4.558973 g, composition K(Fe''0.16Mg0.84)3AlSi3O10(OH)2 feldspar: 13.699524 g, composition K0.81Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 8.955902 g, composition K0.01Na0.99AlSi2O5.10(OH)1.81 apatite: 0.189 g, composition Ca5(PO4)3OH water: 0.530 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 806.507813 liquid: 63.109 g 65.72 0.13 13.98 0.46 2.26 0.11 0.18 2.75 2.60 1.55 0.22 10.04 Activity of H2O = 1.00008 Melt fraction = 0.632936 clinopyroxene: 1.230601 g, composition cpx Na0.08Ca0.90Fe''0.34Mg0.27Fe'''0.07Ti0.35Al0.64Si1.33O6 clinopyroxene: 5.487351 g, composition cpx Na0.09Ca0.86Fe''0.41Mg0.45Fe'''0.07Ti0.08Al0.23Si1.81O6 biotite: 4.352237 g, composition K(Fe''0.17Mg0.83)3AlSi3O10(OH)2 feldspar: 14.648592 g, composition K0.80Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 9.953361 g, composition K0.01Na0.99AlSi2O5.09(OH)1.82 apatite: 0.208 g, composition Ca5(PO4)3OH water: 0.719 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase rhm oxide to the assemblage. ...Dropping phase rhm oxide from the assemblage. ...Adding the solid phase rhm oxide to the assemblage. ...Dropping phase rhm oxide from the assemblage. alphaMELTS at: P 5800.000000, T 799.507813 liquid: 60.648 g 66.22 0.12 13.96 0.44 2.16 0.11 0.17 2.59 2.45 1.47 0.22 10.09 Activity of H2O = 1.00006 Melt fraction = 0.608266 clinopyroxene: 1.135641 g, composition cpx Na0.08Ca0.90Fe''0.34Mg0.27Fe'''0.07Ti0.36Al0.65Si1.32O6 clinopyroxene: 6.359241 g, composition cpx Na0.09Ca0.86Fe''0.42Mg0.45Fe'''0.07Ti0.08Al0.23Si1.82O6 biotite: 4.190382 g, composition K(Fe''0.18Mg0.82)3AlSi3O10(OH)2 feldspar: 15.455866 g, composition K0.80Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 10.813941 g, composition K0.01Na0.99AlSi2O5.09(OH)1.82 apatite: 0.224 g, composition Ca5(PO4)3OH water: 0.879 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase rhm oxide to the assemblage. ...Dropping phase rhm oxide from the assemblage. ...Adding the solid phase rhm oxide to the assemblage. ...Dropping phase rhm oxide from the assemblage. alphaMELTS at: P 5800.000000, T 792.507813 liquid: 58.506 g 66.69 0.11 13.94 0.42 2.06 0.11 0.16 2.44 2.32 1.39 0.22 10.13 Activity of H2O = 1.00005 Melt fraction = 0.58679 clinopyroxene: 1.076013 g, composition cpx Na0.08Ca0.90Fe''0.35Mg0.26Fe'''0.07Ti0.36Al0.65Si1.32O6 clinopyroxene: 7.089433 g, composition cpx Na0.09Ca0.86Fe''0.42Mg0.44Fe'''0.07Ti0.07Al0.22Si1.82O6 biotite: 4.063905 g, composition K(Fe''0.19Mg0.81)3AlSi3O10(OH)2 feldspar: 16.148100 g, composition K0.80Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 11.566786 g, composition K0.01Na0.99AlSi2O5.09(OH)1.83 apatite: 0.238 g, composition Ca5(PO4)3OH water: 1.017 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase rhm oxide to the assemblage. alphaMELTS at: P 5800.000000, T 785.507813 liquid: 56.512 g 67.07 0.10 14.02 0.40 1.93 0.12 0.15 2.34 2.18 1.32 0.21 10.16 Activity of H2O = 1.00003 Melt fraction = 0.566796 clinopyroxene: 0.416188 g, composition cpx Na0.08Ca0.90Fe''0.35Mg0.26Fe'''0.07Ti0.37Al0.66Si1.31O6 clinopyroxene: 8.254124 g, composition cpx Na0.09Ca0.85Fe''0.43Mg0.45Fe'''0.07Ti0.07Al0.22Si1.83O6 biotite: 3.807323 g, composition K(Fe''0.19Mg0.81)3AlSi3O10(OH)2 feldspar: 16.885056 g, composition K0.80Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 12.286933 g, composition K0.01Na0.99AlSi2O5.08(OH)1.83 rhm oxide: 0.137389 g, composition Mn0.01Fe''0.88Mg0.04Fe'''0.15Ti0.93O3 apatite: 0.252 g, composition Ca5(PO4)3OH water: 1.154 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Dropping phase clinopyroxene from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 778.507813 liquid: 54.779 g 67.44 0.10 14.08 0.37 1.80 0.12 0.15 2.24 2.05 1.25 0.21 10.19 Activity of H2O = 1.00002 Melt fraction = 0.549411 clinopyroxene: 9.129142 g, composition cpx Na0.09Ca0.85Fe''0.43Mg0.45Fe'''0.07Ti0.07Al0.21Si1.84O6 biotite: 3.611659 g, composition K(Fe''0.19Mg0.81)3AlSi3O10(OH)2 feldspar: 17.503284 g, composition K0.80Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 12.914241 g, composition K0.01Na0.99AlSi2O5.08(OH)1.84 rhm oxide: 0.233720 g, composition Mn0.01Fe''0.88Mg0.04Fe'''0.14Ti0.93O3 apatite: 0.263 g, composition Ca5(PO4)3OH water: 1.271 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 771.507813 liquid: 53.287 g 67.83 0.09 14.09 0.36 1.70 0.12 0.14 2.13 1.93 1.18 0.21 10.22 Activity of H2O = 1.00001 Melt fraction = 0.534457 clinopyroxene: 9.569315 g, composition cpx Na0.09Ca0.85Fe''0.44Mg0.45Fe'''0.06Ti0.06Al0.21Si1.85O6 biotite: 3.519006 g, composition K(Fe''0.20Mg0.80)3AlSi3O10(OH)2 feldspar: 17.979324 g, composition K0.80Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 13.455435 g, composition K0.01Na0.99AlSi2O5.08(OH)1.84 rhm oxide: 0.255811 g, composition Mn0.01Fe''0.89Mg0.04Fe'''0.14Ti0.93O3 apatite: 0.272 g, composition Ca5(PO4)3OH water: 1.365 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 764.507813 liquid: 51.950 g 68.19 0.08 14.09 0.34 1.60 0.13 0.13 2.03 1.82 1.12 0.21 10.26 Activity of H2O = 1 Melt fraction = 0.521049 clinopyroxene: 9.963522 g, composition cpx Na0.09Ca0.85Fe''0.44Mg0.45Fe'''0.06Ti0.06Al0.20Si1.85O6 biotite: 3.440781 g, composition K(Fe''0.21Mg0.79)3AlSi3O10(OH)2 feldspar: 18.396548 g, composition K0.80Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 13.947181 g, composition K0.00Na1.00AlSi2O5.07(OH)1.85 rhm oxide: 0.275492 g, composition Mn0.01Fe''0.89Mg0.03Fe'''0.14Ti0.93O3 apatite: 0.280 g, composition Ca5(PO4)3OH water: 1.449 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 757.507813 liquid: 50.745 g 68.54 0.07 14.10 0.32 1.50 0.13 0.12 1.94 1.72 1.06 0.21 10.28 Activity of H2O = 0.999994 Melt fraction = 0.508975 clinopyroxene: 10.317670 g, composition cpx Na0.09Ca0.85Fe''0.45Mg0.45Fe'''0.06Ti0.06Al0.20Si1.86O6 biotite: 3.374627 g, composition K(Fe''0.22Mg0.78)3AlSi3O10(OH)2 feldspar: 18.762584 g, composition K0.80Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 14.397376 g, composition K0.00Na1.00AlSi2O5.07(OH)1.86 rhm oxide: 0.293191 g, composition Mn0.01Fe''0.89Mg0.03Fe'''0.14Ti0.93O3 apatite: 0.286 g, composition Ca5(PO4)3OH water: 1.524 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 750.507813 liquid: 49.656 g 68.87 0.07 14.10 0.30 1.41 0.13 0.12 1.85 1.62 1.01 0.21 10.31 Activity of H2O = 0.999988 Melt fraction = 0.498062 clinopyroxene: 10.636691 g, composition cpx Na0.09Ca0.84Fe''0.46Mg0.45Fe'''0.06Ti0.05Al0.19Si1.87O6 biotite: 3.318685 g, composition K(Fe''0.22Mg0.78)3AlSi3O10(OH)2 feldspar: 19.083673 g, composition K0.80Na0.19Ca0.01Al1.01Si2.99O8 leucite ss: 14.812332 g, composition K0.00Na1.00AlSi2O5.07(OH)1.86 rhm oxide: 0.309198 g, composition Mn0.01Fe''0.89Mg0.03Fe'''0.13Ti0.93O3 apatite: 0.292 g, composition Ca5(PO4)3OH water: 1.590 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 743.507813 liquid: 48.669 g 69.19 0.06 14.11 0.28 1.32 0.13 0.11 1.77 1.52 0.96 0.21 10.33 Activity of H2O = 0.999983 Melt fraction = 0.488166 clinopyroxene: 10.924728 g, composition cpx Na0.09Ca0.84Fe''0.46Mg0.45Fe'''0.06Ti0.05Al0.19Si1.87O6 biotite: 3.271454 g, composition K(Fe''0.23Mg0.77)3AlSi3O10(OH)2 feldspar: 19.365018 g, composition K0.80Na0.19Ca0.00Al1.00Si3.00O8 leucite ss: 15.197149 g, composition K0.00Na1.00AlSi2O5.07(OH)1.87 rhm oxide: 0.323729 g, composition Mn0.01Fe''0.89Mg0.03Fe'''0.13Ti0.93O3 apatite: 0.297 g, composition Ca5(PO4)3OH water: 1.650 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 736.507813 liquid: 47.772 g 69.49 0.06 14.12 0.27 1.23 0.14 0.10 1.70 1.43 0.91 0.21 10.35 Activity of H2O = 0.999979 Melt fraction = 0.479169 clinopyroxene: 11.185283 g, composition cpx Na0.09Ca0.84Fe''0.47Mg0.45Fe'''0.05Ti0.05Al0.18Si1.88O6 biotite: 3.231711 g, composition K(Fe''0.24Mg0.76)3AlSi3O10(OH)2 feldspar: 19.611030 g, composition K0.80Na0.19Ca0.00Al1.00Si3.00O8 leucite ss: 15.555971 g, composition K0.00Na1.00AlSi2O5.06(OH)1.87 rhm oxide: 0.336954 g, composition Mn0.01Fe''0.89Mg0.03Fe'''0.13Ti0.94O3 apatite: 0.300 g, composition Ca5(PO4)3OH water: 1.704 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 729.507813 liquid: 46.954 g 69.77 0.05 14.13 0.25 1.14 0.14 0.10 1.63 1.35 0.86 0.21 10.37 Activity of H2O = 0.999976 Melt fraction = 0.470969 clinopyroxene: 11.421340 g, composition cpx Na0.08Ca0.84Fe''0.47Mg0.45Fe'''0.05Ti0.05Al0.18Si1.88O6 biotite: 3.198444 g, composition K(Fe''0.24Mg0.76)3AlSi3O10(OH)2 feldspar: 19.825511 g, composition K0.81Na0.19Ca0.00Al1.00Si3.00O8 leucite ss: 15.892180 g, composition K0.00Na1.00AlSi2O5.06(OH)1.88 rhm oxide: 0.349012 g, composition Mn0.01Fe''0.90Mg0.03Fe'''0.13Ti0.94O3 apatite: 0.303 g, composition Ca5(PO4)3OH water: 1.752 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 722.507813 liquid: 46.206 g 70.04 0.05 14.13 0.24 1.06 0.14 0.09 1.56 1.27 0.82 0.21 10.39 Activity of H2O = 0.999973 Melt fraction = 0.463481 clinopyroxene: 11.635463 g, composition cpx Na0.08Ca0.84Fe''0.47Mg0.45Fe'''0.05Ti0.04Al0.17Si1.89O6 biotite: 3.170812 g, composition K(Fe''0.25Mg0.75)3AlSi3O10(OH)2 feldspar: 20.011786 g, composition K0.81Na0.19Ca0.00Al1.00Si3.00O8 leucite ss: 16.208538 g, composition K0.00Na1.00AlSi2O5.06(OH)1.88 rhm oxide: 0.360026 g, composition Mn0.01Fe''0.90Mg0.03Fe'''0.12Ti0.94O3 apatite: 0.306 g, composition Ca5(PO4)3OH water: 1.796 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 715.507813 liquid: 45.523 g 70.29 0.05 14.14 0.22 0.98 0.14 0.09 1.50 1.19 0.78 0.21 10.40 Activity of H2O = 0.999972 Melt fraction = 0.45663 clinopyroxene: 11.829868 g, composition cpx Na0.08Ca0.84Fe''0.48Mg0.45Fe'''0.05Ti0.04Al0.17Si1.89O6 biotite: 3.148103 g, composition K(Fe''0.25Mg0.75)3AlSi3O10(OH)2 feldspar: 20.172809 g, composition K0.81Na0.19Ca0.00Al1.00Si3.00O8 leucite ss: 16.507296 g, composition K0.00Na1.00AlSi2O5.06(OH)1.89 rhm oxide: 0.370101 g, composition Mn0.01Fe''0.90Mg0.03Fe'''0.12Ti0.94O3 apatite: 0.307 g, composition Ca5(PO4)3OH water: 1.835 g, composition H2O ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. ...Adding the solid phase spinel to the assemblage. ...Dropping phase spinel from the assemblage. alphaMELTS at: P 5800.000000, T 708.507813 liquid: 44.896 g 70.54 0.04 14.15 0.21 0.91 0.14 0.08 1.45 1.12 0.74 0.22 10.42
sh: line 1: 7599 Killed: 9 /usr/local/bin/doalarm 300 /usr/local/bin/alphamelts < batch.txt RUN_ALPHAMELTS.COMMAND WARNING: alphamelts may have crashed!
Dict{String, Union{Vector{Float64}, Vector{String}}} with 23 entries: "Temperature" => [1016.51, 1009.51, 1002.51, 995.51, 988.51, 981.51, 974.51… "water" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 2.31… "elements" => ["Pressure", "Temperature", "mass", "solids", "liquid", "a… "albite" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 3.38… "clinopyroxene" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 6.89… "mass" => [99.707, 99.7072, 99.7074, 99.7077, 99.7079, 99.7081, 99.7… "rhm" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.0,… "ilmenite" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.0,… "muscovite" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.0,… "anorthite" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.12… "biotite" => [0.0, 0.431308, 0.831234, 1.20432, 1.55234, 1.87696, 2.179… "feldspar" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 23.2… "quartz" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.0,… "leucite" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 19.3… "magnetite" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.0,… "hematite" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.0,… "garnet" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.26… "apatite" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 0.31… "Pressure" => [5800.0, 5800.0, 5800.0, 5800.0, 5800.0, 5800.0, 5800.0, 5… "liquid" => [99.707, 99.2759, 98.8762, 98.5033, 98.1556, 97.8312, 97.5… "amphibole" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 9.22… "solids" => [0.0, 0.431308, 0.831234, 1.20432, 1.55234, 1.87696, 2.179… "orthoclase" => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 19.7…
## --- Plot melt composition
h = plot(xlabel="Percent melt",ylabel="Abudance (wt. %) in melt")
for e in ["SiO2","Al2O3","CaO","MgO","FeO","Na2O","K2O"]
plot!(h,melt["mass"],melt[e],label=e)
end
plot!(h,xlims=(0,100),framestyle=:box,fg_color_legend=:white,legend=:right,xflip=true)
# Enter trace element data
# Can include any elements you want, the only required one is zirconium (Zr)
trace = elementify([170.68,],["Zr",],skipstart=0,importas=:Dict)
Dict{String, Union{Float64, String, Vector{String}}} with 2 entries: "Zr" => 170.68 "elements" => ["Zr"]
# Since the mineral/melt partition coefficients we're using are averaged from GERM
# as a function of silica (from 40-80), first figure out which coefficients we want
si_index = round.(Int, melt["SiO2"] .|> x -> isnan(x) ? 80 : x) .- 39
si_index[si_index.<1] .= 1
si_index[si_index.>40] .= 40
# Melt fraction
F = modes["liquid"] ./ (modes["liquid"] + modes["solids"])
# Use GERM partition coeffs to calculate bulk solid/melt d for each element
germ_kd["Whitlockite"] = germ_kd["Apatite"]
germ_kd["minerals"] = unique([germ_kd["minerals"]; "Whitlockite"])
d = Dict()
for e in trace["elements"]
# Calculate bulk partition coeff.
d[e] = zeros(size(modes["solids"]))
for m in germ_kd["minerals"]
for k in filter(x -> containsi(x, m), keys(modes))
# Note that minerals that we don't have data for end up being
# treated like all elements are incompatible in them.
# Note, geometric mean = log average
d[e] = nansum([d[e] modes[k]./modes["solids"] .* (10.0.^germ_kd[m][e][si_index]) ], dim=2)
end
end
end
# Calculate trace elements in melt as a function of melt fraction (equilibrium)
calculated = Dict()
calculated["elements"] = trace["elements"]
for e in calculated["elements"]
calculated[e] = trace[e] ./ (d[e].*(1.0.-F) + F)
end
# Some quantities we'll need to calculate M
melt["FeOT"] = melt["FeO"] + melt["Fe2O3"]/1.11
melt["MnO"] = zeros(size(melt["FeOT"]))
# The `tzircZr` function calculates how much zirconium is required to saturate zircon
# for a given temperature and bulk composition
ZrSat = tzircZr((["SiO2", "TiO2", "Al2O3", "FeOT", "MnO", "MgO", "CaO", "Na2O", "K2O", "P2O5", "Temperature"] .|> x -> melt[x])...)
modes["zircon"] = modes["liquid"] .* max.(calculated["Zr"] - ZrSat, 0)*2.009/1_000_000
modes["elements"] = unique([modes["elements"]; "zircon"])
modes["solids"] .+= modes["zircon"];
modes["liquid"] .-= modes["zircon"];
h = plot(xlabel="Percent melt", ylabel="Zircon abundance (wt. %)")
plot!(h, modes["liquid"], modes["zircon"], label="")
plot!(h,xlims=(0,100),framestyle=:box,fg_color_legend=:white,legend=:right,xflip=true)