Re: Help with regional streamline data drawn to a corresponding map

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri, 19 Oct 2007 10:15:00 -0600

Hi Erik,

If you want a map underneath your streamlines, then
gsn_csm_streamline_map should be the function that you use. I believe
the WRF model uses 2D latitudes/longitudes, and thus in NCL you need to set:
u_plane_at_lat2D = a->XLAT(0,:,:)
u_plane_at_lon2D = a->XLONG(0,:,:)
and the same for v_plane...
Good luck,
Adam

Erik Noble wrote:
> Could I please have some help with plotting the regional U and V data
> onto a WRF map?
>
> Below is NCL code that takes the U and V data from WRF model output
> and invokes the NCL streamline function.
>
> I use the "gsn_csm_streamline" function (streamline plot draw without
> a map) because the U and V data is strictly just that, "regional
> data".
> When I try to use the gsn_csm_streamline_map_ce function along with a
> specific a subregion, NCL incorrectly assumes the data to represent
> the globe and zooms in on the regional data.
> Is there a way to plot the streamlines first and then, using the lat
> and lons from the data itself, display an outline of the map/continent
> beneath?
>
> Attached is a picture of the resulting 925 mb streamlines over West
> Africa, where you can already see a feint outline of Africa below.
> any suggestions?
> Thank you,
>
> Erik
>
>
>
> ; Example script to produce stremaline plots for a WRF real-data run,
> ; with the ARW coordinate dynamics option.
>
> 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
> ;
> ; The WRF ARW input file.
> ; This needs to have a ".nc" appended, so just do it.
> a = addfile("/Volumes/Data_and_Models/Model-Output/Athena/WRF-SOP3-Athena_Phys-3-1-1-1.nc","r")
> ; We generate plots, but what kind do we prefer?
> type = "x11"
> ; type = "pdf"
> ; type = "ps"
> ; type = "ncgm"
> wks = gsn_open_wks(type,"WRF_SOP3_Run-2_Sep10-13_3_1_1_Streamlines")
>
> ; Set some Basic Plot options
> ARWres = True
> ARWres_at_MainTitle = "REAL-TIME WRF"
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;What times and how many time steps are in the data set?
> times = wrf_user_list_times(a) ; get times in the file
> ntimes = dimsizes(times) ; number of times in the file
>
> ; The specific pressure levels that we want the data interpolated to.
> pressure_levels = (/925., 850., 700., 500., 300./) ; pressure levels to plot
> nlevels = dimsizes(pressure_levels) ; number of pressure levels
>
> do it = 324,324 ;;;;;Time step you want!!!!
>
>
> print("Working on time: " + times(it) )
> ARWres_at_TimeLabel = times(it) ; Set Valid time to use on plots
>
>
> mpres = True ; Create map background
> mpres_at_gsnMaximize = True
> mpres = ARWres
> mpres_at_tiMainString = "Streamlines" ; some tit
> ;mpres_at_FieldTitle = "Circulation" ; overwrite Field Title
> mpres_at_mpOutlineOn = True
> mpres_at_mpGeophysicalLineColor = "Black"
> mpres_at_mpGeophysicalLineThicknessF = "3.0"
> mpres_at_mpGridLineColor = "Black"
> mpres_at_mpLimbLineColor = "Black"
> mpres_at_mpNationalLineColor = "Black"
> mpres_at_mpPerimLineColor = "Black"
> mpres_at_mpUSStateLineColor = "Black"
>
>
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;Variables
> p = wrf_user_getvar(a, "pressure",it) ; pressure is our vertical coordinate
> u = wrf_user_getvar(a,"ua",it) ; u averaged to mass points
> v = wrf_user_getvar(a,"va",it) ; v averaged to mass points
> z = wrf_user_getvar(a, "z",it) ; grid point height
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> do level = 0,nlevels-1 ; LOOP OVER LEVELS
>
> pressure = pressure_levels(level)
> z_plane = wrf_user_intrp3d( z,p,"h",pressure,0.,False)
> ; wrf_smooth_2d( z_plane, 1 )
>
>
> u_plane = wrf_user_intrp3d( u,p,"h",pressure,0.,False)
> v_plane = wrf_user_intrp3d( v,p,"h",pressure,0.,False)
> ; u_plane = u_plane*1.94386 ; kts
> ; v_plane = v_plane*1.94386 ; kts
> ; u_plane_at_units = "kts"
> ; v_plane_at_units = "kts"
>
>
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;Plot
> if ( pressure .eq. 925 ) then
> plot = gsn_csm_streamline(wks,u_plane,v_plane,mpres)
>
> end if
>
> end do
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> end do ; END OF TIME LOOP
>
> end
>
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Oct 19 2007 - 10:15:00 MDT

This archive was generated by hypermail 2.2.0 : Mon Oct 22 2007 - 14:48:46 MDT