Skip to content

Commit

Permalink
Implements Thomas Toniazzo's bug fix for spike removal
Browse files Browse the repository at this point in the history
in the monotonic flux limiter.  See

https://github.com/larson-group/clubb_release/pull/11/files

This code change is
expected to be BIT_CHANGING for cases in which
`l_predict_upwp_vpwp = T`, `l_mono_flux_lim_um = T`
or `l_mono_flux_lim_vm = T`, and the monotonic
flux limiter is triggered.

This bug fix prevents non-conservation of momentum
when the vertical integral of either of the wind components `um` or `vm` is negative.
  • Loading branch information
vlarson authored Mar 29, 2023
1 parent dcd170d commit ab7c0ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CLUBB_core/mono_flux_limiter.F90
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ subroutine monotonic_turbulent_flux_limit( nz, ngrdcol, gr, solve_type, dt, xm_o

!Check to ensure the vertical integral is not zero to avoid a divide
!by zero error
if (xm_vert_integral < eps) then
if ( abs(xm_vert_integral) < eps ) then
write(fstderr,*) "Vertical integral of xm is zero;", &
"mfl will remove spike at top of domain,", &
"but it will not conserve xm."
Expand Down

0 comments on commit ab7c0ff

Please sign in to comment.