-
Notifications
You must be signed in to change notification settings - Fork 0
/
cice_run_checks.m
141 lines (107 loc) · 3.51 KB
/
cice_run_checks.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
% Check that the CICE simulation is running correctly
clc
clear all
close all
addpath functions
filename = '/Users/noahday/GitHub/cice-dirs/runs/access-om2_025/history/iceh_inst.2003-01-02-00000.nc';
sector = 'SH';
grid = "om2_025";
%aice_data = data_format_sector(filename,var,sector);
%[lat,lon] = grid_read(grid);
lat = ncread(filename,'TLAT');
lon = ncread(filename,'TLON');
conFigure(11,1)
%%
var = 'aice';
aice_data = ncread(filename,var);
[f, a] = make_map(lat,lon,aice_data);
cmocean('ice')
a.Label.String = "Sea ice concentration [-]";
caxis([0,1])
exportgraphics(f,strcat(var,'_map.png'),'ContentType','image',"Resolution",2000)
clear aice_data
%% Atmospheric forincg
set(gcf,'Visible', 'off');
var = 'Tair';
data = ncread(filename,var);
[f, a] = make_map(lat,lon,data);
cmocean('thermal')
a.Label.String = "Surface air temperature [$^\circ$ C]";
%caxis([0,1])
exportgraphics(f,strcat(var,'_map.png'),'ContentType','image',"Resolution",2000)
clear data
var = 'uatm';
data = ncread(filename,var);
[f, a] = make_map(lat,lon,data);
cmocean('balance','pivot',0)
a.Label.String = "Zonal wind velocity [m/s]";
%caxis([0,1])
exportgraphics(f,strcat(var,'_map.png'),'ContentType','image',"Resolution",2000)
clear data
var = 'vatm';
data = ncread(filename,var);
[f, a] = make_map(lat,lon,data);
cmocean('balance','pivot',0)
a.Label.String = "Meridional wind velocity [m/s]";
%caxis([0,1])
exportgraphics(f,strcat(var,'_map.png'),'ContentType','image',"Resolution",2000)
clear data
var = 'snow';
data = ncread(filename,var);
[f, a] = make_map(lat,lon,data);
cmocean('tempo')
a.Label.String = "Snow fall rate [cm/day]";
%caxis([0,1])
exportgraphics(f,strcat(var,'_map.png'),'ContentType','image',"Resolution",2000)
clear data
var = 'rain';
data = ncread(filename,var);
[f, a] = make_map(lat,lon,data);
cmocean('tempo')
a.Label.String = "Rainfall rate [cm/day]";
%caxis([0,1])
exportgraphics(f,strcat(var,'_map.png'),'ContentType','image',"Resolution",2000)
clear data
%%
var = 'uvel';
data = ncread(filename,var);
[f, a] = make_map(lat,lon,data);
cmocean('balance','pivot',0)
a.Label.String = "Zonal ice velocity [m/s]";
%caxis([0,1])
exportgraphics(f,strcat(var,'_map.png'),'ContentType','image',"Resolution",2000)
clear data
%%
var = 'uvel';
data = ncread(filename,var);
[f, a] = make_map(lat,lon,data);
cmocean('balance','pivot',0)
a.Label.String = "Zonal ice velocity [m/s]";
%caxis([0,1])
exportgraphics(f,strcat(var,'_map.png'),'ContentType','image',"Resolution",2000)
clear data
% FUNCTIONS
function [f_out, a] = make_map(lat,lon,data)
f_out = 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,-50]);
setm(w, 'maplonlimit', [-180,180]);
setm(w, 'meridianlabel', 'off')
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', 'off');
setm(w, 'frame', 'off');
setm(w, 'labelrotation', 'on')
pcolorm(lat,lon,data)
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(w, land, 'FaceColor', [0.5 0.7 0.5])
a = colorbar;
a.TickLabelInterpreter = 'latex';
a.Label.Interpreter = 'latex';
end