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

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 20761|回复: 20

[作图] wrfout垂直剖面图

[复制链接]

新浪微博达人勋

发表于 2017-12-12 16:25:43 | 显示全部楼层 |阅读模式

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

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

x
参照帖子http://bbs.06climate.com/forum.php?mod=viewthread&tid=22131&extra=&page=1画垂直剖面图现在又几个问题请教各位大神。谢谢!
1.怎么把x轴用经度表示?
2.想用右边y轴用km表示高度?res@tmYRMode           = "Explicit"
        res@tmYRValues         = (/0.3, 0.6, 0.9, 1.2, 1.5, 1.8, 2.1, 2.4, 2.7/)
        res@tmYRLabels         = (/0.3, 0.6, 0.9, 1.2, 1.5, 1.8, 2.1, 2.4, 2.7/)
  没有成功。
3.图中有些风矢量没有对齐(如左边第四列),这是差值有问题?还是由于下垫面不平导致的?

脚本如下
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
    ; file handling
    ;************************************************
    ; define filename
    ;************************************************
    ; read needed variables from file
    ;************************************************
    times  = wrf_user_getvar(in,"times",-1) ; get times in the file
    ntimes = dimsizes(times)          ; number of times in the file
    nd = dimsizes(mdims)
    do it =20,ntimes-1,2                  ; TIME LOOP
        print("Working on time: " + times(it) )
;       tc  = wrf_user_getvar(in,"U",it)     ; T in C
        u = wrf_user_getvar(in,"U",it)      ; v wind
        w = wrf_user_getvar(in,"W",it)      ; w wind
        p = wrf_user_getvar(in, "pressure",it)
        w := wrf_user_unstagger(w, w@stagger)
        plane = new(4,float)
        plane = (/ 2,2, mdims(nd-1)-2, mdims(nd-2)-2 /)
        opts = True
;       t_plane = wrf_user_intrp3d(tc ,p,"u",plane,0.,opts)
        u_plane = wrf_user_intrp3d(u, p,"u",plane, 0.,opts)
        w_plane = wrf_user_intrp3d(w, p,"u",plane, 0.,opts)
        p_plane = wrf_user_intrp3d(p, p,"u",plane, 0.,opts)
        wAve   = avg(w_plane(:,104))           ; used for scaling
        uAve   = avg(u_plane(:,104))
        scale  = fabs(uAve/wAve)
        wscale = w_plane*scale                       ; now scale
        w_plane!0="level"
        w_plane&level = p_plane(:, 0)
        copy_VarCoords(w_plane, u_plane)
        copy_VarCoords(w_plane, wscale)
        ;***********************************************
        ; create plot
        ;***********************************************
        gsn_define_colormap(wks,"BlAqGrYeOrRevi200")  ; choose color map
        res@tiMainString    = "Pressure/Height Vector" ; title
        res@tiYAxisString           = "Pressure (mb)"
        res@trYMinF = 750
        res@trYMaxF = 990
        res@tmYLMode           = "Explicit"
        res@trYReverse = True
        res@tmYRMode           = "Explicit"

        res@cnLineLabelsOn  = False              ; turn off line labels
        res@cnFillOn        = True               ; turn on color fill
        res@lbLabelStride   = 2                  ; every other color
        res@gsnSpreadColors = True               ; use full range of color map
        res@vcRefMagnitudeF = 10.0                ; define vector ref mag
        res@vcRefLengthF    = 0.015              ; define length of vec ref
        res@vcGlyphStyle    = "CurlyVector"      ; turn on curley vectors
        res@vcMinDistanceF  = 0.03               ; thin out vectors
        res@vcMapDirection  = False
        plot  = gsn_csm_pres_hgt_vector(wks,w_plane,u_plane,wscale,res )
    end do
end

2vector_20171212.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-12-12 16:39:57 | 显示全部楼层

回帖奖励 +5 金钱

学习了!!!!!!
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2017-12-12 16:41:00 | 显示全部楼层
接币!接币!!!!
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2017-12-12 20:04:20 | 显示全部楼层
楼主叠加的counter图是什么变量的啊
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-12-13 08:06:30 | 显示全部楼层
x轴用经度表示的话你应该要赋坐标变量
tmYRValues设为950,900,850,tmYRLabels设为950,900,850对应的高度(km)试试
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-12-13 14:58:49 | 显示全部楼层
刘勇的下铺 发表于 2017-12-12 20:04
楼主叠加的counter图是什么变量的啊

垂直风速        
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-12-13 19:09:54 | 显示全部楼层
irides 发表于 2017-12-13 08:06
x轴用经度表示的话你应该要赋坐标变量
tmYRValues设为950,900,850,tmYRLabels设为950,900,850对应的高度 ...

谢谢您,不太理解赋坐标变量。我想的先计算每个格点的经纬度,然后x轴不显示格点数,而显示对应格点的经纬度?
请问怎么计算950,900,850对应的高度(km)?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-12-14 08:20:53 | 显示全部楼层
APTX4869 发表于 2017-12-13 19:09
谢谢您,不太理解赋坐标变量。我想的先计算每个格点的经纬度,然后x轴不显示格点数,而显示对应格点的经 ...

这个应该要自己算一下吧,毕竟插值之后变成100个格点经纬度都变了。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-12-14 08:23:28 | 显示全部楼层
irides 发表于 2017-12-14 08:20
这个应该要自己算一下吧,毕竟插值之后变成100个格点经纬度都变了。

用wrf_intrp3d的时候第二个参数设成z就是高度了呀
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-12-14 10:06:26 | 显示全部楼层
irides 发表于 2017-12-14 08:23
用wrf_intrp3d的时候第二个参数设成z就是高度了呀

gsn_csm_pres_hgt_vector这个函数第二个参量需要气压
data
The two-dimensional data to contour. The leftmost dimension must contain a one-dimensional coordinate array of pressure values, and the values must be in the correct units. This is determined by examining the "units" attribute of the coordinate variable. Some accepted units are "hpa", "hPa", "Pa", "pa", "mb", "millibars", etc. If the units attribute doesn't exist or has the wrong value, an error will be issued.
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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