Skip to content

Commit

Permalink
Merge branch 'trhille/fix_fct_tracer_conservation_bug' into MALI-Dev/…
Browse files Browse the repository at this point in the history
…develop

Add a halo update on layerThicknessEdgeFlux to fix a small tracer
conservation error when using fct thickness and tracer advection.
  • Loading branch information
trhille committed Oct 27, 2023
2 parents 1343d1d + 7df9b12 commit 81b36a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module li_advection
!-----------------------------------------------------------------------

subroutine li_advection_thickness_tracers(&
domain, &
dt, &
meshPool, &
velocityPool, &
Expand Down Expand Up @@ -107,6 +108,7 @@ subroutine li_advection_thickness_tracers(&
! input/output variables
!
!-----------------------------------------------------------------
type (domain_type), intent(inout) :: domain !< Input/Output: domain object

type (mpas_pool_type), intent(inout) :: &
velocityPool !< Input/output: velocity information
Expand Down Expand Up @@ -494,6 +496,10 @@ subroutine li_advection_thickness_tracers(&
! This does conserve mass:
layerThickness(:,:) = layerThickness(:,:) + tend(nTracers,:,:) * dt

call mpas_timer_start("halo updates")
call mpas_dmpar_field_halo_exch(domain, 'layerThicknessEdgeFlux')
call mpas_timer_stop("halo updates")

if (trim(config_tracer_advection) .eq. 'fct') then
! Call fct for tracers, using layerThicknessEdgeFlux
! from fct thickness advection as normalThicknessFlux
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ subroutine advection_solver(domain, err)
endif

call li_advection_thickness_tracers(&
domain, &
deltat, &
meshPool, &
velocityPool, &
Expand All @@ -733,6 +734,7 @@ subroutine advection_solver(domain, err)
endif

call li_advection_thickness_tracers(&
domain, &
deltat, &
meshPool, &
velocityPool, &
Expand Down

0 comments on commit 81b36a9

Please sign in to comment.