- 积分
- 506
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-10-20
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
报错
Traceback (most recent call last):
File "d:/py/jiwen/total1.py", line 20, in <module>
Q=0.123*((rsds*60*60*30*24)/(1000*10000))/(4250*4.18) #Q为光合生产潜力
File "D:\Python\lib\site-packages\xarray\core\dataarray.py", line 2690, in func
f(self.variable, other_variable)
File "D:\Python\lib\site-packages\xarray\core\variable.py", line 2049, in func
f(self_data, other_data)
MemoryError: Unable to allocate 408. MiB for an array with shape (1032, 180, 288) and data type float64
代码如下
import xarray as xr
import numpy as np
f1= xr.open_dataset(r'D:\py\pr_Amon_FGOALS-f3-L_ssp370_r1i1p1f1_gr_201501-210012.nc')
f2 = xr.open_dataset(r'D:\py\evspsbl\evspsbl_Amon_FGOALS-f3-L_ssp370_r1i1p1f1_gr_201501-210012.nc')
f3 = xr.open_dataset(r'D:\py\rsds\rsds_Amon_FGOALS-f3-L_ssp370_r1i1p1f1_gr_201501-210012.nc')
f4 = xr.open_dataset(r'D:\py\mtas_Amon_FGOALS-f3-L_ssp370_r1i1p1f1_gr_201501-210012.nc')
f=xr.merge([f1,f2['evspsbl'],f3['rsds'],f4['tas']])
pr=f['pr']
eva=f['evspsbl']
rsds=f['rsds']
tas=f['tas']
Q=0.123*((rsds*60*60*30*24)/(1000*10000))/(4250*4.18)
for i in range(912,920):
for j in range(92,100):
for k in range(57,60):
if tas[i, j, k] >= 283.15:
pr[i, j, k] = Q[i, j, k] * ((tas[i, j, k] - 273.15) * 30) * (pr[i, j, k] / eva[i, j, k])
else:
pr[i,j,k]=0
print(pr)
|
|