Skip to content

Fixes implicitCd computation bug in mpas_ocn_vmix.F#566

Merged
pwolfram merged 1 commit intoMPAS-Dev:ocean/coastalfrom
caozd999:coastal/variable_bottom_drag_fix_bugs_implicitCd
May 19, 2020
Merged

Fixes implicitCd computation bug in mpas_ocn_vmix.F#566
pwolfram merged 1 commit intoMPAS-Dev:ocean/coastalfrom
caozd999:coastal/variable_bottom_drag_fix_bugs_implicitCd

Conversation

@caozd999
Copy link

This PR fixes a bug in the computation of implicitCd in shared/mpas_ocn_vmix.F subroutine
subroutine ocn_vel_vmix_tend_implicit_spatially_variable_mannings

The original code is

implicitCd = gravity*(0.5_RKIND*(bottomDrag(cell1) + bottomDrag(cell2)))**2.0 * & 0.5_RKIND * (ssh(cell1) + ssh(cell2) + bottomDepth(cell1) + bottomDepth(cell2))**(-1.0_RKIND/3.0_RKIND)

and should be

implicitCd = gravity*(0.5_RKIND*(bottomDrag(cell1) + bottomDrag(cell2)))**2.0 * & (0.5_RKIND * (ssh(cell1) + ssh(cell2) + bottomDepth(cell1) + bottomDepth(cell2)))**(-1.0_RKIND/3.0_RKIND)

@caozd999 caozd999 changed the title Coastal/variable bottom drag fix bugs implicit cd implicitCd computation bug in mpas_ocn_vmix.F May 19, 2020
@caozd999 caozd999 changed the title implicitCd computation bug in mpas_ocn_vmix.F Fix implicitCd computation bug in mpas_ocn_vmix.F May 19, 2020
@caozd999 caozd999 changed the title Fix implicitCd computation bug in mpas_ocn_vmix.F Fixes implicitCd computation bug in mpas_ocn_vmix.F May 19, 2020
@pwolfram
Copy link
Contributor

@caozd999, can you please do a rebase (or cherry-pick 7c0c5d0 onto head of ocean/coastal)? It seems there is a conflict with a previous commit of mine.

@caozd999 caozd999 force-pushed the coastal/variable_bottom_drag_fix_bugs_implicitCd branch from 7c0c5d0 to 6ac44b2 Compare May 19, 2020 20:18
@pwolfram pwolfram self-requested a review May 19, 2020 22:00
Copy link
Contributor

@pwolfram pwolfram left a comment

Choose a reason for hiding this comment

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

Thanks for catching this bug @caozd999 !

@pwolfram pwolfram requested a review from mark-petersen May 19, 2020 22:01
Copy link
Contributor

@mark-petersen mark-petersen left a comment

Choose a reason for hiding this comment

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

approved by visual inspection and conversation with @pwolfram

@pwolfram pwolfram merged commit e24f105 into MPAS-Dev:ocean/coastal May 19, 2020
@pwolfram
Copy link
Contributor

Thanks @caozd999 for the great catch!

@caozd999 caozd999 deleted the coastal/variable_bottom_drag_fix_bugs_implicitCd branch August 7, 2020 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants