00001 subroutine IO_output_plot_xyz_mpt(impt)
00002 use phys_constant, only : long
00003 use def_metric, only : psi, alph, bvxd, bvyd
00004 use coordinate_grav_r, only : rg
00005 use coordinate_grav_theta, only : thg
00006 use coordinate_grav_phi, only : phig
00007 use grid_parameter, only : nrg, ntgeq, npgxzp, npgxzm, &
00008 & npgyzp, npgyzm, ntgpolp, ntgpolm
00009 use grid_points_binary_excision, only : irg_exin, irg_exout
00010 use def_binary_parameter, only : sepa, dis
00011 implicit none
00012 integer :: irg, itg, ipg, impt, npg_l, npg_r, count
00013 real(long) :: work_shift, pari, error_psi, error_alph
00014 character(len=1) :: np(5) = (/'1', '2','3', '4', '5'/), char_1
00015
00016 if (impt.eq.1) then
00017 npg_l = npgxzm
00018 npg_r = npgxzp
00019 work_shift = - dis
00020 pari = 1.0
00021 else if(impt.eq.2) then
00022 npg_l = npgxzp
00023 npg_r = npgxzm
00024 work_shift = dis
00025 pari = -1.0
00026 else if(impt.eq.3) then
00027 npg_l = npgxzm
00028 npg_r = npgxzp
00029 work_shift = 0.0d0
00030 pari = 1.0
00031 end if
00032
00033
00034 open(12,file='plot_x_mpt'//np(impt)//'.dat',status='unknown')
00035 count = 0
00036 do irg = nrg, 0, -1
00037 error_psi = ( psi(irg,ntgeq,npg_l) - bvxd(irg,ntgeq,npg_l))* &
00038 & 100.0d0/bvxd(irg,ntgeq,npg_l)
00039 error_alph = (alph(irg,ntgeq,npg_l) - bvyd(irg,ntgeq,npg_l))* &
00040 & 100.0d0/bvyd(irg,ntgeq,npg_l)
00041 char_1 = ' '
00042 if (impt.ne.3) then
00043 if (irg.gt.irg_exin(ntgeq,npg_l).and.irg.lt.irg_exout(ntgeq,npg_l)) then
00044 char_1 = '#'
00045 count = count + 1
00046 end if
00047 end if
00048 write(12,'(a1,1p,10e20.12)') char_1, -rg(irg)+work_shift, &
00049 & psi(irg,ntgeq,npg_l), bvxd(irg,ntgeq,npg_l), &
00050 & alph(irg,ntgeq,npg_l), bvyd(irg,ntgeq,npg_l), &
00051 & dabs(error_psi), dabs(error_alph)
00052 if (count.eq.1) write(12,'(/)')
00053 end do
00054 write(12,'(/)')
00055 count = 0
00056 do irg = 0, nrg
00057 error_psi = ( psi(irg,ntgeq,npg_r) - bvxd(irg,ntgeq,npg_r))* &
00058 & 100.0d0/bvxd(irg,ntgeq,npg_r)
00059 error_alph = (alph(irg,ntgeq,npg_r) - bvyd(irg,ntgeq,npg_r))* &
00060 & 100.0d0/bvyd(irg,ntgeq,npg_r)
00061 char_1 = ' '
00062 if (impt.ne.3) then
00063 if (irg.gt.irg_exin(ntgeq,npg_r).and.irg.lt.irg_exout(ntgeq,npg_r)) then
00064 char_1 = '#'
00065 count = count + 1
00066 end if
00067 end if
00068 if (count.eq.1) write(12,'(/)')
00069 write(12,'(a1,1p,10e20.12)') char_1, rg(irg)+work_shift, &
00070 & psi(irg,ntgeq,npg_r), bvxd(irg,ntgeq,npg_r), &
00071 & alph(irg,ntgeq,npg_r), bvyd(irg,ntgeq,npg_r), &
00072 & dabs(error_psi), dabs(error_alph)
00073 end do
00074 close(12)
00075
00076
00077 open(12,file='plot_y_mpt'//np(impt)//'.dat',status='unknown')
00078 do irg = nrg, 0, -1
00079 write(12,'(1p,10e20.12)') -rg(irg), &
00080 & psi(irg,ntgeq,npgyzm), bvxd(irg,ntgeq,npgyzm), &
00081 & alph(irg,ntgeq,npgyzm), bvyd(irg,ntgeq,npgyzm)
00082 end do
00083 do irg = 0, nrg
00084 write(12,'(1p,10e20.12)') rg(irg), &
00085 & psi(irg,ntgeq,npgyzp), bvxd(irg,ntgeq,npgyzp), &
00086 & alph(irg,ntgeq,npgyzp), bvyd(irg,ntgeq,npgyzp)
00087 end do
00088 close(12)
00089
00090
00091 open(12,file='plot_z_mpt'//np(impt)//'.dat',status='unknown')
00092 do irg = nrg, 0, -1
00093 write(12,'(1p,10e20.12)') -rg(irg), &
00094 & psi(irg,ntgpolm,0), bvxd(irg,ntgpolm,0), &
00095 & alph(irg,ntgpolm,0), bvyd(irg,ntgpolm,0)
00096 end do
00097 do irg = 0, nrg
00098 write(12,'(1p,10e20.12)') rg(irg), &
00099 & psi(irg,ntgpolp,0), bvxd(irg,ntgpolp,0), &
00100 & alph(irg,ntgpolp,0), bvyd(irg,ntgpolp,0)
00101 end do
00102 close(12)
00103
00104 end subroutine IO_output_plot_xyz_mpt