
function absrb = absorb(beta1,beta2)

%  Compute solar radiation absorption profile. This
%  subroutine assumes two wavelengths, and a double
%  exponential depth dependence for absorption.

%  Subscript 1 is for red, non-penetrating light, and
%  2 is for blue, penetrating light. rs1 is the fraction
%  assumed to be red.

global nz dz

rs1 = 0.6;
% rs1 = 1;
rs2 = 1.0-rs1;
absrb = zeros(nz,1);
z1 = (0:nz-1)*dz;
z2 = z1 + dz;
z1b1 = z1/beta1;
z2b1 = z2/beta1;
z1b2 = z1/beta2;
z2b2 = z2/beta2;
absrb = (rs1*(exp(-z1b1)-exp(-z2b1))+rs2*(exp(-z1b2)-exp(-z2b2)))';

% =-------------------------------------------------------------------------=

