From 7df9b1254abd60267d56807f699e65a06f1b722c 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 f39d29ca9434..7d93f114b797 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, & @@ -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 @@ -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 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 8dacce199a78..0b3cd8427fd7 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 @@ -715,6 +715,7 @@ subroutine advection_solver(domain, err) endif call li_advection_thickness_tracers(& + domain, & deltat, & meshPool, & velocityPool, & @@ -733,6 +734,7 @@ subroutine advection_solver(domain, err) endif call li_advection_thickness_tracers(& + domain, & deltat, & meshPool, & velocityPool, &