请选择 进入手机版 | 继续访问电脑版
爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6665|回复: 2

[作图] 最近用NCL画图的两个问题

[复制链接]

新浪微博达人勋

发表于 2015-6-27 20:06:38 | 显示全部楼层 |阅读模式

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

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

x
纠结了好久还是来请教各位大神
问题1:在通过相加这个过程rain = rainc + rainnc,rain的属性好像放生了变化(好像以前看到经纬度赋值什么的,忘了怎么弄了)
问题2:画出来的图覆盖了全球,怎么画成自己domain所在的区域(我的domain很小,只有几个纬度,画出来的却是下面那个大的图)
rain.png



load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.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/wrf/WRFUserARW.ncl"
begin
files = "./wrfout_d01_2015-01-14_00:00:00.nc"
print(files)
f     = addfile (files, "r")
i =17
rainc = wrf_user_getvar(f, "RAINC", i + 24) - wrf_user_getvar(f, "RAINC", i)
rainnc = wrf_user_getvar(f, "RAINNC",i + 24) - wrf_user_getvar(f, "RAINNC", i)
rain = rainc + rainnc

times = chartostring(f->Times)               ; built-in function
ntim    = dimsizes(times)    ;Returns the dimension sizes of the input variable.
znu   = f->ZNU(0,:)                          ; (Time, bottom_top)


wks =gsn_open_wks("png","rain")
gsn_define_colormap(wks,"BLAqGrYeOrReVi200")
res  =True
res@gsnDraw =False
res@gsnFrame =False
res@cnFillOn =True

res@cnFillOn          = True    ; color plot desired 打开等值线填色
res@cnLinesOn           = False   ; turn off contour lines 关闭等值线线条
res@cnLineLabelsOn        = False            ; turn off contour labels
  res@tfDoNDCOverlay       = True     
  res@pmTickMarkDisplayMode = "Always"         ; turn on tickmarks打开坐标

  plot=gsn_csm_contour_map(wks,rain(17:41,:,:),res)

draw(plot)
frame(wks)            
end

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

新浪微博达人勋

发表于 2015-6-28 08:26:21 | 显示全部楼层
1. copy_Var*
2. 用wrf绘图函数:http://www.ncl.ucar.edu/Document/Functions/wrf.shtml
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2015-6-28 15:11:45 | 显示全部楼层
longlivehj 发表于 2015-6-28 08:26
1. copy_Var*
2. 用wrf绘图函数:http://www.ncl.ucar.edu/Document/Functions/wrf.shtml

谢谢longlivehj大神,在你解答的基础上又稍作修改已经正确出图了
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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