Skip to content

Commit

Permalink
Fix logic for reading parameter in MOM_tracer_advect.F90
Browse files Browse the repository at this point in the history
We had random behavior in the doc files because the logical `CS%useHuynh`
was not set when using the PLM scheme.
  • Loading branch information
adcroft committed Jul 31, 2024
1 parent c3349ab commit 7983f5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tracer/MOM_tracer_advect.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,8 @@ subroutine tracer_advect_init(Time, G, US, param_file, diag, CS)
" PPM:H3 - Piecewise Parabolic Method (Huyhn 3rd order)\n"// &
" PPM - Piecewise Parabolic Method (Colella-Woodward)" &
, default='PLM')
CS%usePPM = .false.
CS%useHuynh = .false.
select case (trim(mesg))
case ("PLM")
CS%usePPM = .false.
Expand All @@ -1127,13 +1129,12 @@ subroutine tracer_advect_init(Time, G, US, param_file, diag, CS)
CS%useHuynh = .true.
case ("PPM")
CS%usePPM = .true.
CS%useHuynh = .false.
case default
call MOM_error(FATAL, "MOM_tracer_advect, tracer_advect_init: "//&
"Unknown TRACER_ADVECTION_SCHEME = "//trim(mesg))
end select

if (CS%useHuynh) then
if (CS%usePPM .and. CS%useHuynh) then
call get_param(param_file, mdl, "USE_HUYNH_STENCIL_BUG", &
CS%useHuynhStencilBug, &
desc="If true, use a stencil width of 2 in PPM:H3 tracer advection. " &
Expand Down

0 comments on commit 7983f5b

Please sign in to comment.