-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_ice_clm_ECCO.m
146 lines (122 loc) · 4.22 KB
/
plot_ice_clm_ECCO.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
if ~exist('p')
p = genpath('~/MATLAB/');
addpath(p);
%load nctiles_grid in memory:
fout='~/data/geos5/MITGRID/llc90/';
grid_load(fout,5,'compact',0,0)
%displays list of grid variables:
gcmfaces_global;% disp(mygrid);
end
V={ 'ETAN' 'SIarea' 'SIheff' 'SIhsnow' 'DETADT2' 'PHIBOT' 'sIceLoad' 'MXLDEPTH' 'oceSPDep' 'SIatmQnt' 'SIatmFW' 'oceQnet' 'oceFWflx' 'oceTAUX' 'oceTAUY' 'ADVxHEFF' 'ADVyHEFF' 'DFxEHEFF' 'DFyEHEFF' 'ADVxSNOW' 'ADVySNOW' 'DFxESNOW' 'DFyESNOW' 'SIuice' 'SIvice'};
collection='state_2d_set1';
filo=dir(['../../ECCO_v4_r2_ERA/diags/' collection '*.data']);
units='[m]';
msk=mygrid.mskC(:,:,1).*mygrid.RAC; msk(isnan(msk))=0;
% niter0=0;
%dt=4; %time steps per file
N=length(filo);
th=0.001;
fignum=1;
fdate00=datetime(1992,1,1,0,0,0);
for var=[3 4 7];
fdate=fdate00;
% startdate=datetime(2006,4,14,21,0,0);
% enddtate=datetime(2007,4,14,21,0,0);
i=1;
n=0;
fld=read_bin(['../../ECCO_v4_r2_ERA/diags/' filo(1).name],1,1)*0;
area2=read_bin(['../../ECCO_v4_r2_ERA/diags/' filo(i).name],1,2)*0;
while isbetween(fdate,fdate,enddate)
if isbetween(fdate,startdate,enddate) & i<=length(filo)
area=read_bin(['../../ECCO_v4_r2_ERA/diags/' filo(i).name],1,2);
area2=area2+area;
if var<=4; fld=fld+(read_bin(['../../ECCO_v4_r2_ERA/diags/' filo(i).name],1,var)./area); end
if var>4; fld=fld+(read_bin(['../../ECCO_v4_r2_ERA/diags/' filo(i).name],1,var)); end
fld(area<=th)=0;
fdate
[V{var} ' ' num2str(i) ' ' num2str(nansum(fld.*msk)./nansum(msk))]
n=n+1;
end
i=i+1;
fdate=fdate+calmonths(1);
end
area2(area2./n<=th)=NaN;
area=area2/n;
area2(area2./n>=th)=1;
fld=fld./n.*area2;
h1=figure('Position',[60 259 560 420]);
m_map_gcmfaces(fld,2)
a=findall(gcf,'type','axes'); % Get each subplot in the figure
for j=1:length(a) % for each subplot
if var==3 ; caxis([0 4]); end
if var==4 ; caxis([0 1]); end
if var==7 ; caxis([0 8e3]); end
end
nansum(fld.*msk)./nansum(msk)
pname=['figs/Ice_' V{var} '_np'];
print(pname,'-dpng')
h2=figure('Position',[640 259 560 420]);
m_map_gcmfaces(fld,3)
a=findall(gcf,'type','axes'); % Get each subplot in the figure
for j=1:length(a) % for each subplot
if var==3 ; caxis([0 4]); end
if var==4 ; caxis([0 1]); end
if var==7 ; caxis([0 8e3]); end
end
nansum(fld.*msk)./nansum(msk)
pname=['figs/Ice_' V{var} '_sp'];
print(pname,'-dpng')
fld(isnan(fld))==0;
eval(['fld2=fld_' V{var} '-fld;'])
h1=figure('Position',[60 259 560 420]);
m_map_gcmfaces(fld2,2)
a=findall(gcf,'type','axes'); % Get each subplot in the figure
for j=1:length(a) % for each subplot
if var==3 ; caxis([-4 4]); end
if var==4 ; caxis([-1 1]); end
if var==7 ; caxis([-8e3 8e3]); end
end
nansum(fld2.*msk)./nansum(msk)
pname=['figs/Ice_' V{var} '_np'];
print(pname,'-dpng')
h2=figure('Position',[640 259 560 420]);
m_map_gcmfaces(fld2,3)
a=findall(gcf,'type','axes'); % Get each subplot in the figure
for j=1:length(a) % for each subplot
if var==3 ; caxis([-4 4]); end
if var==4 ; caxis([-1 1]); end
if var==7 ; caxis([-8e3 8e3]); end
end
nansum(fld2.*msk)./nansum(msk)
pname=['figs/Ice_' V{var} '_sp'];
print(pname,'-dpng')
end
h1=figure('Position',[60 259 560 420]);
m_map_gcmfaces(area,2)
a=findall(gcf,'type','axes'); % Get each subplot in the figure
caxis([0 1]);
nansum(area.*msk)./nansum(msk)
pname=['figs/Ice_' V{var} '_np'];
print(pname,'-dpng')
h2=figure('Position',[640 259 560 420]);
m_map_gcmfaces(area,3)
a=findall(gcf,'type','axes'); % Get each subplot in the figure
caxis([0 1]);
nansum(area.*msk)./nansum(msk)
pname=['figs/Ice_' V{var} '_sp'];
print(pname,'-dpng')
eval(['fld2=fld_SIarea-area;'])
h1=figure('Position',[60 259 560 420]);
m_map_gcmfaces(fld2,2)
a=findall(gcf,'type','axes'); % Get each subplot in the figure
caxis([-1 1]);
nansum(fld2.*msk)./nansum(msk)
pname=['figs/Ice_' V{var} '_np'];
print(pname,'-dpng')
h2=figure('Position',[640 259 560 420]);
m_map_gcmfaces(fld2,3)
a=findall(gcf,'type','axes'); % Get each subplot in the figure
caxis([-1 1]);
nansum(fld2.*msk)./nansum(msk)
pname=['figs/Ice_' V{var} '_sp'];
print(pname,'-dpng')