
subroutine BoundaryCondition_UpperLowerBoundary_Slip( &
  & cptr_xyz_Vh, cptr_xyr_W, &
  & cptr_xyz_E, cptr_xyz_R, cptr_xyz_P, &
  & cptr_xyz_RhoBasic, &
  & cptr_tfcoordr, Rd, Cv &
  & ) bind(C, name='BoundaryCondition_UpperLowerBoundary_Slip')

  !
  !
  !
  use, intrinsic :: iso_c_binding

  use dc_types, only: DP

  use Field_IcGrid3D_Manager, only: &
    & Field_IcGrid3D

  use TFCoord_IcGrid3D_helper, only: &
    & TFCoord_IcGrid3D

  use BoundaryCondition_Configurator, only: &
    & apply_UpperLowerBoundary_SlipCondition

  !
  !
  implicit none

  type(c_ptr), value :: cptr_xyz_Vh
  type(c_ptr), value :: cptr_xyr_W
  type(c_ptr), value :: cptr_xyz_E
  type(c_ptr), value :: cptr_xyz_R
  type(c_ptr), value :: cptr_xyz_P
  type(c_ptr), value :: cptr_xyz_RhoBasic
  type(c_ptr), value :: cptr_tfcoordr
  real(DP), value :: Rd
  real(DP), value ::  Cv

  !
  !
  !

  type(Field_IcGrid3D), pointer :: ptr_xyz_Vh, ptr_xyr_W
  type(Field_IcGrid3D), pointer :: ptr_xyz_E, ptr_xyz_R, ptr_xyz_P, ptr_xyz_RhoBasic
  type(TFCoord_IcGrid3D), pointer :: ptr_tfcoordr

  !
  !

  call c_f_pointer(cptr_xyz_Vh, ptr_xyz_Vh)
  call c_f_pointer(cptr_xyr_W, ptr_xyr_W)
  call c_f_pointer(cptr_xyz_E, ptr_xyz_E)
  call c_f_pointer(cptr_xyz_R, ptr_xyz_R)
  call c_f_pointer(cptr_xyz_P, ptr_xyz_P)
  call c_f_pointer(cptr_xyz_RhoBasic, ptr_xyz_RhoBasic)
  call c_f_pointer(cptr_tfcoordr, ptr_tfcoordr)

  call apply_UpperLowerBoundary_SlipCondition( &
    & ptr_xyz_Vh, ptr_xyr_W, &
    & ptr_xyz_E, ptr_xyz_R, ptr_xyz_P, &
    & ptr_xyz_RhoBasic, &
    & ptr_tfcoordr, Rd, Cv )

end subroutine BoundaryCondition_UpperLowerBoundary_Slip

subroutine BoundaryCondition_UpperLowerBoundary_Press( &
  & cptr_xyz_P, cptr_xyz_E, &
  & cptr_xyr_W, cptr_xyr_GW, cptr_xyz_R, &
  & cptr_tfcoordr, Grav, Rd, Cv &
  & ) bind(C, name='BoundaryCondition_UpperLowerBoundary_Press')

  !
  !
  !
  use, intrinsic :: iso_c_binding

  use dc_types, only: DP

  use Field_IcGrid3D_Manager, only: &
    & Field_IcGrid3D

  use TFCoord_IcGrid3D_helper, only: &
    & TFCoord_IcGrid3D

  use BoundaryCondition_Configurator, only: &
    & apply_UpperLowerBoundary_PressCondition

  !
  !
  implicit none

  type(c_ptr), value :: cptr_xyz_P
  type(c_ptr), value :: cptr_xyz_E
  type(c_ptr), value :: cptr_xyr_W
  type(c_ptr), value :: cptr_xyr_GW
  type(c_ptr), value :: cptr_xyz_R
  type(c_ptr), value :: cptr_tfcoordr
  real(DP), value :: Grav
  real(DP), value :: Rd
  real(DP), value ::  Cv

  !
  !
  !

  type(Field_IcGrid3D), pointer :: ptr_xyr_W, ptr_xyr_GW
  type(Field_IcGrid3D), pointer :: ptr_xyz_E, ptr_xyz_R, ptr_xyz_P
  type(TFCoord_IcGrid3D), pointer :: ptr_tfcoordr

  !
  !

  call c_f_pointer(cptr_xyz_P, ptr_xyz_P)
  call c_f_pointer(cptr_xyz_E, ptr_xyz_E)
  call c_f_pointer(cptr_xyr_W, ptr_xyr_W)
  call c_f_pointer(cptr_xyr_GW, ptr_xyr_GW)
  call c_f_pointer(cptr_xyz_R, ptr_xyz_R)
  call c_f_pointer(cptr_tfcoordr, ptr_tfcoordr)

  call apply_UpperLowerBoundary_PressCondition( &
    & ptr_xyz_P, ptr_xyz_E, &
    & ptr_xyr_W, ptr_xyr_GW, ptr_xyz_R, &
    & ptr_tfcoordr, Grav, Rd, Cv )

end subroutine BoundaryCondition_UpperLowerBoundary_Press
