-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathekman_forcing_winds.m
More file actions
59 lines (48 loc) · 1.5 KB
/
ekman_forcing_winds.m
File metadata and controls
59 lines (48 loc) · 1.5 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
%% Now lets calculatew the ekman pump
addpath /Users/dlizarbe/Documents/DANIEL/2001_2010
clear all; close all; clc;
cd /Volumes/BM_2022_x/Hindcast_1990_2010/inout;
[mask,LON,LAT,path1]=lets_get_started;
mask(mask==0)=NaN;
%%
cd /Volumes/BM_2022_x/Hindcast_1990_2010/inout;
hdir=dir('M*.nc');
[Xu,Yu]=meshgrid(LON(1:end-1,1), LAT(1,:));
[Xv,Yv]=meshgrid(LON(:,1), LAT(1,1:end-1));
%MeanWind_Y2010M4
yr=1990:1:2010;
mo=1:1:12;
jj=0;
for iy=yr(1):1:yr(end)
for imo=mo(1):1:mo(end)
fn=sprintf('MeanWind_Y%dM%d.nc',iy,imo);
disp(fn)
%winds
uwind=double(ncread(fn,'uwnd'));
vwind=double(ncread(fn,'vwnd'));
%regrid uwind
U = interp2(Xu, Yu, uwind', LON', LAT', 'linear')';
%regrid vwind
V = interp2(Xv, Yv, vwind', LON', LAT', 'linear')';
[~,~,wE] = ekman(LAT,LON,U,V);
jj=jj+1;
Ekman_We(:,:,jj)=wE;
end
end
%%
Mean_We=mean(Ekman_We,3,'omitnan');
figure
[c,h]=contourf(LON,LAT,Mean_We.*86400.*mask,[-10:0.2:2]);shading flat; colorbar;
cmocean('balance',13); set(h,'LineColor','none');
title('Ekman Pump','fontsize',16);
caxis([-1.6 1.6]);
%%
U=double(ncread('Wind_average.nc','uwnd'));
V=double(ncread('Wind_average.nc','vwnd'));
U = interp2(Xu, Yu, U', LON', LAT', 'linear')';
%regrid vwind
V = interp2(Xv, Yv, V', LON', LAT', 'linear')';
Humboldt_ports
load('Mean_199709_2010_chlor');
%% save
save('Ekman_We_wind.mat','Ekman_We','Mean_We','LON','LAT','mask','U','V','lon','lat','chloro');