[ncl-talk] Temp advection, wrf_contour fails
Ryan Connelly
rconne01 at gmail.com
Mon Apr 18 12:49:16 MDT 2016
Hi,
Running 6.1.2, so can't use advect_variable without upgrading. So instead
I have...
;do it = 12,30,3 ; TIME LOOP
do it = 12,13,1
print("Working on time: " + times(it) )
res at TimeLabel = times(it) ; Set Valid time to use on plots
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; First get the variables we will need
tc = wrf_user_getvar(a,"tc",it) ; 3D tc
td = wrf_user_getvar(a,"td",it) ; 3D td
u = wrf_user_getvar(a,"ua",it) ; 3D U at mass points
v = wrf_user_getvar(a,"va",it) ; 3D V at mass points
p = wrf_user_getvar(a, "pressure",it) ; pressure is our vertical
coordinate
z = wrf_user_getvar(a,"z",it) ; Full model height in meters
z_dec = z/10. ; Height in decameters
lon = wrf_user_getvar(a,"lon",it)
lat = wrf_user_getvar(a,"lat",it)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Interpolate to isobaric planes
pressure = 850.
tc_plane = wrf_user_intrp3d(tc,p,"h",pressure,0.,False)
z_plane = wrf_user_intrp3d(z_dec,p,"h",pressure,0.,False)
u_plane = wrf_user_intrp3d( u,p,"h",pressure,0.,False)
v_plane = wrf_user_intrp3d( v,p,"h",pressure,0.,False)
; Define variables needed to calculate temp advection
dTdx = center_finite_diff_n(tc_plane,lon,False,0,0)
dTdy = center_finite_diff_n(tc_plane,lat,False,0,0)
temp_adv = u_plane*dTdx + v_plane*dTdy
print(temp_adv)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Plotting options for Tc
opts = res
print("Defined ops")
opts at cnFillOn = True
print("Turned fill on")
opts at cnLabelMasking = True
opts at cnInfoLabelOn = False
opts at cnLineLabelPerimOn = False
opts at ContourParameters = (/ -60., 60., 3./)
print("Accepted contour parameters")
;opts at gsnSpreadColorEnd = -3 ; End third from the last color in
color map
contour_tc = wrf_contour(a,wks,temp_adv,opts) ; <- Breaks right here
print("wrf_contour called")
delete(opts)
print("opts deleted")
print("Got past plotting options for Tc")
; MAKE PLOTS
;plot =
wrf_map_overlays(a,wks,(/contour_tc,contour_td,contour_z/),pltres,mpres)
plot = wrf_map_overlays(a,wks,(/contour_tc/),pltres,mpres)
;plot = wrf_map_overlays(a,wks,(/contour_td,vector/),pltres,mpres)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end do ; END OF TIME LOOP
When it prints out the full grid of temp_adv, or random indexes of the
array, I get reasonable values and no reason to suspect the grid is
undefined anywhere. Yet as you can see from my print statements, the call
to wrf_contour fails. It does not throw an error; it just hangs up. I
checked with just tc_plane instead, and that completed fine, so it has to
be an issue with the temp_adv grid I calculated.
Thanks,
Ryan
--
Ryan Connelly
M.S. Student in Atmospheric Sciences, Stony Brook University
B.S. in Meteorology with Minors in Mathematics and GIS, Valparaiso
University
rconne01 at gmail.com
ryan.connelly at stonybrook.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160418/bee22e4b/attachment.html
More information about the ncl-talk
mailing list