爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 7207|回复: 1

[求助] 求助:Metpy 计算的物理量与ERA5再分析资料中的物理量相差很大

[复制链接]

新浪微博达人勋

发表于 2022-4-7 15:25:07 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
因为ERA5自己有散度和涡度可以下载,我自己初学也不太会用python,因此一些物理量计算需要验证下对错,结果发现ERA5再分析资料中的涡度散度和使用Metpy计算出来的相差很多。

比如这个是Metpy中关于涡度的定义,
  1. ##定义
  2. Definition : vorticity(*args: Any, **kwargs: Any)
  3. Calculate the vertical vorticity of the horizontal wind.
  4. Parameters
  5. u(..., M, N) xarray.DataArray or pint.Quantity
  6. x component of the wind
  7. v(..., M, N) xarray.DataArray or pint.Quantity
  8. y component of the wind
  9. dxpint.Quantity, optional
  10. The grid spacing(s) in the x-direction. If an array, there should be one item less than the size of u along the applicable axis. Optional if xarray.DataArray with latitude/longitude coordinates used as input. Keyword-only argument.
  11. dypint.Quantity, optional
  12. The grid spacing(s) in the y-direction. If an array, there should be one item less than the size of u along the applicable axis. Optional if xarray.DataArray with latitude/longitude coordinates used as input. Keyword-only argument.
  13. x_dimint, optional
  14. Axis number of x dimension. Defaults to -1 (implying [..., Y, X] order). Automatically parsed from input if using xarray.DataArray. Keyword-only argument.
  15. y_dimint, optional
  16. Axis number of y dimension. Defaults to -2 (implying [..., Y, X] order). Automatically parsed from input if using xarray.DataArray. Keyword-only argument.


下面是自己的部分:
  1. dx, dy = mpcalc.lat_lon_grid_deltas(lon, lat)
  2. #   计算出来的数据和原来的数据差很多,????
  3. wind_vor = mpcalc.vorticity(u,v,dx=dx,dy=dy,x_dim=-1,y_dim=-2)      
  4. wind_div = mpcalc.divergence(u,v,dx=dx,dy=dy,x_dim=-1,y_dim=-2)     


这个是Metpy算出来的相对涡度:
wind_vor
Out[19]:
array([[ 1.22826072e-05, -1.74879282e-06, -1.80048286e-05, ...,
        -1.22620830e-05, -1.35755185e-05, -1.83350494e-05],
       [ 2.63587489e-05,  1.48204562e-05,  6.34924628e-07, ...,
         9.65214860e-06,  1.33634245e-06, -8.16623809e-06],
       [ 2.67111189e-05,  1.33099878e-05, -2.92370330e-06, ...,
         3.26149484e-05,  2.52949367e-05,  1.80315283e-05],
       ...,
       [ 8.29784375e-05,  6.32179686e-05,  3.79085029e-05, ...,
         9.22821203e-06,  4.61023816e-06,  3.97450527e-07],
       [ 4.54908416e-05,  4.44313939e-05,  4.02905938e-05, ...,
         8.23294447e-06,  5.82363777e-06,  4.14160954e-06],
       [ 4.09520199e-05,  4.88505044e-05,  3.95765279e-05, ...,
         7.05006292e-06,  5.65144343e-06,  5.70478559e-06]]) <Unit('1 / second')>

这个是ERA5资料中的相对涡度:
masked_array(
  data=[[ 1.89363456e-06,  3.88504163e-06, -9.56801947e-06, ...,
         -2.28832029e-06, -2.48746100e-06, -9.65652645e-06],
        [ 2.47948159e-05,  1.28021200e-05, -8.37317523e-06, ...,
          4.43821026e-06, -2.99637614e-06, -1.11611451e-05],
        [ 3.08575441e-05,  1.62096387e-05,  1.67748434e-07, ...,
          4.09030864e-05,  3.31144721e-05,  2.21617332e-05],
        ...,
        [ 4.69436879e-05,  7.75892300e-05,  1.97056645e-05, ...,
          1.01026570e-05,  4.43821026e-06, -3.19039962e-07],
        [ 2.41752670e-05,  5.44667813e-05,  3.40216686e-05, ...,
          8.46527790e-06,  6.27473012e-06,  3.46463347e-06],
        [ 2.75385323e-05,  6.01091013e-05,  2.68083497e-05, ...,
          6.89427899e-06,  6.40749059e-06,  4.32757654e-06]],
  mask=False,
  fill_value=1e+20) <Unit('1 / second')>
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2022-7-8 11:59:25 | 显示全部楼层
回填自己的坑,
问题由于边界处插值导致的,因为计算需要上下左右各有一个点,边界处缺失导致不一致。
处理办法,选要分析或出图略大的范围计算,再去分析或出图,结果基本一致。
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表