News:

alphaMELTS 1.9 is available at the download and information site.
alphaMELTS 2 standalone & for MATLAB/Python are available on request
(see the Version 2 tab on the download site for more details).
For news of all MELTS software see the MELTS Facebook page.

Main Menu

[EX] alphaMELTS (1.X) version of tutorial: 'Quick start using MELTS'

Started by Paula, May 30, 2012, 01:04:22 PM

Previous topic - Next topic

Paula

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 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). 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):

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

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:

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:

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) 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

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, and then start alphaMELTS will an additional '-b batch.txt' in the command line:

Quote
Leda:~ melts$ run_alphamelts.command -f FracXtalTutorial.txt -b batch.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 ...


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

Cheers,
Paula

amir szczupak

hello, i'm trying to install alphaMELTS in my computer, and i followed the instructions that you offer on your website. I tried to run the Morb.melts file, but the output (after i chose '1' and insererted the file name 'Morb.melts') is missing the last four lines. later on, the initial temperature changes from '1200' to '1486.519...'. Sorry for my ignorance, but i'll very much appreciate help in the subject. thank you.

Paula

Hi,

For the four missing lines, I'm not sure whether you mean that four lines are missing compared to what was input in the file, or that it is missing four lines compared to what's shown above. If the former, then that's because alphaMELTS only echoes back those lines that it is using. Any lines that are specific to the graphical user interface (and any blank lines) are ignored - they do not cause a read error but they are not printed to screen either. For the latter i.e. the four "suppress" lines, those lines were in the original Morb.melts file from the original GUI tutorial, as those phases were still in testing at the time that the tutorial was first written. It makes no difference to this particular example whether the "suppress" lines are included or not.

For the temperature, that is the liquidus temperature that you would expect, except that it is Kelvin. As ALPHAMELTS_CELSIUS_OUTPUT is set to true in the settings file, FracXtalTutorial.txt, this suggests that the file is not getting read in for some reason. The link to the file was out of date, because of things being moved from one server to another, but I've just fixed it. So make sure you download the file and follow the instructions to start the perl script, run_alphamelts.command, rather than the alphamelts executable.

Paula

amir szczupak

hi Paula,

your reply last time helped me a lot with understanding how alphaMELTS works, and i very much appreciate the detailed answer. 
sorry for the very delayed reply, but i couldn't find the updated file which you refered me to- the one that should fix the problem i've been having with the degree output ('1486..' instead of '1200').
i'll appreciate it, if you can guide me on how to get to the updated file that'll solve my problem (maybe a link or something).
thank you for your time, and (again) sorry for the delayed reply.

Amir 

Paula

Right click on one of the FracXralTutorial.txt links - either here, in the previous reply, or the original post - and choose "Save Link As..." (Firefox, Chrome), "Download Linked File As..." (Safari), or something similar.

Also, make sure you have run the install.command script that is in the alphaMELTS download folder. You can get brief instructions by choosing your operating system on the alphaMELTS download site.

Paula

aterry4114

I tried to run the tutorial on windows, and I get the following error message

'"C:\Users\aterr\AppData\Local\Temp\Temp7_windows_alphamelts_1-9.zip\windows_alphamelts_1-9\\alphamelts_win64.exe"' is not recognized as an internal or external command,
operable program or batch file.
RUN_ALPHAMELTS.COMMAND WARNING: alphamelts may have crashed!


RUN_ALPHAMELTS.COMMAND WARNING: Cannot find output file "Phase_main_tbl.txt" (No such file or directory)Please check that alphamelts ran properly.
Run again (y or n)?

Could you help me troubleshoot this?

aterry4114

I moved some files around on my system to see if that was my issue, and when I ran the program again I got a different error as follows:

C:\Users\aterr\Documents>run_alphamelts.command -f FracXtalTutorial.txt
Use of uninitialized value $temp in hash element at C:\Users\aterr\AppData\Local\Temp\Temp8_windows_alphamelts_1-9.zip\windows_alphamelts_1-9\run_alphamelts.command line 102, <STDIN> line 1.
RUN_ALPHAMELTS.COMMAND WARNING: Cannot open log_file "logfile.txt" (Permission denied)
Run again (y or n)?