Bugfix for mixing up Rho0
and rho_ref
in Boussinesq PGF
#837
+54
−40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a bug in Boussinesq finite volume pressure gradient force that
GV%Rho0
, mean seawater density andCS%Rho0
, reference density are incorrectly interchanged in a number of instances. The bug probably has zero effect on any existing runs, as I am unaware of cases whereRHO_PGF_REF
is set different fromRHO_0
, otherwise, this bug would have been detected. So the fix here is just for future-proof purpose.RHO_PGF_REF_BUG
is added.CS%Rho0
is renamed toCS%rho_ref
for clarification.GxRho_ref
is added to distinguish fromGxRho0
.GxRho_ref
is used to offset reference density in interface heights inpa
. AndGxRho0
is used to calculate surface pressure. PreviouslyGxRho0
was incorrectly using reference densityrho_ref
(i.e.CS%Rho0
).rho_ref
instead ofGV%rho0
. Two local variablesrho0_int_density
andrho0_set_pbce
are added to maintain and fix this issue.This PR does not change answers.
054354f: Remove unused variable
I_Rho
in threeint_density_dz
subroutines93a86dc: Add runtime flag
RHO_PGF_REF_BUG