====================================================================
Notes for use of thermo input from the 'igneous-W24' set of HPx-eos, as
defined in:

 tc-ig51W24.txt/tc-ig60W24
 tc-ds636.txt

for calculations in anhydrous alkaline to sub-alkaline magmatic systems; 
see:

  Weller, OM, Holland, TJB, Soderman, CR, Green, ECR, Powell, R, 
    Beard, CD & Riel, N (2024). New thermodynamic models for 
    alkaline silicate magmatic systems. Journal of Petrology, 
    doi: 10.1093/petrology/eggae098

The following notes relate to the use of these x-eos for calculations 
with the Thermocalc software (Powell & Holland, 1988).

For general information about the use of HPx-eos and/or Thermocalc,
see https://hpxeosandthermocalc.org

---------------    
original: 04/12/24 by E.C.R. Green (eleanor.green@unimelb.edu.au)
uploaded: 28/06/25 by E.C.R. Green
====================================================================

1. Compatibility with Thermocalc
2. X-eos with geologically relevant solvi: the samecoding script block
3. X-eos with order variables
4. Citing the x-eos

---------------
1. Compatibility with Thermocalc

The input files in this bundle should run with Thermocalc version 3.51
and above.


---------------
2. X-eos with geologically relevant solvi: the samecoding script block

Solvi are miscibility gaps between phases with identical symmetry and the 
capacity to form a continuous solid solution at high temperature. 
Consequently they should be modelled using a single x-eos for both phases, 
with appropriately different starting guesses for the compositions of each 
phase.

In the igneous-W24 set, the following sets of phases use the same x-eos, 
but are separated by solvi at geologically relevant temperatures:

  - spinel, magnetite, Cr-rich spinel and ulvospinel (spinel-group x-eos, spl_T21)
  
  - plagioclase feldspar and alkali feldspar (ternary feldspar x-eos, fsp_H22)

  - augitic clinopyroxene and pigeonite (clinopyroxene x-eos, cpx_W24) 

  - ilmenite and hematite (ilmenite x-eos, ilm_W24)

  - Na-rich nepheline and K-rich nepheline (nepheline x-eos, nph_W24)

The samecoding block (see "samecoding_and_starting_guesses.txt") sets up 
Thermocalc's scriptfile so that Thermocalc will use the correct x-eos for each 
of the sets of phases above. Users should copy the samecoding block into the
scriptfile, and should copy starting guesses from same file for each of the
individual phases involved. 

Comparing the starting guesses for two phases that share an x-eos shows how 
the compositions vary on either side of the solvus. For example, in the 
xyzguess blocks for augitic clinopyroxene (cpx) and pigeonite (pig), the main 
difference is in the variable o, with o(pig) >> o(cpx). The variable o in the 
cpx_W24 x-eos is defined as o(cpx_W24) = xMgM2 + xFeM2 
(see "igneous-W24_set_full_descriptions.txt") so this is consistent with the 
geological expectation that the M2 site in augitic cpx is dominated by Ca, 
while in pigeonite this site is dominated by Mg and Fe2+.

During a calculation in Thermocalc, the composition of a phase is not forced 
to stay on the same side of a solvus as the xyzguess starting guesses. It is
therefore possible for the user to do a calculation with pig that yields 
results with o(pig) << 0.5, i.e. the calculated equilibrium actually contains
augitic cpx rather than pigeonite. Likewise, an equilibrium in which the user
requested a calculation with plagioclase (pl) may yield a high-K "pl"
that should really be called alkali feldspar (afs). Users should keep an eye 
on the calculated compositions to make sure they are aware when this happens.  
To help users interpret the compositional information, the output file with the 
suffix -ic provides the compositions in a variety of ways, including molar oxides 
and site occupancies. 

Finally, if a calculated equilibrium contains two or phases that share the 
same x-eos, Thermocalc may produce results in which these phases have the same
composition to within say 2 decimal places. This is a meaningless result, 
indicating that Thermocalc has failed to calculate an equilibrium that involves
these two phases co-existing across the solvus. This may be because the 
calculation is above the temperature of solvus closure, in which case there is
no longer a meaningful distinction between the two phases, and the calculation
can be re-run with only one of the phases present. However, Thermocalc often 
struggles to calculate the co-existence of such phases as it approaches the 
solvus top from the lower-temperature side. It's therefore worth returning to
the last set of calculations that yielded two distinct phases, and trying again
with carefully chosen starting guesses until the location of the solvus is
established.


---------------
3. X-eos with order variables

In addition to compositional variables, the following x-eos in the igneous-W24 set
contain order variables:

  - silicate melt x-eos (liq_W24d): yan, yab, yen, ykf
  - olivine x-eos (ol_H18): Q
  - spinel-group x-eos (spl_T21): Q1, Q2, Q3
  - low-Na clinopyroxene x-eos (cpx_W24): Q
  - orthopyroxene x-eos (opx_W24): Q
  - ilmenite-hematite x-eos (ilm_W24): Q, Qt
  - nepheline x-eos (nph_W24): Q

The Q variables express the partitioning of cations across different sites, and 
usually can't be compared with observations. 

Q variables do not generally require attention from the user. However they 
are associated with two classic problems: 
(a) Finding valid starting guesses.
(b) Multiple compositions calculated with different Q.
(c) "Inconsistent" Thermocalc output for repeat calculations.

(a) The starting guesses for order variables must lie within legal ranges,
such that, when the starting guesses for the compositional+order variables
are substituted into the expressions for the site fractions in an x-eos (see
"igneous-W24_set_full_descriptions.txt"), all of the site fractions have values 
between 0 and 1. 

Usually this is not a big inconvenience, because the legal ranges of Q
values are large and it is easy to find an appropriate value (commonly,
making Q smaller will help). However, if there are multiple order variables,
and/or the composition of the solid solution is close to one of the 
composition end-members, the range of legal Qs may be very small. 
Therefore, if possible it is easiest to start with the starting guesses 
provided in the "samecoding_and_starting_guesses.txt" file in this bundle, 
and then only amend them using the starting guesses provided in the Thermocalc 
log file via the printxyz script.

(b) For certain x-eos, Thermocalc sometimes finds different values of
compositional and order parameters depending on the Q starting guess that
was used. This has been observed commonly for the ilmenite-hematite x-eos,
and occasionally for the Q parameter (not Qaf, Qfm) in the sodic-calcic
pyroxene x-eos. The correct value of Q for a pseudosection is the more 
stable one. In the above models, this is always the higher value of Q, and 
therefore starting guesses for Q should be kept as high as is legal. 
However, the relative stabilities of the two solutions can be verified by 
checking the calculated values of the assemblage Gibbs energy, G, in the 
output. 

(c) If Thermocalc thinks that a Q value is illegal, it will flag this with
the message "illegal Q starting guess for [phase]: random value used", and
will then try several Q values at random in the hope of finding a valid one. 
This can lead to apparently inconsistent results, if the user repeats a 
calculation but fails to notice the "illegal Q starting guesses" message. 
For example, Thermocalc may intermittently fail to give results when the same 
calculation is run repeatedly, if it only sometimes finds legal starting 
guesses by random trials of Q values. It may also give different results
during repeated calculations, if there are two possible valid Q solutions, as 
in problem (b) above. It is therefore wise to keep a look out for Thermocalc's 
"illegal Q starting guesses" flagging message, and change the Q guess manually 
to a legal value that gives the more stable result. 

Finally, users should be aware that Thermocalc's "illegal Q starting guess" 
strictly just means "the site fractions for [phase] are invalid", i.e. some 
site fractions have values outside the 0--1 range. While Thermocalc assumes
that this means the value of Q is at fault, it's possible for the user to 
give Thermocalc values of the compositional variables that in themselves 
violate the site fraction legal ranges. Starting guesses taken from the 
"samecoding_and_starting_guesses.txt" file, or copied from Thermocalc output,
should be okay in this regard, but users should be wary if they modify the 
compositional variable starting guesses themselves.  


---------------
4. Citing the x-eos

For the purpose of reproducibility, please state the unique name
of each x-eos used (e.g. liq_W24d), and give the version number of Thermocalc
that you are using (e.g. tc351).

Please use the following references:

Calibration of the igneous-W24 set of x-eos, including version 6.36 of the 
Holland & Powell dataset, and the non-dataset end-members and activity-composition
relations for silicate melt (liq_W24d), garnet (g_W24), clinopyroxene (cpx_W24), 
orthopyroxene (opx_W24), ilmenite (ilm_W24), nepheline (nph_W24), kalsilite 
(kals_W24), leucite (lct_W24), melilite (mel_W24), and the Thermocalc 
implementation of oxygen buffering:

  Weller, OM, Holland, TJB, Soderman, CR, Green, ECR, Powell, R, 
    Beard, CD & Riel, N (2024). New Thermodynamic Models for Anhydrous
    Alkaline-Silicate Magmatic Systems. Journal of Petrology, 65,
    doi: 10.1093/petrology/egae098

Activity-composition relations for plagioclase and alkali feldspar (fsp_H22):

  Holland, TJB, Green, ECR & Powell, R (2022). A thermodynamic model
    for feldspars in KAlSi3O8-NaAlSi3O8-CaAl2Si2O8 for mineral 
    equilibrium calculations. Journal of Metamorphic Geology, 40, 587-600, 
    doi: 10.1111/jmg.12639

Activity-composition relations for spinel-group minerals (spl_T21):

  Tomlinson, EL & Holland, TJB (2021). A Thermodynamic Model for the
    Subsolidus Evolution and Melting of Peridotite. Journal of Petrology,
    62, doi: 10.1093/petrology/egab012

Activity-composition relations for olivine (ol_H18):

  Holland, TJB, Green, ECR & Powell, R (2018). Melting of Peridotites
    through to Granites: A Simple Thermodynamic Model in the System
    KNCFMASHTOCr. Journal of Petrology, 59, 881-900, 
    doi: 10.1093/petrology/egy048

THERMOCALC:

  Powell, R & Holland, TJB (1988). An internally consistent dataset 
    with uncertainties and correlations: 3. Applications to geobarometry,
    worked examples and a computer program. Journal of Metamorphic Geology,
    6, 173-204, doi: 10.1111/j.1525-1314.1988.tb00415.x

  Powell, R, Holland, TJB & Worley, B (1998). Calculating phase diagrams
    involving solid solutions via non-linear equations, with examples
    using THERMOCALC. Journal of Metamorphic Geology, 16, 577-588, 
    doi: 10.1111/j.1525-1314.1998.00157.x
