- 积分
- 156
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2020-3-19
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
报错信息如图
这是相关部分脚本
StartYear = 1979;
EndYear = 1988;
SpendYear = EndYear - StartYear + 1;
Level = 10;
DongTuJudge = zeros(340,180,SpendYear);
Deep = [0.0071,0.02792,0.06226,0.11887,0.21219,0.36607,0.61976,1.03803,1.72764,2.86461,4.73916,7.82977,12.92532,21.32647,35.17762];
ZeroDeep = zeros(340,180,12);
ZerosDeepYear = zeros(340,180,SpendYear);
%调试变量
Surf1 = zeros(340,180,SpendYear);
Surf2 = zeros(340,180,SpendYear);
%这部分是画图用的
Boundary = load('TP_boundary.txt');
VarName1 = Boundary(:,1);
VarName2 = Boundary(:,2);
for Year = StartYear:EndYear
Year
ID = ['GLDAS_CLM_TP.',num2str(Year),'.nc'];
ORGANIC1= ncread(ID,'var85');
ORGANIC=ORGANIC1(:,:,:,:);
LAT = ncread(ID,'lat');
LON =ncread(ID,'lon');
SoldTemp = ORGANIC - 273.15*ones(size(ORGANIC));
year = Year-StartYear+1;
%年平均
MeanYear = mean(SoldTemp,4);
Year_surf =(MeanYear(:,:,1)+MeanYear(:,:,2)+MeanYear(:,:,3)+MeanYear(:,:,4))/4;
Year_shallow = (MeanYear(:,:,4)+MeanYear(:,:,5)+MeanYear(:,:,6))/3;
Year_deep = (MeanYear(:,:,7)+MeanYear(:,:,8)+MeanYear(:,:,9))/3;
% 季节平均
% Spring = (SoldTemp(:,:,:,3)+SoldTemp(:,:,:,4)+SoldTemp(:,:,:,5))/3;
Summer = (SoldTemp(:,:,:,6)+SoldTemp(:,:,:,7)+SoldTemp(:,:,:,8))/3;
% Autumn = (SoldTemp(:,:,:,9)+SoldTemp(:,:,:,10)+SoldTemp(:,:,:,11))/3;
Winter = (SoldTemp(:,:,:,12)+SoldTemp(:,:,:,1)+SoldTemp(:,:,:,2))/3;
MeanYear_surf(:,:,year) = Year_surf;
MeanYear_shallow(:,:,year) = Year_shallow;
MeanYear_deep(:,:,year) = Year_deep;
% Spring_surf =(Spring(:,:,1)+Spring(:,:,2)+Spring(:,:,3)+Spring(:,:,4))/4;
% Spring_shallow = (Spring(:,:,5)+Spring(:,:,6)+Spring(:,:,7)+Spring(:,:,8))/4;
% Spring_deep = (Spring(:,:,9)+Spring(:,:,10))/2;
Summer_surf =(Summer(:,:,1)+Summer(:,:,2)+Summer(:,:,3)+Summer(:,:,4)+Summer(:,:,5))/5;
Summer_shallow = (Summer(:,:,5)+Summer(:,:,6)+Summer(:,:,7)+Summer(:,:,8))/4;
Summer_deep = (Summer(:,:,6)+Summer(:,:,7)+Summer(:,:,8)+Summer(:,:,9)+Summer(:,:,10))/5;
% Autumn_surf =(Autumn(:,:,1)+Autumn(:,:,2)+Autumn(:,:,3)+Autumn(:,:,4))/4;
% Autumn_shallow = (Autumn(:,:,5)+Autumn(:,:,6)+Autumn(:,:,7)+Autumn(:,:,8))/4;
% Autumn_deep = (Autumn(:,:,9)+Autumn(:,:,10))/2;
Winter_surf =(Winter(:,:,1)+Winter(:,:,2)+Winter(:,:,3)+Winter(:,:,4)+Winter(:,:,5))/5;
Winter_shallow = (Winter(:,:,5)+Winter(:,:,6)+Winter(:,:,7)+Winter(:,:,8))/4;
Winter_deep = (Winter(:,:,6)+Winter(:,:,7)+Winter(:,:,8)+Winter(:,:,9)+Winter(:,:,10))/5;
% MeanSpring_surf(:,:,year) = Spring_surf;
% MeanSpring_shallow(:,:,year) = Spring_shallow;
% MeanSpring_deep(:,:,year) = Spring_deep;
MeanSummer_surf(:,:,year) = Summer_surf;
MeanSummer_shallow(:,:,year) = Summer_shallow;
MeanSummer_deep(:,:,year) = Summer_deep;
% MeanAutumn_surf(:,:,year) = Autumn_surf;
% MeanAutumn_shallow(:,:,year) = Autumn_shallow;
% MeanAutumn_deep(:,:,year) = Autumn_deep;
MeanWinter_surf(:,:,year) = Winter_surf;
MeanWinter_shallow(:,:,year) = Winter_shallow;
MeanWinter_deep(:,:,year) = Winter_deep;
end
for i = 1:340
for j = 1:180
[i,j]
in = inpolygon(LON(i),LAT(j),VarName1,VarName2);
if in == 0%在边界范围外
MeanYear_surf(i,j,:) = NaN;
MeanYear_shallow(i,j,:) = NaN;
MeanYear_deep(i,j,:) = NaN;
% MeanSpring_surf(i,j,:) = NaN;
% MeanSpring_shallow(i,j,:) = NaN;
% MeanSpring_deep(i,j,:) = NaN;
MeanSummer_surf(i,j,:) = NaN;
MeanSummer_shallow(i,j,:) = NaN;
MeanSummer_deep(i,j,:) = NaN;
% MeanAutumn_surf(i,j,:) = NaN;
% MeanAutumn_shallow(i,j,:) = NaN;
% MeanAutumn_deep(i,j,:) = NaN;
MeanWinter_surf(i,j,:) = NaN;
MeanWinter_shallow(i,j,:) = NaN;
MeanWinter_deep(i,j,:) = NaN;
end
end
end
软件刚入门,只提供一下参考资料也行,十分感谢!!!
|
|