% ==================================================================
% Scriptfile for .... modebox calcs 
%
% in the prefsfile, these scripts are needed
%           dataset   62          
%           calcmode 1 
%           scriptfile modebox  % if this file keeps its name
% 
% Use "%" for commenting (nothing is read between % and the line ending).
% No lines are read after the "*" character.
% ==================================================================

axfile mp50MnNCKFMASHTO  % axfile, tc-<system>.txt, becomes axfile <system>

% =======================
% phases
% =======================

with someof g chl st bi ky  % list of phases in modebox

inexcess  mu q H2O      % list of phases to be included in all calculations
tozero H2O              % zeroes the mode of H2O in the output

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

diagramPT  4 14  400 700     % P in kbar; T in degC 

calcP  9                     % Plow Phigh Pinc
calcT  500 700 10            % Tlow Thigh Tinc

calctatp                     % do calculate T at P (so, info in calcT ignored)

% =======================
% pseudosection-related
% =======================

pseudosection            % this is a pseudosection calc (so requires a bulk composition)

% --------------mode----------------------------------------
rbi                             H2O        SiO2       Al2O3         MgO         FeO         K2O
rbi       g    0.045762           0           3           1    0.267202    2.732798           0
rbi      bi    0.348959    1.000000    2.772251    0.727749    0.764809    2.007442    0.500000
rbi      mu    0.088359           1    3.089130    1.410870    0.037317    0.051813    0.500000
rbi      st    0.157549           2    7.500000           9    0.441832    3.558168           0
rbi       q    0.180773           0           1           0           0           0           0
rbi     H2O    0.178598           1           0           0           0           0           0
% --which gives---------------------------------------------
%       H2O     SiO2    Al2O3      MgO      FeO      K2O
%   25.4318  42.2270  11.3240   4.1906  13.7691   3.0574

% =======================
% what output?
% =======================

modebox                  % print info in mathematica form (in drfile) and comma-delimited 
                         % form (in csvfile)
% =======================
% set up x-eos
% =======================

% samecoding mu pa      % duplicating x-eos: make paragonite from muscovite

% !!!! 
% Add your own xyzguess blocks for all phases (including any made by samecoding)
% !!!! 

% ---------------------------------------------------------- 
xyzguess x(g)          0.887427
xyzguess z(g)                 0  % boiler
xyzguess m(g)                 0  % boiler
xyzguess f(g)                 0  % boiler
% -----------------------------
xyzguess x(bi)         0.674182
xyzguess m(bi)                0  % boiler
xyzguess y(bi)         0.260333
xyzguess f(bi)                0  % boiler
xyzguess t(bi)                0  % boiler
xyzguess Q(bi)        0.0969282
% -----------------------------
xyzguess x(mu)         0.548754
xyzguess y(mu)         0.909621
xyzguess f(mu)                0  % boiler
xyzguess n(mu)                0  % boiler
xyzguess c(mu)                0  % boiler
% -----------------------------
xyzguess x(st)         0.858563
xyzguess m(st)                0  % boiler
xyzguess f(st)                0  % boiler
xyzguess t(st)                0  % boiler
% ---------------------------------------------------------- 
xyzguess x(chl)        0.465451
xyzguess y(chl)        0.805095
xyzguess f(chl)               0  % boiler
xyzguess m(chl)               0  % boiler
xyzguess QAl(chl)      0.194402  range -1.000 1.000
xyzguess Q1(chl)      0.0352754  range -1.000 1.000
xyzguess Q4(chl)      0.0888073  range -1.000 1.000
% -----------------------------

* 

5 separate calculations with the above, manually assembled

{{9.000, 500.00, 0}, {"bi", 0.04647}, {"mu", 0.40692}, {"chl", 0.39871}, {"q", 0.14790}}, 
{{9.000, 510.00, 0}, {"bi", 0.05406}, {"mu", 0.40029}, {"chl", 0.39515}, {"q", 0.15050}}, 
{{9.000, 520.00, 0}, {"bi", 0.06198}, {"mu", 0.39337}, {"chl", 0.39144}, {"q", 0.15321}}, 
{{9.000, 530.00, 0}, {"bi", 0.07025}, {"mu", 0.38615}, {"chl", 0.38756}, {"q", 0.15604}}, 
{{9.000, 540.00, 0}, {"bi", 0.07889}, {"mu", 0.37861}, {"chl", 0.38351}, {"q", 0.15900}}, 

{{9.000, 548.40, 0}, {"g", 0}, {"bi", 0.08643}, {"mu", 0.37203}, {"chl", 0.37997}, {"q", 0.16158}}, 

{{9.000, 550.00, 0}, {"g", 0.02427}, {"bi", 0.09101}, {"mu", 0.37237}, {"chl", 0.35279}, {"q", 0.15957}}, 
{{9.000, 560.00, 0}, {"g", 0.14090}, {"bi", 0.11398}, {"mu", 0.37319}, {"chl", 0.22167}, {"q", 0.15026}}, 
{{9.000, 570.00, 0}, {"g", 0.22022}, {"bi", 0.13112}, {"mu", 0.37242}, {"chl", 0.13179}, {"q", 0.14445}}, 
{{9.000, 580.00, 0}, {"g", 0.28012}, {"bi", 0.14541}, {"mu", 0.37067}, {"chl", 0.06328}, {"q", 0.14052}}, 
{{9.000, 590.00, 0}, {"g", 0.32960}, {"bi", 0.15825}, {"mu", 0.36831}, {"chl", 0.00620}, {"q", 0.13763}}, 

{{9.000, 591.17, 0}, {"g", 0.33496}, {"bi", 0.15969}, {"mu", 0.36801}, {"chl", 0}, {"q", 0.13734}}, 

{{9.000, 600.00, 0}, {"g", 0.33478}, {"bi", 0.16008}, {"mu", 0.36764}, {"q", 0.13750}}, 
{{9.000, 610.00, 0}, {"g", 0.33458}, {"bi", 0.16053}, {"mu", 0.36721}, {"q", 0.13768}}, 
{{9.000, 620.00, 0}, {"g", 0.33437}, {"bi", 0.16098}, {"mu", 0.36678}, {"q", 0.13787}}, 
{{9.000, 630.00, 0}, {"g", 0.33417}, {"bi", 0.16143}, {"mu", 0.36635}, {"q", 0.13805}}, 
{{9.000, 640.00, 0}, {"g", 0.33396}, {"bi", 0.16189}, {"mu", 0.36591}, {"q", 0.13824}}, 
{{9.000, 650.00, 0}, {"g", 0.33375}, {"bi", 0.16236}, {"mu", 0.36547}, {"q", 0.13843}}, 
{{9.000, 660.00, 0}, {"g", 0.33354}, {"bi", 0.16282}, {"mu", 0.36502}, {"q", 0.13862}}, 
{{9.000, 670.00, 0}, {"g", 0.33332}, {"bi", 0.16329}, {"mu", 0.36457}, {"q", 0.13881}}, 
{{9.000, 680.00, 0}, {"g", 0.33311}, {"bi", 0.16377}, {"mu", 0.36412}, {"q", 0.13901}}, 
{{9.000, 690.00, 0}, {"g", 0.33289}, {"bi", 0.16424}, {"mu", 0.36367}, {"q", 0.13920}}, 
{{9.000, 700.00, 0}, {"g", 0.33267}, {"bi", 0.16472}, {"mu", 0.36321}, {"q", 0.13940}}, 


