%This procedure calculates the (a,c) values used to drive the Monte Carlo 
%optical simulations - see vector avec and matrix cvec.

%particulate absorption values (m^(-1))- equal logarithmic intervals
ap=[0.0013, 0.0026, 0.0053, 0.011, 0.021, 0.043, 0.087, 0.17, 0.35, 0.7]; 
asw=0.43; %seawater absorption coefficient at 670nm (m^(-1))
avec=ap+asw; %total absorption = particulate + seawater absorpton
bp(1:10,1:10) = 0; %particulate scattering coefficients will be stored here
cvec(1:10,1:10) = 0; %total attenuation coefficients will be stored here
for i=1:10;
    bp(i,1) = 0.05+6.08*(ap(i)-0.0013); %for each value of ap define the 
                                        %the lowest value of bp
    bp(i,10) = 0.05+37.63*(ap(i)-0.0013); %highest value of bp
    for j=2:9;
        bp(i,j)=10^(log10(bp(i,j-1))+(log10(bp(i,10))-log10(bp(i,1)))/9); 
        %equal logarithmic intervals
    end;
end;
bsw=0.0008176; %seawater scattering coefficient at 670nm (m^(-1))
bvec=bp+bsw; %total scattering = particulate + seawater scattering
for i=1:10;
    for j=1:10;
        cvec(i,j)=bvec(i,j)+avec(i);
    end;
end;

return;
    