Skip to content

Commit

Permalink
Resolving issues brought up in review
Browse files Browse the repository at this point in the history
  • Loading branch information
OngChia committed Nov 17, 2023
1 parent 0d4dddd commit a85e3ce
Show file tree
Hide file tree
Showing 11 changed files with 178 additions and 402 deletions.
67 changes: 67 additions & 0 deletions dummy_dycore_driver_2021-06-20T12:00:00.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
2023-11-09 15:37:52,502 dycore_driver.py (433 ) : main : INFO Starting ICON dycore run: 2021-06-20T12:00:00
2023-11-09 15:37:52,502 dycore_driver.py (434 ) : main : INFO input args: input_path=testdata/ser_icondata/mpitask1/mch_ch_r04b09_dsl/ser_data, n_time_steps=1, ending date=2021-06-20 12:00:10
2023-11-09 15:37:52,502 dycore_driver.py (438 ) : main : INFO input args: input_path=testdata/ser_icondata/mpitask1/mch_ch_r04b09_dsl/ser_data, n_time_steps=1
2023-11-09 15:37:52,502 dycore_driver.py (440 ) : main : INFO dycore configuring: DONE
2023-11-09 15:37:52,503 dycore_driver.py (441 ) : main : INFO timeloop: START
2023-11-09 15:37:52,503 dycore_driver.py (155 ) : time_integration : INFO starting time loop for dtime=10.0 n_timesteps=1
2023-11-09 15:37:52,503 dycore_driver.py (158 ) : time_integration : INFO apply_to_horizontal_wind=True linit=True apply_horizontal_diffusion_at_large_dt=True dtime=10.0 substep_timestep=5.0
2023-11-09 15:37:52,503 dycore_driver.py (162 ) : time_integration : INFO running initial step to diffuse fields before timeloop starts
2023-11-09 15:37:55,008 diffusion.py (603 ) : _do_diffusion_step : DEBUG rbf interpolation 1: start
2023-11-09 15:37:59,215 diffusion.py (616 ) : _do_diffusion_step : DEBUG rbf interpolation 1: end
2023-11-09 15:37:59,218 diffusion.py (619 ) : _do_diffusion_step : DEBUG communication rbf extrapolation of vn - start
2023-11-09 15:37:59,218 diffusion.py (621 ) : _do_diffusion_step : DEBUG communication rbf extrapolation of vn - end
2023-11-09 15:37:59,218 diffusion.py (623 ) : _do_diffusion_step : DEBUG running stencil 01(calculate_nabla2_and_smag_coefficients_for_vn): start
2023-11-09 15:38:09,923 diffusion.py (650 ) : _do_diffusion_step : DEBUG running stencil 01 (calculate_nabla2_and_smag_coefficients_for_vn): end
2023-11-09 15:38:09,923 diffusion.py (651 ) : _do_diffusion_step : DEBUG running stencils 02 03 (calculate_diagnostic_quantities_for_turbulence): start
2023-11-09 15:38:14,813 diffusion.py (671 ) : _do_diffusion_step : DEBUG running stencils 02 03 (calculate_diagnostic_quantities_for_turbulence): end
2023-11-09 15:38:14,814 diffusion.py (680 ) : _do_diffusion_step : DEBUG 2nd rbf interpolation: start
2023-11-09 15:38:16,419 diffusion.py (693 ) : _do_diffusion_step : DEBUG 2nd rbf interpolation: end
2023-11-09 15:38:16,420 diffusion.py (696 ) : _do_diffusion_step : DEBUG communication rbf extrapolation of z_nable2_e - start
2023-11-09 15:38:16,420 diffusion.py (698 ) : _do_diffusion_step : DEBUG communication rbf extrapolation of z_nable2_e - end
2023-11-09 15:38:16,420 diffusion.py (700 ) : _do_diffusion_step : DEBUG running stencils 04 05 06 (apply_diffusion_to_vn): start
2023-11-09 15:38:27,303 diffusion.py (728 ) : _do_diffusion_step : DEBUG running stencils 04 05 06 (apply_diffusion_to_vn): end
2023-11-09 15:38:27,303 diffusion.py (729 ) : _do_diffusion_step : DEBUG communication of prognistic.vn : start
2023-11-09 15:38:27,303 diffusion.py (732 ) : _do_diffusion_step : DEBUG running stencils 07 08 09 10 (apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulance): start
2023-11-09 15:38:45,458 diffusion.py (763 ) : _do_diffusion_step : DEBUG running stencils 07 08 09 10 (apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulance): end
2023-11-09 15:38:45,458 diffusion.py (767 ) : _do_diffusion_step : DEBUG running fused stencils 11 12 (calculate_enhanced_diffusion_coefficients_for_grid_point_cold_pools): start
2023-11-09 15:38:48,481 diffusion.py (784 ) : _do_diffusion_step : DEBUG running stencils 11 12 (calculate_enhanced_diffusion_coefficients_for_grid_point_cold_pools): end
2023-11-09 15:38:48,481 diffusion.py (787 ) : _do_diffusion_step : DEBUG running stencils 13 14 (calculate_nabla2_for_theta): start
2023-11-09 15:38:51,332 diffusion.py (804 ) : _do_diffusion_step : DEBUG running stencils 13_14 (calculate_nabla2_for_theta): end
2023-11-09 15:38:51,332 diffusion.py (805 ) : _do_diffusion_step : DEBUG running stencil 15 (truly_horizontal_diffusion_nabla_of_theta_over_steep_points): start
2023-11-09 15:38:55,772 diffusion.py (828 ) : _do_diffusion_step : DEBUG running fused stencil 15 (truly_horizontal_diffusion_nabla_of_theta_over_steep_points): end
2023-11-09 15:38:55,772 diffusion.py (831 ) : _do_diffusion_step : DEBUG running stencil 16 (update_theta_and_exner): start
2023-11-09 15:38:58,441 diffusion.py (844 ) : _do_diffusion_step : DEBUG running stencil 16 (update_theta_and_exner): end
2023-11-09 15:38:58,442 diffusion.py (846 ) : _do_diffusion_step : DEBUG communication of prognogistic.vn - end
2023-11-09 15:38:58,442 diffusion.py (536 ) : _sync_cell_fields : DEBUG communication of prognostic cell fields: theta, w, exner - start
2023-11-09 15:38:58,442 diffusion.py (543 ) : _sync_cell_fields : DEBUG communication of prognostic cell fields: theta, w, exner - done
2023-11-09 15:38:58,442 dycore_driver.py (168 ) : time_integration : INFO starting real time loop for dtime=10.0 n_timesteps=1
2023-11-09 15:38:58,442 dycore_driver.py (173 ) : time_integration : INFO simulation date : 2021-06-20 12:00:00 run timestep : 0 linit : True
2023-11-09 15:38:58,442 dycore_driver.py (250 ) : _do_dyn_substepping : INFO simulation date : 2021-06-20 12:00:10 sub timestep : 0, linit : True, nnow: 0, nnew : 1
2023-11-09 15:44:47,480 dycore_driver.py (250 ) : _do_dyn_substepping : INFO simulation date : 2021-06-20 12:00:10 sub timestep : 1, linit : False, nnow: 1, nnew : 0
2023-11-09 15:46:32,712 diffusion.py (603 ) : _do_diffusion_step : DEBUG rbf interpolation 1: start
2023-11-09 15:46:34,282 diffusion.py (616 ) : _do_diffusion_step : DEBUG rbf interpolation 1: end
2023-11-09 15:46:34,283 diffusion.py (619 ) : _do_diffusion_step : DEBUG communication rbf extrapolation of vn - start
2023-11-09 15:46:34,283 diffusion.py (621 ) : _do_diffusion_step : DEBUG communication rbf extrapolation of vn - end
2023-11-09 15:46:34,283 diffusion.py (623 ) : _do_diffusion_step : DEBUG running stencil 01(calculate_nabla2_and_smag_coefficients_for_vn): start
2023-11-09 15:46:40,201 diffusion.py (650 ) : _do_diffusion_step : DEBUG running stencil 01 (calculate_nabla2_and_smag_coefficients_for_vn): end
2023-11-09 15:46:40,204 diffusion.py (651 ) : _do_diffusion_step : DEBUG running stencils 02 03 (calculate_diagnostic_quantities_for_turbulence): start
2023-11-09 15:46:42,425 diffusion.py (671 ) : _do_diffusion_step : DEBUG running stencils 02 03 (calculate_diagnostic_quantities_for_turbulence): end
2023-11-09 15:46:42,425 diffusion.py (680 ) : _do_diffusion_step : DEBUG 2nd rbf interpolation: start
2023-11-09 15:46:44,032 diffusion.py (693 ) : _do_diffusion_step : DEBUG 2nd rbf interpolation: end
2023-11-09 15:46:44,033 diffusion.py (696 ) : _do_diffusion_step : DEBUG communication rbf extrapolation of z_nable2_e - start
2023-11-09 15:46:44,033 diffusion.py (698 ) : _do_diffusion_step : DEBUG communication rbf extrapolation of z_nable2_e - end
2023-11-09 15:46:44,033 diffusion.py (700 ) : _do_diffusion_step : DEBUG running stencils 04 05 06 (apply_diffusion_to_vn): start
2023-11-09 15:46:47,572 diffusion.py (728 ) : _do_diffusion_step : DEBUG running stencils 04 05 06 (apply_diffusion_to_vn): end
2023-11-09 15:46:47,573 diffusion.py (729 ) : _do_diffusion_step : DEBUG communication of prognistic.vn : start
2023-11-09 15:46:47,573 diffusion.py (732 ) : _do_diffusion_step : DEBUG running stencils 07 08 09 10 (apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulance): start
2023-11-09 15:46:57,401 diffusion.py (763 ) : _do_diffusion_step : DEBUG running stencils 07 08 09 10 (apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulance): end
2023-11-09 15:46:57,401 diffusion.py (767 ) : _do_diffusion_step : DEBUG running fused stencils 11 12 (calculate_enhanced_diffusion_coefficients_for_grid_point_cold_pools): start
2023-11-09 15:46:58,513 diffusion.py (784 ) : _do_diffusion_step : DEBUG running stencils 11 12 (calculate_enhanced_diffusion_coefficients_for_grid_point_cold_pools): end
2023-11-09 15:46:58,513 diffusion.py (787 ) : _do_diffusion_step : DEBUG running stencils 13 14 (calculate_nabla2_for_theta): start
2023-11-09 15:46:59,431 diffusion.py (804 ) : _do_diffusion_step : DEBUG running stencils 13_14 (calculate_nabla2_for_theta): end
2023-11-09 15:46:59,432 diffusion.py (805 ) : _do_diffusion_step : DEBUG running stencil 15 (truly_horizontal_diffusion_nabla_of_theta_over_steep_points): start
2023-11-09 15:47:02,140 diffusion.py (828 ) : _do_diffusion_step : DEBUG running fused stencil 15 (truly_horizontal_diffusion_nabla_of_theta_over_steep_points): end
2023-11-09 15:47:02,140 diffusion.py (831 ) : _do_diffusion_step : DEBUG running stencil 16 (update_theta_and_exner): start
2023-11-09 15:47:03,077 diffusion.py (844 ) : _do_diffusion_step : DEBUG running stencil 16 (update_theta_and_exner): end
2023-11-09 15:47:03,079 diffusion.py (846 ) : _do_diffusion_step : DEBUG communication of prognogistic.vn - end
2023-11-09 15:47:03,082 dycore_driver.py (454 ) : main : INFO timeloop: DONE
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def time_step(
diagnostic_state_nh: DiagnosticStateNonHydro,
prognostic_state_ls: list[PrognosticState],
prep_adv: PrepAdvection,
z_fields: ZFields,
z_fields: ZFields, # TODO (Magdalena): move local fields to SolveNonHydro
nh_constants: NHConstants,
bdy_divdamp: Field[[KDim], float],
dtime: float,
Expand Down Expand Up @@ -1697,6 +1697,7 @@ def run_corrector_step(
offset_provider={},
)

# TODO (magdalena): delete NonHydrostaticConfig. l_open_ubc
if not (self.config.l_open_ubc and self.l_vert_nested):
mo_solve_nonhydro_stencil_46.with_backend(run_gtfn)(
w_nnew=prognostic_state[nnew].w,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def test_nonhydro_predictor_step(
assert dallclose(
np.asarray(sp_exit.z_exner_ex_pr())[cell_start_lb_plus2:, :],
np.asarray(solve_nonhydro.z_exner_ex_pr)[cell_start_lb_plus2:, :],
atol=2.0e-18,
)

# stencils 4,5
Expand Down Expand Up @@ -255,6 +256,7 @@ def test_nonhydro_predictor_step(
assert dallclose(
np.asarray(sp_exit.z_th_ddz_exner_c())[cell_start_lb_plus2:, 1:],
np.asarray(solve_nonhydro.z_th_ddz_exner_c)[cell_start_lb_plus2:, 1:],
atol=1.0e-18,
)

# stencils 7,8,9, 11
Expand Down Expand Up @@ -341,13 +343,13 @@ def test_nonhydro_predictor_step(

# stencil 30
assert dallclose(
np.asarray(sp_exit.z_vn_avg())[2538:31558, :],
np.asarray(solve_nonhydro.z_vn_avg)[2538:31558, :],
np.asarray(sp_exit.z_vn_avg())[edge_start_lb_plus4:, :],
np.asarray(solve_nonhydro.z_vn_avg)[edge_start_lb_plus4:, :],
atol=5e-14,
)
# stencil 30
assert dallclose(
np.asarray(sp_exit.z_graddiv_vn()[edge_start_lb_plus4:, :]),
np.asarray(sp_exit.z_graddiv_vn())[edge_start_lb_plus4:, :],
np.asarray(z_fields.z_graddiv_vn)[edge_start_lb_plus4:, :],
atol=5e-20,
)
Expand Down Expand Up @@ -399,8 +401,8 @@ def test_nonhydro_predictor_step(

# stencil 41
assert dallclose(
np.asarray(sp_exit.z_flxdiv_mass())[3316:20896, :],
np.asarray(solve_nonhydro.z_flxdiv_mass)[3316:20896, :],
np.asarray(sp_exit.z_flxdiv_mass())[cell_start_nudging:, :],
np.asarray(solve_nonhydro.z_flxdiv_mass)[cell_start_nudging:, :],
atol=5e-15,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ def test_velocity_predictor_step(
np.asarray(icon_result_vn_ie), np.asarray(diagnostic_state.vn_ie), atol=1.0e-14
)
# stencil 07
# TODO: this is not called when vn_only is true, no comparison should be done
assert dallclose(
np.asarray(icon_result_z_v_grad_w)[3777:31558, :],
np.asarray(velocity_advection.z_v_grad_w)[3777:31558, :],
atol=1.0e-16,
)
if not vn_only:
assert dallclose(
np.asarray(icon_result_z_v_grad_w)[3777:31558, :],
np.asarray(velocity_advection.z_v_grad_w)[3777:31558, :],
atol=1.0e-16,
)
# stencil 08
assert dallclose(
np.asarray(savepoint_velocity_exit.z_ekinh())[3316:20896, :],
Expand Down
1 change: 0 additions & 1 deletion model/driver/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ classifiers = [
]
dependencies = [
"gt4py>=1.0.1",
"pytz>=2023.2",
"icon4py-common>=0.0.5",
"icon4py-atmosphere-dycore>=0.0.5",
"icon4py-atmosphere-diffusion>=0.0.5"
Expand Down
Loading

0 comments on commit a85e3ce

Please sign in to comment.