00001 subroutine test_excurve
00002 use phys_constant, only : long
00003 use grid_parameter, only : nrg, ntg, npg, rgin
00004 use coordinate_grav_r
00005 use coordinate_grav_phi
00006 use coordinate_grav_theta
00007 use def_metric, only : psi, tfkij
00008 use def_metric_excurve_grid, only : tfkij_grid
00009 use make_array_2d
00010 implicit none
00011 real(long), pointer :: psi_bhsurf(:,:), dpsi_bhsurf(:,:)
00012 real(long) :: work(2,2), val
00013 integer :: irg, itg, ipg, ii, jj, kk, irg1, irg2, ipg1, ipg2, itg1, itg2
00014
00015 open(15,file='kij_r_line.txt',status='unknown')
00016 ipg1 = npg
00017 ipg2 = 1
00018 itg1 = ntg/2
00019 itg2 = ntg/2+1
00020 ipg = 0
00021 itg =ntg/2
00022
00023 do ii = 1,3
00024 do jj = ii,3
00025 write(15,'(a4,i5,a10,i5)') '# i=',ii, ' j=',jj
00026 write(15,'(1p,2e20.12)') rg(0), tfkij_grid(0,itg,ipg,ii,jj)
00027 do irg = 1,nrg-1
00028 val = 0.125d0*(tfkij(irg,itg1,ipg1,ii,jj) + tfkij(irg,itg2,ipg1,ii,jj) + &
00029 & tfkij(irg,itg1,ipg2,ii,jj) + tfkij(irg,itg2,ipg2,ii,jj) + &
00030 & tfkij(irg+1,itg1,ipg1,ii,jj) + tfkij(irg+1,itg2,ipg1,ii,jj) + &
00031 & tfkij(irg+1,itg1,ipg2,ii,jj) + tfkij(irg+1,itg2,ipg2,ii,jj) )
00032
00033 write(15,'(1p,3e20.12)') rg(irg), tfkij_grid(irg,itg,ipg,ii,jj), val
00034 end do
00035 write(15,'(1p,2e20.12)') rg(nrg), tfkij_grid(nrg,itg,ipg,ii,jj)
00036 write(15,'(a1)') ' '
00037 end do
00038 end do
00039 close(15)
00040
00041
00042
00043 end subroutine test_excurve