clear;close all;

mmdd_all=['1106';'1105';'1104';'1103';'1102';'1101';'1031';'1030'];
mmdd2_all=['1112';'1111';'1110';'1109';'1108';'1107';'1106';'1105'];
d0d7='d7';

for id=5:7
mmdd=mmdd_all(id,:)
mmdd2=mmdd2_all(id,:)

Wrk_path='/home/doglioli/ANDREA/MYMATLAB/LATEXtools/OSCAHR/SST/'

latN=45;
latS=41;
lonW=4;
lonE=10;

nc_name=[Wrk_path,'2015',mmdd,'000000-GOS-L4_GHRSST-SSTfnd-OISST_UHR_NRT-MED-v02.0-fv02.0.nc']
eval(['!gunzip ',nc_name,'.gz']);

%ncdisp(nc_name);

lon=ncread(nc_name,'lon');
lat=ncread(nc_name,'lat');
sst=ncread(nc_name,'analysed_sst');
sst=sst';
scale_factor=0.01;
sst=sst-273.15;%.*scale_factor; %[deg C]

save([nc_name(1:end-3),'.mat'],'lon','lat','sst') 

eval(['!gzip ',nc_name]);

end%nfor id=1:8

