Re: plotting on wrf grid

From: Saji Hameed <saji.nh_at_nyahnyahspammersnyahnyah>
Date: Sun Mar 27 2011 - 19:08:23 MDT

Hi Zack,

You may need to do two things.
  1. Use gsn_csm_contour_map
  2. Input some map settings

Some settings I use are

  res = set_mp_wrf_map_resources(a,res)
  res@mpLimitMode = "Corners" ; Portion of map to zoom
  res@mpLeftCornerLatF = lat1(0,0)
  res@mpLeftCornerLonF = lon1(0,0)
  res@mpRightCornerLatF = lat1(ny1,nx1)
  res@mpRightCornerLonF = lon1(ny1,nx1)
  res@mpFillOn = True
  res@mpOutlineDrawOrder = "PostDraw"

where
  lat1 = a->XLAT(0,:,:)
  lon1 = a->XLONG(0,:,:)

and nx1, ny1 as follows
  dom_dims = dimsizes(u10)
  dom_rank = dimsizes(dom_dims)
  nx1 = dom_dims(dom_rank - 1) - 1
  ny1 = dom_dims(dom_rank - 2) - 1

Hope it helps bring out the map!

saji

On Mon, Mar 28, 2011 at 9:57 AM, Zack Taylor <zbt09@fsu.edu> wrote:
> Hello NCL,
>
> I'm taking wrf-output and calculating the maximum wind speed over a 24-hr
> period. The plot itself looks fine, but there is no associated lat/lon
> coordinates and I'm having difficulties getting a lat/lon grid to plot with
> the data. The script below runs without errors. Any help is appreciated.
> Thanks,
>
> Zack
>
>
>
> 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"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>
> begin
>   a =
> addfile("/sully/r0/ztaylor/WRF/DATA_FILES/WRFOUT_DATA/2_DOMS_12000_KM_35_LEVS_2010_0727_WSM6_WISC/wsm6_d02.nc","r")
>   wks = gsn_open_wks("ps","maxwind")
>
>   u10 = a->U10(:,:,:)
>   v10 = a->V10(:,:,:)
>
>
>   u2 = u10(:,:,:)*u10(:,:,:)
>   v2 = v10(:,:,:)*v10(:,:,:)
>
>   speed = sqrt(u2+v2)
>   speed_mph = speed(:,:,:)*0.868976
>
>   maxwind= dim_max(speed_mph(:,:,:))
>   print(maxwind)
>
>   u10@lat2d = a->XLAT(0,:,:)
>   u10@lon2d = a->XLONG(0,:,:)
>   v10@lat2d = a->XLAT(0,:,:)
>   v10@lon2d = a->XLONG(0,:,:)
>
> ; lat2d = a->XLAT(0,:,:)
> ; lon2d = a->XLONG(0,:,:)
> ; maxwind@lat2d = lat2d
> ; maxwind@lon2d = lon2d
>
>   gsn_define_colormap(wks,"WhBlReWh")
>
>   res                     = True
>   res@gsnMaximize       = True
>   res@cnLevelSelectionMode = "ManualLevels"   ; Set contour levels manually
>   res@cnMinLevelValF       = 10             ; Minimum contour level
>   res@cnMaxLevelValF       = 24.0             ; Maximum contour level
>   res@gsnDraw   = True    ; Forces the plot to be drawn
>   res@gsnFrame  = True    ; Frame advance
>   res@cnFillOn = True
>   res@gsnPaperOrientation = "portrait"
>   res@lbAutoManage             = True
>   res@gsnMaximize          = True    ; Maximize plot in frame
>   res@gsnSpreadColors      = True  ; span full colormap
>   res@tiMainString         = "24-hr Maximum Wind Speed"
>
>   ;plot = wrf_contour(a,wks,maxwind,res)
>
>    plot = gsn_csm_contour(wks,maxwind,res)
>
> end
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Mar 27 19:08:28 2011

This archive was generated by hypermail 2.1.8 : Mon Mar 28 2011 - 08:51:50 MDT