source: trunk/NS3D_JMC/JMFFT-8.0/test/tjmTables.f90

Last change on this file was 12, checked in by xlvlod, 17 years ago

ajout code NS3D

File size: 1.5 KB
Line 
1! Test des sous-programmes de generation des sinus-cosinus
2! pour les T.F. en sinus et cosinus
3
4program tTable
5
6  implicit none
7
8  integer, parameter :: nmax = 32
9  integer, parameter :: nmin = nmax/2
10  integer, parameter :: ntable = nmax*4
11  real(8), dimension(0:ntable-1) :: table
12  real(8), dimension(0:ntable-1) :: tableRef
13  real(8) :: pi
14  integer :: n
15  integer :: i
16
17  pi = acos( -1._8 )
18
19  ! Verification de jmtable
20  do n = nmin, nmax
21    table(:) = 0
22    call jmtable( table, 2*n, 0, n )
23    do i = 0, n-1
24      tableRef(i)   = cos( 2 * pi * i / real( n, 8 ) )
25      tableRef(n+i) = sin( 2 * pi * i / real( n, 8 ) )
26    end do
27    print *, maxval( abs( table(0:2*n-1) - tableRef(0:2*n-1) ) )
28  end do
29  print *
30
31  ! Verification de jmTableSin
32  do n = nmin, nmax
33    table(:) = 0
34    call jmTableSin( table, 3*n, 0, n )
35    do i = 0, n-1
36      tableRef(i)     = cos( 2 * pi * i / real( n, 8 ) )
37      tableRef(n+i)   = sin( 2 * pi * i / real( n, 8 ) )
38      tableRef(2*n+i) = sin(     pi * i / real( n, 8 ) )
39    end do
40    print *, maxval( abs( table(0:3*n-1) - tableRef(0:3*n-1) ) )
41  end do
42  print *
43
44  ! Verification de jmTableSinCos
45  do n = nmin, nmax
46    table(:) = 0
47    call jmTableSinCos( table, 4*n, 0, n )
48    do i = 0, n-1
49      tableRef(i)     = cos( 2 * pi * i / real( n, 8 ) )
50      tableRef(n+i)   = sin( 2 * pi * i / real( n, 8 ) )
51      tableRef(2*n+i) = sin(     pi * i / real( n, 8 ) )
52      tableRef(3*n+i) = cos(     pi * i / real( n, 8 ) )
53    end do
54    print *, maxval( abs( table(0:4*n-1) - tableRef(0:4*n-1) ) )
55  end do
56
57end program tTable
Note: See TracBrowser for help on using the repository browser.