00001 subroutine sourceterm_MoC_CF_corot(souvec)
00002 use phys_constant, only : long, pi
00003 use grid_parameter, only : nrg, ntg, npg
00004 use coordinate_grav_r, only : hrg
00005 use trigonometry_grav_theta, only : hsinthg, hcosthg
00006 use trigonometry_grav_phi, only : hsinphig, hcosphig
00007 use def_metric, only : psi, alph, bvxd, bvyd, bvzd
00008 use def_matter, only : emdg
00009 use def_matter_parameter, only : ome, ber, radi
00010 use def_vector_phi, only : hvec_phig
00011 use make_array_3d
00012 use interface_grgrad_midpoint
00013 use interface_interpo_linear_type0
00014 implicit none
00015 real(long), pointer :: souvec(:,:,:,:)
00016 real(long) :: vphig(3)
00017 real(long) :: emdgc, rhogc, pregc, hhgc, ene, utgc, oterm, zfac, rjj
00018 real(long) :: psigc, alpgc
00019 real(long) :: bvxdgc, bvydgc, bvzdgc
00020 integer :: ii, irg, itg, ipg
00021
00022
00023
00024
00025 do ii = 1, 3
00026 do ipg = 1, npg
00027 do itg = 1, ntg
00028 do irg = 1, nrg
00029 call interpo_linear_type0(emdgc,emdg,irg,itg,ipg)
00030 call interpo_linear_type0(psigc,psi,irg,itg,ipg)
00031 call interpo_linear_type0(alpgc,alph,irg,itg,ipg)
00032 call interpo_linear_type0(bvxdgc,bvxd,irg,itg,ipg)
00033 call interpo_linear_type0(bvydgc,bvyd,irg,itg,ipg)
00034 call interpo_linear_type0(bvzdgc,bvzd,irg,itg,ipg)
00035
00036 zfac = 1.0d0
00037 if (emdgc <= 1.0d-15) then
00038 emdgc = 1.0d-15
00039 zfac = 0.0d0
00040 end if
00041 call peos_q2hprho(emdgc, hhgc, pregc, rhogc, ene)
00042 utgc = hhgc/ber
00043 vphig(1) = hvec_phig(irg,itg,ipg,1)
00044 vphig(2) = hvec_phig(irg,itg,ipg,2)
00045 vphig(3) = hvec_phig(irg,itg,ipg,3)
00046 oterm = 0.0d0
00047 if (ii == 1) oterm = bvxdgc + ome*vphig(1)
00048 if (ii == 2) oterm = bvydgc + ome*vphig(2)
00049 if (ii == 3) oterm = bvzdgc + ome*vphig(3)
00050 rjj = hhgc*rhogc*alpgc*utgc**2*psigc**4*oterm
00051
00052 souvec(irg,itg,ipg,ii) = radi**2*16.0d0*pi*alpgc*rjj*zfac
00053 end do
00054 end do
00055 end do
00056 end do
00057
00058 end subroutine sourceterm_MoC_CF_corot