-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHB_SSTanomonth.m
More file actions
142 lines (115 loc) · 4.04 KB
/
HB_SSTanomonth.m
File metadata and controls
142 lines (115 loc) · 4.04 KB
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
%% Hot_Blob monthly anomaly
path0='/Volumes/USB DISK/hot_blob';
fn='SST_2020.nc';
fns=fullfile(path0,fn);
fn2='SST1993_2019dic.mat';
fnclim=fullfile(path0,fn2);
load(fnclim);
lon=double(ncread(fns,'longitude'));
lat=double(ncread(fns,'latitude'));
time=double(ncread(fns,'time'))./24;
[loni,lati]=meshgrid(lon,lat);
[yr,mo,da,hr,mi,se]=datevec(time+datenum(1950,1,1,1,0,0));
yrst=2020;
most=1;
yren=2020;
moen=1;
moen0=moen;
iter=0;
%aviobj=QTWriter('Hot-Blob','FrameRate',2);
%aviobj.Quality=100;
figure
P=get(gcf,'position');
P(3)=P(3)*1.5;
P(4)=P(4)*2;
set(gcf,'position',P);
set(gcf,'PaperPositionMode','auto');
for iy=yrst:1:yren
if iy>yrst
most=1;
end
% if iy is equal to yren, then let most is moen0,
if iy==yren
moen=moen0;
% otherwise 12
else
moen=12;
end
for im=most:1:moen
disp(datestr(datenum(iy,im,28,0,0,0)));
indx01=find(yr==iy&mo==im);
iter=iter+1;
numrec=length(indx01);
for irec=1:1:numrec
disp (['Proceess No.' num2str(irec) ' ... '])
daynum=datestr(datenum(iy,im,28,0,0,0));
SST=ncread(fns,'to',[1 1 1 indx01(irec)]...
,[length(lon) length(lat) 1 1],[1 1 1 1]);
uvel=double(ncread(fns,'ugo',[1 1 1 indx01(irec)]...
,[length(lon) length(lat) 1 1],[1 1 1 1]));
vvel=double(ncread(fns,'vgo',[1 1 1 indx01(irec)]...
,[length(lon) length(lat) 1 1],[1 1 1 1]));
masknan=double(~isnan(SST));
SST(isnan(SST))=0;
if irec==1
sstm=zeros(size(SST));
numnonnan=zeros(size(SST));
uvel0=zeros(size(uvel));
vvel0=zeros(size(vvel));
end
sstm=sstm+SST;
numnonnan=numnonnan+masknan;
uvelm=uvel0+uvel./length(indx01);
vvelm=uvel0+uvel./length(indx01);
end
sstm=sstm./numnonnan;
sstanom=sstm'-ssts(:,:,im);
subplot(2,1,2)
h=imagescn(loni,lati,sstanom);
hold on
[c,h]=contour(loni,lati,sstanom,[-6:1:6],'k:');
clabel(c,h);
caxis([-6 6]);
cb=colorbar; cmocean('balance');
ylabel(cb,'sea surface temperature anomaly (\circC)');
title(['SST Monthly anom ' daynum]);
hold on
% quiversc(loni,lati,uvel',vvel','k','density',70)
% axis tight
% hold on
centerLon=180;
he=earthimage('center',centerLon);
uistack(he,'bottom');
text(260,-55,'CIO-CHALLENGER','Fontsize',12,'Color','k');
set(gca,'ytick',[-60:10:0],'yticklabel',[-60:10:0],'ylim',[-60 0]);
set(gca,'xtick',[170:10:290],'xticklabel',[[170:10:180] [-170:10:-70]],'xlim',[170 290]);
xlabel('Longitude'); ylabel('Latitude');
subplot(2,1,1)
g=imagescn(loni,lati,sstm');
hold on
[c,h]=contour(loni,lati,sstm',[10:2:24],'k:');
clabel(c,h);
caxis([10 24]);
cb=colorbar; cmocean('balance');
ylabel(cb,'sea surface temperature (\circC)');
title(['SST Monthly average ' daynum]);
hold on
% quiversc(loni,lati,uvel',vvel','k','density',70)
% axis tight
% hold on
centerLon=180;
he=earthimage('center',centerLon);
uistack(he,'bottom');
text(260,-55,'CIO-CHALLENGER','Fontsize',12,'Color','w');
set(gca,'ytick',[-60:10:0],'yticklabel',[-60:10:0],'ylim',[-60 0]);
set(gca,'xtick',[170:10:290],'xticklabel',[[170:10:180] [-170:10:-70]],'xlim',[170 290]);
xlabel('Longitude'); ylabel('Latitude');
% pause(0.5)
% %
% M1=getframe(gcf);
% writeMovie(aviobj,M1);
% clf
%
end
end
%close(aviobj);