!===============================================================================
!
! typedef_hmc.F90
!
!-------------------------------------------------------------------------------
!
! Copyright (C) 2003-2013 Hinnerk Stueben, 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"

!-------------------------------------------------------------------------------
module typedef_hmc

  use typedef

  type hmc_para
     REAL :: beta
     REAL :: beta_qed
     REAL :: kappa_axion
     REAL :: finv_axion
     REAL :: kappa
     REAL :: kappa_strange
     REAL :: nf1_kappa(6)
     REAL :: nf2_kappa(6)
     REAL :: nf1_em_charge(6)
     REAL :: nf2_em_charge(6)
     REAL :: nf1_lambda(6)
     REAL :: nf2_lambda(6)
     REAL :: nf2_rho(6,3)

     REAL :: csw
!!     REAL :: csw_kappa          ! not use anymore
!!     REAL :: csw_kappa_strange  ! not use anymore
     integer :: n_stout
     REAL :: alpha
     REAL :: theta
     REAL :: chemi
     REAL :: chemi_i
     REAL :: h
     REAL :: traj_length
     REAL :: tau
     integer :: ntau
     integer :: m_scale
     integer :: m_scale2
     integer :: m_scale3
     integer :: m_scale4
     integer :: m_scale5
     character :: model
     character(len=6) :: integrator(6)
  end type hmc_para

  type hmc_para_char
     character(len = 20) :: beta
     character(len = 20) :: beta_qed
     character(len = 20) :: kappa_axion
     character(len = 20) :: finv_axion
     character(len = 20) :: kappa
     character(len = 20) :: kappa_strange
     character(len = 20) :: nf1_kappa(6)
     character(len = 20) :: nf2_kappa(6)
     character(len = 20) :: csw
     character(len = 20) :: n_stout
     character(len = 20) :: alpha
     character(len = 20) :: theta
     character(len = 20) :: chemi
     character(len = 20) :: chemi_i
     character(len = 20) :: nf1_lambda(6)
     character(len = 20) :: nf2_lambda(6)
     character(len = 20) :: h
     character(len = 20) :: traj_length
     character(len = 20) :: tau
     character(len = 20) :: ntau
     character(len = 20) :: nf2_rho(6,3)
     character(len = 20) :: m_scale
     character(len = 20) :: m_scale2
     character(len = 20) :: m_scale3
     character(len = 20) :: m_scale4
     character(len = 20) :: m_scale5
  end type hmc_para_char

  type hmc_out
     REAL :: exp_dh ! exp(-Delta H)
     REAL :: sg     ! without factor beta
     REAL :: sg_qed ! without factor beta_qed
     REAL :: sk_axion ! without factor kappa_axion
     REAL :: sf
     REAL :: plaq(3), rect(3)
     REAL :: plaq_qed
     REAL :: axion_energy
     REAL :: axion_average
     integer :: accepted
     integer :: cg_ncall
     integer :: cg_niter_max
     integer :: cg_niter_tot
     integer :: cgm_ncall
     integer :: cgm_niter_max
     integer :: cgm_niter_tot
  end type hmc_out

  type hmc_conf
     P_GAUGE_FIELD    :: u
     P_U1_GENERATOR_FIELD :: a_qed
     P_AXION_FIELD    :: axion
     P_SPINCOL_FIELD  :: phi
     P_SPINCOL_FIELD  :: phi2
     P_CLOVER_FIELD_A :: a       ! A := 1 - kappa c_sw sigma F (in 6x6 blocks)
     P_CLOVER_FIELD_A :: i       ! inverse of A
     P_CLOVER_FIELD_B :: b       ! inverse of A in (L D L+) decomposed form
     integer          :: former     ! ensemble index before tempering
  end type hmc_conf

end
!===============================================================================
