% defines the optimum temperature; this is the air temperature in the
% month when the LAI is highest.

io = LAI(:,month) >= maxlai;
fid = LAI(:,month);
maxlai(io) = fid(io);
fid = airt(:,month);
topt(io)   = fid(io);
topt(topt<0) = 0;

if year==1 & month==1
    for i=1:13
        lais(:,i) = LAI(:,month);
    end
else
    for i=13:-1:2
        lais(:,i) = lais(:,i-1);
    end
end
lais(:,1) = LAI(:,month);