clear;close all;
LATEXtools_param

%fname_CHL=['20151102_d-OC_CNR-L3-CHL-MedOC3AD4_A_1KM-MED-NRT-v02.mat']
%fname_CHL=['20151106_d-OC_CNR-L3-CHL-MedOC3AD4_A_1KM-MED-NRT-v02.mat']

pipo=['1030';'1031';'1101';'1102';'1103';'1104';'1105';'1106'];
pipo2=['30-oct';'31-oct';'01-nov';'02-nov';'03-nov';'04-nov';'05-nov';'06-nov'];

fname_TSG='TSG/OSCAHR_TSG.mat'

for i=1:8

%%% VIIRS data
%fname_CHL_L3=['2015',pipo(i,:),'_d-OC_CNR-L3-CHL-MedOC3AD4_V_1KM-MED-NRT-v02.mat']
%%% MODIS data
fname_CHL_L3=['2015',pipo(i,:),'_d-OC_CNR-L3-CHL-MedOC3AD4_A_1KM-MED-NRT-v02.mat']


interval_chl=[datenum([pipo2(i,:),'-2015 00:01:00']) datenum([pipo2(i,:),'-2015 23:59:00'])];


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%- Map boundaries -%
lonmin=6;
lonmax=9.1;
latmin=42.8;
latmax=44.2;
%
%- Geographic projection for m_map -%plot_
projection = 'mercator';
%
%- User coast in dirin -%
UserCoast='GOL.mat'; % in "sub_functions" directory
UserCoast2='NWMed.mat';
%
%- Plot the figures
m_proj(projection,'lon',[lonmin lonmax],'lat',[latmin latmax])

h=figure('Visible','on'); hold on; 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%plot_SST(fname_SST_L4);
plot_CHL(fname_CHL_L3);

plot_TSG(fname_TSG,'pos',[datenum('30-oct-2015 00:01:00') datenum('06-nov-2015 23:59:00')],'k-')
plot_TSG(fname_TSG,'pos',interval_chl,'m-')

%plot_TSG(fname_TSG,'sst',interval_sst)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%- User's High Resolution Coastline -%
m_usercoast(UserCoast,'patch',[.7 .7 .7],'edgecolor','k');
%m_coast('patch',[.7 .7 .7],'edgecolor','k');
%
%- Geographical Axis -%
m_grid('box','fancy','tickdir','in');
xlabel('Longitude');
ylabel('Latitude');

title(['CHL L3 ',fname_CHL_L3(1:8)]);

add_regional_map

print(h,[figdir,'figure4lotty_CHL_',fname_CHL_L3(1:8)],'-dpng','-r200')

%disp('pause');pause
%close

end

