00001 subroutine calc_mass_peos_irrot
00002   use phys_constant, only  :   long, pi
00003   use grid_parameter, only :   nrg, ntg, npg, nrf, ntf, npf
00004   use def_matter_parameter, only : radi
00005   use make_array_3d
00006   use def_quantities, only : admmass, komarmass, komarmass_nc
00007   use interface_source_adm_mass_peos_irrot
00008   use interface_source_komar_mass_peos_irrot
00009   use interface_source_komar_mass_compact_peos_irrot
00010   use interface_vol_int_grav
00011   use interface_vol_int_fluid
00012   implicit none
00013   real(long)       ::     fac2pi, fac4pi
00014   real(long)       ::     volg, volf
00015   real(long),pointer :: soug(:,:,:), souf(:,:,:)
00016 
00017   call alloc_array3d(soug, 0, nrg, 0, ntg, 0, npg)
00018   call alloc_array3d(souf, 0, nrf, 0, ntf, 0, npf)
00019 
00020   call source_adm_mass_peos_irrot(soug,souf)
00021   call vol_int_grav(soug,volg)
00022   call vol_int_fluid(souf,volf)
00023 
00024   fac2pi = 0.5d0/pi
00025   admmass = fac2pi*(radi*volg + radi**3*volf)
00026 
00027   call source_komar_mass_peos_irrot(soug,souf)
00028   call vol_int_grav(soug,volg) 
00029   call vol_int_fluid(souf,volf)
00030 
00031   fac4pi = 0.25d0/pi
00032   komarmass_nc = fac4pi*(radi*volg + radi**3*volf)
00033 
00034   call source_komar_mass_compact_peos_irrot(souf)
00035   call vol_int_fluid(souf,volf)
00036 
00037   komarmass = radi**3*volf
00038 
00039   write (6,'(a20,1p,e14.6)')  ' ADM   mass nc=     ', admmass
00040   write (6,'(a20,1p,2e14.6)') ' Komar mass nc=     ', komarmass_nc
00041   write (6,'(a20,1p,2e14.6)') ' Komar mass compact=', komarmass
00042 
00043   deallocate(soug)
00044   deallocate(souf)
00045 end subroutine calc_mass_peos_irrot