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=1:8
mmdd=mmdd_all(id,:)
mmdd2=mmdd2_all(id,:)

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

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

data_type='h';
nc_name=['nrt_med_allsat_madt_',data_type,'_2015',mmdd,'_2015',mmdd2,'.nc']

eval(['!wget ftp://lob_doglioli:coral15@ftp.aviso.oceanobs.com/regional-mediterranean/near-real-time/grids/madt/all-sat-merged/',data_type,'/',nc_name,'.gz']);
%ftp://lob_doglioli:coral15@ftp.aviso.oceanobs.com/regional-mediterranean/near-real-time/grids/madt/all-sat-merged/h/nrt_med_allsat_madt_h_20151030_20151105.nc.gz
eval(['!mv ',nc_name,'.gz OSCAHR/AVISO/']);
eval(['!gunzip OSCAHR/AVISO/',nc_name,'.gz']);

[lon,lat,var2]=read_nc_aviso_med_2014(nc_name,latN,latS,lonW,lonE,data_type);

save([Wrk_path,'/','2015',mmdd,'_AVISO_',d0d7,'_h.mat'],'lon','lat','var2') 

data_type='uv';
nc_name=['nrt_med_allsat_madt_',data_type,'_2015',mmdd,'_2015',mmdd2,'.nc']

eval(['!wget ftp://lob_doglioli:coral15@ftp.aviso.oceanobs.com/regional-mediterranean/near-real-time/grids/madt/all-sat-merged/',data_type,'/',nc_name,'.gz']);
%ftp://lob_doglioli:coral15@ftp.aviso.oceanobs.com/regional-mediterranean/near-real-time/grids/madt/all-sat-merged/uv/nrt_med_allsat_madt_uv_20151030_20151105.nc.gzeval(['!mv ',nc_name,' OSCAHR/AVISO/']);
eval(['!mv ',nc_name,'.gz OSCAHR/AVISO/']);
eval(['!gunzip OSCAHR/AVISO/',nc_name,'.gz']);

[lon,lat,var1]=read_nc_aviso_med_2014(nc_name,latN,latS,lonW,lonE,data_type);

save([Wrk_path,'/','2015',mmdd,'_AVISO_',d0d7,'_uv.mat'],'lon','lat','var1') 

end%nfor id=1:8

