Skip to content

Commit 8c8dbd0

Browse files
committed
Merge branch 'atmosphere/invAreaCell_fix' into release-v4.0
This merge moves the computation of invAreaCell field above first call to atm_compute_solve_diagnostics(). The atm_compute_solve_diagnostics() routine is called from the MPAS-A init routine, and thereafter, toward the end of each timestep. This routine makes use of the invAreaCell field, which wasn't computed until after the first call to the routine during model init. Besides leading to some incorrect diagnostic fields in the first model timestep, this broke bit-identical restarts of the model.
2 parents 1432e34 + b05be2c commit 8c8dbd0

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/core_atmosphere/mpas_atm_core.F

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,14 @@ subroutine atm_mpas_init_block(dminfo, stream_manager, block, mesh, dt)
241241
call mpas_pool_get_config(block % configs, 'config_do_restart', config_do_restart)
242242
call mpas_pool_get_config(block % configs, 'config_do_DAcycling', config_do_DAcycling)
243243
244+
call mpas_pool_get_array(mesh, 'areaCell', areaCell)
245+
call mpas_pool_get_array(mesh, 'invAreaCell', invAreaCell)
246+
call mpas_pool_get_dimension(mesh, 'nCells', nCells)
247+
248+
do iCell=1,nCells
249+
invAreaCell(iCell) = 1.0_RKIND / areaCell(iCell)
250+
end do
251+
244252
if (.not. config_do_restart .or. (config_do_restart .and. config_do_DAcycling)) then
245253
call atm_init_coupled_diagnostics( state, 1, diag, mesh, block % configs)
246254
end if
@@ -262,14 +270,6 @@ subroutine atm_mpas_init_block(dminfo, stream_manager, block, mesh, dt)
262270
uReconstructZonal, &
263271
uReconstructMeridional &
264272
)
265-
266-
call mpas_pool_get_array(mesh, 'areaCell', areaCell)
267-
call mpas_pool_get_array(mesh, 'invAreaCell', invAreaCell)
268-
call mpas_pool_get_dimension(mesh, 'nCells', nCells)
269-
270-
do iCell=1,nCells
271-
invAreaCell(iCell) = 1.0_RKIND / areaCell(iCell)
272-
end do
273273
274274
#ifdef DO_PHYSICS
275275
!check that all the physics options are correctly defined and that at least one physics

0 commit comments

Comments
 (0)