00001 subroutine test_source_helical_binary_mpt(impt)
00002 use phys_constant, only : long, pi
00003 use coordinate_grav_r, only : rg
00004 use grid_parameter, only : nrg, ntg, npg
00005 use def_binary_parameter, only : sepa, mass_ratio
00006 use def_matter, only : emdg, rs
00007 use def_matter_parameter, only : ome
00008 use def_bh_parameter, only : ome_bh
00009 use def_vector_x, only :vec_xg
00010 implicit none
00011 integer :: irg, itg, ipg, impt
00012 real(long) :: zfac, small = 1.0d-15
00013 real(long), parameter :: a = 1.0d0, q = 1.0d0, sigma = 0.5d0
00014 real(long) :: xx, yy, zz, rplusR, rminusR
00015
00016
00017
00018
00019 ome = ome_bh
00020 call calc_vector_x_grav(1)
00021 if(impt.eq.1) then
00022 do ipg = 0, npg
00023 do itg = 0, ntg
00024 rs(itg,ipg) = 1.0d0
00025 do irg = 0, nrg
00026 xx = vec_xg(irg,itg,ipg,1)
00027 yy = vec_xg(irg,itg,ipg,2)
00028 zz = vec_xg(irg,itg,ipg,3)
00029 rplusR = (xx - sepa)**2 + yy**2 + zz**2
00030 rminusR = xx**2 + yy**2 + zz**2
00031 emdg(irg,itg,ipg) = q/((sqrt(2.0d0*pi)*sigma)**3) &
00032 & * ( 1.0d0 *exp(-rplusR /(2.0d0*sigma**2)) &
00033 & + mass_ratio*exp(-rminusR/(2.0d0*sigma**2)) )
00034 end do
00035 end do
00036 end do
00037 end if
00038 if(impt.eq.2) then
00039 do ipg = 0, npg
00040 do itg = 0, ntg
00041 rs(itg,ipg) = 1.0d0
00042 do irg = 0, nrg
00043 xx = vec_xg(irg,itg,ipg,1)
00044 yy = vec_xg(irg,itg,ipg,2)
00045 zz = vec_xg(irg,itg,ipg,3)
00046 rplusR = xx**2 + yy**2 + zz**2
00047 rminusR = (xx - sepa)**2 + yy**2 + zz**2
00048 emdg(irg,itg,ipg) = q/((sqrt(2.0d0*pi)*sigma)**3) &
00049 & * ( 1.0d0 *exp(-rplusR /(2.0d0*sigma**2)) &
00050 & + mass_ratio*exp(-rminusR/(2.0d0*sigma**2)) )
00051 end do
00052 end do
00053 end do
00054 end if
00055
00056
00057 end subroutine test_source_helical_binary_mpt