我从这里获得了名为precip.mon.total.v6.nc的 netCDF 文件。我ncdf
在 R 中使用包来打开和分析文件。
new <- open.ncdf("precip.mon.total.v6.nc")
> new
[1] "file precip.mon.total.v6.nc has 4 dimensions:"
[1] "lat Size: 360"
[1] "lon Size: 720"
[1] "nbnds Size: 2"
[1] "time Size: 1320"
[1] "------------------------"
[1] "file precip.mon.total.v6.nc has 1 variables:"
[1] "float precip[lon,lat,time] Longname:GPCC Monthly total of precipitation Missval:-9.96920996838687e+36"
但是当我提取变量时,我得到了错误
> get.var.ncdf(new, "precip")
Error: cannot allocate vector of size 2.5 Gb
In addition: Warning messages:
1: In double(totvarsize) :
Reached total allocation of 2047Mb: see help(memory.size)
2: In double(totvarsize) :
Reached total allocation of 2047Mb: see help(memory.size)
3: In double(totvarsize) :
Reached total allocation of 2047Mb: see help(memory.size)
4: In double(totvarsize) :
Reached total allocation of 2047Mb: see help(memory.size)
我的疑问是:(a)如何处理内存问题?(b) 如何将此 netCDF 文件的分辨率从 0.5*0.5 更改为 0.25*0.25 数据?我在 MATLAB 中尝试过类似的问题。对于 netCDF 文件,它可以比 R 更好地解决内存问题。但是改变分辨率仍然是一个问题,因为我不擅长 MATLAB。我将非常感谢这方面的任何帮助。