Skip to content

Commit

Permalink
Fix small conservation error when using fct thickness and tracer adve…
Browse files Browse the repository at this point in the history
…ction

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 20, 2023
1 parent fb51715 commit c648a08
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 @@ -108,6 +109,7 @@ subroutine li_advection_thickness_tracers(&
! input/output variables
!
!-----------------------------------------------------------------
type (domain_type), intent(inout) :: domain !< Input/Output: domain object

type (domain_type), intent(inout) :: domain

Expand Down Expand Up @@ -526,6 +528,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 @@ -721,6 +721,7 @@ subroutine advection_solver(domain, err)
endif

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

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

0 comments on commit c648a08

Please sign in to comment.