[ncl-talk] Zooming Functions Clarification

Will Hobbs will.hobbs at utas.edu.au
Wed Apr 13 21:47:01 MDT 2016


Brad

I'm not a WRF user so any suggestion here is just a guess. However, have you tried setting the resources trYMinF, trYMaxF etc instead of mpMaxLatF etc.

I would guess that wrf_contour() is not a map plotting function, so it wouldn't recognise the mp resources. As long as the array that you're plotting has lat/lon coordinate dimensions the bounds set by the 'tr' resources should work fine.

Hope that helps

Will


From: <Illston>, "Bradley G." <illston at ou.edu<mailto:illston at ou.edu>>
Date: Thursday, 14 April 2016 1:16 PM
To: "ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>" <ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>>
Subject: [ncl-talk] Zooming Functions Clarification

NCL Users,

I am one to try and figure my problems on their own, but I am a bit stumped after working on this for a few days. I am trying to zoom my map in to a set of bounding latitudes and longitudes in my domain to no avail. I kept trying various iterations utilizing ZoomIn or mpMinLatF/mpMinLonF/etc. I am not sure when you should use one and when you would use the other. Below is my latest script that works, but not zoomed in. When I run it, I get the following warnings:

warning:mpLimitMode is not a valid resource in /tair_24hr_2011_2008091502_contour at this time
warning:mpMinLonF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time
warning:mpMaxLonF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time
warning:mpMinLatF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time
warning:mpMaxLatF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time

Am I mixing various gsn functions that is causing a confusion? Is there a preferred one for plotting basic WRF output (in NetCDF format) to a PNG file? Any thoughts? Thank you so much.

Cheers,
Brad Illston

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/wrf/WRFUserARW.ncl"

begin

;---Define colormap. First is background color, second is foreground color
  colors = (/(/255, 255, 255/),(/0, 0, 0/),(/255, 255, 255/),(/088, 164, 074/),(/047,124,062/),(/055, 072, 114/),(/095,129,183/),(/094,165,212/),(/116,196,205/),(/135,099,162/),(/128,076,144/)/) / 255.

;---Open WRF output file
  a = addfile(wrf_filename,"r")

  print("  NetCDF file = "+wrf_filename)
  print("  Output image = "+output_png)

;---Read temperature at first time step
  tc = wrf_user_getvar(a,"T2",0)
  tc at long_name = "2m Air Temperature"
  tc at units = "C"
  tc=tc-273.15
  wks = gsn_open_wks("png",output_png)
  gsn_define_colormap(wks,"WhiteBlueGreenYellowRed")                ; choose colormap
; gsn_define_colormap(wks,colors)

;---Resources for filled contour plot
  res                      = True

  res at cnFillOn             = True
  res at cnLinesOn            = False
  res at gsnMaximize          = True

  res at tiMainString         = run_length + " Run (" + year + ") - " + run_date + " " + end_time + " UTC"
  res at Footer               = False
  res at FieldTitle           = "2m Air Temperature"
  res at lbTitleOn            = True
  res at lbTitleString        = ""
 res at NoHeaderFooter       = True            ; Switch headers and footers off

  res at cnLevelSelectionMode = "ExplicitLevels"
  res at cnLevels             =  (/10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25/)
; res at ContourParameters = (/10,25,1/)      ; Contour levels

  res at mpLimitMode            = "LatLon"
  res at mpMinLatF              =   35
  res at mpMinLonF              =  -98
  res at mpMaxLatF              =   36
  res at mpMaxLonF              =  -97

  contour = wrf_contour(a,wks,tc,res)        ; Create contour plot

  pltres                      = True         ; Basic overlay plot options
  pltres at PanelPlot            = True         ; Tells wrf_map_overlays not to remove overlays

  mpres                       = True         ; Set map options
  mpres at mpOutlineOn           = True         ; Turn on map outlines
  mpres at mpFillOn              = False        ; Turn off map fill
  mpres at mpDataBaseVersion     = "Ncarg4_1"
  mpres at mpDataSetName         = "Earth..2"   ; For counties
  mpres at mpOutlineBoundarySets = "GeophysicalAndUSStates"
  mpres at mpOutlineSpecifiers   = (/"Land", "Oklahoma:counties"/)
  mpres at tiMainString          = run_length + " Run (" + year + ") - " + run_date + " " + end_time + " UTC"
  mpres at gsnMaximize           = True

;---Create the contours over the WRF map (nothing will be drawn yet).
  plot = wrf_map_overlays(a,wks,contour,pltres,mpres)

end


University of Tasmania Electronic Communications Policy (December, 2014).
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160414/dd406036/attachment.html 


More information about the ncl-talk mailing list