爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 11158|回复: 9

[作图] ncl坐标问题

[复制链接]
发表于 2014-5-23 10:47:36 | 显示全部楼层 |阅读模式

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

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

x
请教各位大神,我在网上下载了一个ncl处理wrfout脚本,都没怎么修改,为什么画出来的图坐标刻度都不显示呢?求指导求帮助;*************************************************

; WRF: panel three different variables at the same time step

;************************************************

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/wrf/WRF_contributed.ncl"

begin
;************************************************
; open file and read in data
;************************************************
  f     = addfile("wrfout_d01_000000.nc", "r")
;************************************************
; Read character variable Times; Convert to string for plots
; Read vertical coordinate for plot labels
;************************************************
  times = chartostring(f->Times)               ; built-in function
  znu   = f->ZNU(0,:)                          ; (Time, bottom_top)

;************************************************
; Read perturbation geopotential, pressure, water vapor
; at all times and levels
;************************************************
  ph    = f->PH                     ; (Time, bottom_top, south_north, west_east)
  p     = f->P                      ; (Time, bottom_top, south_north, west_east)
  q2    = f->Q2                     ; (Time, south_north, west_east )

;************************************************
; create plots  
;************************************************
  wks = gsn_open_wks("ps" ,"WRF_lc")           ; ps,pdf,x11,ncgm,eps
  gsn_define_colormap(wks ,"BlAqGrYeOrReVi200"); choose colormap

  res                       = True             ; plot mods desired
;;res@gsnMaximize           = True             ; uncomment to maximize size
  res@gsnSpreadColors       = True             ; use full range of colormap
  res@cnFillOn              = True             ; color plot desired
  res@cnLinesOn             = False            ; turn off contour lines
  res@cnLineLabelsOn        = False            ; turn off contour labels
  res@lbLabelAutoStride     = True             ; let NCL figure lb stride
;************************************************
; Use WRF_contributed procedure to set map resources
;************************************************
  WRF_map_c(f,res,0)                           ; set map resources   

;************************************************
; set True for native mapping (faster plotting)
; set to False othewise
;************************************************
   res@tfDoNDCOverlay       = True     

;************************************************
; associate the 2-dimensional coordinates to variables for plotting
; only if res@tfDoNDCOverlay=False
;************************************************
  if (.not.res@tfDoNDCOverlay) then
      lat2d    = f->XLAT(0,:,:)                 ; need for map limits        
      lon2d    = f->XLONG(0,:,:)      

      p@lat2d  = lat2d
      p@lon2d  = lon2d
      ph@lat2d = lat2d
      ph@lon2d = lon2d
      q2@lat2d = lat2d
      q2@lon2d = lon2d
  end if

;************************************************
; allocate array for 3 plots
;************************************************
  plts                      = new (3,"graphic")   
;************************************************
; Specify (arbitrarily chosen) subscripts
; This could also be done in a do loop or explicitly specified
;************************************************
  nt                        = 24               ; last time step
  kl                        = 3      
;************************************************
; Tell NCL not to draw or advance frame for individual plots
;************************************************
  res@gsnDraw               = False            ; (a) do not draw
  res@gsnFrame              = False            ; (b) do not advance 'frame'

  res@gsnLeftString         = ph@description+": znu="+znu(kl)
  plts(0)                   = gsn_csm_contour_map(wks,ph(nt,kl,:,:),res)

  res@gsnLeftString         = p@description+": znu="+znu(kl)
  plts(1)                   = gsn_csm_contour_map(wks,p(nt,kl,:,:),res)
  delete(res@gsnLeftString)            

  plts(2)                   = gsn_csm_contour_map(wks,q2(nt,:,:),res)
;************************************************
; create panel: panel plots have their own set of resources
;************************************************
  resP                  = True                   ; modify the panel plot
  resP@txString         = f@TITLE+": "+times(nt)      
  resP@gsnMaximize      = True                   ; maximize panel area
  resP@gsnPanelRowSpec  = True                   ; specify 1 top, 2 lower level  
  gsn_panel(wks,plts,(/1,2/),resP)               ; now draw as one plot

end


密码修改失败请联系微信:mofangbao
发表于 2014-5-23 12:01:13 | 显示全部楼层
本来这个例子就没有显示坐标的。
加入下面的,可以打开。
pmTickMarkDisplayMode = "Always"
密码修改失败请联系微信:mofangbao
发表于 2014-5-23 14:35:29 | 显示全部楼层
longlivehj 发表于 2014-5-23 12:01
本来这个例子就没有显示坐标的。
加入下面的,可以打开。
pmTickMarkDisplayMode = "Always"

大神您无处不在呀
密码修改失败请联系微信:mofangbao
发表于 2014-5-23 20:32:19 | 显示全部楼层
longlivehj 发表于 2014-5-23 12:01
本来这个例子就没有显示坐标的。
加入下面的,可以打开。
pmTickMarkDisplayMode = "Always"

大神真的好厉害。。。。。。
密码修改失败请联系微信:mofangbao
发表于 2014-5-24 09:44:53 | 显示全部楼层
沙发大神真的好厉害~解决问题一针见血!
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-5-27 21:04:34 | 显示全部楼层
longlivehj 发表于 2014-5-23 12:01
本来这个例子就没有显示坐标的。
加入下面的,可以打开。
pmTickMarkDisplayMode = "Always"

谢谢大神了!
密码修改失败请联系微信:mofangbao
发表于 2015-8-13 22:25:52 | 显示全部楼层
谢谢楼主的分享
密码修改失败请联系微信:mofangbao
发表于 2016-7-21 17:11:19 | 显示全部楼层
{:eb513:}{:eb513:}{:eb513:}
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

发表于 2016-10-27 19:50:55 | 显示全部楼层
{:5_275:}{:5_275:}{:5_275:}{:5_275:}
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

发表于 2016-11-12 11:47:33 | 显示全部楼层
在哪个网站上下的?
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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