m_modmet_obuk.f90 Source File


This file depends on

sourcefile~~m_modmet_obuk.f90~~EfferentGraph sourcefile~m_modmet_obuk.f90 m_modmet_obuk.f90 sourcefile~modmet_constants.f90 modmet_constants.f90 sourcefile~m_modmet_obuk.f90->sourcefile~modmet_constants.f90

Files dependent on this one

sourcefile~~m_modmet_obuk.f90~~AfferentGraph sourcefile~m_modmet_obuk.f90 m_modmet_obuk.f90 sourcefile~m_modmet_flxln2.f90 m_modmet_flxln2.f90 sourcefile~m_modmet_flxln2.f90->sourcefile~m_modmet_obuk.f90 sourcefile~modmet.f90 modmet.f90 sourcefile~modmet.f90->sourcefile~m_modmet_obuk.f90 sourcefile~modmet.f90->sourcefile~m_modmet_flxln2.f90 sourcefile~m_modmet_lusthov.f90 m_modmet_lusthov.f90 sourcefile~modmet.f90->sourcefile~m_modmet_lusthov.f90 sourcefile~m_modmet_lusthov.f90->sourcefile~m_modmet_flxln2.f90

Source Code

!------------------------------------------------------------------------------
! Module:     m_modmet_obuk
! Authors:    Marte Voorneveld, RIVM
!             Anton Beljaars, KNMI (original OBUK routine)
! Created:    June 11 2026
! Updated:    June 11 2026
! Description:
!   This module computes Obukhov length from friction velocity and
!   temperature scale.
!------------------------------------------------------------------------------
module m_modmet_obuk
    use modmet_constants, only: GRAVITY, VONK, TR, EPS
   implicit none (type, external)
   private
   public :: modmet_obuk
contains
   ! ===========================================================
   ! Function: modmet_obuk
   ! Description: Computes Obukhov length and returns a large-magnitude
   !              fallback when temperature scale is near zero.
   ! input: ust - friction velocity [m/s]
   ! input: tst - temperature scale
   ! output: ol - Obukhov length [m]
   ! ===========================================================
   !! Computes Obukhov length from friction velocity and temperature scale.
   !!   Reference: OBUK routine from KNMI legacy implementation.
pure function modmet_obuk(ust, tst) result(ol)
   real, intent(in) :: ust
   !! friction velocity [m/s]
   real, intent(in) :: tst
   !! temperature scale
      real :: ol


      if (abs(tst) < EPS) then
         ol = -1e5 ! effectively infinite Obukhov length
         return
      end if

      ol = (TR*ust**2) / (GRAVITY * tst * VONK)
   end function modmet_obuk
end module m_modmet_obuk