This topic will show you how to work through one page of the MELTS tutorial, using the alphaMELTS program:
Testing MELTS installation using the sample input file - Try this firstThe page is part of the 'Getting Started: Testing and Examples' section of the
MELTS manual, written by Mark Ghiorso for the original graphical-user-interface (GUI) version. The idea of this topic is to show the similarities and differences between his GUI and our text-menu versions of MELTS and how to reproduce GUI MELTS calculations in alphaMELTS. It should be useful for newcomers to MELTS / alphaMELTS who want to know how to get started and for those switching from the original GUI version. This post is for version 1.9 (updated from 1.3.2).
The screen output in this particular example is from a run on Windows 10 but almost all the information applies to Linux and Mac users also. The downloadable text files are almost all in Windows format but can be converted to Linux / Mac by typing 'file_format.command
file_to_be_converted' at the command line or by double-clicking file_format.command and dragging and dropping the appropriate files onto the terminal window.
The example uses the
melts_file Morb.melts from the MELTS website (this has Linux / Mac line endings). A modified version of the file is also included in the downloaded alphaMELTS package (the modifications simply bring it up to date with the latest GUI versions of MELTS and do not affect alphaMELTS use); if you use this version please make a copy of the file and place it in another folder. Either 'Morb.melts' file can be used without being edited first but certain lines will be ignored by alphamelts(.exe). You will also need the
settings_file FracXtalTutorial.txt, which is modified from the 'frac_xtal_env.txt' file included with alphaMELTS. Right click (PC) or CTRL-click (Mac) and choose "Save Link Target As..." or a similar option; alternatively, copy the contents of the file from
this post.
For the alphaMELTS version of MELTS, some of the settings in 'Morb.melts' are specified in 'FracXtalTutorial.txt' instead (see comments within that file and the latest version of the
alphaMELTS manual for more details). Start the program from the command line by typing 'run_alphamelts.command -f FracXtalTutorial.txt' (a separate tutorial post is available for the 'double-click' mode of using run_alphamelts.command). You will see a list of environment variables from 'FracXtalTutorial.txt' that were set by run_alphamelts.command before starting alphamelts(.exe):
C:\Users\psmith\Documents\MELTS\tutorial>run_alphamelts.command -f FracXtalTutorial.txt
ALPHAMELTS_OLD_SPINEL true
ALPHAMELTS_MINT 1000
ALPHAMELTS_VERSION MELTS
ALPHAMELTS_FRACTIONATE_SOLIDS true
ALPHAMELTS_DELTAT -3
ALPHAMELTS_CELSIUS_OUTPUT true
ALPHAMELTS_MODE isobaric
ALPHAMELTS_MINT 1000
Checking for updates...
*** alphaMELTS 1.9 (Aug 29 2018 16:02:51) -- MELTS isobar w/ or w/o liquid ***
... etc ...
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:
Choose option 1 to read in 'Morb.melts'. Only those lines that alphamelts(.exe) actually uses are printed to screen; lines that are ignored do not appear:
Your choice: 1
Filename: Morb.melts
input file open
Successfully read: 'title: dummy'
Successfully read: 'initial composition: sio2 48.68'
Successfully read: 'initial composition: tio2 1.01'
Successfully read: 'initial composition: al2o3 17.64'
Successfully read: 'initial composition: fe2o3 0.89'
Successfully read: 'initial composition: cr2o3 0.03'
Successfully read: 'initial composition: feo 7.59'
Successfully read: 'initial composition: mgo 9.10'
Successfully read: 'initial composition: cao 12.45'
Successfully read: 'initial composition: na2o 2.65'
Successfully read: 'initial composition: k2o 0.03'
Successfully read: 'initial composition: p2o5 0.08'
Successfully read: 'initial composition: h2o 0.20'
Successfully read: 'initial temperature: 1200.00'
Successfully read: 'initial pressure: 500.00'
WARNING: Ignoring 'final pressure' line!
Try using the '-m melts_file' switch with run_alphamelts.command.
WARNING: Ignoring 'increment pressure' line!
Try using the '-m melts_file' switch with run_alphamelts.command.
Successfully read: 'log fo2 path: none'
Successfully read: 'suppress: cummingtonite'
Successfully read: 'suppress: nepheline-ss'
Successfully read: 'suppress: leucite-ss'
Successfully read: 'suppress: ortho-oxide'
Choose:
As of version 1.9, alphaMELTS is able to understand some more GUI
melts_file lines, which is what the two warnings are about. (This is for forwards compatibility with alphaMELTS 2, which understands all current GUI
melts_file lines.) It still ignores the 'Mode: Fractionation' line, though, as this has been updated to 'Mode: Fractionate solids' in the GUI.
Although the front-end program looks very different to the one in the
original tutorial, the settings for the underlying MELTS algorithm are now exactly the same as described in the 'Four things have been accomplished:' list there. You can verify that the initial pressure and temperature are set correctly with option 2:
Your choice: 2
Starting Temp = 1200.000000 C
Type new temperature (or 0 to keep old one): 0
Starting Pressure = 500.000000 bars
Type new start pressure (or 0 to keep old one): 0
alphaMELTS does not have a dedicated 'Find Liquidus' function like the GUI one described. However, it does have a phase-diagram mode that can be used to find the F = 1.0 point for a given pressure and can thus mimic the use of 'Find Liquidus'. The temperature obtained can then be used as a starting point for subsequent calculations. First choose option 10 to turn on Phase Diagram mode, then choose option 3 to perform a single batch calculation. Answer the questions, which will be mostly self-explanatory:
Your choice: 10
Phase diagram mode:
0. Off
1. Bracket reaction (includes follow phi, F, & aH2O contours)
2. Follow affinity=0 contour (includes find wet liquidus)
Choose:1
... etc ...
Your choice: 3
Superliquidus (1) or subsolidus (0) initial guess ? 1
Phase to track boundary of (by name, lower case) or 'x' to return to menu: liquid
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: 1
Type the F value to set (or < 0.0 for default): 1.0
Use special monotonic search for troublesome phases (1) or quick search (0)? 0
...Adding the solid phase feldspar to the assemblage.
...Adding the solid phase olivine to the assemblage.
Initial Guess (not an isograd solution): P 500.000000, T 1200.000000
... etc ...
...Quadratic convergence was acceptable at iterQuad = 82 (rNorm = 6.71602e-011).
Isograd 1 solution at: P 500.000000, T 1220.195313
liquid: 100.349 g 48.51 1.01 17.58 0.89 0.03 7.56 9.07 12.41 2.64 0.03 0.08 0.20
Activity of H2O = 0.0179038 Melt fraction = 0.999994
feldspar: 0.000592 g, composition K0.00Na0.18Ca0.82Al1.82Si2.18O8
Choose:
Note that, by design, alphaMELTS stops the 'Find Liquidus' calculation with a negligible amount of the solid phase present. That way you can see what the liquidus phase is, without the liquid composition or temperature being affected significantly. You can compare the result printed to the screen with the first entries in the
GUI melts output and see that the temperatures calculated by the two different methods agree to within ~0.1
oC. Note that alphamelts(.exe) outputs to the screen in
oC because we set the ALPHAMELTS_CELSIUS_OUTPUT environment variable.
After turning off Phase Diagram mode (option 10 again), choose option 4. This will continue the calculation from the current conditions, incrementing by ALPHAMELTS_DELTAT at each iteration (i.e. decrease temperature by 3
oC) until the temperature hits ALPHAMELTS_MINT (1000
oC). At each stage crystallized solids will be removed:
Your choice: 10
Phase diagram mode:
0. Off
1. Bracket reaction (includes follow phi, F, & aH2O contours)
2. Follow affinity=0 contour (includes find wet liquidus)
Choose: 0
Choose:
... etc ...
Your choice: 4
...Quadratic convergence was acceptable at iterQuad = 1 (rNorm = 6.71602e-011).
Initial alphaMELTS calculation at: P 500.000000, T 1220.195313
liquid: 100.349 g 48.51 1.01 17.58 0.89 0.03 7.56 9.07 12.41 2.64 0.03 0.08 0.20
Activity of H2O = 0.0179038 Melt fraction = 0.999994
feldspar: 0.000592 g, composition K0.00Na0.18Ca0.82Al1.82Si2.18O8
... etc ...
...Adding the solid phase apatite to the assemblage.
alphaMELTS at: P 500.000000, T 1001.195313
liquid: 12.489 g 58.74 0.53 8.88 1.50 0.00 14.14 0.72 5.08 7.99 0.19 0.62 1.60
Activity of H2O = 0.464185 Melt fraction = 0.981789
olivine: 0.058547 g, composition (Ca0.01Mg0.25Fe''0.75Mn0.00Co0.00Ni0.00)2SiO4
clinopyroxene: 0.023729 g, composition cpx Na0.03Ca0.81Fe''0.55Mg0.50Fe'''0.05Ti0.02Al0.16Si1.89O6
feldspar: 0.126135 g, composition K0.00Na0.59Ca0.41Al1.41Si2.59O8
spinel: 0.017232 g, composition Fe''1.57Mg0.10Fe'''0.55Al0.10Cr0.00Ti0.68O4
apatite: 0.006 g, composition Ca5(PO4)3OH
Minimum Temperature reached
Successful return from alphamelts...
Choose:
As of version 1.3.2: if you forget to turn off phase diagram mode, before selecting option 4, you can type 'x' to return to the menu and try again. Once it has finished executing, choose option 0 to quit (as opposed to shutting the terminal window) and you should find 7 new text files have been generated.
The results can be compared with the GUI output. Aside from the differences in formatting the results will not be absolutely identical for the following reasons:
- The GUI Liquid table gives thermodynamic quantities, such as entropy, for the liquid whereas the main output table in alphaMELTS, 'System_main_tbl.txt', gives system values instead (including a small amount of solids prior to fractionation)
- The slightly different method for finding the liquidus gives a slightly different starting point
- We made a minor change to how a fractional crystallization run is calculated. When the solids are removed a nominal amount is retained in the assemblage, mainly to help stabilize the calculation. In the original version of MELTS this nominal amount is 10-5 moles but we decided to use a gram amount instead to make analysis of text output files simpler. By default the retained amount is 10-3 grams, although this is adjustable (see ALPHAMELTS_MASSIN in the alphaMELTS manual). 10-3 grams is a similar but not identical quantity to 10-5 moles for typical mineral phases.
- The original tutorial is rather old compared to the current version of the GUI software package. Certain more recent changes to the underlying MELTS code may have had a minor effect on results.
The differences are negligible though (e.g. identical compositions and < 0.01 gram difference in masses for phases in the last calculation at 1000
oC) and certainly insignificant when compared to other sources of inaccuracy in the model.
If there are any problems or feedback about this post then please let me know.
Cheers!
Paula