Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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))
- 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,s,y,x] = u[t,s,y,x]*abs(T[t,s,y,x])
- vt[t,s,y,x] = v[t,s,y,x]*abs(T[t,s,y,x])
- UT[t,s,y,x] = ((ut[t,s,y,x]**2 + vt[t,s,y,x]**2)**0.5)*np.sign(T[t,s,y,x])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement