爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2337|回复: 1

ncl画wrfout的矢量图

[复制链接]
发表于 2014-6-14 20:44:51 | 显示全部楼层 |阅读模式
GrADS
系统平台:
问题截图: -
问题概况: 坐标有问题,不知道如何对应
我看过提问的智慧: 看过
自己思考时长(天): 2

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

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

x
;----------------------------------------------------------------------
; vector_4.ncl,用到的脚本
;
; Concepts illustrated:
;   - Coloring vectors based on temperature data
;   - Drawing curly vectors
;   - Thinning vectors using a minimum distance resource
;   - Changing the length of the smallest vector as a fraction of the reference vector
;   - Adding gray to an existing color map
;----------------------------------------------------------------------

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"   
;************************************************
begin
;************************************************
; read in netCDF file
;************************************************
  a = addfile("wrfout_d02_2012-07-18_18:00:00.nc","r")
;************************************************
; read in zonal [u] and meridional [v] winds
;************************************************
  u = a->U10(1,:,:)
  v = a->V10(1,:,:)   
  t = a->T2(1,:,:)   
;************************************************
; create plot
;************************************************
  wks = gsn_open_wks("ps","vector_one")                       ; open a ps file
  gsn_define_colormap(wks,"BlAqGrYeOrReVi200")            ; choose color map

  vcres                     = True      ; plot mods desired
  vcres@gsnSpreadColors     = True      ; use full colormap
  vcres@gsnSpreadColorEnd   = 193       ; last color to use
  vcres@gsnSpreadColorStart = 6         ; first color to use
  vcres@lbLabelStride       = 2         ; plot every other colar bar label
;
; This is not necessary in V6.1.0 and later. Named colors can
; be used without having to first add them to the color map.
;
  i = NhlNewColor(wks,0.7,0.7,0.7)      ; add gray to colormap for continents
                                        ; w/o this, they are white, and you
                                        ; can not see them.
  vcres@vcRefMagnitudeF         = 5.0              ; make vectors larger
  vcres@vcRefLengthF            = 0.050            ; ref vec length
  vcres@vcGlyphStyle            = "CurlyVector"    ; turn on curly vectors
  vcres@vcMinDistanceF          = 0.017            ; thin out vectors
  vcres@tiMainString            = "Vectors colored by a scalar map"
plot=gsn_csm_vector_scalar_map_ce(wks,u,v,t,vcres)  ; create plot
end
包含的变量
TITLE :  OUTPUT FROM WRF V3.4 MODEL
      START_DATE : 2012-07-18_18:00:00
      SIMULATION_START_DATE : 2012-07-18_18:00:00
      WEST-EAST_GRID_DIMENSION : 109
      SOUTH-NORTH_GRID_DIMENSION : 103
      BOTTOM-TOP_GRID_DIMENSION : 28
      DX : 3000

      DY : 3000
float U10 ( Time, south_north, west_east )
         FieldType :        104
         MemoryOrder :        XY
         description :        U at 10 M
         units :        m s-1
         stagger :       
         coordinates :        XLONG XLAT

      float V10 ( Time, south_north, west_east )
         FieldType :        104
         MemoryOrder :        XY
         description :        V at 10 M
         units :        m s-1
         stagger :       
         coordinates :        XLONG XLAT

float T2 ( Time, south_north, west_east )
         FieldType :        104
         MemoryOrder :        XY
         description :        TEMP at 2 M
         units :        K
         stagger :       
         coordinates :        XLONG XLAT
出现的错误:
(0)        check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.
(0)        A valid latitude coordinate array should have a 'units' attribute equal to one of the following values:
(0)            'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'
(0)        check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.
(0)        A valid longitude coordinate array should have a 'units' attribute equal to one of the following values:
(0)            'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'



密码修改失败请联系微信:mofangbao
发表于 2014-6-15 08:55:01 | 显示全部楼层
    lon = a->XLONG(0, :, :)
    lat = a->XLAT(0, :, :)

    vcres@mpLimitMode = "LatLon"
    vcres@mpMinLatF = min(lat)
    vcres@mpMaxLatF = max(lat)
    vcres@mpMinLonF = min(lon)
    vcres@mpMaxLonF = max(lon)

    vcres@vfXArray = lon
    vcres@vfYArray = lat

    vcres@gsnAddCyclic = False
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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