- 积分
- 15
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2024-9-6
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2024-9-26 18:38:49
|
显示全部楼层
clc,clear,close all;
lon=ncread('fengchang40_year.nc','lon');
lat=ncread('fengchang40_year.nc','lat');
time=ncread('fengchang40_year.nc','time');
taux40_year=ncread('fengchang40_year.nc','taux40_year');
tauy40_year=ncread('fengchang40_year.nc','tauy40_year');
%方法1
curlmean_year=NaN(40,1);
for i=1:40
taux1=taux40_year(:,:,i);
tauy1=tauy40_year(:,:,i);
[mm,nn]=curl(taux1,tauy1);
curlmean_year(i)=nanmean(mm(:));
end
% 方法1(距离)
%网格距离
[lon,lat]=meshgrid(lon,lat);
d=2*pi*6371000/360;%一个纬度网格的距离,单位m,(地球半径为6371 km),大约为111km
d_lon=lon*d.*cosd(lat);
d_lat=lat*d;
curlz_year=NaN(40,1);
for i=1:40
taux1=taux40_year(:,:,i);
tauy1=tauy40_year(:,:,i);
[curlz,~]=curl(d_lon',d_lat',taux1,tauy1);
curlz_year(i)=nanmean(curlz(:));
disp(i)
end
% 方法2
[dtauy_dx, ~] = gradient(tauy40_year);%求偏导
[~, dtaux_dy] = gradient(taux40_year);
wind_stress_curl =dtauy_dx-dtaux_dy;
curl_year=NaN(40,1);
for i=1:40
wind_stress_curl11=wind_stress_curl(:,:,i);
curl_year(i)=nanmean(wind_stress_curl11(:));
end |
|