Skip to content

Commit

Permalink
Only pass layer thickness tracer for first call to fct
Browse files Browse the repository at this point in the history
Only pass layer thickness tracer instead of all tracers for thickness
advection step, which is the first call to fct when using fct for
both thickness and tracers.
  • Loading branch information
trhille committed Aug 28, 2023
1 parent 35a89ae commit f43c26b
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,18 +489,14 @@ subroutine li_advection_thickness_tracers(&
! Call fct routine for thickness first, and use activeTracerHorizontalAdvectionEdgeFlux
! returned by that call as normalThicknessFlux for call to tracer fct
call li_tracer_advection_fct_tend(&
tend, advectedTracers, layerThicknessOld * 0.0_RKIND + 1.0_RKIND, &
tend(nTracers:,:,:), advectedTracers(nTracers:,:,:), layerThicknessOld * 0.0_RKIND + 1.0_RKIND, &
layerNormalVelocity, 0.0_RKIND * normalVelocity, dt, &
nTracers, activeTracerHorizontalAdvectionEdgeFlux, computeBudgets=.false.)
1, activeTracerHorizontalAdvectionEdgeFlux(nTracers:,:,:), computeBudgets=.false.)
! layerThickness is last tracer. However, for some reason
! this: layerThickness(:,:) = advectedTracers(nTracers,:,:) does not conserve mass!
! This does conserve mass:
layerThickness(:,:) = layerThickness(:,:) + tend(nTracers,:,:) * dt
! Reset tracers after thickness advection for tracer advection
! TODO: determine whether we need to treat other tracer tendencies
! the same as layerThickness for conservation.
advectedTracers(:,:,:) = advectedTracersOld(:,:,:)
tend(:,:,:) = 0.0_RKIND

! Call fct for tracers, using activeTracerHorizontalAdvectionEdgeFlux
! from fct thickness advection as normalThicknessFlux
call li_tracer_advection_fct_tend(&
Expand Down

0 comments on commit f43c26b

Please sign in to comment.