爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 12577|回复: 13

NCL画图出错求助

[复制链接]

新浪微博达人勋

发表于 2015-10-30 15:41:21 | 显示全部楼层 |阅读模式

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

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

x
今天画图出现了这个错误,以前是好好的
      0 [main] ncl 7464 fhandler_dev_zero::fixup_mmap_after_fork: requested 0xA14E0000 != 0x0 mem alloc base 0x80000000, state 0x2000, size 246546432, Win32 error 487
  12041 [main] ncl 7464 E:\cygwin\usr\local\bin\ncl.exe: *** fatal error in forked process - recreate_mmaps_after_fork_failed
  27780 [main] ncl 7464 cygwin_exception::open_stackdumpfile: Dumping stack trace to ncl.exe.stackdump
      0 [main] ncl 5980 fork: child -1 - forked process 7464 died unexpectedly, retry 0, exit code 0x100, errno 11
fatal:systemfunc: cannot create child process:[errno=11]
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 4061 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl

fatal:["Execute.c":8578]:Execute: Error occurred at or near line 30 in file /gzy/CRE/CRE2000-1850.ncl


密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2015-10-30 15:42:09 | 显示全部楼层
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"
begin
  files1 = systemfunc ("ls /gzy/R1850.*.nc")
  f1     = addfiles(files1,"r")  
  a = f1[:]->LWCF
  b = dim_avg_n_Wrap(a,0)  

  c = f1[:]->SWCF

  d = dim_avg_n_Wrap(c,0)  

  files2 = systemfunc ("ls /gzy/Ref.*.nc")
  f2     = addfiles(files2,"r")  
  e = f2[:]->LWCF

  f = dim_avg_n_Wrap(e,0)  

  g = f2[:]->SWCF

  h = dim_avg_n_Wrap(g,0)  

  LW=f
  LW=f-b
  SW=f
  SW=h-d

  plot = new(2,graphic)
  wks = gsn_open_wks("pdf","/gzy/CRE/CRE20001850")
  gsn_define_colormap(wks,"BlWhRe")
  res1             = True
  res1@mpFillOn    = True                        ; turn map fill off
  res1@mpOutlineOn = True      ; turn the map outline on
  res1@cnLevelSelectionMode = "ExplicitLevels"                            ; set explicit contour levels
  res1@cnLevels    = (/-10,-8,-6,-4,-2,0,2,4,6,8,10/)        ; set levels
  res1@cnFillOn    = True                                                   ; turn on color fill
  res1@cnLinesOn   = False                                                   ; turn off the contour lines
  res1@cnLineLabelsOn = False                                        ; turn the line labels off
  res1@gsnDraw             = False           ; don't draw
  res1@gsnFrame            = False           ; don't advance frame
  res1@cnInfoLabelOn       = False           ; turn off cn info label
  res1@tiMainString = "annual mean LWCRE in CAM5 2000-1850"
  res1@lbLabelBarOn        = False
  res1@gsnRightString= "W/m2"
  

  res2             = True
  res2@mpFillOn    = True           ; turn map fill off
  res2@mpOutlineOn = True      ; turn the map outline on
  res2@cnLevelSelectionMode = "ExplicitLevels"              ; set explicit contour levels
  res2@cnLevels    = (/-10,-8,-6,-4,-2,0,2,4,6,8,10/)    ; set levels
  res2@cnFillOn    = True                       ; turn on color fill
  res2@cnLinesOn   = False                      ; turn off the contour lines
  res2@cnLineLabelsOn = False                   ; turn the line labels off
  res2@gsnDraw             = False           ; don't draw
  res2@gsnFrame            = False           ; don't advance frame
  res2@cnInfoLabelOn       = False           ; turn off cn info label
  res2@tiMainString = "annual mean SWCRE in CAM5 2000-1850"
  res2@lbLabelBarOn        = False
  res2@gsnRightString= "W/m2"
  plot(0) = gsn_csm_contour_map(wks,LW,res1)
  plot(1) = gsn_csm_contour_map(wks,SW,res2)

  resP                     = True                ; modify the panel plot
  resP@gsnPanelLabelBar    = False                ; add common colorbar
  resP@lbLabelFontHeightF  = 0.007
  gsn_panel(wks,plot(0:1),(/2,1/),resP)               ; now draw as one plot

end     
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2015-11-2 09:48:29 | 显示全部楼层
问题解决了,ncl在cygwin环境下一次缓存的内容不能过多,我把以前文件中所需要的变量放到了一个新的nc中,程序就正常了
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-1-30 10:31:47 | 显示全部楼层
sinagzy 发表于 2015-11-2 09:48
问题解决了,ncl在cygwin环境下一次缓存的内容不能过多,我把以前文件中所需要的变量放到了一个新的nc中, ...

楼主请问你是怎么把变量放到新nc中的,我也遇到了这个问题但是找不到解决方案暂时
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-9-9 15:19:08 | 显示全部楼层
Maziy 发表于 2016-1-30 10:31
楼主请问你是怎么把变量放到新nc中的,我也遇到了这个问题但是找不到解决方案暂时

创建新的nc文件,把变量输出出来
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-11-12 20:03:57 | 显示全部楼层
我也出现了这个问题  哎 老麻烦了
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-11-22 16:33:38 | 显示全部楼层
jiangbing 发表于 2016-11-12 20:03
我也出现了这个问题  哎 老麻烦了

有些变量你计算完后可以delete掉,不然会一直占用内存
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-4-16 17:21:56 | 显示全部楼层
如果是在交互页面直接用delete(变量)可以删除,如果是用的脚本直接运行出现这个错误呢,要怎么解决这个问题
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-4-17 15:29:33 | 显示全部楼层
气象草鸟 发表于 2018-4-16 17:21
如果是在交互页面直接用delete(变量)可以删除,如果是用的脚本直接运行出现这个错误呢,要怎么解决这个问 ...

在脚本里也可以delete呀
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-4-18 11:03:27 | 显示全部楼层
sinagzy 发表于 2018-4-17 15:29
在脚本里也可以delete呀

哦哦,没想到呢,谢谢啦
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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