Skip to content

Commit

Permalink
Merge branch 'mark-petersen/ocn/zero-velocity-init-mode' (PR #5232)
Browse files Browse the repository at this point in the history
Add zeroing of velocity to ocean init mode

Explicitly sets normal velocity to zero at the beginning of init mode.
Each test case can then overwrite the zeros with initial velocities, but
most do not. In the past the unassigned arrays wrote out zeros, but this
is not true now, as described in #5230.

This code is used to create MPAS-Ocean initial conditions. It is not
compiled in the E3SM code base for simulations.

Fixes #5230
[BFB]
  • Loading branch information
jonbob committed Oct 18, 2022
2 parents 0fedbb1 + 66ac386 commit 28dd4d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/mpas-ocean/src/mode_init/mpas_ocn_init_mode.F
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,15 @@ function ocn_init_mode_run(domain) result(iErr)!{{{
type (mpas_pool_type), pointer :: forcingPool

type (MPAS_timeInterval_type) :: timeStep
real (kind=RKIND), dimension(:,:), pointer :: normalVelocity

ierr = 0

! Initialize normalVelocity to zero for cases that do not specify it.
call mpas_pool_get_subpool(domain % blocklist % structs, 'state', statePool)
call mpas_pool_get_array(statePool, 'normalVelocity', normalVelocity, 1)
normalVelocity(:,:) = 0.0_RKIND

! Eventually, dt should be domain specific
timeStep = mpas_get_clock_timestep(domain % clock, ierr=ierr)
call mpas_get_timeInterval(timeStep, dt=dt)
Expand Down

0 comments on commit 28dd4d7

Please sign in to comment.