% Script for AFM compatibility diagram tutorial
% follow the tutorial for step-by-step guide to calculations

% created by SS 29.07.2020

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

axfile mp50KFMASH

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

with someof bi chl g st ctd cd ky 
inexcess mu q H2O     % list of excess phases

calctatp

diagramPT 0.001  18  440  750

calcP   10
calcT  530

projection

% ------------------------------------------------
% AFM - projected from q mu H2O
% ------------------------------------------------
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
% ------------------------------------------------

pseudosection 

% ------------------------------------------------
bulk           H2O    SiO2   Al2O3   MgO   FeO   K2O  
% ------------------------------------------------
bulk            20   67.23  15.08   3.69  7.47  2.71	% bulk A33 from Schorn, 2018 (JMG)
% ------------------------------------------------

projcomp       % projects the bulk rock composition 

compatibility 

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

zeromodeiso no

dogmin no  

modeisopleth no

isopleth no

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

printxyz

% starting guesses
% --------------------------------------------------------
ptguess 2.5 532
% --------------------------------------------------------
xyzguess x(g)          0.960315
% -----------------------------
xyzguess x(mu)         0.510528
xyzguess y(mu)         0.956896  range  0.000 2.000
% -----------------------------
xyzguess x(bi)         0.670125
xyzguess y(bi)         0.336795
xyzguess Q(bi)        0.0999679
% -----------------------------
xyzguess x(st)         0.879386
% -----------------------------
xyzguess x(chl)        0.563620
xyzguess y(chl)        0.811544
xyzguess QAl(chl)      0.188171  range -1.000 1.000
xyzguess Q1(chl)      0.0562308  range -1.000 1.000
xyzguess Q4(chl)       0.126625  range -1.000 1.000
% -----------------------------
xyzguess x(ctd)        0.949744
% -----------------------------
xyzguess x(cd)         0.645836
xyzguess h(cd)         0.416340
% --------------------------------------------------------

*