- 积分
- 939
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-12-10
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
在网上搜到一段计算水汽通量的matlab程序:(出处http://blog.sina.com.cn/s/blog_4cfb5a620101cesh.html,原程序数据读取有些问题,已稍作改动)
程序中有几处不明,下面用红色标识,求指点!
%资料:hgt.mon.mean.nc;uwnd.mon.mean.nc,vwnd.mon.mean.nc;shum.mon.mean.nc(比湿);
%---------------------------------------------------
hgt1 = ncread('hgt.mon.mean.nc','hgt',[9 13 1 1],[65 37 8 806],[1 1 1 1]);
lon = ncread('hgt.mon.mean.nc','lon',9,65,1);
lat = ncread('hgt.mon.mean.nc','lat',13,37,1);
j=1;
for i=6:12:740
hgt(:,:,:,[j,j+1,j+2])=squeeze(hgt1(:,:,:,[i,i+1,i+2]));
j=j+1;
end
logc1=hgt<0;
hgt(logc1)=0.0;
sum11=62*3-sum(logc1);
sum1=sum(hgt);
[ii]=find(sum11==0);
sum11(ii)=1;
hgtm=squeeze(sum1./sum11);
clear file f hgt hgt1 logc1 sum11 sum1 ii
%----------------------------------------------------
uwnd1 = ncread('uwnd.mon.mean.nc','uwnd',[9 13 1 1],[65 37 8 806],[1 1 1 1])*.01 + 202.65;
j=1;
for i=6:12:740
uwnd(:,:,:,[j,j+1,j+2])=squeeze(uwnd1(:,:,:,[i,i+1,i+2]));
j=j+1;
end
logc1=uwnd>200;
uwnd(logc1)=0.0;
sum11=62*3-sum(logc1);
sum1=sum(uwnd);
[ii]=find(sum11==0);
sum11(ii)=1;
uwm=squeeze(sum1./sum11);
clear file f uwnd uwnd1 logc1 sum11 sum1 ii j
%----------------------------------------------------
vwnd1 = ncread('vwnd.mon.mean.nc','vwnd',[9 13 1 1],[65 37 8 806],[1 1 1 1])*.01 + 202.65;
j=1;
for i=6:12:740
vwnd(:,:,:,[j,j+1,j+2])=squeeze(vwnd1(:,:,:,[i,i+1,i+2]));
j=j+1;
end
logc1=vwnd>200;
vwnd(logc1)=0.0;
sum11=62*3-sum(logc1);
sum1=sum(vwnd);
[ii]=find(sum11==0);
sum11(ii)=1;
vwm=squeeze(sum1./sum11);
clear file f vwnd vwnd1 logc1 sum11 sum1 ii j
%----------------------------------------------------
shum1 = ncread('shum.mon.mean.nc','shum',[9 13 1 1],[65 37 8 806],[1 1 1 1])*.001 + 32.665;
j=1;
for i=6:12:740
shum(:,:,:,[j,j+1,j+2])=squeeze(shum1(:,:,:,[i,i+1,i+2]));
j=j+1;
end
logc1=shum>2000;
shum(logc1)=0.0;
sum11=62*3-sum(logc1);
sum1=sum(shum);
[ii]=find(sum11==0);
sum11(ii)=1;
shm=squeeze(sum1./sum11);
clear file f shum shum1 logc1 sum11 sum1 ii j
%----------------------------------------------------
g = 9.8;
qu = squeeze(sum((hgtm(:,1:7,:)-hgtm(:,2:8,:)).*(uwm(:,1:7,:)+uwm(:,2:8,:)).*(shm(:,1:7,:)+shm(:,2:8,:))/4));
qv = squeeze(sum((hgtm(:,1:7,:)-hgtm(:,2:8,:)).*(vwm(:,1:7,:)+vwm(:,2:8,:)).*(shm(:,1:7,:)+shm(:,2:8,:))/4));
qu=qu/g;
qv=qv/g;
quiver(lon,lat,-qu,-qv)
hold on
worldmap2;
axis([20 180 -30 60])
程序中计算每部分数据时都用到了:
sum11=62*3-sum(logc1); %62指共使用了62年的数据
sum1=sum(hgt);
[ii]=find(sum11==0);
sum11(ii)=1;
hgtm=squeeze(sum1./sum11);
这样一段算法,不知此段代码是什么意思?
另外,处理风场时加的202.65 和 处理比湿时加的32.665 又作何解释?
望大家指教,谢过了!
|
|