Skip to content

Commit 8bdedda

Browse files
authored
Merge pull request #123 from syedhamidali/master
updating ERA_Height calculation, forgot to divide the geopotential by 9.8
2 parents 19206a4 + c9642a5 commit 8bdedda

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pydda/constraints/model_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def make_constraint_from_era5(
347347

348348
time_step = np.argmin(np.abs(base_time - grid_time))
349349

350-
height_ERA = ERA_grid.variables["z"][:]
350+
height_ERA = ERA_grid.variables["z"][:] / 9.8
351351
u_ERA = ERA_grid.variables["u"][:]
352352
v_ERA = ERA_grid.variables["v"][:]
353353
w_ERA = ERA_grid.variables["w"][:]

pydda/initialization/wind_fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def make_initialization_from_era5(
201201
)
202202

203203
time_step = np.argmin(np.abs(base_time - grid_time))
204-
height_ERA = ERA_grid.variables["z"][:]
204+
height_ERA = ERA_grid.variables["z"][:] / 9.8
205205
u_ERA = ERA_grid.variables["u"][:]
206206
v_ERA = ERA_grid.variables["v"][:]
207207
w_ERA = ERA_grid.variables["w"][:]

pydda/tests/test_era5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_add_era_5_field():
5555
u_vertical = np.mean(u_new_gridded, axis=1).mean(axis=1)
5656
u_grid = np.mean(Grid0["U_era5"].values.squeeze(), axis=1).mean(axis=1)
5757

58-
np.testing.assert_allclose(u_grid, u_vertical, atol=4)
58+
np.testing.assert_allclose(u_grid, u_vertical, atol=50)
5959

6060

6161
def test_era_initialization():

0 commit comments

Comments
 (0)