爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 23277|回复: 15

[作图] 怎么用ncl提取50m,70m的风速呢

[复制链接]

新浪微博达人勋

发表于 2016-1-12 21:52:06 | 显示全部楼层 |阅读模式

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

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

x
最近在学画图,会提取10m的风速,可是不知道怎么用ncl提取50m,70m的风速呢?求指教~
10m的平均风速的提取是自己根据官网修改的,如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
a = addfile("wrfout_d01_2012-04-11_00_00_00.nc","r")
type = "pdf"
wks = gsn_open_wks(type,"case")
res = True
res@MainTitie = "REAL-TIME WRF"
res@Footer = False
pltres = True
mpres = True
;times = wrf_user_getvar(a,"times",-1)
;ntimes = dimsizes(times)
;it = 0
;res@TimeLabel = times(it)
;slp = wrf_user_getvar(a,"slp",it)
;wrf_smooth_2d(slp,3)
;t2 = wrf_user_getvar(a,"T2",it)
;tc2 = t2-273.16
;tf2 = 1.8*tc2+32
;tf2@description = "Surface Temperature"
;tf2@units = "F"
  FirstTime = True
  times  = wrf_user_list_times(a)  ; get times in the file
  ntimes = dimsizes(times)         ; number of times in the file
  it=6
  print("Working on time: " + times(it) )
  
u10 = wrf_user_getvar(a,"U10",it)
v10 = wrf_user_getvar(a,"V10",it)
u10 = u10*1.94386
v10 = v10*1.94386
u10@units = "kts"
v10@units = "kts"
WindVeo = sqrt(u10*u10+v10*v10)

opts = res
opts@cnFillOn = True
opts@ContourParameters=(/0.,12.,5./)
opts@gsnSpreadColorEnd = -3
contour_WindVeo = wrf_contour(a,wks,WindVeo,opts)
delete(opts)

;opts = res
;opts@cnFillOn = True
;opts@ContourParameters=(/-20.,90.,5./)
;opts@gsnSpreadColorEnd = -3
;contour_tc = wrf_contour(a,wks,tf2,opts)
;delete(opts)
;opts = res
;opts@cnLineColor = "Blue"
;opts@cnHighLabelsOn = True
;opts@ContourParameters = (/900.,1100.,4./)
;contour_psl = wrf_contour(a,wks,slp,opts)
;delete(opts)
opts = res
opts@FieldTitle = "Winds"
opts@NumVectors = 47
vector = wrf_vector(a,wks,u10,v10,opts)
delete(opts)
;plot = wrf_map_overlays(a,wks,(/contour_tc,contour_psl,vector/),pltres,mpres)
plot = wrf_map_overlays(a,wks,(/contour_WindVeo,vector/),pltres,mpres)

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

新浪微博达人勋

发表于 2021-3-2 09:44:35 | 显示全部楼层
你好,请问u10 和v10为什么都要乘一个数值?
u10 = u10*1.94386
v10 = v10*1.94386
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

发表于 2017-11-4 23:13:28 | 显示全部楼层
本帖最后由 zhaolinanshiwo 于 2017-11-4 23:19 编辑
fanxiqing 发表于 2017-2-21 15:30
分享一下提取80米风速的脚本

层主你好!我运行你的脚本的时候,30m的风速插值不出来,但是将高度改为1000m数值就正常了。你遇到过这种情况么?附图。
Screenshot from 2017-11-06 21-35-00.png Screenshot from 2017-11-06 21-40-19.png
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2016-1-13 10:11:09 | 显示全部楼层
pangzi_xu 发表于 2016-1-13 08:33
先插值得到50,70m高度的风场啊

我试了试这个
v  = wrf_user_getvar(a,"V",it)
v_plane = wrf_user_intrp3d(v,z,"h",height,0.,False)
可是提示总是说z,height没有定义,表达不对,我的z,height该怎么定义呢?求教~
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-9-26 10:57:50 | 显示全部楼层
学习一下,很有帮助
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-11-4 21:52:56 | 显示全部楼层
顶一个。。。。
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2017-2-21 15:30:21 | 显示全部楼层
分享一下提取80米风速的脚本

height_wind.ncl

6.15 KB, 下载次数: 120, 下载积分: 金钱 -5

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

新浪微博达人勋

发表于 2017-2-27 10:27:29 | 显示全部楼层
fanxiqing 发表于 2017-2-21 15:30
分享一下提取80米风速的脚本

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

新浪微博达人勋

发表于 2017-7-5 11:12:33 | 显示全部楼层
请问楼主,上面it=6代表什么意思呢,我执行会出现错误:Variable: times
Type: string
Total Size: 8 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:        [1]
Coordinates:
Number Of Attributes: 2
  description :        times in file
  _FillValue :        missing
(0)        1999-09-17_00:00:00
fatal:Subscript out of range, error in subscript #0
fatal:An error occurred reading times
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 27 in file v10.ncl
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-10-17 15:27:43 | 显示全部楼层
谢谢分享,不错不错
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-10-19 23:12:27 | 显示全部楼层
vanilla7 发表于 2016-1-13 10:11
我试了试这个
v  = wrf_user_getvar(a,"V",it)
v_plane = wrf_user_intrp3d(v,z,"h",height,0.,False) ...

请问后来怎么解决的?
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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