Skip to content

Commit

Permalink
Only use MARBL for Chl when using base_bio tracers
Browse files Browse the repository at this point in the history
If MARBL is not configured to provide the base biotic tracers, then it will not
be able to provide chlorophyll. In that case, if CHL_FROM_FILE=False, MOM6
needs to get chlorophyll from the generic tracers.
  • Loading branch information
mnlevy1981 committed Jul 15, 2024
1 parent bbffde0 commit bbf3f7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/tracer/MARBL_tracers.F90
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ end subroutine configure_MARBL_tracers

!> This subroutine is used to register tracer fields and subroutines
!! to be used with MOM.
function register_MARBL_tracers(HI, GV, US, param_file, CS, tr_Reg, restart_CS)
function register_MARBL_tracers(HI, GV, US, param_file, CS, tr_Reg, restart_CS, MARBL_computes_chl)
type(hor_index_type), intent(in) :: HI !< A horizontal index type structure.
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
Expand All @@ -550,6 +550,8 @@ function register_MARBL_tracers(HI, GV, US, param_file, CS, tr_Reg, restart_CS)
type(tracer_registry_type), pointer :: tr_Reg !< A pointer that is set to point to the control
!! structure for the tracer advection and diffusion module.
type(MOM_restart_CS), target, intent(inout) :: restart_CS !< MOM restart control struct
logical, intent(out) :: MARBL_computes_chl !< If MARBL is computing chlorophyll, MOM
!! may use it to compute SW penetration

! Local variables
! This include declares and sets the variable "version".
Expand Down Expand Up @@ -581,6 +583,7 @@ function register_MARBL_tracers(HI, GV, US, param_file, CS, tr_Reg, restart_CS)
allocate(CS)

call configure_MARBL_tracers(GV, US, param_file, CS)
MARBL_computes_chl = CS%base_bio_on

! Read all relevant parameters and write them to the model log.
call log_version(param_file, mdl, version, "")
Expand Down
9 changes: 5 additions & 4 deletions src/tracer/MOM_tracer_flow_control.F90
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ module MOM_tracer_flow_control
logical :: use_boundary_impulse_tracer = .false. !< If true, use the boundary impulse tracer package
logical :: use_dyed_obc_tracer = .false. !< If true, use the dyed OBC tracer package
logical :: use_nw2_tracers = .false. !< If true, use the NW2 tracer package
logical :: get_chl_from_MARBL = .false. !< If true, use the MARBL-provided Chl for shortwave penetration
!>@{ Pointers to the control strucures for the tracer packages
type(USER_tracer_example_CS), pointer :: USER_tracer_example_CSp => NULL()
type(DOME_tracer_CS), pointer :: DOME_tracer_CSp => NULL()
Expand Down Expand Up @@ -254,7 +255,7 @@ subroutine call_tracer_register(G, GV, US, param_file, CS, tr_Reg, restart_CS)
tr_Reg, restart_CS)
if (CS%use_MARBL_tracers) CS%use_MARBL_tracers = &
register_MARBL_tracers(G%HI, GV, US, param_file, CS%MARBL_tracers_CSp, &
tr_Reg, restart_CS)
tr_Reg, restart_CS, CS%get_chl_from_MARBL)
if (CS%use_regional_dyes) CS%use_regional_dyes = &
register_dye_tracer(G%HI, GV, US, param_file, CS%dye_tracer_CSp, &
tr_Reg, restart_CS)
Expand Down Expand Up @@ -401,10 +402,10 @@ subroutine get_chl_from_model(Chl_array, G, GV, CS)
type(tracer_flow_control_CS), pointer :: CS !< The control structure returned by a
!! previous call to call_tracer_register.

if (CS%use_MOM_generic_tracer) then
call MOM_generic_tracer_get('chl', 'field', Chl_array, CS%MOM_generic_tracer_CSp)
elseif (CS%use_MARBL_tracers) then
if (CS%get_chl_from_MARBL) then
call MARBL_tracers_get('Chl', G, GV, Chl_array, CS%MARBL_tracers_CSp)
elseif (CS%use_MOM_generic_tracer) then
call MOM_generic_tracer_get('chl', 'field', Chl_array, CS%MOM_generic_tracer_CSp)
else
call MOM_error(FATAL, "get_chl_from_model was called in a configuration "// &
"that is unable to provide a sensible model-based value.\n"// &
Expand Down

0 comments on commit bbf3f7f

Please sign in to comment.