爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 21133|回复: 2

[其他] 在用calculate_daily_values函数处理小时数据时遇到的超出范围的问题

[复制链接]
发表于 2021-2-4 10:02:13 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
我在大型机上处理十年的小时数据时,想把数据转换成日数据,所以用calculate_daily_values函数,选取十年处理的话会报错,但是只选30天就不会报错,希望各位能帮我看看是哪里的问题
报错信息如下:fatal:Subscript out of range, error in subscript #0
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 18296 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 18 in file hr_to_daily.ncl

代码如下:load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

begin
f1 = addfile("~/data/sfo3_AERhr_UKESM1-0-LL_historical_r1i1p1f2_gn_195001010030-195912302330.nc", "r")
new_cdf = "1950.nc"

nni=37
nnj=33
nnv=3600

sfo3_0 = f1->sfo3(:,85:117,37:73)
printVarSummary(sfo3_0)
opt = True
opt@nval_crit = 24
sfo3_1 = calculate_daily_values(sfo3_0, "avg", 0, opt)

cdf = addfile(new_cdf, "c")
print("Creating new init file....")

; define dimensions
dimNames = (/"lon","lat","time"/)
dimSizes = (/nni, nnj, nnv/)
dimUnlim = (/False,False,False/)
filedimdef(cdf,dimNames,dimSizes,dimUnlim)

; write variables
cdf->sfo3=sfo3_1

end




密码修改失败请联系微信:mofangbao
发表于 2022-9-29 11:08:56 | 显示全部楼层
楼主,请问我出现了(calculate_daily_values) is undefined,这个错误是为什么呀,load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2022-10-3 14:43:41 | 显示全部楼层
陈小翔 发表于 2022-9-29 11:08
楼主,请问我出现了(calculate_daily_values) is undefined,这个错误是为什么呀,load "$NCARG_ROOT/lib/nc ...

请问解决了吗
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表