爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6075|回复: 2

ncl 脚本总是报错

[复制链接]
发表于 2014-7-29 15:27:34 | 显示全部楼层 |阅读模式

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

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

x
报错内容:
fatal:MapSetTrans: error initializing map: MAPINT/MDPINT/GKS ERROR REPORTED FROM libhlu.a(Error.o)
Segmentation fault

脚本内容:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
f = addfile("/home/liuzhe/gmf.639.2013091500144.grb2","r")
vpt =f->TMP_P0_L100_GLL0
lat2d = f->lat_0
lon2d = f->lon_0
wks = gsn_open_wks("x11","pltName")
gsn_define_colormap(wks,"amwg")
res = True
res@tiMainString      = "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@corners(0)
  res@mpLeftCornerLonF  = lon2d@corners(0)
  res@mpRightCornerLatF = lat2d@corners(2)
  res@mpRightCornerLonF = lon2d@corners(2)
;************************************************
; 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   = lat2d@mpLambertParallel1F
  res@mpLambertParallel2F   = lat2d@mpLambertParallel2F
  res@mpLambertMeridianF    = lat2d@Lov       ; ncl adds from grib file

  res@pmTickMarkDisplayMode = "Always"
  res@mpFillOn              = False           ; turn off map fill
  res@mpOutlineDrawOrder    = "PostDraw"      ; draw continental outline last
  res@mpOutlineBoundarySets = "GeophysicalAndUSStates" ; state 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 off contour lines
  res@gsnSpreadColors       = True            ; use full range of colormap
  res@gsnAddCyclic          = False           ; regional data

  plot = gsn_csm_contour_map(wks,vpt(1000,:,:),res)
end

数据类型:
float TMP_P0_L1_GLL0 ( lat_0, lon_0 )
         center :       Beijing (RSMC)
         production_status :    Operational products
         long_name :    Temperature
         units :        K
         _FillValue :   1e+20
         grid_type :    Latitude/longitude
         parameter_discipline_and_category :    Meteorological products, Temperature
         parameter_template_discipline_category_number :        ( 0, 0, 0, 0 )
         level_type :   Ground or water surface
         level :         0
         forecast_time :        144
         forecast_time_units :  hours
         initial_time : 09/15/2013 (00:00)


密码修改失败请联系微信:mofangbao
发表于 2014-7-29 15:48:26 | 显示全部楼层
报错前边是不是还有内容啊?   你脚本设置的变量是 vpt =f->TMP_P0_L100_GLL0但是后边给出的数据是 TMP_P0_L1_GLL0?
密码修改失败请联系微信:mofangbao
发表于 2014-7-29 16:24:52 来自手机 | 显示全部楼层
地图投影设置错误。你确定lat2d有mpLambertParallel1F和mpLambertParallel2F属性么?
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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