爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 7000|回复: 3

[作图] 请各位帮忙看下为何温度显示不正确

[复制链接]

新浪微博达人勋

发表于 2014-11-3 17:55:31 | 显示全部楼层 |阅读模式

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

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

x
用wrfout作图,单画地面温度没问题,显示正常,但是叠加了风场跟气压场后温度显示不正常,分层特别明显,如下两张图:
QQ截图20141103175047.png QQ截图20141103175120.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/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"

begin
;
; The WRF ARW input file.  
  a = addfile("wrfout_d02_1991-05-21_18.nc","r")

; We generate plots, but what kind do we prefer?
;  type = "x11"
type = "pdf"
; type = "ps"
; type = "ncgm"
  wks = gsn_open_wks(type,"plt_Surface1")
; gsn_define_colormap(wks,"WhBlGrYeRe")  

; Set some basic resources
  res = True
  res@MainTitle                   = "REAL-TIME WRF"

  pltres = True
  mpres = True

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; What times and how many time steps are in the data set?
  times = wrf_user_getvar(a,"times",-1)  ; get all times in the file
  ntimes = dimsizes(times)         ; number of times in the file

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  
    res@TimeLabel = times(0)   ; Set Valid time to use on plots
    mpres@mpGridAndLimbOn = False

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; First get the variables we will need        

    slp = wrf_user_getvar(a,"PSFC",0)    ; slp
      wrf_smooth_2d( slp, 3 )            ; smooth slp
    tc2 = wrf_user_getvar(a,"T2",0)     ; T2 in Kelvin
      ; tc2 = tc2-273.16                  ; T2 in C
    u10 = wrf_user_getvar(a,"U10",0)    ; u at 10 m, mass point
    v10 = wrf_user_getvar(a,"V10",0)    ; v at 10 m, mass point

      tc2@description = "Surface Temperature"
      tc2@units = "K"


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ; Plotting options for T               
      opts = res                        
      opts@cnFillOn = True  
      ;res@ContourParameters = (/ 274., 302., 2./)
      opts@gsnSpreadColorEnd = -3  ; End third from the last color in color map
      ;contour_tc = wrf_contour(a,wks,tc2,opts)


      opts@cnLineColor = "Blue"
      opts@gsnDraw  = False               ; Don't draw plots
      opts@gsnFrame = False               ; Don't advance frames
      ;res@cnLinesOn            = False   

      contour_tc = wrf_contour(a,wks,tc2,opts)
      ;plot2 = wrf_map_overlays(a,wks,(/contour_tc/),pltres,mpres)
      delete(opts)


    ; Plotting options for SLP                     
      opts = res         
      opts@cnLineColor = "Black"
      opts@cnHighLabelsOn = True
      opts@cnLowLabelsOn = True
      ;opts@ContourParameters = (/ 900., 1100., 4. /)
      opts@cnLineLabelBackgroundColor = -1
      opts@gsnContourLineThicknessesScale = 2.0
      contour_psl = wrf_contour(a,wks,slp,opts)
      delete(opts)

    ; Plotting options for Wind Vectors                 
      opts = res         
      opts@FieldTitle = "Wind"       ; overwrite Field Title
     ; opts@NumVectors = 47           ; density of wind barbs

   ;opts@mpFillDrawOrder = "PostDraw"
   opts@vcRefMagnitudeF         = 4.                ; make vectors larger
   opts@vcRefLengthF            = 0.032              ; ref vec length
   ;res@vcGlyphStyle            = "WindBarb"         ; select wind barbs
   opts@vcMinDistanceF        = 0.015                ; thin out vectors
   opts@vcGlyphStyle          = "CurlyVector"   
   opts@vcWindBarbColor     = "Blue"
   opts@vcMinDistanceF          = 0.05
   opts@vcRefAnnoString1On = True
   opts@vcRefAnnoString1   = "4m/s"

      vector = wrf_vector(a,wks,u10,v10,opts)
      delete(opts)
  

    ; MAKE PLOTS                                       
      plot = wrf_map_overlays(a,wks,(/contour_tc,contour_psl,vector/),pltres,mpres)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end
对NCL还是处在摸索阶段,还请各位帮我找一下原因。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-11-3 18:11:32 | 显示全部楼层
代码没什么问题,我换了下数据,出来的图一样的。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-11-3 21:39:47 | 显示全部楼层
longlivehj 发表于 2014-11-3 18:11
代码没什么问题,我换了下数据,出来的图一样的。

额...谢谢啊,我再检查下数据。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-3-11 17:53:54 | 显示全部楼层
我也在学NCL,想问一下你这脚本有啥问题没?能不能借用一次啊
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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