%function m1_chl

% Brian Schlining
% 09 Oct 2000

infile = netcdf('d:\web\extern\bog\netcdf\m1.avg.nc');
t      = nctime(infile);

% Calculate Morel Chl
[k z]  = oms_k1(infile, 490);
c      = morel_chl2(k, 490);

% Calculate OC2V4
[lw490 k490 n490] = oms_lw(m1, 490);
lw490_10 = lw490(:, 3);
lw490_20 = lw490(:, 4);
ed490    = infile{'Ed490_0_3'}(:);
ed490(find(ed490 == -999)) = NaN;

[lw555 k555 n555] = oms_lw(m1, 555);
lw555_10 = lw555(:, 3);
lw555_20 = lw555(:, 4);
ed555    = infile{'Ed555_0_5'}(:);
ed555(find(ed555 == -999)) = NaN;

ncquit(infile)

Rrs490_10 = lw490_10./ed490;
Rrs490_20 = lw490_20./ed490;
Rrs555_10 = lw555_10./ed555;
Rrs555_20 = lw555_20./ed555;


oc_10 = oc2v4(Rrs490_10, Rrs555_10);
oc_20 = oc2v4(Rrs490_20, Rrs555_20);


