Using wrf_user_interp3d with large # of vertical grid points

The NCL graphics package.

Using wrf_user_interp3d with large # of vertical grid points

Postby LarissaR » Tue Oct 18, 2016 4:28 pm

This is a pro tip suggestion in case others out there ever run in to problems with this function.

When using the wrf_user_interp3d function to interpolate 3-D arrays in to 2-D vertical cross sections, the function decides for you that you only want to interpolate to 100 evenly-spaced points in the vertical. In V6.3.0, that happens on line 382 in WRFUserARW.ncl

Code: Select all
dz = 0.01 * z_max


So, if your model top is, say, 22,000 m (22 km), your data will be interpolated to points every 220 m in the vertical. This can be problematic, especially if you have lots of grid points in the vertical (I personally run at 50m grid spacing in the lowest 1500m). In the case that your original vertical grid spacing in the area of interest is < 1% of your model top, you will experience significant degradation of data resolution. Luckily, the fix is simple! You can increase the number of grid points by 10 or 100 fold without much additional computational time required. Just change the above line of code to

Code: Select all
dz = (1/1000) * z_max


for 1000 grid points or

Code: Select all
dz = (1/10000) * z_max


for 10,000 points.

This simple change should result in improved representation of the data, especially in the boundary layer where grid points are normally more closely packed.

If you don't have root access to your NCL build, such as the case where NCL is installed on a central location on an offsite server or cluster (i.e. Yellowstone or some other supercomputer), you can copy $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl to somewhere on your home directory, modify it, then load that file at the beginning of your cross section code like:

Code: Select all
load "[your home directory]/WRFUserARW.ncl"

instead of
Code: Select all
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"


I hope this can help people in the future!
LarissaR
 
Posts: 4
Joined: Wed Feb 27, 2013 7:10 pm

Return to NCL

Who is online

Users browsing this forum: Google [Bot] and 3 guests