incomp-flame-post/code/test_compact.f90

94 lines
1.3 KiB
Fortran

program test_calculate
use Compact
implicit none
real*8, parameter :: pi=3.14159265358979323846
real*8, parameter :: me=1.00e-20
integer :: nxp,nyp,nzp
real*8 :: hxp,hyp,hzp
real*8 :: l_0
real*8, allocatable, dimension(:,:,:) :: aaa,bbb,ccc,ddd
real*8, allocatable, dimension(:,:) :: aa,bb,cc,dd
integer :: ierr
real*8 :: xx,yy,zz,fxyz
integer :: i,j,k
real*4, dimension(2) :: startt
real*4, dimension(2) :: endt
real*4 :: result
nxp = 512
nyp = 256
nzp = 256
l_0 = 2.0
hyp=l_0*pi/REAL(nyp)
hxp=hyp
hzp=hyp
allocate(aa(1, nxp), stat=ierr); aa=0.0
allocate(bb(1, nxp), stat=ierr); bb=0.0
allocate(cc(1, nxp), stat=ierr); cc=0.0
allocate(dd(1, nxp), stat=ierr); dd=0.0
allocate(aaa(nxp, nyp, nzp), stat=ierr); aaa=0.0
allocate(bbb(nxp, nyp, nzp), stat=ierr); bbb=0.0
allocate(ccc(nxp, nyp, nzp), stat=ierr); ccc=0.0
allocate(ddd(nxp, nyp, nzp), stat=ierr); ddd=0.0
call ludcmp(nxp, nyp, nzp, 1, 0, 0)
do i = 1,nxp
xx = i * hxp
aa(1,i) = sin(1.1 * xx)
dd(1,i) = 1.1 * cos(1.1 * xx)
end do
call rhs1np(nxp, hxp, aa, bb, 1)
call dfnonp(nxp, hxp, aa, cc, 1, 1)
print *, lxf
print *, lxs
print *, aa
print *, bb
print *, cc
print *, dd
write(*,*) "relerr_min_max", minval((cc - dd)/dd), maxval(((cc - dd)/dd))
deallocate(aa)
deallocate(bb)
deallocate(cc)
deallocate(dd)
deallocate(aaa)
deallocate(bbb)
deallocate(ccc)
deallocate(ddd)
end program