bbl_glue_is_effective Function

public pure function bbl_glue_is_effective(cfg) result(on)

Will &ocean_vdiff_nml bbl_glue actually be ON after setup?

vdiff_bbl_configure (rdb_ocean_vdiff.F90) turns a requested glue OFF when its effective drag coefficient or BBL thickness is not positive: quadratic cd <= 0, linear bg_vel <= 0 (no cd = r·hbbl/bg_vel) or r <= 0, or hbbl and its hbbl_visc fallback both <= 0. This is the same predicate on cfg, so a configure check that only holds while the glue is on (the implicit_drag + hbbl > 0 exception) cannot accept a namelist the setup then runs without it. Keep the two in step.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(in) :: cfg

Return Value logical


Called by

proc~~bbl_glue_is_effective~~CalledByGraph proc~bbl_glue_is_effective bbl_glue_is_effective proc~validate_config validate_config proc~validate_config->proc~bbl_glue_is_effective proc~build_pending_handle build_pending_handle proc~build_pending_handle->proc~validate_config proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~build_pending_handle proc~rdb_ocean_create_pending rdb_ocean_create_pending proc~rdb_ocean_create_pending->proc~build_pending_handle

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: cd_eff
real(kind=wp), private :: hbbl

Source Code

   pure function bbl_glue_is_effective(cfg) result(on)
      !! Will `&ocean_vdiff_nml bbl_glue` actually be ON after setup?
      !!
      !! `vdiff_bbl_configure` (`rdb_ocean_vdiff.F90`) turns a requested
      !! glue OFF when its effective drag coefficient or BBL thickness is
      !! not positive: quadratic `cd <= 0`, linear `bg_vel <= 0` (no
      !! `cd = r·hbbl/bg_vel`) or `r <= 0`, or `hbbl` and its `hbbl_visc`
      !! fallback both `<= 0`.  This is the same predicate on `cfg`, so a
      !! configure check that only holds while the glue is on (the
      !! `implicit_drag` + `hbbl > 0` exception) cannot accept a namelist
      !! the setup then runs without it.  Keep the two in step.
      type(config_t), intent(in) :: cfg
      logical :: on
      real(wp) :: hbbl, cd_eff
      on = .false.
      if (.not. cfg%ocean%vdiff%bbl_glue) return
      hbbl = cfg%ocean%bdrag%hbbl
      if (hbbl <= 0.0_wp) hbbl = cfg%ocean%vdiff%hbbl_visc
      if (trim(adjustl(cfg%ocean%bdrag%form)) == "linear") then
         cd_eff = 0.0_wp
         if (cfg%ocean%bdrag%bg_vel > 0.0_wp) then
            cd_eff = cfg%ocean%bdrag%r*hbbl/cfg%ocean%bdrag%bg_vel
         end if
      else
         cd_eff = cfg%ocean%bdrag%cd
      end if
      on = cd_eff > 0.0_wp .and. hbbl > 0.0_wp
   end function bbl_glue_is_effective