爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 16236|回复: 16

[作图] 求助:NCL和Grads画垂直风场差异为何很大?

[复制链接]
发表于 2014-12-8 11:16:01 | 显示全部楼层 |阅读模式

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

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

x
     最近练习画风场的垂直剖面,用Grads和NCL分别画同一数据,但是感觉差异特别大。感觉Grads画出的垂直运动明显要比NCL画出的更加显著。     一直感觉NCL画出的图会更加美观一些,但不知这次是什么原因。现将图和数据以及处理数据的脚本都放到网上。请高手给予指点。

NCL画垂直风场剖面

NCL画垂直风场剖面

Grads画垂直风场剖面

Grads画垂直风场剖面
hadley.gs (243 Bytes, 下载次数: 32)

vertical-1.ncl

3.76 KB, 下载次数: 92, 下载积分: 金钱 -5

NCL脚本

w.ctl

385 Bytes, 下载次数: 9, 下载积分: 金钱 -5

w.dat

6.75 KB, 下载次数: 4, 下载积分: 金钱 -5

u.ctl

385 Bytes, 下载次数: 4, 下载积分: 金钱 -5

u.dat

6.75 KB, 下载次数: 3, 下载积分: 金钱 -5

密码修改失败请联系微信:mofangbao
发表于 2014-12-8 11:44:28 | 显示全部楼层
你的数据是wrf转出来的吗?如果是WRF出的结果,grads画图之前要用ARWpost 转换数据,这一步会自动将原始数据差值到grads能画图的分辨率上,有一定的失真。我还是觉得ncl直接画图比较准确。个人理解希望能帮到你。
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

 楼主| 发表于 2014-12-8 11:59:19 | 显示全部楼层
瓶子 发表于 2014-12-8 11:44
你的数据是wrf转出来的吗?如果是WRF出的结果,grads画图之前要用ARWpost 转换数据,这一步会自动将原始数 ...

谢谢你的回复。我不是用WRF的数据,是美国NCEP的再分析数据。这个问题困扰很久了。
密码修改失败请联系微信:mofangbao
发表于 2014-12-8 12:32:58 | 显示全部楼层
最好是把你的脚本都直接贴出来。我觉得差别在于垂直速度的数量级问题,grads应该是给垂直速度扩大了相应的数量级,而NCL没有。
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-12-8 12:48:43 | 显示全部楼层
river 发表于 2014-12-8 12:32
最好是把你的脚本都直接贴出来。我觉得差别在于垂直速度的数量级问题,grads应该是给垂直速度扩大了相应的 ...

;----------------------------------------------------------------------
; NOTE: The second frame of this example will only work with
;       NCL V6.1.0 and later.
;----------------------------------------------------------------------
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/csm/contributed.ncl"

begin
;---read in zonal winds
  nlon = 91                              ; YDEF
  nlev = 19                          ; XDEF
  ntim = 1                             ; time
;>==================================================================<  
  time =ispan(0,ntim-1,1)                ; generate time
  time!0         = "time"
  time@long_name = "time"
  time@units     = "month"                 
;>==================================================================<                                          
  lev = ispan(0,nlev-1,1)*(-50.0) + 1000.0      ; generate lat/lon
  lev!0 = "lon"
  lev@long_name = "level"
  lev@units     ="hPa"
;>==================================================================<
  lon = ispan(0,nlon-1,1)*2.0 - 90.0
  lon!0 = "lon"
  lon@long_name = "latitude"
  lon@units     ="degrees-north"
;>==============read the zonnal wind==================<
  UNDEF = -1.0e+30                           ; UNDEF
  uw     = new ( (/ntim,nlev,nlon/), float, UNDEF)
  uw!0   = "time"
  uw!1   = "lev"
  uw!2   = "lon"
  uw&time=  time
  uw&lev =  lev
  uw&lon =  lon
  uw@long_name = " "         ; VARS
  uw@units     = " "  
;>===================================================<
  vw    = new ( dimsizes(uw), typeof(uw), uw@_FillValue )
  u1    = new ( dimsizes(uw), typeof(uw), uw@_FillValue )
  ut    = new ( dimsizes(uw), typeof(uw), uw@_FillValue )
  wv    = new ( dimsizes(uw), typeof(uw), uw@_FillValue )
  vv    = new ( dimsizes(uw), typeof(uw), uw@_FillValue )
  copy_VarCoords(uw, wv )
  copy_VarCoords(uw, vv )
;>===================================================================<
  do nt=0,ntim-1
    vv(nt,:,:) = fbindirread("D:\u.dat", nt, (/nlev,nlon/), "float")
    wv(nt,:,:) = fbindirread("D:\w.dat", nt, (/nlev,nlon/), "float")
  end do
  wv = wv*(100)
;>===================================================================<
; Create plot
;>===================================================================<
  wks  = gsn_open_wks("png","/cygdrive/d/paper/20130911/figure/vertical-circulation-1")
;>==========Plot the First figure===============<
res                                  = True
res@gsnDraw                          = False
res@gsnFrame                         = False
res@pmTickMarkDisplayMode            = "Always"     ; Turn on map tickmarks

res@cnLinesOn                        = False
res@cnLineLabelsOn                   = False
res@cnFillOn                         = True

res@cnLevelSelectionMode             = "ManualLevels"        ; set manual contour levels
res@cnMinLevelValF                   = -1                 ; set min contour level
res@cnMaxLevelValF                   = 1                  ; set max contour level
res@cnLevelSpacingF                  = 0.2                ; set contour spacing

res@vcRefMagnitudeF                  = 2
res@vcRefLengthF                     = 0.05
res@vcRefAnnoOrthogonalPosF          = -1.06

res@cnLinesOn                        = False
res@cnLineLabelsOn                   = False
res@cnFillOn                         = False
res@cnInfoLabelOn                    = False                      ; turn off contour label

;==========================================================================================
plot = gsn_csm_pres_hgt_vector(wks,wv(0,:,{0:60}),vv(0,:,{0:60}),wv(0,:,{0:60}),res)   
draw(plot)
frame(wks)
end
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-12-8 12:49:23 | 显示全部楼层
river 发表于 2014-12-8 12:32
最好是把你的脚本都直接贴出来。我觉得差别在于垂直速度的数量级问题,grads应该是给垂直速度扩大了相应的 ...

这是NCL的脚本
;----------------------------------------------------------------------
; NOTE: The second frame of this example will only work with
;       NCL V6.1.0 and later.
;----------------------------------------------------------------------
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/csm/contributed.ncl"

begin
;---read in zonal winds
  nlon = 91                              ; YDEF
  nlev = 19                          ; XDEF
  ntim = 1                             ; time
;>==================================================================<  
  time =ispan(0,ntim-1,1)                ; generate time
  time!0         = "time"
  time@long_name = "time"
  time@units     = "month"                 
;>==================================================================<                                          
  lev = ispan(0,nlev-1,1)*(-50.0) + 1000.0      ; generate lat/lon
  lev!0 = "lon"
  lev@long_name = "level"
  lev@units     ="hPa"
;>==================================================================<
  lon = ispan(0,nlon-1,1)*2.0 - 90.0
  lon!0 = "lon"
  lon@long_name = "latitude"
  lon@units     ="degrees-north"
;>==============read the zonnal wind==================<
  UNDEF = -1.0e+30                           ; UNDEF
  uw     = new ( (/ntim,nlev,nlon/), float, UNDEF)
  uw!0   = "time"
  uw!1   = "lev"
  uw!2   = "lon"
  uw&time=  time
  uw&lev =  lev
  uw&lon =  lon
  uw@long_name = " "         ; VARS
  uw@units     = " "  
;>===================================================<
  vw    = new ( dimsizes(uw), typeof(uw), uw@_FillValue )
  u1    = new ( dimsizes(uw), typeof(uw), uw@_FillValue )
  ut    = new ( dimsizes(uw), typeof(uw), uw@_FillValue )
  wv    = new ( dimsizes(uw), typeof(uw), uw@_FillValue )
  vv    = new ( dimsizes(uw), typeof(uw), uw@_FillValue )
  copy_VarCoords(uw, wv )
  copy_VarCoords(uw, vv )
;>===================================================================<
  do nt=0,ntim-1
    vv(nt,:,:) = fbindirread("D:\u.dat", nt, (/nlev,nlon/), "float")
    wv(nt,:,:) = fbindirread("D:\w.dat", nt, (/nlev,nlon/), "float")
  end do
  wv = wv*(100)
;>===================================================================<
; Create plot
;>===================================================================<
  wks  = gsn_open_wks("png","/cygdrive/d/paper/20130911/figure/vertical-circulation-1")
;>==========Plot the First figure===============<
res                                  = True
res@gsnDraw                          = False
res@gsnFrame                         = False
res@pmTickMarkDisplayMode            = "Always"     ; Turn on map tickmarks

res@cnLinesOn                        = False
res@cnLineLabelsOn                   = False
res@cnFillOn                         = True

res@cnLevelSelectionMode             = "ManualLevels"        ; set manual contour levels
res@cnMinLevelValF                   = -1                 ; set min contour level
res@cnMaxLevelValF                   = 1                  ; set max contour level
res@cnLevelSpacingF                  = 0.2                ; set contour spacing

res@vcRefMagnitudeF                  = 2
res@vcRefLengthF                     = 0.05
res@vcRefAnnoOrthogonalPosF          = -1.06

res@cnLinesOn                        = False
res@cnLineLabelsOn                   = False
res@cnFillOn                         = False
res@cnInfoLabelOn                    = False                      ; turn off contour label

;==========================================================================================
plot = gsn_csm_pres_hgt_vector(wks,wv(0,:,{0:60}),vv(0,:,{0:60}),wv(0,:,{0:60}),res)   
draw(plot)
frame(wks)
end
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-12-8 12:50:20 | 显示全部楼层
river 发表于 2014-12-8 12:32
最好是把你的脚本都直接贴出来。我觉得差别在于垂直速度的数量级问题,grads应该是给垂直速度扩大了相应的 ...

这是Grads的脚本

'reinit'
'reinit'
'open D:\u.ctl'
'open D:\w.ctl'
'enable print D:\cir.gmf'
'set vpage off'
'set parea off'
'set grads off'
'set grid off'
'set lat 5 60'
'set zlog on'
'd u;u.2*(-100)'
'print'
'disable print'
'reinit'
'reinit'
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-12-8 12:50:57 | 显示全部楼层
river 发表于 2014-12-8 12:32
最好是把你的脚本都直接贴出来。我觉得差别在于垂直速度的数量级问题,grads应该是给垂直速度扩大了相应的 ...

麻烦您给看一下。谢谢
密码修改失败请联系微信:mofangbao
发表于 2014-12-8 14:56:13 | 显示全部楼层
hxyj 发表于 2014-12-8 12:50
麻烦您给看一下。谢谢

你看啊,红色的部分,grads里面'd u;u.2*(-100)'。垂直速度扩大了100倍。楼主应该要弄清楚这个垂直速度应该是omega,单位是Pa/s,这是P坐标下的垂直速度,和水平风速数量级相差100倍左右,并且正值表示下沉运动,负值才表示上升。这个和Z坐标下单位为m/s的垂直速度w是有相互转换公式的,天原书上有。所以你的NCL也应该扩大相应的量级
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-12-8 16:50:40 | 显示全部楼层
river 发表于 2014-12-8 14:56
你看啊,红色的部分,grads里面'd u;u.2*(-100)'。垂直速度扩大了100倍。楼主应该要弄清楚这个垂直速度应 ...

您好!非常感谢您的回复。您的意思是垂直速度在Grads里和NCL里表达的意义不一样吗?
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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