From c648a08a5bdad180da36800e9ce4c7d36cc072ae Mon Sep 17 00:00:00 2001 From: Trevor Hillebrand Date: Thu, 19 Oct 2023 13:36:34 -0700 Subject: [PATCH] Fix small conservation error when using fct thickness and tracer advection Add a halo update on layerThicknessEdgeFlux to fix a small tracer conservation error when using fct thickness and tracer advection. --- .../src/mode_forward/mpas_li_advection.F | 6 ++++++ .../src/mode_forward/mpas_li_time_integration_fe.F | 2 ++ 2 files changed, 8 insertions(+) diff --git a/components/mpas-albany-landice/src/mode_forward/mpas_li_advection.F b/components/mpas-albany-landice/src/mode_forward/mpas_li_advection.F index 9b9f416164ff..674af3a9d01a 100644 --- a/components/mpas-albany-landice/src/mode_forward/mpas_li_advection.F +++ b/components/mpas-albany-landice/src/mode_forward/mpas_li_advection.F @@ -74,6 +74,7 @@ module li_advection !----------------------------------------------------------------------- subroutine li_advection_thickness_tracers(& + domain, & dt, & meshPool, & velocityPool, & @@ -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 @@ -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 diff --git a/components/mpas-albany-landice/src/mode_forward/mpas_li_time_integration_fe.F b/components/mpas-albany-landice/src/mode_forward/mpas_li_time_integration_fe.F index 9d73e62d462f..45bdd188e636 100644 --- a/components/mpas-albany-landice/src/mode_forward/mpas_li_time_integration_fe.F +++ b/components/mpas-albany-landice/src/mode_forward/mpas_li_time_integration_fe.F @@ -721,6 +721,7 @@ subroutine advection_solver(domain, err) endif call li_advection_thickness_tracers(& + domain, & deltat, & meshPool, & velocityPool, & @@ -740,6 +741,7 @@ subroutine advection_solver(domain, err) endif call li_advection_thickness_tracers(& + domain, & deltat, & meshPool, & velocityPool, &