====================================================================
Notes for use of the axfiles

 tc-ig47NCKFMASHTOCr.txt, tc-ig47NCKFMASTOCr.txt, 
                   and
 tc-ig50NCKFMASHTOCr.txt, tc-ig50NCKFMASTOCr.txt 

the 'igneous set' of HPx-eos, for use with version 6.33
of the Holland & Powell (2011) dataset.

The following are some brief notes about issues related 
specifically to the use of these x-eos for calculations 
with the Thermocalc software (Powell & Holland, 1988).

---------------
12/12/19 E.C.R. Green (eleanor.green@unimelb.edu.au)
====================================================================

1. Compatibility among axfiles, with the Holland & Powell dataset, 
   and with Thermocalc
2. Relationship to the metapelite and metabasite set of HPx-eos
3. The x-eos, and which to use when
4. Calculating solvi
5. Idiosyncrasies of order parameters
6. Citing the x-eos and ensuring reproducibility

---------------
1. Compatibility with the Holland & Powell dataset and Thermocalc

For the user's convenience, axfiles are provided in two different systems: 
NCKFMASHTO and NCKFMASTO. The thermo input in these two 
different systems is compatible, i.e. the thermo input for NCKFMASTO represents 
the NCKFMASTO subsystem of the NCKFMASHTO thermodynamic system.

These x-eos were calibrated with version 6.33 of the Holland & Powell 
(2011) dataset (ds6). 

The two sets of axfiles contain the same sets of x-eos, for different
versions of Thermocalc:
  - tc-ig47NCKFMASHTO.txt and tc-ig47NCKFMASTO.txt 
    work with Thermocalc version 3.47
  - tc-ig50NCKFMASHTO.txt and tc-ig50NCKFMASTO.txt
    work with Thermocalc version 3.50.

Due to changes in the way that Thermocalc handles reference states
and the application of the pressure dependence of ∆G terms (formerly DQF), 
versions 3.47 and 3.50 produce very slightly different results. As far as
we're aware, they move phase field boundaries by < 1ºC and < 0.01 kbar.



---------------
2. Relationship to metapelite set of HPx-eos

Lots of the same phases appear in the igneous set as in the metabasite
and metapelite sets. However, in many cases the x-eos are slightly 
different, as listed on the website, https://hpxeosandthermocalc.org.
It's simplest just to use the x-eos in complete sets - mixing and 
matching may have unpredictable effects. We will discuss the differences
in the sets in a forthcoming paper.


---------------
2. The x-eos, and which to use when

To understand more about the igneous x-eos work, look in the file 
metapelite_set_full_descriptions.txt. Thermocalc produces versions of this
file on each calculation, including just the phases and the system you are 
looking at, in the -it file. There is more information on the website,
https://hpxeosandthermocalc.org.


Feldspars:

Most users should use pl4tr and/or k4tr. These are the same x-eos, but 
pl4tr is expressed in terms of xCa and xK, whereas k4tr is expressed in 
terms of xCa and xNa. For co-existing plagioclase and alkali feldspars,
it’s therefore convenient to use pl4tr for plagioclase and k4tr for 
alkali feldspar; however they are the same x-eos, and therefore are 
correctly able to describe solvus relations in the ternary feldspar system.

Pl4tr and k4tr replace the older set of feldspar x-eos, plc, pli and ksp.
These three have been left in the axfile for backwards compatibility.
An overview of the changes can be found at 
https://hpxeosandthermocalc.org/2022/01/23/a-new-x-eos-for-ternary-feldspars/

Note that you can rename the x-eos within the scriptfile for your 
convenience using the samecoding script, e.g.
  samecoding pl4tr pl
renames pl4tr as pl. You will then need to make sure that you have a set
of xyzguess scripts for “pl” in the scriptfile (copy the variables for
pl4tr, but rename as pl).


Ilmenite:
X-eos are provided in the systems FTO (ilm) and FMTO (ilmm).
The older, more restricted version in FTO is currently recommended 
(23/11/15), as the FMTO model may take excessive magnesium.


---------------
4. Calculating solvi

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.  

The igneous axfiles and samecoding script make it 
possible to generate multiple phases with different compositions 
from several of the x-eos. These are:

Clinopyroxene -- pigeonite: cpx, pig
 
Spinel--magnetite--chrome spinel: sp, mt, cr


N.B. When calculating solvi, check that Thermocalc really has calculated
different compositions for both phases! If it can't find two different
solutions for the composition variables, it will just return a meaningless
result in which the two phases have essentially the same composition.

N.B.B. When using any of these phases, it's wise to check that the 
calculated compositions are in the range that you expect... 



---------------
5. Idiosyncrasies of order parameters: ilmenite

In addition to compositional variables, many of the x-eos involve order 
parameters. These are designated with variable starting with 
Q, or followed by the script 'isQ'. The Q parameters express the 
partitioning of cations across different sites, and usually can't be 
compared with observations. 

Q parameters do not generally require attention from the user. However they 
are associated with two classic problems: 
(a) Finding valid starting guesses, especially in hornblende
(b) Multiple compositions calculated with different Q (ilmenite).

(a) The starting guesses for order parameters must lie within legal ranges,
such that, when the starting guesses for the compositional+order parameters
are substituted into the expressions for the site fractions in an x-eos, 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, in the clinoamphibole x-eos, the two
order parameters Q1 and Q2 have to be chosen from a very narrow range that
depends on the composition. Therefore, if possible it is easiest to start 
with the starting guesses for clinoamphibole provided with in these files, 
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. 
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, which is
now a standard part of Thermocalc's on-screen output. 

N.B. If Thermocalc finds that a Q value is illegal, it will try several 
Q values at random in the hope of finding a valid one. This process may 
go unnoticed by the user, but it occasionally causes problems if in fact 
there are two possible valid Q solutions, one leading to a lower Gibbs 
energy for the assemblage than the other, as in (b) above. Therefore
it is wise to keep a look out for Thermocalc's flagging message
"illegal Q starting guess for [phase]: random value used", and change the
Q guess manually to a legal value that gives the more stable result. 


---------------
6. Citing the x-eos and ensuring reproducibility

In the interests of reproducibility, please record the following in 
publications:
- the version of the Holland & Powell internally-consistent dataset
    (e.g. Holland & Powell, 2011, dataset version 6.33), and preferably, 
    for safety's sake, the date of generation of the dataset file tc-dsXX.
    The date is found on the last line of the file.
- the version of Thermocalc, e.g. Thermocalc 3.50,
- the citations for the various x-eos used, and preferably the date given
  in the 0_version_notes.txt file in this bundle.

Citation for the x-eos are found in the -it file. The citation for the 
Holland and Powell dataset version 6 is:

% Holland, TJB, Powell, R (2011) An improved and extended internally consistent
% thermodynamic dataset for phases of petrological interest, involving a new
% equation of state for solids. Journal of Metamorphic Geology, 29, 333-383.