Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zeroing of velocity to ocean init mode #5232

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that I did not use a block loop here. Block loops are no longer supported in forward mode, and we never used multiple blocks for init mode anyway, so it seemed silly to add it. We could remove block loops from the rest of the code sometime, but for this PR, I just get the array from the first block. @philipwjones do you agree?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt @philipwjones cares if we break init mode ;-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I care deeply and passionately ;^). But yeah, this is fine - I've been removing them as I find them (block loops that is, not velocity)


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