News:

alphaMELTS 2.3 standalone & for MATLAB/Python is now open source and available on GitHub (https://github.com/magmasource/alphaMELTS).
alphaMELTS 1.9 is available at the legacy download and information site.
For news of all MELTS software see the MELTS Facebook page.

Main Menu

[EX] alphaMELTS (double-click) version of tutorial: 'Quick start using MELTS'

Started by Paula, June 13, 2014, 04:39:43 AM

Previous topic - Next topic

Paula

This topic will show you how to work through one page of the MELTS tutorial, using the alphaMELTS program in 'double-click' mode:

Testing MELTS installation using the sample input file - Try this first

The 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). Open the folder where the Morb.melts and FracXtalTutorial.txt input files are located in a file manager (e.g. Windows Explorer, or Finder on Mac). In this folder make a subfolder called, for example, 'output'. Also open the links_folder (see the 'Installation' section of the alphaMELTS manual). Start the program by double-clicking the 'run_alphamelts.command' link (not the alphamelts link!). Type '-f ' at the command line, including the space after the 'f', then drag the FracXtalTutorial.txt file onto the run_alphamelts.command window; once the plus sign appears on the mouse pointer you can drop the file onto the command line and its full path will be printed:


You may need to click the run_alphamelts.command window to bring it back into focus. Make sure there is a space after 'FracXtalTutorial.txt' on the command line. Type '-p ' at the command line, including the space after the 'p':


Drag-and-drop the 'output' folder onto the run_alphamelts.command window in the same way:


Click the run_alphamelts.command window to bring into focus, if necessary, and then press return. You will see a list of environment variables from 'FracXtalTutorial.txt' that were set by run_alphamelts.command before starting alphamelts(.exe):

Quote
No command line switches specified! Please enter switches now
(or press return for default '-f alphamelts_default_env.txt').
-f C:\Users\psmith\Documents\MELTS\tutorial\FracXtalTutorial.txt -o C:\Users\psmith\Documents\MELTS\tutorial\output
ALPHAMELTS_OLD_SPINEL true
ALPHAMELTS_MINT 1000
ALPHAMELTS_DELTAT -3
ALPHAMELTS_MODE isobaric
ALPHAMELTS_VERSION MELTS
ALPHAMELTS_FRACTIONATE_SOLIDS true
ALPHAMELTS_CELSIUS_OUTPUT true


Checking for updates...


*** alphaMELTS 1.9 (Aug 29 2018 16:02:51) -- MELTS isobar w/ or w/o liquid ***

... etc ...


Choose option 1 to read in a melts_file, then drag-and-drop the Morb.melts file into the run_alphamelts.command window; see the before and after screentshots:



Again, click the window to focus, if necessary, and press return. Only those lines that alphamelts(.exe) actually uses are printed to screen; lines that are ignored do not appear:

Quote
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:

Quote
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:

Quote
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:

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:

Quote
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). You should find 7 new text files have been generated in the 'output' folder. If you did not drag-and-drop the output folder, as described above, then the files will either be in the links_folder or in the user's home space, depending on the operating system. See the 'Interactive operation' section of the alphaMELTS manual for more details.

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

Paula

To run alphaMELTS in 'batch' mode (meaning automated as opposed to 'batch crystallisation') open a text editor, such as gedit (Linux), TextEdit (Mac), Notepad (Windows) or leafpad (Lubuntu).  Put everything you would type at the alphaMELTS menu prompt i.e. most of the things printed in bold above:

Quote
1
Morb.melts
10
1
3
1
liquid
1
1.0
0
10
0
4
0

The last '0' is used to exit the program. You can also include the call to option 2 but since you won't get a chance to view the temperature and pressure before the program continues, there isn't much point... Save the file as 'batch.txt', say. Start alphaMELTS, as above, but just after dragging and dropping FracXtalTutorial.txt do not press return. Instead type '-b ' (or ' -b ' on Windows) and then drag and drop batch.txt in the same way. Then continue with '-p ' and drag and drop the output folder, as before.

That's it! The program should run in a few seconds and generate the usual 7 output files.

Actually the order of the command line switches does not matter, especially in double-click mode, but I tend to put the output path last. When using alphaMELTS from the command line (see the original alphaMELTS tutorial) you can still drag-and-drop files in the way described above. If you use the up arrow key to get previous run_alphamelts.command lines you can adjust the output folder name for subsequent runs without have to make new folder; useful for multiple runs with nested output folders (e.g. by composition, pressure, fO2...).

Cheers,
Paula