爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 9831|回复: 12

Unable to allocate memory for output arrays

[复制链接]
回帖奖励 60 金钱 回复本帖可获得 5 金钱奖励! 每人限 1 次

新浪微博达人勋

发表于 2020-6-1 18:13:33 | 显示全部楼层 |阅读模式

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

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

x
windws下用cygwin安装的ncl在跑程序,出现了如图的错误。上网查了之后暂认为是分配的内存不足,我就去regedit下添加了一个dword,设置了内存上限为8g,结果还是老问题,是我的电脑内存不足吗,请教一下大佬们。 TIM截图20200601180904.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 成长值: 0
发表于 2020-6-1 18:34:20 | 显示全部楼层

回帖奖励 +5 金钱

发一下源代码和数据呢?
或者你可以试试本人的Cygwin NCL绿色免安装版
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-6-1 18:44:47 | 显示全部楼层
kermit 发表于 2020-6-1 18:34
发一下源代码和数据呢?
或者你可以试试本人的Cygwin NCL绿色免安装版
  1. ;*************************************************
  2. ; corel_3.ncl
  3. ;
  4. ; Concepts illustrated:
  5. ;   - Calculating a two-dimensional correlation in time
  6. ;   - Reordering an array
  7. ;   - Copying attributes from one variable to another
  8. ;   - Copying coordinate arrays from one variable to another
  9. ;   - Removing the end boxes in a labelbar
  10. ;
  11. ;************************************************
  12. ;
  13. ; These files are loaded by default in NCL V6.2.0 and newer
  14. ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  15. ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
  16. ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
  17. begin
  18. ;************************************************
  19. ; open file and read in variable
  20. ;***********************************************
  21.   in1  = addfile("J:\实验数据\结果\wrfout201801.nc","r")
  22.   ;diri="J:/"
  23.   ;files=systemfunc("ls "+diri+"met_em.d01.*.nc")
  24. ; in2=addfiles(files,"r")
  25.   in2  = addfile("J:\实验数据\erain\2018\sur\201801.nc","r")
  26.   
  27.   tmp1 = in1->SWDOWN
  28.   tmp2 = in2->sp
  29. ;************************************************
  30. ; reorder to get time as right most dimension
  31. ;***********************************************
  32.   ts1 = tmp1(south_north|:,west_east|:,Time|:)
  33.   ts2 = tmp2(latitude|:,longitude|:,time|:)
  34. ;************************************************
  35. ; calculate cross correlations
  36. ;************************************************
  37.   maxlag = 2                                  ; set lag
  38. ; note, the max lag should not be more than N/4
  39.   
  40.   ccr = esccr(ts1,ts2,maxlag)                   ; calc cross correlations

  41. ; copy meta data and coordinate variables using contributed functions
  42.   copy_VarAtts(ts1, ccr)                    
  43.   copy_VarCoords_1(ts2,ccr)
  44. ;************************************************
  45. ; plot the correlations
  46. ;************************************************
  47.   wks  = gsn_open_wks("png","corelsp")             ; send graphics to PNG file

  48.   res                      = True                ; make plot mods

  49.   res@cnFillOn             = True                ; turn on color
  50.   res@cnFillPalette        = "BlWhRe"            ; set color map

  51.   res@cnLinesOn            = False               ; turn off contour lines
  52.   res@cnLevelSelectionMode = "ManualLevels"      ; manually set cn levels
  53.   res@cnMinLevelValF       = -1.                 ; min level
  54.   res@cnMaxLevelValF       =  1.                 ; max level
  55.   res@cnLevelSpacingF      = .1                  ; contour level spacing

  56.   res@cnLabelBarEndStyle   = "ExcludeOuterBoxes" ; remove the two end boxes from the labelbar
  57.   res@pmLabelBarWidthF     = 0.8

  58.   lag                      = 0
  59.   res@tiMainString         = "Correlations at lag "+lag
  60.   plot = gsn_csm_contour_map(wks,ccr(:,:,lag),res)
  61. ;************************************************
  62. end






  63.        
复制代码

这个是在ncl官网找的实例,自己对需要修改的参数进行了修改 另外两个文件一个是wrf跑出来的结果,一个就是从ecmef那里下载的再分析数据 不知道是不是我在修改参数的时候有些地方没修改到位,麻烦看一下
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 成长值: 0
发表于 2020-6-1 21:21:27 | 显示全部楼层
你不把数据给我我没法看鸭
你可以发我邮箱 i@nui.st
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-6-7 20:23:37 | 显示全部楼层

回帖奖励 +5 金钱

楼主有试过用学校的大型机来进行计算么
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-6-8 17:33:34 | 显示全部楼层
supersupergirl 发表于 2020-6-7 20:23
楼主有试过用学校的大型机来进行计算么

完全是自己的电脑在运行,老师不太舍得买服务器。不过这个问题已经解决了,还是很感谢你的答复。
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-6-13 20:53:13 | 显示全部楼层

回帖奖励 +5 金钱

学习学习
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2020-6-16 11:00:35 | 显示全部楼层

回帖奖励 +5 金钱

{:5_275:}
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2020-6-24 11:20:53 | 显示全部楼层

回帖奖励 +5 金钱

windows的话应该是内存不足,我遇到过一次,解决办法是在脚本里面,把已经读进来且之后不用的数组delete掉,delete(var),或者就是循环处理数据,比如多层数据一层一层地读。
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-11-2 14:44:36 | 显示全部楼层
谢谢分享
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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