function make_Cl36_consts_web()

% This generates constants useful for Cl-36 production rate calculations.
% 1. Element-specific cross-sections and other nuclear parameters
% All are 24x1 vectors corresponding to list of 24 elements, in ascending order
% of atomic number

% Define list of elements
consts.elts = {'H','Li','B','C','N','O','Na','Mg','Al','Si','P','S','Cl','Ar','K','Ca','Ti','Cr','Mn','Fe','Sm','Gd','Th','U'};

% Atomic numbers
consts.Z_k = [1
3
5
6
7
8
11
12
13
14
15
16
17
18
19
20
22
24
25
26
62
64
90
92];

% Atomic masses (g/mol)
consts.A_k = [1.010
6.940
10.810
12.010
14.010
16.000
22.990
24.310
26.980
28.090
30.970
32.070
35.450
39.940
39.100
40.080
47.880
52.000
54.940
55.850
150.360
157.250
232.050
238.070];

% Elemental microscopic neutron scattering x-section (cm2/atom)
consts.sigma_sc_k = [2.049E-23
9.500E-25
4.270E-24
4.740E-24
1.003E-23
3.760E-24
3.038E-24
3.414E-24
1.413E-24
2.044E-24
3.134E-24
1.100E-24
1.580E-23
6.560E-25
2.040E-24
2.930E-24
4.090E-24
3.380E-24
2.060E-24
1.135E-23
3.800E-23
1.720E-22
1.355E-23
9.080E-24];

% Elemental neutron absorbtion cross-section (cm2/atom)
consts.sigma_th_k = [3.330E-25
7.050E-23
7.670E-22
3.500E-27
1.910E-24
1.900E-28
5.170E-25
6.660E-26
2.310E-25
1.710E-25
1.650E-25
5.200E-25
3.314E-23
6.750E-25
2.100E-24
4.300E-25
6.410E-24
3.100E-24
1.336E-23
2.560E-24
9.640E-21
4.156E-20
7.340E-24
2.680E-24];

% Epithermal resonance integral (cm2/atom)
consts.I_abs_k = [0.000E+00
3.200E-23
3.430E-22
1.800E-27
8.500E-25
2.700E-28
3.110E-25
3.800E-26
1.700E-25
8.200E-26
7.900E-26
2.500E-25
1.383E-23
4.080E-25
1.000E-24
2.330E-25
3.100E-24
1.600E-24
1.340E-23
1.360E-24
1.400E-21
3.900E-22
8.330E-23
2.770E-22];

% Macroscopic log decrement energy loss per collision (unitless)
consts.zeta_k = [1.0000
0.2640
0.1740
0.1580
0.1360
0.1200
0.0850
0.0800
0.0720
0.0700
0.0630
0.0610
0.0550
0.0490
0.0500
0.0490
0.0410
0.0380
0.0360
0.0350
0.0130
0.0130
0.0086
0.0084];

% Elemental stopping power at 8 MeV (MeV/g/cm2)
consts.S_k = [1542
548
537
573
0
539
454
463
449
455
444
439
420
0
432
436
367
0
351
353
0
0
0
0];

% Neutron yield from U decay (n/ppm U)
consts.YU_k = [0
21.1
62.3
0.45
0
0.23
14.5
5.8
5.1
0.69
0
0
0
0
0.45
0
0
0
0
0.19
0
0
0
0];

% Neutron yield from Th decay (n/ppm Th) -- time? 
consts.YTh_k = [0
9.6
19.2
0.18
0
0.079
6.8
2.6
2.6
0.335
0
0
0
0
0.305
0
0
0
0
0.205
0
0
0
0];

% Negative muon capture probability relative to oxygen (unitless)
consts.W_k = [0
0
0.25
0.43
1.02
1
1
0.93
0.76
0.84
1.04
0
1.32
1.03
1.54
1.9
2.66
0
2.73
3.28
4.4
5.8
3
4.7];

% Muon survival probability in k-shell (unitless)
consts.f_surv_k = [0
0
0
0.079
0
0.184
0.454
0.521
0.61
0.659
0.724
0
0.748
0
0.804
0.851
0.853
0
0.897
0.909
0
0
0
0];

% Probability of negative muon capbure (unitless)
consts.f_star_k = [0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.035
0.045
0
0
0
0
0
0
0
0];

% Neutron yield per muon capture (n/capture)
consts.y_n_k = [0
0
0.66
0.76
0.72
0.8
1
0.6
1.26
0.86
0.94
0
0.99
0
1.25
0.75
1.09
0
1.14
1.13
1.6
1.62
1.84
1.86];

% Air parameters
% These are all from Alfimov. 

consts.A_air = 14.45; 

consts.I_eff_air = 27.5e-3; 
consts.Sigma_sc_air = 0.364; 
consts.zeta_bar_air = 0.151;   

consts.Lambda_eth_air = 16.3;
consts.R_eth_air = 1;
consts.D_eth_air = 0.96;
consts.Sigma_eth_air = 0.0591;
consts.L_eth_air = (consts.D_eth_air./consts.Sigma_eth_air).^0.5;

consts.pE_th_air = 0.606;
consts.Lambda_th_air = 16.3;  
consts.R_th_air = 1;   
consts.L_th_air = 3.95; 
consts.Sigma_th_air = 1/consts.Lambda_th_air; 
consts.D_th_air = consts.D_eth_air;
             
% I am not sure what the following is for. 
consts.N_k_air  = 1.0e+22 * [0 0 0 0 3.1982 0.8611 0 0 0 0 0 0 0 0.0410 0 0 0 0 0 0 0 0 0 0]';

% Other stuff
consts.l36 = 2.303e-6;

% Reference production rates for spallation targets, spallation neutrons

% All need proper calibration

% The below are from Shasta's paper
%consts.Psp_0_Ca_St = 52;
%consts.Psp_0_K_St = 151;

%consts.Psp_0_Ca_St = 42.2; % This is to match Irene/CREP for testing
%consts.delPsp_0_Ca_St = 4.8; % Likewise
consts.Psp_0_Ca_St = 48.6; % This is calibrated 
consts.delPsp_0_Ca_St = 48.6.*0.06; % Random
%consts.Psp_0_K_St = 145.5; % This is to match Irene/CREP for testing
%consts.delPsp_0_K_St = 7.7;
consts.Psp_0_K_St = 147.6; % This is calibrated
consts.delPsp_0_K_St = 147.6.*0.06; % random
consts.Psp_0_Ti_St = 3.8; % This is to match Irene/CREP for testing
consts.delPsp_0_Ti_St = 0.4;
consts.Psp_0_Fe_St = 1.42; % This is attempted to be calibrated
consts.delPsp_0_Fe_St = 1.42.*0.1; % random
consts.P_f_0_St = 750; % calibrated
consts.delP_f_0_St = 750*0.3; 

% For Lm scaling
%consts.Psp_0_Ca_Lm = 42.2;
%consts.delPsp_0_Ca_Lm = 4.8;
consts.Psp_0_Ca_Lm = 48.7; % Calibrated
consts.delPsp_0_Ca_Lm = 48.7.* 0.06; % random
%consts.Psp_0_K_Lm = 145.5;
%consts.delPsp_0_K_Lm = 7.7;
consts.Psp_0_K_Lm = 151.7; % calibrated
consts.delPsp_0_K_Lm = 151.7.*0.06; % Random
consts.Psp_0_Ti_Lm = 3.8;
consts.delPsp_0_Ti_Lm = 0.4;
consts.Psp_0_Fe_Lm = 1.43; % Attempted to be calibrated
consts.delPsp_0_Fe_Lm = 1.43.*0.1;
consts.P_f_0_Lm = 740;
consts.delP_f_0_Lm = 740*0.3;

% For LSDn scaling

consts.Psp_0_Ca_LSDn = 0.942; % Calibrated
consts.delPsp_0_Ca_LSDn = 0.942.*0.06; % Somewhat random
consts.Psp_0_K_LSDn = 1.13; % Calibrated
consts.delPsp_0_K_LSDn = 1.13.*0.06; % Somewhat random
consts.Psp_0_Ti_LSDn = 0.536; % This produces 3.8 at 0/1013.24/SPhiInf
consts.delPsp_0_Ti_LSDn = 0.536.*0.1; % Random
consts.Psp_0_Fe_LSDn = 0.833; % Attempted to be calibrated
consts.delPsp_0_Fe_LSDn = 0.833.*0.1; % Random

% The precalculated grids of Pf(0) have 1098 n/g/yr at reference condition.
% To make this be 759, apply 759/1098 = 0.691
consts.P_f_0_LSDn = 0.826; % calibrated
consts.delP_f_0_LSDn = 0.826.*0.3; % Of course this is totally random

% Do we really need to have different P_f_0 for different scaling? I doubt
% it, seeing as how the uncertainty is like 50% no matter what. 

% Exponential approximation consts for muon production
% Note this isn't for production rates, it's for muon fluxes or stopping
% rates. Cross-sections get multiplied in later. Thus, the exponential
% approx consts don't need to be recalculated in future. 

consts.mu.P0_neg = 190.43; consts.mu.Leff_neg = -261.5;
consts.mu.P0_fast = 4876346; consts.mu.Leff_fast = -482.2;
consts.mu.a_neg = 9.6869e-03; consts.mu.b_neg = -8.9370e-06;
consts.mu.a_fast = 1.7584e-03; consts.mu.b_fast = -1.4138e-06;

% Fast muon x-sections
% These need to be recalibrated, obviously
consts.sigma0_Ca = 7.3e-30; % Heisinger
consts.sigma0_K = 9.4e-30; % Marrero

% Housekeeping items

consts.default_yr = 2010;

consts.sschemes = {'St','Lm','LSDn','Ag'}; 
consts.sspropernames = {'Lal(1991)/Stone(2000)','Time-variable Lal/Stone',...
    'Fully loaded Lifton/Sato','Some form of Argento (2014)'};

% File paths, etc.
% Note this is redundant with other code. 

consts.machine_name = get_machine_name();

if strcmp(computer,'MACI64')
    % If running locally on GB's Macbook
    consts.isLocal = 1;
    consts.scratchdir = '/Users/balcs/sw/calcs_v3/Cl36/scratch/';
    consts.RCfname = '/Users/balcs/sw/calcs_v3/v3/core/data/PavonDip.mat';
    consts.Sfname = '/Users/balcs/sw/calcs_v3/v3/core/data/LiftonS2015.mat';
    consts.datadir = '/Users/balcs/sw/calcs_v3/v3/core/data/';
    consts.plotURL = consts.scratchdir;
else
    % Must be running on one of the Linux systems
    consts.isLocal = 0;
    consts.scratchdir = '/var/www/html/scratch/';
    consts.RCfname = '/var/www/html/math/v3/data/PavonDip.mat';
    consts.Sfname = '/var/www/html/math/v3/data/LiftonS2015.mat';
    consts.datadir = '/var/www/html/math/v3/data/';
    consts.plotURL = ['https://' consts.machine_name '/scratch/'];  
end

% Finish up

consts.version = '0.4-dev';
consts.prepdate = fix(clock);

save Cl36_consts consts;
disp('Cl-36 consts saved');


%% Plot 



