-
Notifications
You must be signed in to change notification settings - Fork 1
/
TSM_erro.m
166 lines (140 loc) · 5.31 KB
/
TSM_erro.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
% Código para obtenção da diferença de TSM de diferentes entradas no WRF.
clear all
close all
clc
% Essas variáveis são definidas pelo próprio usuário, onde estarão os
% diretórios com os dados do WRF e observacionais
path_in=['C:\Users\matheus\Desktop\TCCfinal\'];
path_in2=['C:\Users\matheus\Desktop\TCCfinal\'];
path_in3=['D:\Dados TCC\2016\'];
path_in4=['D:\Dados TCC\avaliar_modelo\'];
ncfile3 = [path_in4,'d03_default_201607'];
ncfile3t = [path_in3,'d03_201607_sst'];
% ncdisp(ncfile);
shpfile = [path_in2, 'LINHA_DE_COSTA_IMAGEM_GEOCOVER_SIRGAS_2000','.shp']
s = shaperead(shpfile,'UseGeoCoords',true)
LAT = (s.Lat);
LON = (s.Lon);
% for hora = 06:12:18;
hora = 06;
d2 = 24;
dia2 = 0* d2;
dia = 361 + dia2 + hora;
lat3=ncread(ncfile3,'XLAT');
truelat3 = lat3(:,:,dia);
% ncdisp(ncfile);
lon3=ncread(ncfile3,'XLONG');
truelon3 = lon3(:,:,dia);
lat3t=ncread(ncfile3t,'XLAT');
truelat3t = lat3t(:,:,dia);
% ncdisp(ncfile);
lon3t=ncread(ncfile3t,'XLONG');
truelon3t = lon3t(:,:,dia);
sst3 = ncread(ncfile3,'SST');
truesst3 = sst3(:,:,dia);
truesst3 = truesst3-273;
sst3t = ncread(ncfile3t,'SST');
truesst3t = sst3t(:,:,dia);
truesst3t = truesst3t-273;
landmask3=ncread(ncfile3,'LANDMASK');
ld3=landmask3(:,:,dia);
sst3=truesst3;
sst3(ld3==1)=nan;
landmask3t=ncread(ncfile3t,'LANDMASK');
ld3t=landmask3t(:,:,dia);
sst3t=truesst3t;
sst3t(ld3t==1)=nan;
% sst3 = interp2(sst3);
% truelat3 = interp2(truelat3);
% truelon3 = interp2(truelon3);
%
% sst3t = interp2(sst3t);
% truelat3t = interp2(truelat3t);
% truelon3t = interp2(truelon3t);
% figure(3+hora)
% subplot(1,2,1)
% % pcolor(truelon1, truelat1, sst1);caxis([26,28]);colorbar
% % axis equal
%
% latmin = double(min(min(truelat3)));
% latmax = double(max(max(truelat3)));
% lonmin = double(min(min(truelon3)));
% lonmax = double(max(max(truelon3)));
% % i = 4;
% m_proj('lambert','lat',[latmin latmax],'lon',[lonmin lonmax]);
% m_line(LON(1,:),LAT(1,:),'color','k','linewidth',1.5);
% m_grid('box','fancy','linestyle','-','gridcolor','k','fontsize',12,'fontweight','bold');
% hold on;
% imgg2 = m_contourf(truelon3,truelat3,sst3,100,'edgecolor','none');
% c2 = colorbar
% colormap jet
% caxis([25,28]);
% c2.Label.String = 'Temperatura da Superfície do Mar (°C)';
% xlabel('Longitude','fontsize',14,'fontweight','bold');
% ylabel('Latitude','fontsize',14,'fontweight','bold');
% title(sprintf('TSM-GFS (Grade: 3km) - 22/07/2016 - %02d:00',hora),'fontsize',14,'fontweight','bold');
% set(gca,'Fontsize',18,'fontweight','bold')
%
% hold on
% subplot(1,2,2)
%
latmin = double(min(min(truelat3t)));
latmax = double(max(max(truelat3t)));
lonmin = double(min(min(truelon3t)));
lonmax = double(max(max(truelon3t)));
% % pcolor(truelon2, truelat2, sst2);caxis([26,28]);colorbar
% m_proj('lambert','lat',[latmin latmax],'lon',[lonmin lonmax]);
% m_line(LON(1,:),LAT(1,:),'color','k','linewidth',1.5);
% m_grid('box','fancy','linestyle','-','gridcolor','k','fontsize',12,'fontweight','bold');
% hold on;
% imgg2 = m_contourf(truelon3t,truelat3t,sst3t,100,'edgecolor','none');
% c2 = colorbar
% colormap jet
% caxis([25,28]);
% c2.Label.String = 'Temperatura da Superfície do Mar (°C)';
% xlabel('Longitude','fontsize',14,'fontweight','bold');
% ylabel('Latitude','fontsize',14,'fontweight','bold');
% title(sprintf('TSM-RTG (Grade: 3km) - 22/07/2016 - %02d:00',hora),'fontsize',14,'fontweight','bold');
% set(gca,'Fontsize',18,'fontweight','bold')
figure(1)
tsm_erro = sst3 - sst3t;
% pcolor(truelon2, truelat2, sst2);caxis([26,28]);colorbar
m_proj('lambert','lat',[latmin latmax],'lon',[lonmin lonmax]);
m_line(LON(1,:),LAT(1,:),'color','k','linewidth',1.5);
m_grid('box','fancy','linestyle','-','gridcolor','k','fontsize',12,'fontweight','bold');
hold on;
hold on
imgg2 = m_contourf(truelon3t,truelat3t,tsm_erro,100, 'edgecolor','none');
hold on
imgg2 = m_contour(truelon3t,truelat3t,tsm_erro,[0 0],'Showtext','on','color','k');
% imgg2 = m_contour(truelon3t,truelat3t,tsm_erro,[0 0]);
c2 = colorbar
colormap jet
% caxis([25,28]);
c2.Label.String = 'Temperatura da Superfície do Mar (°C)';
xlabel('Longitude','fontsize',14,'fontweight','bold');
ylabel('Latitude','fontsize',14,'fontweight','bold');
title(sprintf('Diferença de TSM (Grade: 3km) - 15/01/2016 - %02d:00',hora),'fontsize',14,'fontweight','bold');
set(gca,'Fontsize',18,'fontweight','bold')
figure(2)
[row, column] = find(tsm_erro == min(min(tsm_erro)))
% [row, column] = find(tsm_erro == 0)
figure(2)
% row = 97;
% column = 75;
tsm_erro2 = tsm_erro;
tsm_erro2(row,column) = 10;
m_proj('lambert','lat',[latmin latmax],'lon',[lonmin lonmax]);
m_line(LON(1,:),LAT(1,:),'color','k','linewidth',1.5);
m_grid('box','fancy','linestyle','-','gridcolor','k','fontsize',12,'fontweight','bold');
hold on
imgg2 = m_contourf(truelon3t,truelat3t,tsm_erro2,100, 'edgecolor','none');
hold on
imgg2 = m_contour(truelon3t,truelat3t,tsm_erro,[0 0],'Showtext','on','color','k');
c2 = colorbar
colormap jet
c2.Label.String = 'Temperatura da Superfície do Mar (°C)';
xlabel('Longitude','fontsize',14,'fontweight','bold');
ylabel('Latitude','fontsize',14,'fontweight','bold');
title(sprintf('Diferença de TSM (Grade: 3km) - 15/01/2016 - %02d:00',hora),'fontsize',14,'fontweight','bold');
set(gca,'Fontsize',18,'fontweight','bold')