% Script for suprasolidus KFMASH PT projection tutorial
% follow the tutorial for step-by-step guide to calculations

% created by SS 21.10.2021

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

axfile mp50KFMASH            % mandatory script

with someof g mu bi chl st ctd cd opx sp1 ky and sill H2O ksp q liq % mandatory script
inexcess mu q H2O  % list of excess phases

acceptvar no

% =======================
% conditions
% =======================

diagramPT 0.1 18 440 720     % mandatory script

calctatp ask

% =======================
% which calcs
% =======================

pseudosection yes             % mandatory script
% ===========================================================================================================
% KFMASH bulk composition (mol.%) sample A33, Table 4 in Schorn (2019) JMG 36 (3), 369-391
% -----------------------------------------------------------------------------------------------------------
  bulk	 H2O	SiO2    Al2O3     MgO     FeO     K2O
% -----------------------------------------------------------------------------------------------------------
  bulk	 20		67.23	15.08	  3.69	  7.47	  2.71	% added a bunch of H2O for fluid saturation
% ----------------------------------------------------------------------------------------------------------

projection no
% ------------------------------------------------
% AFM
% ------------------------------------------------
projplane              H2O  SiO2 Al2O3   MgO   FeO   K2O
% ------------------------------------------------
projplane     a          0     0     1     0     0     0
projplane     f          0     0     0     0     1     0
projplane     m          0     0     0     1     0     0
% ------------------------------------------------

%dogmin 0               % DO G MINimisation. CARE!! good starting guesses critical
	         
zeromodeiso yes        % to calculate phase-out lines

modeisopleth no
isopleth no

% =======================
% set up a-x relations
% =======================

printxyz
printbulkinfo 

% starting guesses


% ----------------------------------------------------------
% at P = 6.5, T = 561, for: g mu bi st chl q H2O 
% ----------------------------------------------------------
ptguess 6.500 560.78
% ----------------------------------------------------------
xyzguess x(g)          0.934933
% -----------------------------
xyzguess x(mu)         0.650219
xyzguess y(mu)         0.919549
% -----------------------------
xyzguess x(bi)         0.795109
xyzguess y(bi)         0.225772
xyzguess Q(bi)        0.0667504
% -----------------------------
xyzguess x(st)         0.921385
% -----------------------------
xyzguess x(ctd)        0.949744
% -----------------------------
xyzguess x(chl)        0.723911
xyzguess y(chl)        0.725999
xyzguess QAl(chl)      0.273769  range -1.000 1.000
xyzguess Q1(chl)      0.0776481  range -1.000 1.000
xyzguess Q4(chl)       0.145937  range -1.000 1.000
% ----------------------------------------------------------


*

% -----------------------------
xyzguess x(g)          0.960315
% -----------------------------
xyzguess x(bi)         0.874027
xyzguess y(bi)         0.222239
xyzguess Q(bi)        0.0411372
% -----------------------------
xyzguess x(mu)         0.747763
xyzguess y(mu)         0.929210 
% -----------------------------
xyzguess x(st)         0.953406
% -----------------------------
xyzguess x(chl)        0.826344
xyzguess y(chl)        0.749435
xyzguess QAl(chl)      0.250336  range -1.000 1.000
xyzguess Q1(chl)      0.0650287  range -1.000 1.000
xyzguess Q4(chl)       0.138989  range -1.000 1.000
% -----------------------------
xyzguess x(ctd)        0.949744
% -----------------------------
xyzguess x(cd)         0.645836
xyzguess h(cd)         0.416340
% -----------------------------
xyzguess q(L)        0.329452
xyzguess fsp(L)      0.291896
xyzguess ol(L)     0.00997396
xyzguess x(L)        0.833930
xyzguess h2o(L)      0.359643


