Skip to content
Snippets Groups Projects
Commit c85081f8 authored by Evgeny Mortikov's avatar Evgeny Mortikov
Browse files

boundary conditions module update

parent e9e7e362
No related branches found
No related tags found
Loading
module obl_bc
!< @brief boundary conditions module
! --------------------------------------------------------------------------------
! modules used
use obl_common_phys
use obl_state_eq
use obl_math
! --------------------------------------------------------------------------------
! directives list
implicit none
private
real, parameter :: CD = 0.001
! public interface
! --------------------------------------------------------------------------------
public :: get_dyn_velocity
public :: set_bottom_friction
! --------------------------------------------------------------------------------
!> @brief boundary conditions datatype
type, public :: oblBcType
......@@ -35,28 +39,36 @@ module obl_bc
contains
subroutine get_dyn_velocity(dyn_velocity, flux_u, flux_v)
! ----------------------------------------------------------------------------
subroutine get_dyn_velocity(U_dyn, u_momentum_flux, v_momentum_flux)
!< @brief get dynamic velocity
real, intent(out) :: dyn_velocity
real, intent(in) :: flux_u, flux_v
! ----------------------------------------------------------------------------
dyn_velocity = (flux_u**(2.0) + flux_v**(2.0))**(1.0/4.0)
real, intent(out) :: U_dyn
real, intent(in) :: u_momentum_flux, v_momentum_flux
! ----------------------------------------------------------------------------
U_dyn = (u_momentum_flux**(2.0) + v_momentum_flux**(2.0))**(1.0/4.0)
end subroutine
subroutine set_bottom_friction(flux_u_bot, flux_v_bot, U, V, nz)
!< @brief set bottom u-momentum flux
real, intent(out) :: flux_u_bot, flux_v_bot !< u_dyn0**2, v_dyn0**2,[(m/s)**2] (?)
! ----------------------------------------------------------------------------
subroutine set_bottom_friction(u_momentum_flux0, v_momentum_flux0, U, V, Cd, cz)
!< @brief set bottom momentum flux (kinematic)
! ----------------------------------------------------------------------------
real, intent(out) :: u_momentum_flux0, v_momentum_flux0 !< tau / rho, [(m/s)**2]
integer, intent(in) :: cz !< grid size
real, intent(in), dimension(cz) :: U, V
integer, intent(in) :: nz !< number of timesteps
real, intent(in), dimension(nz) :: U, V
real, intent(in) :: Cd !< drag coefficient
real U_bot, V_bot
real U0, V0
! ----------------------------------------------------------------------------
U_bot = U(1)
V_bot = V(1)
U0 = U(1)
V0 = V(1)
flux_u_bot = CD * sqrt(U_bot**2 + V_bot**2) * U_bot
flux_v_bot = CD * sqrt(U_bot**2 + V_bot**2) * V_bot
u_momentum_flux0 = Cd * sqrt(U0**2 + V0**2) * U0
v_momentum_flux0 = Cd * sqrt(U0**2 + V0**2) * V0
end subroutine
......
......@@ -11,6 +11,7 @@ program obl_main
! modules used
use obl_grid
use obl_state
use obl_state_eq
use obl_common_phys
use obl_tforcing
use obl_tslice
......@@ -80,6 +81,8 @@ program obl_main
integer, parameter :: obl_setup = 1 ! 1 - Kato-Phillips, 2 - Papa station
real, parameter :: Cd0 = 0.001 ! bottom drag coefficient
real :: mld !< mixed layer depth, [m]
real :: lab_mld !< theoretical mixed layer depth, [m]
......
......@@ -145,6 +145,8 @@ module obl_scm
subroutine advance_state_eq_scm(bc, grid, dt)
!> @brief single-column model time advancement
! ----------------------------------------------------------------------------
use obl_state_eq
type(oblBcType), intent(in) :: bc
type(gridDataType), intent(in) :: grid
......@@ -178,6 +180,7 @@ module obl_scm
!< @brief set RHS for Theta equation
! --------------------------------------------------------------------------------
use obl_common_phys
use obl_state_eq
integer, intent(in) :: cz !< grid size
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment