- 积分
- 39670
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-5-13
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 一大碗年糕 于 2022-3-7 20:30 编辑
晚上在做事件频次计算的时候发现对原数据在时间维sum总数竟然会出现负值(照理说肯定是大于等于0),仔细检查之后发现变量的类型竟然是byte,其取值范围是-128到127,显然错误原因是由于频次总和超出范围被强制转换了,对byte这个类型数据好像说有些函数也不适用,以后建议多加小心
附上ncl关于byte的一些解释:
- (*) Note that as of version 6.0.0 the byte type has changed from unsigned to signed. This is to help NCL track more closely with NetCDF usage. If you have byte data that you need to treat as 8 bit unsigned data it is coercible to the ubyte type directly by assignment or through use of the tounsigned function.
- CAUTION: Currently, arithmetic overflow and underflow are not always reported as errors to the user. Assignment of out-of-range values may cause errors.
|
|