爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 31502|回复: 27

[其他] 最近的两个错误让我觉得突然有点不懂ncl了

[复制链接]
发表于 2013-1-30 07:46:19 | 显示全部楼层 |阅读模式

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

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

x
第一个是不小心把一个变量里的djf写成了dfj,在一大堆代码里一直没发现,运行的时候ncl只报有错,连第几行都没说。在我的记忆里,像这种错误ncl一般会说变量undefined,而且会指出第几行错误。结果这次啥都没说,害我费了老半天才找出错在哪儿。

第二个,错误提示是:
Assignment type mismatch, right hand side can't be coerced to type of left hand side
这个错误其实我经常见,但是记忆里也是ncl会运行不下去,而且会说错误在第几行。但是这次能顺利运行而且没说错误在哪儿。由于是在循环里,满屏的这条信息让我受不了,就去找根源,终于找到是这一句:
  ampano(2+ir*2) = npano({lat0},{lon0})
问题是这两变量ampano和npano都是float类型,很match啊,而且稍稍改动成这样错误就好了:
  temp  = npano({lat0},{lon0})
  ampano(2+ir*2) = temp

除了一行和两行代码,这两种方式有啥区别啊?

我的ncl也没升级啥的,这两错误彻底让我迷糊了。看来是ncl太博大精深了,我的经验太肤浅了

评分

参与人数 1金钱 +2 贡献 +2 收起 理由
环境气象DDD + 2 + 2

查看全部评分

密码修改失败请联系微信:mofangbao
发表于 2013-5-8 18:20:35 | 显示全部楼层
同样一套ncl程序,换了一套资料而已,运行ncl时出现如下错误
“fatal:NclMalloc Failed:[errno=12]
assertion "value != NULL" failed: file "putget.c", line 4081, function: getNCvx_float_float
Aborted (core dumped)”
请问该怎么解决啊?

刚接触ncl,实在想不出该怎么改,麻烦大神指教
密码修改失败请联系微信:mofangbao
发表于 2013-10-27 22:12:07 | 显示全部楼层

A Malloc error usually means that your machine has run out of memory.

Looking at the file you are trying to plot, the array size is rather big
(81MB) for plotting.

There are no coordinate variables (latitudes/longitude arrays) within
the .hdf file. I assume you are creating those yourself, or have them
from somewhere else. I also converted to float from short using
short2flt, as I am guessing you did.

My best guess is that your machine is running out of memory when trying
to plot the large array. Can you subset the data somehow, seeing if you
can get a smaller region to plot? Alternatively you can try running this
on a machine with more memory.

If these suggestions do not help please let us know..
Best regards,
Adam
密码修改失败请联系微信:mofangbao
发表于 2013-10-28 14:59:30 | 显示全部楼层
guizi 发表于 2013-10-27 22:12
A Malloc error usually means that your machine has run out of memory.

Looking at the file you a ...

I have solved this problem sometime ago, but I also want to thank you for your suggestions.
密码修改失败请联系微信:mofangbao
发表于 2013-11-8 22:25:42 | 显示全部楼层
蓝馨蝶韵 发表于 2013-10-28 14:59
I have solved this problem sometime ago, but I also want to thank you for your suggestions.

你是如何解决的啊?我也遇到同样的问题,我以为可以忽略的,看来是想的太简单啦!
密码修改失败请联系微信:mofangbao
发表于 2013-11-9 00:05:28 | 显示全部楼层
dataiyang 发表于 2013-11-8 22:25
你是如何解决的啊?我也遇到同样的问题,我以为可以忽略的,看来是想的太简单啦!

delete掉不用的变量 释放内存
密码修改失败请联系微信:mofangbao
发表于 2013-11-9 09:52:29 | 显示全部楼层
ulegend 发表于 2013-11-9 00:05
delete掉不用的变量 释放内存

非常感谢,回头再看看ncl的manual啊!
密码修改失败请联系微信:mofangbao
发表于 2014-2-8 22:11:06 | 显示全部楼层
新手路过。
密码修改失败请联系微信:mofangbao
发表于 2014-2-15 13:53:18 | 显示全部楼层
对于第一个问题实在是不知道是什么原因导致,对于第二个问题也经常出现,运行的时候有时候也不会提示错误所在行的,但是对于楼主的问题有个建议就是注意“=”号的使用,在ncl中“=”号表示的是两边不管是数据类型还是数据维数都必须一致!
密码修改失败请联系微信:mofangbao
发表于 2014-7-6 15:24:01 | 显示全部楼层
请问有人知道fatal:NhlRealloc Failed:[errno=12]
fatal:Memory allocation failure:[errno=12]
这个错误提示是什么意思吗?错在哪里呢?
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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