Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Differential Temperature Advection with NARR Data

By: Kevin Goebbert

This example creates a four-panel plot to illustrate the difference between single level temperature advection and a computed differential temperature advection between two layers. This example makes use of NARR output.

Data Input

Use Xarray to access GFS data from THREDDS resource and uses metpy accessor to parse file to make it easy to pull data using common coordinate names (e.g., vertical) and attach units.

Differential Temperature Advection Calculation

Use MetPy advection funtion to calculate temperature advection at 700 and 300 hPa, then manually compute the differential between those two layers. The differential temperature advection is then valid at 500 hPa (due to centered differencing) and is the same level that height changes due to absolute vorticity advection is commonly assessed.

/tmp/ipykernel_4347/3635212219.py:2: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
  tadv_700 = mpcalc.advection(tmpk_700, uwnd_700, vwnd_700)
/tmp/ipykernel_4347/3635212219.py:3: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
  tadv_300 = mpcalc.advection(tmpk_300, uwnd_300, vwnd_300)

Make Four Panel Plot

A four panel plot is produced to illustrate the temperature fields at two levels (700 and 300 hPa), which are common fields to be plotted. Then a panel containing the evaluated temperature advection at 700 hPa and differential temperature advection between 700 and 300 hPa. Of meteorological significance is the difference between these two advection plots. For the QG Height Tendency equation, the forcing term is proportional to the differential temperature advection, which paints a slightly different picture than just the 700-hPa temperature advection alone.

To create the four panel plot it takes a bit of code at this point. The following code is segmented into Upper-left, Lower-left, Upper-right, Lower-right panels using matplotlib’s gridspec to help with spacing.

<Figure size 2200x1500 with 8 Axes>