!===============================================================================
!
! bc.F90 -- boundary condition switching
!
!-------------------------------------------------------------------------------
!
! Copyright (C) 2007 Yoshifumi Nakamura
!
! This file is part of BQCD -- Berlin Quantum ChromoDynamics program
!
! BQCD is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! BQCD is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with BQCD.  If not, see <http://www.gnu.org/licenses/>.
!
!-------------------------------------------------------------------------------
# include "defs.h"

!-------------------------------------------------------------------------------
subroutine init_bc()

  use      module_switches
  implicit none

  if (switches%boundary_sf) then
     call init_schr_bc()
     call init_schr_weight()
  else
     call init_flip_bc_normal()
  endif

end

!-------------------------------------------------------------------------------
subroutine flip_bc(u)

  use      module_switches
  use      module_lattice
  use      module_vol
  implicit none

  GAUGE_FIELD, intent(inout) :: u

  if (switches%boundary_sf) then
     call flip_bc1_schfun(u)
  else
     call flip_bc1_normal(u)
  endif

end

!-------------------------------------------------------------------------------
subroutine flip_bc2(u_flip, u)

  use      module_switches
  use      module_lattice
  use      module_vol
  implicit none

  GAUGE_FIELD, intent(in)  :: u
  GAUGE_FIELD, intent(out) :: u_flip

  if (switches%boundary_sf) then
     call flip_bc2_schfun(u_flip, u)
  else
     call flip_bc2_normal(u_flip, u)
  endif

end

!===============================================================================
