!===============================================================================
!
! cg_wrapper_mbcg.F90 - wrapper for multi_shift_blockcg_qr in BQCDi
!
!-------------------------------------------------------------------------------
!
! Copyright (C) 2016 Hinnerk Stueben
!
! 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/>.
!
!-------------------------------------------------------------------------------
# define LANGUAGE_FORTRAN
# include "defs.h"
# include "cg_defs.h"

!-------------------------------------------------------------------------------
# define TRACE_NAME cg_wrapper_mbcg
!-------------------------------------------------------------------------------
subroutine cg_wrapper_mbcg(matrix, id, b, iters)

  use multi_lr_solver
  use module_vol
  use module_action
  use module_field
  use module_input
  use module_cg_arrays
  use module_cg_conf
  use module_cg_procs
  implicit none
  external      :: matrix
  integer       :: id
  COMPLEX       :: b(12*volh_tot, nr)
  integer       :: iters

  integer :: cid

  TRACE_ENTRY

  call die("cg_wrapper_mbcg(): under construction: disabled for cg_version=2")

  CHECK(input%tuning_cg_precision == 64)

  cid = action%mtilde(id)%cid

  call cg_init_modules()

  call cg_procs%copyin_gauge(cg_conf%u, gauge(2)%u)

  call cg_procs%copyin_clover(cg_conf%c_even, clover(cid)%cfield%i(1,1,EVEN))
  call cg_procs%copyin_clover(cg_conf%c_odd, clover(cid)%cfield%i(1,1,ODD))

  call cg_procs%kernel_mbcg(matrix, id, b, iters)

  TRACE_RETURN

end

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