Está en la página 1de 2

clear all

addpath('C:\Users\laboratorio\Desktop\Matlab\mexcdf\mexnc')
addpath('C:\Users\laboratorio\Desktop\Matlab\mexcdf\netcdf_toolbox')
addpath('C:\Users\laboratorio\Desktop\Matlab\mexcdf\snctools')
addpath('C:\Users\laboratorio\Desktop\Matlab\m_map1.4f')
nombre = 'C:\Users\laboratorio\Desktop\Matlab\sst.mnmean.nc'
javaaddpath([pwd '/netcdfAll-4.2.jar']);
nc_dump(nombre)
tiempo=nc_varget(nombre,'time');
fecha=datenum(1800,1,1)+tiempo;
[ano,mes,dia]=datevec(fecha);
lat=nc_varget(nombre,'lat');
lon=nc_varget(nombre,'lon');

%Climatologia de la ts /(graficado otoño-invierno-primavera-verano)


I=find(fecha==datenum(1982,1,1));
F=find(fecha==datenum(2018,12,1));
fecha2=fecha(I:F);
[ano mes dia]=datevec(fecha2);
J=find(lon==120.5);
K=find(lat==45.5);
ts_cc=nc_varget(nombre,'sst',[0 K J],[-1 70 170]);
lat_2=nc_varget(nombre,'lat',[K],70);
lon_2=nc_varget(nombre,'lon',[J],170);
m_proj('mercator','lon',[min(115) max(300)],'lat',[min(-30) max(50)])
temps=ts_cc(I:F,:,:);
for i=1:12;
c=find(mes==i);
clim(i,:,:)=nanmean(temps(c,:,:),1);
end

ts_cc_ot=nanmean(clim(3:5,:,:),1);
ts_cc_iv=nanmean(clim(6:8,:,:),1);
ts_cc_pri=nanmean(clim(9:11,:,:),1);
ts_cc_ve=nanmean(clim([1 2 12],:,:),1);
%{
m_pcolor(lon_2,lat_2,squeeze(clim(i,:,:))),shading flat,colorbar
m_gshhs_l('patch', 'k')
m_grid('box','fancy')

subplot(2,2,1)
m_pcolor(lon_2,lat_2,squeeze(ts_cc_ot)),shading flat,colorbar
m_gshhs_l('patch', 'k')
m_grid('box','fancy')
subplot(2,2,2)
m_pcolor(lon_2,lat_2,squeeze(ts_cc_iv)),shading flat,colorbar
m_gshhs_l('patch', 'k')
m_grid('box','fancy')
subplot(2,2,3)
m_pcolor(lon_2,lat_2,squeeze(ts_cc_pri)),shading flat,colorbar
m_gshhs_l('patch', 'k')
m_grid('box','fancy')
subplot(2,2,4)
m_pcolor(lon_2,lat_2,squeeze(ts_cc_ve)),shading flat,colorbar
m_gshhs_l('patch', 'k')
m_grid('box','fancy')
%anomalias de ts/ (graficado anomalias de diciembre del 2015)
%}
[tt mm nn]=size(temps);
for i=1:tt;
[ano mes dia]=datevec(fecha2(i));
anom(i,:,:)=ts_cc(i,:,:)-clim(mes,:,:);
end
A=find(fecha==datenum(2015,12,1))
%{
m_pcolor(lon_2,lat_2,squeeze(anom(A,:,:))),shading flat,colorbar
m_gshhs_l('patch', 'k')
m_grid('box','fancy')
%}
%Punto frente a las costas de valparaiso
L=find(lon==288.5)
M=find(lat==-33.5)
sst_valpo=anom(:,M,L);
plot(fecha2,sst_valpo)

También podría gustarte