function IOPs = GSM01_invert(rrs);
%
% function IOPs = GSM01_invert(rrs);
% input is RRS(0-) at 5 wavelengths...outputs are 3 retrieval params
% chl, acdm(443), and bbp(443)
%
disp('----------MAKE SURE RRS IS BELOW AIR-WATER INTERFACE--------------')
global rrs_obs

options = optimset('fminsearch');
options = optimset(options,'tolx',1e-6,'tolfun',1e-6,'MaxFunEvals',2000,'MaxIter',4000);

%%%%%% FOR EACH SPECTRUM, INVERT USING GS97 TO GIVE IOP's

for i = 1:size(rrs,1), i
   rrs_obs = rrs(i,:)';
   [X cost(i)] = fminsearch('GSM01_cost',[0.2 0.01 0.001]); %% stephane uses [.002 .01 .0029]
   IOPs(i,:) = X;
end

IOPs(:,2)=IOPs(:,2) .* 0.754188;    %%%%% CORRECTION FOR BIAS IN OPTIMIZED MODEL
				    %%%%% SEE MARITORENA et al., (2002)
