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

Recent posts

#51
Windows / Ways to Resolve Locale Warning...
Last post by liushanke - October 06, 2024, 06:32:23 AM
I've recently started learning how to use alphaMelts, and I found it quite complex, especially for beginners. I experimented with different ways to run the script and encountered issues when using Perl, particularly with the "en_US.UTF-8" locale settings. Below, I provide a guide to help others who might face the same problem.

If a similar method has already been shared, I kindly ask the forum administrators to remove this post. Thank you!

If you try to run `run_alphamelts.command` using Perl when the locale is not set to "en_US.UTF-8" (e.g., it defaults to "Chinese (Simplified)_China.936," which is unsupported by the Perl interpreter), you will encounter warnings related to locale settings. This happens because Perl expects to use the "en_US.UTF-8" locale. To resolve this issue, there are two common solutions:

Option 1: Create a Batch Script

You can create a batch script that sets the locale and then runs your Perl command. Follow these steps:

1. Open **Notepad** or any text editor and paste the following code:

    @echo off
    set LANG=C
    set LC_ALL=C
    perl C:\your\local\file\folder\run_alphamelts.command (Replace `C:\your\local\file\folder\` with the path to the folder where the `run_alphamelts.command` script is located.)

2. Save this file with a `.bat` extension, for example, `run_alphamelts.bat`.

3. Double-click the `.bat` file to run the script. This batch script sets the locale variables to "C" and then executes your Perl script.

Option 2: Set Environment Variables Permanently

You can also set the `LANG` and `LC_ALL` environment variables permanently in the system settings:

1. Press `Windows + R`, type `sysdm.cpl`, and press Enter to open "System Properties".
2. Go to the "Advanced tab" and click on "Environment Variables".
3. In the "System variables" section, click "New" to create a new environment variable:
    - Variable name: `LANG`
    - Variable value: `C`
4. Click "New" again to create another environment variable:
    - Variable name: `LC_ALL`
    - Variable value: `C`
5. Click "OK" to close all windows and apply the changes.
6. Restart your computer for the changes to take effect.
#52
Thank you, Paula.
Writing out a .melts file and running it in the alphaMELTS 2 may be a quick way to obtain the solid composition.
I will try it.
#53
All the information is there but spread across multiple files and I don't think there's a quick way to create the solid composition for open system runs. What I would do is write out a .melts file just after you have set up the assimilation run in easyMelts. Add an "Output: both" line and run it in the standalone alphaMELTS 2 app. That way you'll get the alphaMELTS-style output as well as the melts.out / .tbl files.
#54
Hi, Paula,
Sorry to bother you again.
I have recently conducted some carbonate assimilation calculations by using easyMELTS.
However, there is no solid composition in these output files, only liquid and mineral compositions.
So I was wondering how to make easyMELTS give the solid composition automatically, just like the alphaMELTS2.
Thank you.
#55
Thank you, Paula.
I will try to use alphaMELTS 2.
#56
You need to turn on assimilation (remove the '!' in front of ALPHAMELTS_ASSIMILATE). Then you should be asked how many steps you want to take.

But alphaMELTS 1.9 doesn't have any of the CO2-capable models. If you want to do carbonate assimilation you'll need something like easyMelts or a newer version of alphaMELTS (see the LINKS and VERSION 2 tabs on the alphaMELTS site, as well as https://github.com/magmasource/alphaMELTS).
#57
Hi,
I am doing some assimilation-fractional crystallization (AFC) calculations modeling the assimilation between basalt and carbonate using alphamelts 1.9.
Whew I call the option 4, the number of iterations is not asked, instead popping a warning "WARNING: closed system calculation is effectively isobaric and isothermal. Please adjust DELTAT or DELTAP, or restart in a different calculation mode to avoid infinite loop!"
So I was wondering how to solve the warning.
Thank you very much!

The alphamelts_default_env.txt and melts.file are shown following,
!Default values of environment variables (version 1.6)
!Variables preceeded by '!' are 'unset' (i.e. 'false')

ALPHAMELTS_VERSION pMELTS
!ALPHAMELTS_OLD_GARNET true
!ALPHAMELTS_OLD_SPINEL true
!ALPHAMELTS_OLD_BIOTITE true
!ALPHAMELTS_2_AMPH true
!ALPHAMELTS_NO_CHLORITE true
ALPHAMELTS_MODE isenthalpic
!ALPHAMELTS_PTPATH_FILE ptpath.txt
ALPHAMELTS_DELTAP 0
ALPHAMELTS_DELTAT 0
ALPHAMELTS_MAXP 30000
ALPHAMELTS_MINP 1
ALPHAMELTS_MAXT 2000
ALPHAMELTS_MINT 900
!ALPHAMELTS_ALTERNATIVE_FO2 true
!ALPHAMELTS_LIQUID_FO2 true
!ALPHAMELTS_IMPOSE_FO2 true
!ALPHAMELTS_FO2_PRESSURE_TERM true
!ALPHAMELTS_CONTINUOUS_MELTING true
ALPHAMELTS_MINF 0.005
!ALPHAMELTS_MINPHI 0.01
!ALPHAMELTS_CONTINUOUS_RATIO float
!ALPHAMELTS_CONTINUOUS_VOLUME true
!ALPHAMELTS_FRACTIONATE_SOLIDS true
ALPHAMELTS_MASSIN  0.001
!ALPHAMELTS_FRACTIONATE_WATER true
!ALPHAMELTS_MINW 0.9
!ALPHAMELTS_FRACTIONATE_TARGET true
!ALPHAMELTS_MGO_TARGET 8.0
!ALPHAMELTS_MGNUMBER_TARGET float
!ALPHAMELTS_ASSIMILATE true
!ALPHAMELTS_FLUX_MELTING true
!ALPHAMELTS_DRY_ITER_PATIENCE 100
!ALPHAMELTS_DO_TRACE true
!ALPHAMELTS_DO_TRACE_H2O true
!ALPHAMELTS_HK_OL_TRACE_H2O true
!ALPHAMELTS_HK_PXGT_TRACE_H2O mineral-mineral
!ALPHAMELTS_2X_OPX_TRACE_H2O true
!ALPHAMELTS_TRACE_DEFAULT_DPTX true
!ALPHAMELTS_TRACE_NORMALIZATION 1
!ALPHAMELTS_TRACE_INPUT_FILE yourtraceinfile.txt
!ALPHAMELTS_TRACE_USELIQFEMG true
!ALPHAMELTS_MULTIPLE_LIQUIDS true
!ALPHAMELTS_FRACTIONATE_SECOND_LIQUID true
!ALPHAMELTS_FOCUS true
!ALPHAMELTS_FOCUS_FACTOR float
!ALPHAMELTS_ADIABAT_FILE true
!ALPHAMELTS_CELSIUS_OUTPUT true
!ALPHAMELTS_SAVE_ALL true
!ALPHAMELTS_SKIP_FAILURE true
!ALPHAMELTS_FAILED_ITER_PATIENCE 10
!ALPHAMELTS_INTEGRATE_FILE filename
!ALPHAMELTS_LATENT_HEAT true
!ALPHAMELTS_QUICK_OUTPUT true
#58
Windows / Re: Updated: enabling the WSL ...
Last post by Paula - September 09, 2024, 03:50:59 PM
Hi Mitsuki,

I've just posted instructions for using Ubuntu 20.04 with Windows 11 (or Windows 10 with November 2021 update or later). They are a bit simpler than previously but, as Ubuntu 20.04 LTS will only be supported until Spring 2025, I am not sure how long they will work for.

The GUI isn't really supported anymore. The Linux versions haven't been updated since 2018 and the Mac ones are even older. There have been some important bugs fixed in the underlying code but it's getting too difficult to build the interface.

We recommend you try easyMelts instead, which is like a more modern version of the GUI and works on native Windows, Mac and Linux (see the alphaMELTS links page). Although our main development effort is with alphaMELTS we hope to continue providing occasional updates for easyMelts too.

Paula


#59
Windows / Updated: enabling the WSL and ...
Last post by Paula - September 09, 2024, 03:00:27 PM
For 64-bit Windows 10 and 11, it is possible to enable the 'Windows Subsystem for Linux' (WSL) and use the latest rhyolite-MELTS for Linux version. (If you have downloaded rhyolite-MELTS from the OFM website you will run into this problem when using it with Ubuntu.) This version of the post assumes you are fresh installing Ubuntu 20.04 LTS with an updated version of WSL 2 (WSLg), or upgrading an existing Ubuntu 20.04 LTS installation to WSLg, but instructions for other options are linked. Things that you should type at the command line are in bold in quote boxes; names you should substitute are in italics and comments are preceded by ellipsis (...). Except where noted, by 'command line', we mean the Ubuntu bash shell that opens when you click the 'Ubuntu' program (or select it from the Windows Terminal) and not the Windows Command Prompt (cmd.exe) or PowerShell.

When the previous version of this post was written there were two versions of Ubuntu available for the WSL - Ubuntu 18.04 LTS and Ubuntu 20.04 LTS - though if you searched for 'ubuntu' in the Microsoft Store then you would see three versions. Now there are multiple versions from Ubuntu 18.04 LTS to Ubuntu 24.04 LTS, but only Ubuntu 18.04 LTS and Ubuntu 20.04 LTS will work for Rhyolite-MELTS. At the time of writing now, 'Ubuntu' and 'Ubuntu 22.04 LTS' are the same, so you should not use either of these. For most purposes Ubuntu 20.04 LTS should be fine. If you need to use Ubuntu 18.04 LTS for some reason, you can try downloading it from the Microsoft Store and continuing to follow this post (but I have not tested this combination).

Previously, running Linux GUI apps such as rhyolite-MELTS on WSL (1 or 2) required installing third-party X server software. The version of WSL compatible with Windows 11, when it was released, had built in support for running GUI apps with WSL 2. As of the Windows 10 November 2021 Update (version 21H2; build 19044 or higher), this functionality was added to WSL 2 in Windows 10 also. If you are unable to update Windows 10 to 21H2, or want to run WSL 1, then see the  older version of this post for options.

Enable the WSL, install ubuntu and some helper software
  • You should simply be able to download and install Ubuntu 20.04 LTS from the Microsoft Store without opening Settings beforehand. Similarly, you should be able to upgrade an existing WSL 2 instance to WSLg by updating the ubuntu app in the Microsoft Store.
  • Open the Microsoft Store and search for 'ubuntu'. Choose 'Ubuntu 20.04.6', and select 'Get' (or 'Update' / 'Upgrade').
  • Select 'Launch'. You will be prompted to enter a username and password for Linux. The username is case sensitive; it may, or may not, be the same as your Windows username but you should avoid spaces or special characters in it. The password should be different to your Windows password; you will need to enter it when installing or updating software at the Linux command line. Type exit when done.
  • Optionally, download and install VS Code. This can be convenient for editing settings files, as well as rhyolite-MELTS input files.
  • Next return to the Microsoft Store and install 'Windows Terminal'. From now on you should be able to copy commands in these instructions (using Ctrl+C) and then paste them to the Windows Terminal command line by with Ctrl+Shift+V.

Set up WSLg and the ubuntu command line
  • Open Windows Terminal, if it is not already open. By default it will open a PowerShell tab. On Windows 10, we need to make sure that Ubuntu is running in WSL 2 and not WSL 1. This step should not be necessary in Windows 11, though it does no harm to check. In PowerShell type:
    Quotewsl --list --verbose
    There should be an 'Ubuntu' or 'Ubuntu-20.04' instance under NAME. If the VERSION is '1' then we need to convert to WSL 2. In PowerShell type:
    Quotewsl --set-version Ubuntu-20.04 2
    ... substitute 'Ubuntu' for 'Ubuntu-20.04' if appropriate.
    The process takes some time but you only need do it once.
  • Next, if you click the 'V' drop-down menu in Windows Terminal 'Ubuntu-20.04' or similar should be one of the options.
  • Sometimes Windows Terminal will map Ctrl+C and Ctrl+V to copy and paste (in addition to Ctrl+Shift+C and Ctrl+Shift+V, respectively). You should probably disable that so that Ctrl+C can be used to break out if a program hangs or gets in a loop. In Windows Terminal, go to Settings in the drop-down menu. If you installed VS Code the settings will open in that, but if not you may be asked to choose a text editor e.g. Notepad to edit the settings. Scroll to the bottom. Comment out ('//') or edit the lines under 'keybindings'. For example, you might replace "ctrl+c" and "ctrl+v" with "alt+c" and "alt+v" respectively:
    Quote... e.g. replace
    { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" }'
    { "command": "paste", keys: "ctrl+v" },

    ... with
    //{ "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" }'
    //{ "command": "paste", keys: "ctrl+v" },

    ... or
    { "command": {"action": "copy", "singleLine": false }, "keys": "alt+c" }'
    { "command": "paste", keys: "alt+v" },

  • Note that you can use ubuntu commands and Linux software to modify your regular files on Windows and vice versa. For WSL 2 there may be a performance benefit to storing working files in ubuntu, but it will be easier to keep regular backups if you transfer the output to a Windows folder. So, it's a good idea to set up links so that you can easily access your Windows folders from the ubuntu command line:
    Quotecd
    ... this just ensures that you are in your ubuntu home directory
    ln -sf /mnt/c/Users/your_windows_username/Downloads .
    ... the space between 'Downloads' and '.' is required
    ... if you copy and paste the command then use the left arrow and delete to replace 'your_windows_username' with the actual name of the folder that your Windows files are stored in
    ... if the 'your_windows_username' folder has spaces in its name you need to put a '\' before each one e.g:
    ln -sf /mnt/c/Users/your\ windows\ username/Downloads .
    You can now switch to the folder by typing 'cd Downloads'. If you don't want the link to be called 'Downloads' then replace '.' with your choice of link name e.g. 'MyFiles'. 'ln' stands for 'link'; '-s' is for 'symbolic', so if you delete the link you do not delete the original file (much like Windows shortcuts); '-f' is for 'force', which makes no difference at this point but should you change your mind about where you want the 'MyFiles' link to point to, then is required to overwrite the original.
  • Substitute 'Downloads' and repeat the above for any other folders that you would like to be able to access from the command line while running rhyolite-MELTS, such as 'Documents' or 'Desktop'.
  • Finally, this step makes a 'bin' folder, which is short for 'binary' and is a folder where we will put a link (shortcut) to rhyolite-MELTS. By default ubuntu sets the Path to include the user's 'bin' folder, if it exists, so that you will be able to run rhyolite-MELTS from anywhere on the system. Open ubuntu, if it is not already open:
    Quotecd
    ... this just ensures that you are in your ubuntu home directory
    mkdir bin
    ... which means make a directory called 'bin' (where 'directory' is what is called 'folder' on Windows)
    exit
    ... this closes ubuntu; when you next open it the settings file will be read and acted upon

Download and set up rhyolite-MELTS
  • Download the 64-bit Ubuntu 18.04 LTS rhyolite-MELTS/pMELTS executable. You should be able to unzip it on Windows. Put the extracted file in 'Downloads' (or your choice of folder, as long as you have set up a link to it in ubuntu). Open ubuntu, if it is not already open:
    Quotecd ~/bin
    ... '~' is shorthand for your home space on ubuntu
    ln -sf ../Downloads/Melts-rhyolite-public Melts-rhyolite
    ... see the 'Set up the ubuntu command line' section for an explanation of the 'ln' command; note that '..' means up one directory level
    Since we added the 'bin' folder to the Path you will be able to open rhyolite-MELTS from any folder by typing 'Melts-rhyolite'. (Without these settings you would need to navigate to the folder containing Melts-rhyolite-public and type './Melts-rhyolite-public', where '.' means the current directory.)
  • If you installed VS Code then type 'code'. The first time it will install VS Code Server, which allows you to open files stored in ubuntu for editing.
  • You shouldn't need to install anything else within ubuntu (although you can if you want to be able to access alternatives to paid software like Adobe Photoshop; see the WSL Tutorial for more details). You will want to apply updates from time to time. 'apt' is the ubuntu package manager. If you get a message about updates being available then type the following:
    Quotesudo apt update
    ... enter your password
    sudo apt upgrade
    sudo apt full-upgrade

    ... choose 'y' as appropriate

You will not need to repeat all these steps next time. Just select 'Ubuntu' from the Windows Terminal program, navigate to the folder where your input (.melts) files are, and type 'Melts-rhyolite'.

Any problems, please let me know,
Paula
#60
Windows / Re: Updated: enabling the WSL ...
Last post by Mitsuki OGASAWARA - September 04, 2024, 10:54:00 AM
Hi Paula,

I'm Mitsuki from Japan.
I want to know How can I install and use MELTS for Win11. Is it same way to install for Win10?