anchor.diff:          close(log)
         end if
         write(dat,*)  qx,  qy, result(1)
  -      write(dat,*)  qy,  qx, result(1)
  -      write(dat,*) -qy,  qx, result(1)
  +      write(dat,*)  qx, -qy, result(1)
         write(dat,*) -qx,  qy, result(1)
         write(dat,*) -qx, -qy, result(1)
  +      write(dat,*)  qy,  qx, result(1)
  +      write(dat,*)  qy, -qx, result(1)
  +      write(dat,*) -qy,  qx, result(1)
         write(dat,*) -qy, -qx, result(1)      
  -      write(dat,*)  qy, -qx, result(1)
  -      write(dat,*)  qx, -qy, result(1)
         call flush(dat)
       end do
     end do
   
     close(dat)
     open(log, file="susy_qpi.log", position="append", status="old")
  -  write(log,*) "END: "//date//"_"//time//"_susy_qpi.dat"
  +  write(log,*) "END: "//filename
     call cpu_time(end)
     write(log,*) "TOTAL TIME: ", end-start
     close(log)
  
positive.code:   character(len=4) :: time
    character(len=16):: somega
    character(len=64):: filename
  ! Variables for dcuhre
  !     ndim   integer.
  !            number of variables. 1 < ndim <=  15.
  
negative.code: !     epsf   real.
  !   Inv[G(k,omega)] = (omega)*I - H_k
  !     Gkinv  real array of dimension 16 (4x4 matrix)
  !            Inverse of Green function at k
  !     Gkqinv real array of dimension 16 (4x4 matrix)
  !            Inverse of Green function at k+q
    common /gvars/ Pi, t, mu, x0, epsf, Gkinv, Gkqinv
    real(dp)    :: Pi, t, mu, x0, epsf
    complex(dp) :: Gkinv(16), Gkqinv(16)
  
  ! Local variables
    real(dp) :: V, Uc, Uf
    integer  :: i, j, log=10
  
  ! Set constants
    Pi=4.0_dp*datan(1.0_dp)
  
  ! Set experimental data
    t   = 1_dp
    mu  =-0.9_dp*t
    x0  = 1e-2_dp
    epsf=-0.9_dp*x0
    V   = 1e-2_dp
    Uc  = 1_dp
    Uf  = 1e-3_dp
  
    open(log, file="susy_qpi.log", position="append", status="unknown")
    write(log, *) "t:     ", t
    write(log, *) "mu:    ", mu
    write(log, *) "x0:    ", x0
    write(log, *) "epsf:  ", epsf
    write(log, *) "V:     ", V
    write(log, *) "Uc:    ", Uc
    write(log, *) "Uf:    ", Uf
    close(log)
  
  ! Set up matrix as an array of size 16
    Gkinv = (/ complex(dp) :: &
         0,  V, -Uc,  0, &
         V,  0,   0, Uf, &
       -Uc,  0,   0,  V, &
         0, Uf,   V,  0 /)
    Gkqinv = (/ complex(dp) :: &
         0,  V, -Uc,  0, &
         V,  0,   0, Uf, &
       -Uc,  0,   0,  V, &
         0, Uf,   V,  0 /)
  
    do i=1,100
      do j=1,10
        call write_data(i*0.5_dp,j*0.2_dp)
      end do
    end do
  
  end program susy_qpi
  
  subroutine write_data(om, del)
    implicit none
    external sG0
  
  ! Double precision
    integer, parameter :: dp=kind(0.d0)
  
  ! Parameters
  !    omega = om + i * del
    real(dp), intent(in) :: om, del
  
  ! Global variables
  !     omega  complex.
  !            Frequency (energy) used for G
    common /gvars/ Pi, t, mu, x0, epsf, Gkinv, Gkqinv
    common /freq/  omega, qx, qy
    real(dp)    :: Pi, t, mu, x0, epsf, qx, qy
    complex(dp) :: omega, Gkinv(16), Gkqinv(16)
  
  ! Local variables
  !     steps  integer.
  