Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. dy=111000 # [m]
  2. lonres=lon[1]-lon[0] # constant
  3. tadv=np.zeros(np.shape(T)); tadv.fill(np.nan)
  4. for t in range(np.shape(T)[0]):
  5. for x in np.arange(1,len(lon)-1):
  6. for y in np.arange(1,len(lat)-1):
  7. dx = abs(111000*np.cos(lat[y]*(2*np.pi/360))*lonres)
  8. tadv[t,y,x] = -(u[t,y,x]*(T[t,y,x+1]-T[t,y,x-1])/(2*dx) +
  9. v[t,y,x]*(T[t,y+1,x]-T[t,y-1,x])/(2*dy))
  10.  
  11. ut = np.zeros(np.shape(T))
  12. vt = np.zeros(np.shape(T))
  13. UT = np.zeros(np.shape(T))
  14. for t in range(np.shape(T)[0]):
  15. for x in range(len(lon)):
  16. for y in range(len(lat)):
  17. ut[t,s,y,x] = u[t,s,y,x]*abs(T[t,s,y,x])
  18. vt[t,s,y,x] = v[t,s,y,x]*abs(T[t,s,y,x])
  19. 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