00001 subroutine calc_mass_WL_MHD
00002 use phys_constant, only : long, pi
00003 use grid_parameter, only : nrg, ntg, npg, nrf, ntf, npf, ntgeq
00004 use coordinate_grav_r, only : hrg
00005 use def_matter_parameter, only : radi
00006 use make_array_3d
00007 use def_quantities, only : admmass, komarmass, komarmass_nc
00008 use interface_source_adm_mass_WL
00009 use interface_source_adm_mass_WL_EMF
00010 use interface_source_komar_mass_peos
00011 use interface_source_komar_mass_peos_EMF
00012 use interface_source_komar_mass_compact_WL
00013 use interface_source_komar_mass_compact_WL_EMF
00014 use interface_vol_int_grav
00015 use interface_vol_int_fluid
00016 implicit none
00017 real(long) :: fac2pi, fac4pi
00018 real(long) :: volg, volf
00019 real(long), pointer :: soug(:,:,:), souf(:,:,:), soug_EMF(:,:,:)
00020 integer :: irg, itg, ipg
00021
00022
00023 call alloc_array3d(soug, 0, nrg, 0, ntg, 0, npg)
00024 call alloc_array3d(soug_EMF, 0, nrg, 0, ntg, 0, npg)
00025 call alloc_array3d(souf, 0, nrf, 0, ntf, 0, npf)
00026
00027 call source_adm_mass_WL(soug,souf)
00028 call source_adm_mass_WL_EMF(soug_EMF)
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 soug(0:nrg,0:ntg,0:npg) = soug(0:nrg,0:ntg,0:npg) &
00041 & + soug_EMF(0:nrg,0:ntg,0:npg)
00042 call vol_int_grav(soug,volg)
00043 call vol_int_fluid(souf,volf)
00044
00045 fac2pi = 0.5d0/pi
00046 admmass = fac2pi*(radi*volg + radi**3*volf)
00047
00048
00049 open(16,file='test_vec_admf',status='unknown')
00050 do irg = 1, nrf
00051 write(16,'(1p,9e20.12)') hrg(irg), fac2pi*radi**3*souf(irg,itg,ipg)
00052 end do
00053 close(16)
00054
00055
00056 call source_komar_mass_peos(soug,souf)
00057 call source_komar_mass_peos_EMF(soug_EMF)
00058 soug(0:nrg,0:ntg,0:npg) = soug(0:nrg,0:ntg,0:npg) &
00059 & + soug_EMF(0:nrg,0:ntg,0:npg)
00060 call vol_int_grav(soug,volg)
00061 call vol_int_fluid(souf,volf)
00062
00063 fac4pi = 0.25d0/pi
00064 komarmass_nc = fac4pi*(radi*volg + radi**3*volf)
00065
00066 call source_komar_mass_compact_WL(souf)
00067 call source_komar_mass_compact_WL_EMF(soug)
00068 call vol_int_grav(soug,volg)
00069 call vol_int_fluid(souf,volf)
00070
00071 komarmass = radi*volg + radi**3*volf
00072
00073 write (6,'(a20,1p,e14.6)') ' ADM mass = ', admmass
00074 write (6,'(a20,1p,e14.6)') ' Komar mass compact=', komarmass
00075 write (6,'(a20,1p,e14.6)') ' Komar mass noncomp=', komarmass_nc
00076
00077 deallocate(soug)
00078 deallocate(soug_EMF)
00079 deallocate(souf)
00080 end subroutine calc_mass_WL_MHD