source_komar_mass_compact_WL.f90

Go to the documentation of this file.
00001 subroutine source_komar_mass_compact_WL(souf)
00002   use phys_constant, only  : long, pi
00003   use grid_parameter, only : nrf, ntf, npf
00004   use coordinate_grav_r, only       : rg
00005   use trigonometry_grav_theta, only : sinthg, costhg
00006   use trigonometry_grav_phi, only   : sinphig, cosphig
00007   use def_matter
00008   use def_matter_parameter, only  :   radi, ber, ome
00009   use def_metric, only : psi, alph, bvxd, bvyd, bvzd, bvxu, bvyu, bvzu
00010   use def_metric_hij, only : hxxd, hxyd, hxzd, hyyd, hyzd, hzzd
00011   use def_vector_phi, only : vec_phif
00012   use make_array_3d
00013   use interface_interpo_gr2fl
00014   implicit none
00015   real(long), pointer :: souf(:,:,:)
00016   real(long), pointer :: alphf(:,:,:),  psif(:,:,:) 
00017   real(long), pointer :: bvxdf(:,:,:), bvydf(:,:,:), bvzdf(:,:,:)
00018   real(long), pointer :: bvxuf(:,:,:), bvyuf(:,:,:), bvzuf(:,:,:)
00019   real(long), pointer :: hxxdf(:,:,:), hxydf(:,:,:), hxzdf(:,:,:), 
00020                         hyydf(:,:,:), hyzdf(:,:,:), hzzdf(:,:,:)
00021   real(long) :: emdw, alphw, psiw, rhow, prew, hhw, utw, rhoHw, esseS
00022   real(long) :: rjjx, rjjy, rjjz, rjjbeta, ene
00023   real(long) :: vphif(1:3)
00024   real(long) :: otermx, otermy, otermz
00025   real(long) :: bvxdfw, bvydfw, bvzdfw, bvxufw, bvyufw, bvzufw
00026   integer    :: irf, itf, ipf
00027   real(long) :: zfac, small = 1.0d-15
00028   real(long) :: hhxxdf, hhxydf, hhxzdf, hhyxdf, hhyydf, hhyzdf, 
00029                hhzxdf, hhzydf, hhzzdf
00030 !
00031   call alloc_array3d(psif, 0, nrf, 0, ntf, 0, npf)
00032   call alloc_array3d(alphf, 0, nrf, 0, ntf, 0, npf)
00033   call alloc_array3d(bvxdf, 0, nrf, 0, ntf, 0, npf)
00034   call alloc_array3d(bvydf, 0, nrf, 0, ntf, 0, npf)
00035   call alloc_array3d(bvzdf, 0, nrf, 0, ntf, 0, npf)
00036   call alloc_array3d(bvxuf, 0, nrf, 0, ntf, 0, npf)
00037   call alloc_array3d(bvyuf, 0, nrf, 0, ntf, 0, npf)
00038   call alloc_array3d(bvzuf, 0, nrf, 0, ntf, 0, npf)
00039 !
00040   call alloc_array3d(hxxdf, 0, nrf, 0, ntf, 0, npf)
00041   call alloc_array3d(hxydf, 0, nrf, 0, ntf, 0, npf)
00042   call alloc_array3d(hxzdf, 0, nrf, 0, ntf, 0, npf)
00043   call alloc_array3d(hyydf, 0, nrf, 0, ntf, 0, npf)
00044   call alloc_array3d(hyzdf, 0, nrf, 0, ntf, 0, npf)
00045   call alloc_array3d(hzzdf, 0, nrf, 0, ntf, 0, npf)
00046 !
00047   call interpo_gr2fl(alph, alphf)
00048   call interpo_gr2fl(psi, psif)
00049   call interpo_gr2fl(bvxd, bvxdf)
00050   call interpo_gr2fl(bvyd, bvydf)
00051   call interpo_gr2fl(bvzd, bvzdf)
00052   call interpo_gr2fl(bvxu, bvxuf)
00053   call interpo_gr2fl(bvyu, bvyuf)
00054   call interpo_gr2fl(bvzu, bvzuf)
00055 !
00056   call interpo_gr2fl(hxxd, hxxdf)
00057   call interpo_gr2fl(hxyd, hxydf)
00058   call interpo_gr2fl(hxzd, hxzdf)
00059   call interpo_gr2fl(hyyd, hyydf)
00060   call interpo_gr2fl(hyzd, hyzdf)
00061   call interpo_gr2fl(hzzd, hzzdf)
00062 !
00063   do ipf = 0, npf
00064     do itf = 0, ntf
00065       do irf = 0, nrf
00066         emdw = emd(irf,itf,ipf)
00067         if (emdw <= small) emdw = small
00068         psiw = psif(irf,itf,ipf)
00069         alphw = alphf(irf,itf,ipf)
00070         bvxufw = bvxuf(irf,itf,ipf)
00071         bvyufw = bvyuf(irf,itf,ipf)
00072         bvzufw = bvzuf(irf,itf,ipf)
00073         bvxdfw = bvxdf(irf,itf,ipf)
00074         bvydfw = bvydf(irf,itf,ipf)
00075         bvzdfw = bvzdf(irf,itf,ipf)
00076         call peos_q2hprho(emdw, hhw, prew, rhow, ene)
00077         utw = hhw/ber
00078 !
00079         vphif(1) = vec_phif(irf,itf,ipf,1)
00080         vphif(2) = vec_phif(irf,itf,ipf,2)
00081         vphif(3) = vec_phif(irf,itf,ipf,3)
00082 !
00083         hhxxdf = hxxdf(irf,itf,ipf)
00084         hhxydf = hxydf(irf,itf,ipf)
00085         hhxzdf = hxzdf(irf,itf,ipf)
00086         hhyydf = hyydf(irf,itf,ipf)
00087         hhyzdf = hyzdf(irf,itf,ipf)
00088         hhzzdf = hzzdf(irf,itf,ipf)
00089         hhyxdf = hhxydf
00090         hhzxdf = hhxzdf
00091         hhzydf = hhyzdf
00092 !        
00093         otermx = bvxdfw + ome*vphif(1) &
00094              &   + hhxxdf*ome*vphif(1) &
00095              &   + hhxydf*ome*vphif(2) &
00096              &   + hhxzdf*ome*vphif(3)
00097         otermy = bvydfw + ome*vphif(2) &
00098              &   + hhyxdf*ome*vphif(1) &
00099              &   + hhyydf*ome*vphif(2) &
00100              &   + hhyzdf*ome*vphif(3)
00101         otermz = bvzdfw + ome*vphif(3) &
00102              &   + hhzxdf*ome*vphif(1) &
00103              &   + hhzydf*ome*vphif(2) &
00104              &   + hhzzdf*ome*vphif(3)
00105 !
00106         rhoHw = hhw*rhow*(alphw*utw)**2 - prew
00107         esseS = -hhw*rhow + 4.0d0*prew + rhoHw
00108 ! 
00109         rjjx = hhw*rhow*alphw*utw**2*psiw**4*otermx
00110         rjjy = hhw*rhow*alphw*utw**2*psiw**4*otermy
00111         rjjz = hhw*rhow*alphw*utw**2*psiw**4*otermz
00112 !
00113         rjjbeta = rjjx*bvxufw + rjjy*bvyufw + rjjz*bvzufw
00114 !
00115         souf(irf,itf,ipf) = (alphw*(esseS+rhoHw) - 2.0d0*rjjbeta)*psiw**6
00116       end do
00117     end do
00118   end do
00119 !
00120   deallocate(psif)
00121   deallocate(alphf)
00122   deallocate(bvxdf)
00123   deallocate(bvydf)
00124   deallocate(bvzdf)
00125   deallocate(bvxuf)
00126   deallocate(bvyuf)
00127   deallocate(bvzuf)
00128 !
00129   deallocate(hxxdf)
00130   deallocate(hxydf)
00131   deallocate(hxzdf)
00132   deallocate(hyydf)
00133   deallocate(hyzdf)
00134   deallocate(hzzdf)
00135 !
00136 end subroutine source_komar_mass_compact_WL

Generated on 27 Oct 2011 for Cocal by  doxygen 1.6.1