From 422590786c9ed17d33fc956c65450fd654016a22 Mon Sep 17 00:00:00 2001 From: MHBalsmeier Date: Tue, 13 May 2025 19:05:39 +0200 Subject: [PATCH] Bugfix in mpas_init_atm_cases regarding the mountain wave test case The mountain wave test initialization (subroutine init_atm_case_mtn_wave) delivered wrong results when executed in parallel due to the xc variable being computed without calling mpas_dmpar_max_real. This is fixed now. --- src/core_init_atmosphere/mpas_init_atm_cases.F | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core_init_atmosphere/mpas_init_atm_cases.F b/src/core_init_atmosphere/mpas_init_atm_cases.F index 7d43b5ee83..3d98b3a5e1 100644 --- a/src/core_init_atmosphere/mpas_init_atm_cases.F +++ b/src/core_init_atmosphere/mpas_init_atm_cases.F @@ -158,7 +158,7 @@ subroutine init_atm_setup_case(domain, stream_manager) call mpas_pool_get_subpool(block_ptr % structs, 'diag', diag) call mpas_log_write(' calling test case setup ') - call init_atm_case_mtn_wave(mesh, nCells, nVertLevels, state, diag, block_ptr % configs) + call init_atm_case_mtn_wave(domain % dminfo, mesh, nCells, nVertLevels, state, diag, block_ptr % configs) call decouple_variables(mesh, nCells, nVertLevels, state, diag) call mpas_log_write(' returned from test case setup ') block_ptr => block_ptr % next @@ -1969,13 +1969,15 @@ end subroutine init_atm_case_squall_line !---------------------------------------------------------------------------------------------------------- - subroutine init_atm_case_mtn_wave(mesh, nCells, nVertLevels, state, diag, configs) + subroutine init_atm_case_mtn_wave(dminfo, mesh, nCells, nVertLevels, state, diag, configs) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Setup baroclinic wave test case from Jablonowski and Williamson 2008 (QJRMS) + ! Setup mountain wave test case from Schär et al. (2001): A New Terrain-Following Vertical + ! Coordinate Formulation for Atmospheric Prediction Models !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! implicit none + type (dm_info), intent(in) :: dminfo type (mpas_pool_type), intent(inout) :: mesh integer, intent(in) :: nCells integer, intent(in) :: nVertLevels @@ -2159,7 +2161,8 @@ subroutine init_atm_case_mtn_wave(mesh, nCells, nVertLevels, state, diag, config ! for hx computation xa = 5000. !SHP - should be changed based on grid distance xla = 4000. - xc = maxval (xCell(:))/2. + call mpas_dmpar_max_real(dminfo, maxval(xCell(:)), xc) + xc = xc * 0.5 ! metrics for hybrid coordinate and vertical stretching str = 1.0