Skip to content

Commit

Permalink
Enable fct thickness advection without tracer advection
Browse files Browse the repository at this point in the history
Enable fct thickness advection without tracer advection and throw error
if using unsupported  combination of thickness and tracer advection.
  • Loading branch information
trhille committed Sep 1, 2023
1 parent 8f218c3 commit 358431a
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions components/mpas-albany-landice/src/mode_forward/mpas_li_advection.F
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,7 @@ subroutine li_advection_thickness_tracers(&
tend, advectedTracers, layerThicknessOld, &
layerThicknessEdge * layerNormalVelocity, 0 * normalVelocity, dt, &
nTracers, activeTracerHorizontalAdvectionEdgeFlux, computeBudgets=.false.)!{{{
elseif ((trim(config_thickness_advection) .eq. 'fct') .and. &
trim(config_tracer_advection) .eq. 'fct') then
elseif (trim(config_thickness_advection) .eq. 'fct') then
! 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(&
Expand All @@ -497,17 +496,25 @@ subroutine li_advection_thickness_tracers(&
! This does conserve mass:
layerThickness(:,:) = layerThickness(:,:) + tend(nTracers,:,:) * dt

! Call fct for tracers, using activeTracerHorizontalAdvectionEdgeFlux
! from fct thickness advection as normalThicknessFlux
call li_tracer_advection_fct_tend(&
tend(1:nTracers-1,:,:), advectedTracers(1:nTracers-1,:,:), layerThicknessOld, &
activeTracerHorizontalAdvectionEdgeFlux(nTracers,:,:), 0.0_RKIND * normalVelocity, dt, &
nTracers-1, computeBudgets=.false.)
elseif ((trim(config_thickness_advection) .eq. 'fct') .and. &
trim(config_tracer_advection) .eq. 'fo') then
if (trim(config_tracer_advection) .eq. 'fct') then
! Call fct for tracers, using activeTracerHorizontalAdvectionEdgeFlux
! from fct thickness advection as normalThicknessFlux
call li_tracer_advection_fct_tend(&
tend(1:nTracers-1,:,:), advectedTracers(1:nTracers-1,:,:), layerThicknessOld, &
activeTracerHorizontalAdvectionEdgeFlux(nTracers,:,:), 0.0_RKIND * normalVelocity, dt, &
nTracers-1, computeBudgets=.false.)
elseif (trim(config_tracer_advection) .eq. 'none') then
! do nothing
else
err_tmp = 1
call mpas_log_write(trim(config_tracer_advection) // &
' tracer advection is not currently supported with fct thickness advection.', MPAS_LOG_ERR)
endif
else
err_tmp = 1
call mpas_log_write("config_tracer_advection = fo is not currently supposed &
with config_thickness_advection = fct", MPAS_LOG_ERR)
call mpas_log_write("config_thickness_advection = " // trim(config_thickness_advection) // &
", config_tracer_advection = " // trim(config_tracer_advection) // &
" is not a supported combination.", MPAS_LOG_ERR)
endif

if (config_print_thickness_advection_info) then
Expand Down

0 comments on commit 358431a

Please sign in to comment.