Skip to content

Commit

Permalink
Merge branch 'cbegeman/ocn/dam-break-bugfix' into next (PR #5279)
Browse files Browse the repository at this point in the history
Add tracers to dam break initialization for MPAS-Ocean standalone test

This PR adds temperature and salinity initialization to the
initialization steps for the dam break test case. This is necessary to
avoid run time crashes since the fill value feature was merged in
PR #5154.

[BFB]
  • Loading branch information
jonbob committed Nov 17, 2022
2 parents 9aa79a2 + 471b138 commit 37a4627
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/mpas-ocean/src/mode_init/mpas_ocn_init_dam_break.F
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ subroutine ocn_init_setup_dam_break(domain, iErr)!{{{
call mpas_pool_get_subpool(statePool, 'tracers', tracersPool)

call mpas_pool_get_dimension(meshPool, 'nVertLevels', nVertLevels)
call mpas_pool_get_dimension(tracersPool, 'index_temperature', index_temperature)
call mpas_pool_get_dimension(tracersPool, 'index_salinity', index_salinity)
call mpas_pool_get_dimension(meshPool, 'nCellsSolve', nCellsSolve)
call mpas_pool_get_array(meshPool, 'xCell', xCell)
call mpas_pool_get_array(meshPool, 'yCell', yCell)
Expand All @@ -200,6 +202,7 @@ subroutine ocn_init_setup_dam_break(domain, iErr)!{{{
call mpas_pool_get_array(meshPool,'cullCell',cullCell)

call mpas_pool_get_array(statePool,'layerThickness',layerThickness,1)
call mpas_pool_get_array(tracersPool, 'activeTracers', activeTracers, 1)
call mpas_pool_get_array(statePool,'ssh',ssh,1)
call mpas_pool_get_array(verticalMeshPool,'restingThickness',restingThickness)
call mpas_pool_get_array(verticalMeshPool,'refZMid',refZMid)
Expand Down Expand Up @@ -252,6 +255,19 @@ subroutine ocn_init_setup_dam_break(domain, iErr)!{{{
restingThickness(k,iCell) = layerThickness(k,iCell)
enddo
enddo
! Set salinity
if ( associated(activeTracers) ) then
do iCell = 1, nCellsSolve
activeTracers(index_salinity, :, iCell) = 30.0_RKIND
end do
end if

! Set temperature
if ( associated(activeTracers) ) then
do iCell = 1, nCellsSolve
activeTracers(index_temperature, :, iCell) = 10.0_RKIND
end do
end if

! Determine global min and max values.
call mpas_dmpar_min_real(domain % dminfo, yMin, yMinGlobal)
Expand Down

0 comments on commit 37a4627

Please sign in to comment.