Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

How to show shoreline when plotting wind over an island using NCL

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

Hi,

I am using NCL to plot wind over an island using "plt_Surface1 and plt_Surface3", but I am unable to make out the coastline for the island.

Appreciate guidance and assistance so that I can also differentiate the winds onshore and offshore around the island.

Regards
Kunal
 
Hi,

Please find below the script.
"
begin
a = addfile("Desktop/data/Build_WRF/WRFV3/run/wrfout_d03_2016-01-01_00:00:00.nc","r")
type = "pdf"
wks = gsn_open_wks(type,"plt_Surface3")
res = True
res@MainTitle = "REAL-TIME WRF"
pltres = True
mpres = True

times = wrf_user_getvar(a,"times",-1)
ntimes = dimsizes(times)

do it = 0,ntimes-1

print("Working on time: " + times(it) )
res@TimeLabel = times(it)

slp = wrf_user_getvar(a,"slp",it)
wrf_smooth_2d( slp, 3 )
tc = wrf_user_getvar(a,"tc",it)
tf = 1.8*tc+32.
tf@description = "Surface Air Temperature"
tf@units = "F"

u = wrf_user_getvar(a,"ua",it)
v = wrf_user_getvar(a,"va",it)
u = u*1.94386
v = v*1.94386
u@units = "kts"
v@units = "kts"

opts = res
opts@cnFillOn = True
opts@cnLinesOn = True
opts@ContourParameters = (/ -50., 90., 5./)
opts@gsnSpreadColorEnd = -3
contour_tc = wrf_contour(a,wks,tf(0,:,:),opts)
delete(opts)

opts = res
opts@cnLineColor = "Blue"
opts@cnHighLabelsOn = True
opts@cnLowLabelsOn = True
opts@ContourParameters = (/ 900., 1100., 4. /)
opts@cnLineLabelBackgroundColor = -1
opts@gsnContourLineThicknessesScale = 2.0
contour_psl = wrf_contour(a,wks,slp,opts)
delete(opts)

opts = res
opts@FieldTitle = "Wind"
opts@NumVectors = 15
vector = wrf_vector(a,wks,u(0,:,:),v(0,:,:),opts)
delete(opts)

plot = wrf_map_overlays(a,wks,(/contour_tc,contour_psl,vector/),pltres,mpres)

end do

end
"
 
Top