-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidate_different_resolutions.m
117 lines (96 loc) · 3.54 KB
/
validate_different_resolutions.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
clear all
close all
filename_10 = '/Users/noahday/GitHub/cice-dirs/runs/om2-1deg/history/iceh.2017-01-01.nc';
lat_10 = ncread(filename_10,'TLAT');
lon_10 = ncread(filename_10,'TLON');
tair_10 = ncread(filename_10,'Tair');
filename_025 = '/Users/noahday/GitHub/cice-dirs/runs/access-om2_025/history/iceh_inst.2003-01-01-03600.nc';
lat_025 = ncread(filename_025,'TLAT');
lon_025 = ncread(filename_025,'TLON');
tair_025 = ncread(filename_025,'Tair');
[len wid] = size(lat_10);
for i = 1:len
for j = 1:wid
lat_10_025(i,1) = mean(lat_025(4*(i-1)+1:4*(i-1)+4,1));
end
end
conFigure(11,1)
f = figure;
w = worldmap('world');
axesm eqaazim; %, eqaazim wetch eqdazim vperspec, eqdazim flips the x-axis, and y-axis to eqaazim. cassini
setm(w, 'Origin', [-90 0 0]);
setm(w, 'maplatlimit', [-90,-55]);
setm(w, 'maplonlimit', [-180,-55]);
setm(w, 'meridianlabel', 'on')
setm(w, 'parallellabel', 'off')
setm(w, 'mlabellocation', 60);
setm(w, 'plabellocation', 10);
setm(w, 'mlabelparallel', -45);
setm(w, 'mlinelimit', [-75 -55]);
setm(w, 'plinelimit', [-75 -55]);
setm(w, 'grid', 'on');
setm(w, 'frame', 'off');
setm(w, 'labelrotation', 'on')
pcolorm(lat_10,lon_10,tair_10)
a = colorbar;
a.Label.String = "Air temp [C]";
a.TickLabelInterpreter = 'latex';
a.Label.Interpreter = 'latex';
caxis([-30,30])
conFigure(11,1)
f = figure;
w = worldmap('world');
axesm eqaazim; %, eqaazim wetch eqdazim vperspec, eqdazim flips the x-axis, and y-axis to eqaazim. cassini
setm(w, 'Origin', [-90 0 0]);
setm(w, 'maplatlimit', [-90,-55]);
setm(w, 'maplonlimit', [-180,-55]);
setm(w, 'meridianlabel', 'on')
setm(w, 'parallellabel', 'off')
setm(w, 'mlabellocation', 60);
setm(w, 'plabellocation', 10);
setm(w, 'mlabelparallel', -45);
setm(w, 'mlinelimit', [-75 -55]);
setm(w, 'plinelimit', [-75 -55]);
setm(w, 'grid', 'on');
setm(w, 'frame', 'off');
setm(w, 'labelrotation', 'on')
pcolorm(lat_025,lon_025,tair_025)
a = colorbar;
a.Label.String = "Air temp [C]";
a.TickLabelInterpreter = 'latex';
a.Label.Interpreter = 'latex';
caxis([-30,30])
%% Check the the ocean velocities were read in correctly on Maths1
% We simply check whether the forcing files change each day
filename1 = '/Users/noahday/GitHub/cice-dirs/runs/access-om2_025/history/iceh_inst.2003-01-01-03600.nc';
filename2 = '/Users/noahday/GitHub/cice-dirs/runs/access-om2_025/history/iceh_inst.2003-01-01-07200.nc';
[lat,lon] = grid_read('om2');
lat = ncread(filename1,'ULAT');
lon = ncread(filename1,'ULON');
uocn1 = ncread(filename1,'uocn');
uocn2 = ncread(filename2,'uocn');
conFigure(11,1)
f = figure;
w = worldmap('world');
axesm eqaazim; %, eqaazim wetch eqdazim vperspec, eqdazim flips the x-axis, and y-axis to eqaazim. cassini
setm(w, 'Origin', [-90 0 0]);
setm(w, 'maplatlimit', [-90,-55]);
setm(w, 'maplonlimit', [-180,-55]);
setm(w, 'meridianlabel', 'on')
setm(w, 'parallellabel', 'off')
setm(w, 'mlabellocation', 60);
setm(w, 'plabellocation', 10);
setm(w, 'mlabelparallel', -45);
setm(w, 'mlinelimit', [-75 -55]);
setm(w, 'plinelimit', [-75 -55]);
setm(w, 'grid', 'on');
setm(w, 'frame', 'off');
setm(w, 'labelrotation', 'on')
pcolorm(lat,lon,uocn2-uocn1)
a = colorbar;
a.Label.String = "Difference in u-ocean velocity [m/s]";
a.TickLabelInterpreter = 'latex';
a.Label.Interpreter = 'latex';
caxis([-0.001,0.001])
cmocean('balance')
exportgraphics(f,'difference_u-ocean.png','ContentType','image')