Skip to content

Commit 4225907

Browse files
committed
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.
1 parent 41e9a3f commit 4225907

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/core_init_atmosphere/mpas_init_atm_cases.F

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ subroutine init_atm_setup_case(domain, stream_manager)
158158
call mpas_pool_get_subpool(block_ptr % structs, 'diag', diag)
159159

160160
call mpas_log_write(' calling test case setup ')
161-
call init_atm_case_mtn_wave(mesh, nCells, nVertLevels, state, diag, block_ptr % configs)
161+
call init_atm_case_mtn_wave(domain % dminfo, mesh, nCells, nVertLevels, state, diag, block_ptr % configs)
162162
call decouple_variables(mesh, nCells, nVertLevels, state, diag)
163163
call mpas_log_write(' returned from test case setup ')
164164
block_ptr => block_ptr % next
@@ -1969,13 +1969,15 @@ end subroutine init_atm_case_squall_line
19691969
!----------------------------------------------------------------------------------------------------------
19701970

19711971

1972-
subroutine init_atm_case_mtn_wave(mesh, nCells, nVertLevels, state, diag, configs)
1972+
subroutine init_atm_case_mtn_wave(dminfo, mesh, nCells, nVertLevels, state, diag, configs)
19731973
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1974-
! Setup baroclinic wave test case from Jablonowski and Williamson 2008 (QJRMS)
1974+
! Setup mountain wave test case from Schär et al. (2001): A New Terrain-Following Vertical
1975+
! Coordinate Formulation for Atmospheric Prediction Models
19751976
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19761977

19771978
implicit none
19781979

1980+
type (dm_info), intent(in) :: dminfo
19791981
type (mpas_pool_type), intent(inout) :: mesh
19801982
integer, intent(in) :: nCells
19811983
integer, intent(in) :: nVertLevels
@@ -2159,7 +2161,8 @@ subroutine init_atm_case_mtn_wave(mesh, nCells, nVertLevels, state, diag, config
21592161
! for hx computation
21602162
xa = 5000. !SHP - should be changed based on grid distance
21612163
xla = 4000.
2162-
xc = maxval (xCell(:))/2.
2164+
call mpas_dmpar_max_real(dminfo, maxval(xCell(:)), xc)
2165+
xc = xc * 0.5
21632166

21642167
! metrics for hybrid coordinate and vertical stretching
21652168
str = 1.0

0 commit comments

Comments
 (0)