
function plot_sbdart_output()

   nAlb = 11;
   nSsa = 11;

   %-- read the SBDART out file.
   %
   fid=fopen('./ex03_tbaer0.0.out', 'r');
   ssa = textscan(fid, '%f', nSsa);
   alb = textscan(fid, '%f', nAlb);
   dat = textscan(fid, '%f');
   fclose(fid);
   ssa = cell2mat(ssa);
   alb = cell2mat(alb);
   dat = cell2mat(dat);
   datclr = reshape(dat, 9,[]);

   fid=fopen('./ex03_tbaer0.3.out', 'r');
   ssa = textscan(fid, '%f', nSsa);
   alb = textscan(fid, '%f', nAlb);
   dat = textscan(fid, '%f');
   fclose(fid);
   ssa = cell2mat(ssa);
   alb = cell2mat(alb);
   dat = cell2mat(dat);
   dataer = reshape(dat, 9,[]);


   %-- get difference between fluxes with and without aerosol
   %
   Ftoadn_aer = dataer(4,:);
   Ftoaup_aer = dataer(5,:);
   Fbotdn_aer = dataer(7,:);
   Fbotup_aer = dataer(8,:);
   
   Ftoadn_clr = datclr(4,:);
   Ftoaup_clr = datclr(5,:);
   Fbotdn_clr = datclr(7,:);
   Fbotup_clr = datclr(8,:);

   Ftoant_aer = Ftoadn_aer - Ftoaup_aer; % TOA net
   Fbotnt_aer = Fbotdn_aer - Fbotup_aer; % bottom net
   Ftoant_clr = Ftoadn_clr - Ftoaup_clr; % TOA net
   Fbotnt_clr = Fbotdn_clr - Fbotup_clr; % bottom net
   
   tfc = Ftoant_aer - Ftoant_clr; %TOA forcing
   bfc = Fbotnt_aer - Fbotnt_clr; %Bottom forcing
   tfc = reshape(tfc, nSsa, nAlb);
   bfc = reshape(bfc, nSsa, nAlb);
   


   %-- plotting
   albx = linspace(alb(1),alb(end));
   ssay = linspace(ssa(1),ssa(end));
   [xm,ym]=meshgrid(alb,ssa);
   [xi,yi]=meshgrid(albx,ssay);
   %zi = interp2(xm,ym,tfc,xi,yi);
   zi = interp2(xm,ym,bfc,xi,yi);
   zeroLine = contourc(albx,ssay,zi,[0,0]);
   zeroLine = zeroLine(:,2:end); %critical single scattering albedo line.
   
   figure(7);clf
   set(gca,'FontSize',14)
   imagesc(albx,ssay,zi);
   colorbar
   set(gca,'YDir','normal')
   hold on
   plot(zeroLine(1,:),zeroLine(2,:), 'y-','LineWidth',3)
   grid on
   text(0.20,0.65,{['\DeltaF>0 (Heating)'],[ ],...
                   ['\DeltaF = F_{net}(TOA)_{aer} - F_{net}(TOA)_{clr}']},...
                    'FontSize',16, 'Color',[.7,.7,.7])
   text(0.01,0.92,'\DeltaF<0 (Cooling)','FontSize',16,'Color',[.7,.7,.7])
   title({['TOA aerosol forcing as function of surface albedo and']...
          ['single scattering albdo (\omega) and the critical \omega value']...
          ['at which aerosol forcing canges sign.']...
          ['Aerosol optical depth = 0.3']...
          ['Aerosol asymmetry factor = 0.7']})
   ylabel('Single Scattering Albedo');
   xlabel('Surface Albedo');

   
%keyboard   
end %----------------------------   
   
