00001 subroutine calc_redblue_shift
00002   use phys_constant, only  : long, pi
00003   use coordinate_grav_r, only : rg
00004   use grid_parameter, only : nrf, ntf, npf, &
00005   &                          ntfpolp, ntfeq, ntfxy, npfxzp, npfyzp
00006   use trigonometry_grav_theta, only : sinthg, costhg
00007   use trigonometry_grav_phi, only : sinphig, cosphig
00008   use def_metric, only : psi, alph, bvxd, bvyd, bvzd
00009   use def_matter, only : rs
00010   use def_matter_parameter, only : ome, ber, radi
00011   use def_quantities, only : zrb_xp_plus, zrb_xp_minus, &
00012   &                          zrb_yp_plus, zrb_yp_minus, &
00013   &                          zrb_zp_plus, zrb_zp_minus
00014   use interface_interpo_radial1p_grav
00015   implicit none
00016   integer    :: ir, it, ip, ii
00017   real(long) :: rv, xx, yy, zz, vphixu, vphiyu, vphizu
00018   real(long) :: psiw, alphw, bvxdw, bvydw, bvzdw
00019   real(long) :: gtt, gtp, gpp, hhgc, utgc, bplus, bminus
00020   real(long) :: kdott_plus, kdotu_plus, kdott_minus, kdotu_minus
00021 
00022 
00023 
00024 
00025   do ii = 1, 2
00026     if (ii.eq.1) then; it = ntfeq; ip = npfxzp; end if
00027     if (ii.eq.2) then; it = ntfeq; ip = npfyzp; end if
00028 
00029     rv = rg(nrf)*rs(it,ip)
00030     xx = rv*sinthg(it)*cosphig(ip)
00031     yy = rv*sinthg(it)*sinphig(ip)
00032     zz = rv*costhg(it)
00033     vphixu = - yy
00034     vphiyu =   xx
00035     vphizu =   0.0d0
00036     hhgc  = 1.0d0
00037     utgc  = hhgc/ber
00038     call interpo_radial1p_grav(psi,psiw,rv,it,ip) 
00039     call interpo_radial1p_grav(alph,alphw,rv,it,ip) 
00040     call interpo_radial1p_grav(bvxd,bvxdw,rv,it,ip) 
00041     call interpo_radial1p_grav(bvyd,bvydw,rv,it,ip) 
00042     call interpo_radial1p_grav(bvzd,bvzdw,rv,it,ip) 
00043 
00044     gtt = - alphw**2 + psiw**4*(bvxdw**2 + bvydw**2 + bvzdw**2)
00045     gtp =   psiw**4*(bvxdw*vphixu + bvydw*vphiyu + bvzdw*vphizu)
00046     gpp =   psiw**4*(vphixu**2 + vphiyu**2 + vphizu**2)
00047     bplus = (- gtp + sqrt(gtp**2 - gtt*gpp))/gpp
00048     bminus = (- gtp - sqrt(gtp**2 - gtt*gpp))/gpp
00049 
00050     kdott_plus = gtt + bplus*gtp
00051     kdotu_plus = utgc*(gtt + (bplus + ome)*gtp + bplus*ome*gpp)
00052     kdott_minus = gtt + bminus*gtp
00053     kdotu_minus = utgc*(gtt + (bminus + ome)*gtp + bminus*ome*gpp)
00054 
00055     if (ii.eq.1) then
00056       zrb_xp_plus = kdotu_plus/kdott_plus - 1.0d0
00057       zrb_xp_minus = kdotu_minus/kdott_minus - 1.0d0
00058     end if
00059     if (ii.eq.2) then
00060       zrb_yp_plus = kdotu_plus/kdott_plus - 1.0d0
00061       zrb_yp_minus = kdotu_minus/kdott_minus - 1.0d0
00062     end if
00063 
00064   end do
00065 
00066   hhgc  = 1.0d0
00067   utgc  = hhgc/ber
00068   zrb_zp_plus = utgc - 1.0d0
00069   zrb_zp_minus = utgc - 1.0d0
00070 
00071 end subroutine calc_redblue_shift