-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCompareEf.m
80 lines (55 loc) · 1.51 KB
/
CompareEf.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
clearvars; clc;
%%
fileEle = 'SLPEXP/SLP0.53.nc';
fileVel = 'SLPEXP/SLP0.54.nc';
const = 6;
%%
b = ncread(fileEle,'depth');
amp = ncread(fileEle,'amp');
eamp = amp(const,:)' ;
phs = ncread(fileEle,'phs');
ephs = phs(const,:)' ;
U_AMP = ncread(fileVel,'u_amp');
U_PHS = ncread(fileVel,'u_phs');
V_AMP = ncread(fileVel,'v_amp');
V_PHS = ncread(fileVel,'v_phs');
uamp = U_AMP(const,:)';
vamp = V_AMP(const,:)';
uphs = U_PHS(const,:)';
vphs = V_PHS(const,:)';
[Fx,Fy] = comptide_eflux( b, eamp, ephs, uamp, uphs, vamp, vphs) ;
TotF = hypot(Fx,Fy) ;
X = ncread(fileEle,'x');
Y = ncread(fileEle,'y');
T = ncread(fileEle,'element')';
%%
fileEle = 'BASE/BASE_V20_wIT.53.nc';
fileVel = 'BASE/BASE_V20_wIT.54.nc';
b = ncread(fileEle,'depth');
amp = ncread(fileEle,'amp');
eamp = amp(const,:)' ;
phs = ncread(fileEle,'phs');
ephs = phs(const,:)' ;
U_AMP = ncread(fileVel,'u_amp');
U_PHS = ncread(fileVel,'u_phs');
V_AMP = ncread(fileVel,'v_amp');
V_PHS = ncread(fileVel,'v_phs');
uamp = U_AMP(const,:)';
vamp = V_AMP(const,:)';
uphs = U_PHS(const,:)';
vphs = V_PHS(const,:)';
[Fx,Fy] = comptide_eflux( b, eamp, ephs, uamp, uphs, vamp, vphs) ;
TotF2 = hypot(Fx,Fy) ;
lon = ncread(fileEle,'x');
lat = ncread(fileEle,'y');
t = ncread(fileEle,'element')';
FIntrp = scatteredInterpolant(lon,lat,TotF2) ;
TotF2_On1 = FIntrp(X,Y) ;
figure;
PD = 100.*(TotF2_On1 - TotF)./TotF ;
fastscatter(X,Y,(TotF2_On1 - TotF));
cmocean('balance',9);
caxis([-1 1])
figure;
trisurf(T,X,Y,PD); shading interp; view(2);
caxis([-5 5])