00001 subroutine IO_output_plot_averaged_error
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, ntg, npg
00008 use grid_points_binary_excision, only : irg_exin, irg_exout
00009 use def_binary_parameter, only : sepa, dis
00010 implicit none
00011 integer :: irg, itg, ipg, count
00012 real(long) :: work_shift, error_psi, error_alph
00013
00014 work_shift = 0.0
00015
00016 open(12,file='plot_averaged_error.dat',status='unknown')
00017 do irg = nrg, 0, -1
00018 count = 0
00019 error_psi = 0.0d0
00020 error_alph = 0.0d0
00021 do itg = 0, ntg
00022 do ipg = 0, npg
00023 if (irg.gt.irg_exin(itg,ipg).and. &
00024 & irg.lt.irg_exout(itg,ipg)) cycle
00025 error_psi = error_psi + &
00026 & dabs((psi(irg,itg,ipg) - bvxd(irg,itg,ipg))* &
00027 & 100.0d0/bvxd(irg,itg,ipg))
00028 error_alph = error_alph + &
00029 & dabs((alph(irg,itg,ipg) - bvyd(irg,itg,ipg))* &
00030 & 100.0d0/bvyd(irg,itg,ipg))
00031 count = count + 1
00032 end do
00033 end do
00034 write(12,'(1p,10e20.12)') -rg(irg)+work_shift, &
00035 & dabs(error_psi)/dble(count), dabs(error_alph)/dble(count)
00036 end do
00037 write(12,'(/)')
00038 do irg = 0, nrg
00039 count = 0
00040 error_psi = 0.0d0
00041 error_alph = 0.0d0
00042 do itg = 0, ntg
00043 do ipg = 0, npg
00044 if (irg.gt.irg_exin(itg,ipg).and. &
00045 & irg.lt.irg_exout(itg,ipg)) cycle
00046 error_psi = error_psi + &
00047 & dabs((psi(irg,itg,ipg) - bvxd(irg,itg,ipg))* &
00048 & 100.0d0/bvxd(irg,itg,ipg))
00049 error_alph = error_alph + &
00050 & dabs((alph(irg,itg,ipg) - bvyd(irg,itg,ipg))* &
00051 & 100.0d0/bvyd(irg,itg,ipg))
00052 count = count + 1
00053 end do
00054 end do
00055 write(12,'(1p,10e20.12)') rg(irg)+work_shift, &
00056 & dabs(error_psi)/dble(count), dabs(error_alph)/dble(count)
00057 end do
00058 close(12)
00059
00060 end subroutine IO_output_plot_averaged_error