Closed lars2015 closed 6 months ago
for ihem in range(2):
if ihem == 0:
i89 = 1
i90 = 0
lon = era5.variables['lon'][:] * np.pi/180
else:
i89 = nlats-2
i90 = nlats-1
# correct sign of longitude cycle that is opposite at the south pole
lon = -era5.variables['lon'][:] * np.pi/180
for ilev in range(nlevs):
# transform 89 degree u and v winds into cartesian coordinates and take the mean
u89 = era5.variables['U'][0,ilev,i89,:]
v89 = era5.variables['V'][0,ilev,i89,:]
u89x = u89 * np.cos(lon)
u89y = u89 * np.sin(lon)
v89x = -v89 * np.sin(lon)
v89y = v89 * np.cos(lon)
vel89x = np.mean(u89x + v89x)
vel89y = np.mean(u89y + v89y)
u90 = vel89x * np.cos(lon) + vel89y * np.sin(lon)
v90 = -vel89x * np.sin(lon) + vel89y * np.cos(lon)
era5.variables['U'][0,ilev,i90,:] = u90
era5.variables['V'][0,ilev,i90,:] = v90
Replaces the winds at the poles by mean winds at 89 degrees N/S (in Cartesian coordinates).
Related discussion: https://www.researchgate.net/post/How_do_I_compute_the_wind_speed_at_the_pole_90N_or_90S_by_ncep_ncar_reanalysis_u_and_v_wind_data
Tested this fix with the existing test cases of MPTRAC and by means of synthetic wind fields created by the wind
tool.
The issue seems to be related to a new interpolation scheme of the meteo data on MARS implemented in 2019.
More information can be found in the meteocloud issue tracker: https://jugit.fz-juelich.de/slcs/meteocloud/-/issues/66
Identify and further investigate a test case for MPTRAC
Add a fix to the meteo data during meteo data preprocessing?