[Wrf-users] WRF / NCL plotting a sub-region

Tom Addis t.addis at unsw.edu.au
Thu Nov 24 21:15:29 MST 2005


Further to my WRF/NCL plotting issue, I've changed down to using lower level functions but am still having problems. Following is a trimmed down script that gives an example.

I'm wondering if a fellow NCL user could please try this on their data after changing the lat/long limits at the end to suit their domain....

For me, the first plot using the full domain works fine, the next frame plots with the background map zoomed but the data displayed for the full domain (unzoomed). 

I guess this could be a problem with:
1 - script
2 - data
3 - NCL (not that I can believe that I would be the first to come across this particular one!)

Any tips appreciated, 
Thanks very much,

Tom

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin

  f      = addfile("wrfout_d01_2005-11-23_03:00:00.nc", "r")
  x      = f->HGT(0,:,:)  ; surface height

  lat2d  = f->XLAT(0,:,:)
  lon2d  = f->XLONG(0,:,:)
  dimll  = dimsizes(lat2d)
  nlat   = dimll(0)
  mlon   = dimll(1)

  wks = gsn_open_wks("x11"  ,"WRF_test")  ; ps,pdf,x11,ncgm,eps
  res                       = True        ; plot mods desired

  res at gsnAddCyclic          = False       ; regional data: not cyclic
  res at tfDoNDCOverlay        = True        ; set True for native projection

  res at gsnMaximize           = True
  res at mpFillOn              = True

  res at mpProjection          = "LambertConformal"
  res at mpLambertParallel1F   = f at TRUELAT1
  res at mpLambertParallel2F   = f at TRUELAT2
  res at mpLambertMeridianF    = f at CEN_LON
  res at mpLimitMode           = "Corners"
  res at mpLeftCornerLatF      = lat2d(0,0)
  res at mpLeftCornerLonF      = lon2d(0,0)
  res at mpRightCornerLatF     = lat2d(nlat-1,mlon-1)
  res at mpRightCornerLonF     = lon2d(nlat-1,mlon-1)

  plot                      = gsn_csm_contour_map(wks, x, res)

  res at mpLeftCornerLatF      = -45
  res at mpLeftCornerLonF      = 165
  res at mpRightCornerLatF     = -35.
  res at mpRightCornerLonF     = 175.

  plot                      = gsn_csm_contour_map(wks, x, res)

end



More information about the Wrf-users mailing list