爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 8262|回复: 2

画不出图来,提示fatal:ContourPlotDraw: Workspace reallocation would exceed ma...

[复制链接]

新浪微博达人勋

发表于 2014-4-28 17:34:15 | 显示全部楼层 |阅读模式
GrADS
系统平台: linux
问题截图:
问题概况: 想画个nc文件的surface pressure的图,画不出来。print PS变量数据都是101192左右,报错fatal:ContourPlotDraw: Workspace reallocation would exceed maximum size 100000000
我看过提问的智慧: 看过
自己思考时长(天): 1

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

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

x
;*******************************************************
; lcnative_2.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"
   
begin
;************************************************
; open file and read in data
;************************************************
  f     = addfile ("CoordinatesInfo.nc", "r")
  nf     = addfile ("nc.nc", "r")
;print(f)
  t = nf->ps(0,0,:,:)
;print(t)   
  lat2d     = f->lat
  lon2d     = f->lon
  dimll  = dimsizes(lat2d)                ; get size of dimensions
;print(dimll)
  nlat   = dimll(0)
  mlon   = dimll(1)
;************************************************
; create plot
;************************************************
  wks = gsn_open_wks("png","aaa_out")         ; open a workstation
gsn_define_colormap(wks,"gui_default")    ; choose colormap
  ;gsn_define_colormap(wks,"test111") ; select color map
  res                   = True              ; plot mods desired
  res@tiMainString      = "test" ;Native Lambert Conformal"
;************************************************
; lambert conformal projections are limited using
; the corners method rather than the latlon method
; seen for cylindrical equidistant projections
;************************************************
  res@mpLimitMode       = "Corners"         ; choose range of map
  res@mpLeftCornerLatF       = lat2d(0,0)
  res@mpLeftCornerLonF       = lon2d(0,0)
  res@mpRightCornerLatF      = lat2d(nlat-1,mlon-1)
  res@mpRightCornerLonF      = lon2d(nlat-1,mlon-1)
;************************************************
; native lambert grids read in from grib files are
; different than those read in from netCDF files.
; NCL automatically looks for the parallel and
; meridian information on the grib file and attaches
; this information as attributes to the lat2d array.
;************************************************
  res@mpProjection          = "LambertConformal"
  res@mpLambertParallel1F   = nf->Latin1(0)
  res@mpLambertParallel2F   = nf->Latin2(0)
  res@mpLambertMeridianF    = nf->LoV(0)       ; ncl adds from grib file

  res@pmTickMarkDisplayMode = "Always"
  res@mpFillOn              = True           ; turn on map fill
  res@mpOutlineDrawOrder    = "PostDraw"      ; draw continental outline last
  res@mpOutlineBoundarySets = "AllBoundaries" ; all boundaries
;****************************************************************************
; usually, when data is placed onto a map, it is TRANSFORMED to the specified
; projection. Since this model is already on a native lambert conformal grid,
; we want to turn OFF the tranformation.
;****************************************************************************
  res@tfDoNDCOverlay = True
;****************************************************************************
  res@cnFillOn              = True            ; color plot desired
  res@cnLinesOn             = False           ; turn on contour lines
  res@cnLineLabelsOn    = False     ;turn on label lines

  res@gsnSpreadColors       = True            ; use full range of colormap
  res@gsnAddCyclic          = False           ; regional data
  ;res@tmXTLabelsOn          = False
  ;res@tmYRLabelsOn          = False
  res@mpGridAndLimbOn = True                ;turn on grid line
  
plot = gsn_csm_contour_map(wks,t,res)
end


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

新浪微博达人勋

 楼主| 发表于 2014-4-29 17:50:21 | 显示全部楼层
自己动手,丰衣足食啊http://www.ncl.ucar.edu/Document/Functions/Built-in/NhlGetWorkspaceObjectId.shtml
密码修改失败请联系微信:mofangbao
回复 支持 4 反对 0

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2014-4-28 17:48:18 | 显示全部楼层
Variable: t
Type: float
Total Size: 13694804 bytes
            3423701 values
Number of Dimensions: 2
Dimensions and sizes:        [y | 1801] x [x | 1901]
Coordinates:
Number Of Attributes: 10
  z :         0
  navigation_dim :        nav
  record :        valtime, reftime
  _FillValue :        1e+37
  long_name :        surface pressure
  units :        pascal
  valid_range :        (  0, 120000 )
  LAPS_var :        PS
  lvl_coord :        AGL
  LAPS_units :        PA
这是ps变量的概要信息
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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