TABLE OF CONTENTS


ABINIT/check/test_radsintr [ Programs ]

[ Top ] [ Programs ]

NAME

  test_radsintr

FUNCTION

  Tests the routine src/32_util/radsintr.F90 that performs
  radial Fourier transform.

COPYRIGHT

  Copyright (C) 2011-2018 ABINIT group (CE)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  (main routine)

OUTPUT

  (main routine)

NOTES

  All required data are generated internally. This program
  performs radial FT of a gaussian function and then transforms
  it back to real space to check possible differences.

PARENTS

CHILDREN

      radsintr

SOURCE

 34 #if defined HAVE_CONFIG_H
 35 #include "config.h"
 36 #endif
 37 
 38 #include "abi_common.h"
 39 
 40 program test_radsintr
 41 
 42  use defs_basis
 43  use m_abicore
 44  use m_errors
 45 
 46  use m_integrals,     only : radsintr
 47 
 48 !This section has been created automatically by the script Abilint (TD).
 49 !Do not modify the following lines by hand.
 50 #undef ABI_FUNC
 51 #define ABI_FUNC 'test_radsintr'
 52 !End of the abilint section
 53 
 54  implicit none
 55 
 56 !Arguments ------------------------------------
 57 
 58 !Local variables-------------------------------
 59 !scalars
 60  integer :: ii,qmesh_size,rmesh_size
 61  real(dp) :: qstep,rstep,yq1,yqn,yr1,yrn
 62 !character(len=500) :: message ! to be uncommented, if needed
 63 !arrays
 64  real(dp), allocatable :: funr(:),funr2(:),funq(:),qmesh(:),rmesh(:)
 65 
 66 ! *************************************************************************
 67 
 68 !Parameters for the generation of the grids
 69  rmesh_size = 150
 70  rstep = 0.02d0
 71  qmesh_size = 50
 72  qstep = 0.04
 73 
 74 !Initialization of meshes
 75  ABI_ALLOCATE(rmesh,(rmesh_size))
 76  ABI_ALLOCATE(qmesh,(qmesh_size))
 77  do ii=1,rmesh_size
 78    rmesh(ii) =rstep*dble(ii-1)
 79  end do
 80  do ii=1,qmesh_size
 81    qmesh(ii) =qstep*dble(ii-1)
 82  end do
 83 
 84  ABI_ALLOCATE(funr,(rmesh_size))
 85  ABI_ALLOCATE(funq,(qmesh_size))
 86  ABI_ALLOCATE(funr2,(rmesh_size))
 87 
 88  do ii=1,rmesh_size
 89    funr(ii)=exp(-((rmesh(ii)-one)**two)/0.1d0)
 90  end do
 91 
 92  call radsintr(funr,funq,qmesh_size,rmesh_size,qmesh,rmesh,yq1,yqn)
 93 
 94  write(std_out,*) ch10, 'r  F(r):',ch10
 95  do ii=1,rmesh_size
 96    write(std_out,*) rmesh(ii), funr(ii)
 97  end do
 98 
 99  write(std_out,*) ch10, 'q  F(q):',ch10
100  do ii=1,qmesh_size
101    write(std_out,*) qmesh(ii), funq(ii)
102  end do
103 
104  call radsintr(funq,funr2,rmesh_size,qmesh_size,rmesh,qmesh,yr1,yrn)
105 
106  write(std_out,*) ch10, 'r  F2(r):',ch10
107  do ii=1,rmesh_size
108    write(std_out,*) rmesh(ii), funr2(ii)
109  end do
110 
111  ABI_DEALLOCATE(funq)
112  ABI_DEALLOCATE(funr)
113  ABI_DEALLOCATE(funr2)
114  ABI_DEALLOCATE(rmesh)
115  ABI_DEALLOCATE(qmesh)
116 
117  end program test_radsintr