SWIM - 风驱动的海洋环流向西强化的数值模型研究(Matlab代码实现)

 👨‍🎓个人主页:研学社的博客  

💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

📋📋📋本文目录如下:🎁🎁🎁

目录

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码实现


💥1 概述

SWIM这个名字代表浅水教学模型。求解 beta 平面上的线性化浅水方程。它被配置为再现Stommel(1948)关于风驱动的海洋环流向西加强的理论。它是墨西哥湾流等洋流的最基本模型。本文用于学习物理海洋学数值模拟的基础知识,并了解“向西强化”的概念。

📚2 运行结果

 

运行时间比较久喔。
部分代码:

function [] = plot_SWIM(outFname);

figure
clf;

% Load the results
load(outFname);

% Parameters
length_panel_1 = 0.15;
height_panel_1 = 0.6;
length_panel_2 = 0.70;
height_panel_2 = (Ly/Lx)*length_panel_2;
height_panel_3 = 0.2;
i0             = 0.1;
j0             = 0.075;
di             = 0.025;
dj             = 0.05;
fs             = 8;   % fontsize
lw             = 2.0; % linewidth
x_h_label      = 3850;
y_h_label      = 2175;

% Convert to km only for plotting purposes
xu = xu/1000;
yu = yu/1000;
xv = xv/1000;
yv = yv/1000;
Ly = Ly/1000;
Lx = Lx/1000;

% Interpolate the variable at the center of each cell, that is at the
% coordinate of the elevation h.
[Xu,Yu] = meshgrid(xu,yu);
[Xv,Yv] = meshgrid(xv,yv);
[Xh,Yh] = meshgrid(xv,yu);
uh      = interp2(Xu,Yu,u',Xh,Yh);
vh      = interp2(Xv,Yv,v',Xh,Yh);
xh      = xv;
yh      = yu;

% v at y = 0
v0 = vh(round(N/2),:);

% Colormap
load blue_red_cmap.mat; 

%% Wind stress
axes('Position',[i0 j0+height_panel_3+dj length_panel_1 height_panel_2])
plot(tau_x(1,:),yh,'linewidth',lw);
hold;
plot([0 0],[-Ly/2 Ly/2],'k--');
xlabel('$\tau_x (\mathrm{N\,m^{-2}})$','interpreter','LaTex','fontsize',fs);
ylabel('$y (\mathrm{km})$','interpreter','LaTex','fontsize',fs);
set(gca,'xminortick','on','yminortick','on','fontsize',fs,'tickdir','out');
set(gca,'xlim',[min(tau_x(:))-0.05 max(tau_x(:))+0.05],'ylim',[-Ly/2 Ly/2]);

%% Stream function
axes('Position',[i0+length_panel_1+di j0+height_panel_3+dj length_panel_2 height_panel_2])
contourf(xh,yh,h',12,'linestyle','none');
colormap(cmap_br)
hc = colorbar('horiz');
set(hc,'position',[0.7 0.8 0.275 0.02])
hold
hs = streamslice(Xh,Yh,uh,vh);
set(hs,'color','k');
set(gca,'xminortick','on','yminortick','on','tickdir','out','xticklabel',[],'yticklabel',[],'fontsize',fs);
set(gca,'xlim',[0 Lx],'ylim',[-Ly/2 Ly/2]);
text(x_h_label,y_h_label,'$h \mathrm{(m)}$','interpreter','Latex');

axes('Position',[i0+length_panel_1+di j0+0.015 length_panel_2 height_panel_3])
plot(xh,v0,'linewidth',lw);
hold;
plot([0 Lx],[0 0],'k--');
set(gca,'xminortick','on','yminortick','on','fontsize',fs,'tickdir','out');
xlabel('$x (\mathrm{km})$','interpreter','LaTex','fontsize',fs);
set(gca,'xlim',[0 Lx]);
ylabel('$v_0 (\mathrm{m\,s^{-1}})$','interpreter','LaTex','fontsize',fs);

paperwidth  = 14;  % cm 
paperheight = 14;  % cm
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperSize',    [paperwidth paperheight]);
set(gcf,'PaperPosition',[0 0 paperwidth paperheight]);

print('-dpng','-r300',[outFname(1:end-4),'.png']);

🎉3 参考文献

部分理论来源于网络,如有侵权请联系删除。

[1]Daniel Bourgault, Cédric Chavanne (2022) SWIM - An instructional numerical model for the westward intensification of the wind-driven ocean circulation

🌈4 Matlab代码实现

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

荔枝科研社

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值