%% euvac.m is my reduced version of Phil Richards' EUVAC model (JGR - 1994).
%% It is reduced in the sense that the calculations are only done up to 
%% flux bin 16 (500-550 A), which is all that is required to calculate He+.
%% The output is given in a single vector corresponding to bins 1 to 16.
%%

function solf=euvac(f107,f107a)

% f107 = daily F10.7 of day of interest (scalar)
% f107a = 81 day averaged F10.7 centered on the day of interest (scalar)
% solf = solar flux 16 element vector corresponding to first 16 bins in Richards paper (photon cm^-2 s^-1).

f74113=[1.200 0.450 4.800 3.100 0.460 0.210 1.679 0.800 6.900 0.965 0.650 0.314 0.383 0.290 0.285 0.452];
ai1=[1.0017e-2 7.1250e-3 1.3375e-2 1.9450e-2 2.7750e-3 1.3768e-1 2.6467e-2 2.5000e-2 ];
ai2=[3.3333e-3 2.2450e-2 6.5917e-3 3.6542e-2 7.4083e-3 7.4917e-3 2.0225e-2 8.7583e-3];
ai=[ai1 ai2];

p=(f107a+f107)/2; 
solf=1e9*f74113.*(1+ai*(p-80));