00001 subroutine source_adm_mass(soug,souf)
00002   use phys_constant, only  :   long, pi
00003   use grid_parameter, only  :   nrg, ntg, npg, nrf, ntf, npf
00004   use def_matter, only  :   emdg, emd
00005   use def_matter_parameter, only  :  radi, pinx, ber
00006   use def_metric, only  :   tfkijkij, psi, alph
00007   use make_array_3d
00008   use interface_interpo_gr2fl
00009   use interface_interpo_linear_type0
00010   implicit none
00011   real(long), pointer :: soug(:,:,:)
00012   real(long), pointer :: souf(:,:,:)
00013   real(long), pointer :: alphf(:,:,:), psif(:,:,:) 
00014   integer     ::   irg,itg,ipg,irf,itf,ipf
00015   real(long)  ::   psiwm7
00016   real(long)  ::   emdw, alphw, psiw, rhow, prew, hhw, utw, rhoHw
00017   real(long)  ::   epsilonw, alutw
00018   real(long)  ::   zfac, small = 1.0d-15
00019 
00020   call alloc_array3d(psif, 0, nrf, 0, ntf, 0, npf)
00021   call alloc_array3d(alphf, 0, nrf, 0, ntf, 0, npf)
00022   call interpo_gr2fl(alph, alphf)
00023   call interpo_gr2fl(psi, psif)
00024 
00025   do ipg = 1, npg
00026     do itg = 1, ntg
00027       do irg = 1, nrg
00028         call interpo_linear_type0(psiw,psi,irg,itg,ipg)
00029         soug(irg,itg,ipg) = 0.125d0*psiw**5*tfkijkij(irg,itg,ipg)
00030       end do
00031     end do
00032   end do
00033 
00034   do ipf = 0, npf
00035     do itf = 0, ntf
00036       do irf = 0, nrf
00037         emdw = emd(irf,itf,ipf)
00038         if (emdw <= small) emdw = small
00039         psiw = psif(irf,itf,ipf)
00040         alphw = alphf(irf,itf,ipf)
00041         rhow = emdw**pinx
00042         prew = rhow*emdw
00043         epsilonw = emdw**pinx*(1.0d0+pinx*emdw)
00044         hhw  = 1.0d0 + (pinx+1.0d0)*emdw
00045         utw = hhw/ber
00046 
00047         alutw = alphw*utw
00048 
00049 
00050         souf(irf,itf,ipf) = 2.0d0*pi*psiw**5  &
00051         &  *(epsilonw*alutw**2 + prew*(alutw-1.0d0)*(alutw+1.0d0))
00052       end do
00053     end do
00054   end do
00055 
00056   deallocate(alphf)
00057   deallocate(psif)
00058 end subroutine source_adm_mass