Advection of a scalar quantity, such as temperature (T), by the horizontal wind, is defined as follows:
$-\textbf{U}\cdot\nabla T$
where $\textbf{U}$ is the horizontal wind vector, $\textbf{U}=(u,v)$, being $u$ and $v$ its zonal and meridional components, respectively (source).
To compute it with gridded data, it is convenient to use finite differences (or similar numerical approaches), as pointed here.
Using this method, the following lines written in Python calculate the advection of temperature (TAdv):
dy=111000 # [m]
lonres=lon[1]-lon[0] # constant
tadv=np.zeros(np.shape(T)); tadv.fill(np.nan)
for t in range(np.shape(T)[0]):
for x in np.arange(1,len(lon)-1):
for y in np.arange(1,len(lat)-1):
dx = abs(111000*np.cos(lat[y]*(2*np.pi/360))*lonres)
tadv[t,y,x] = -(u[t,y,x]*(T[t,y,x+1]-T[t,y,x-1])/(2*dx) +\
v[t,y,x]*(T[t,y+1,x]-T[t,y-1,x])/(2*dy))
I would expect a similar result from scaling the wind components by the temperature, at each grid cell, which is done as follows:
ut = np.zeros(np.shape(T))
vt = np.zeros(np.shape(T))
UT = np.zeros(np.shape(T))
for t in range(np.shape(T)[0]):
for x in range(len(lon)):
for y in range(len(lat)):
ut[t,y,x] = u[t,y,x]*abs(T[t,y,x])
vt[t,y,x] = v[t,y,x]*abs(T[t,y,x])
UT[t,y,x] = ((ut[t,y,x]**2 + vt[t,y,x]**2)**0.5)*np.sign(T[t,y,x])
The magnitude of the scaled wind vectors (UT) would be then similar to this "amount of transport of T". It is multiplied by the sign of T (-1 or 1), because T are anomalies (there is T<0), in order to keep its the sign.
However, the results are totally different. What I am missing here? Is it a mistake in this assumption (that both results should look fairly similar)? Or is it a coding problem?
In the figure below, I show the original T, u and v fields (left), and the results of the two above calculations: Tadv with u and v (middle), and the magnitude of the scaled vectors, UT, with the scaled vectors themselves uT and vT (right). TAdv is multiplied by 24*3600, so that the units are K/day.
Here is a link to a Dropbox folder, where the full script and sample data are available for download: https://www.dropbox.com/sh/kcrb08h72jjj3rn/AAAIAUgKVrRrICAQtXhOHS2ta?dl=0