diff --git a/src/tracer/MARBL_tracers.F90 b/src/tracer/MARBL_tracers.F90 index 0aeb9670b3..fc93994044 100644 --- a/src/tracer/MARBL_tracers.F90 +++ b/src/tracer/MARBL_tracers.F90 @@ -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 @@ -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". @@ -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, "") diff --git a/src/tracer/MOM_tracer_flow_control.F90 b/src/tracer/MOM_tracer_flow_control.F90 index 3b0f9a8eea..ef80f9d23c 100644 --- a/src/tracer/MOM_tracer_flow_control.F90 +++ b/src/tracer/MOM_tracer_flow_control.F90 @@ -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() @@ -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) @@ -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"// &