00001 subroutine calc_vector_irg(sb,irg)
00002   use phys_constant, only : long
00003   use grid_parameter, only : nrf, ntf, npf, nrg, ntg, npg
00004   use coordinate_grav_r, only : rg, hrg
00005   use trigonometry_grav_theta, only : sinthg, hsinthg, costhg, hcosthg
00006   use trigonometry_grav_phi, only : sinphig, cosphig, hsinphig, hcosphig
00007   use def_binary_parameter, only : dis
00008 
00009   use def_vector_irg
00010   use interface_interpo_linear_type0_2Dsurf
00011   implicit none
00012   real(long) :: rrgg, sth, cth, sphi, cphi, dis_bin
00013 
00014   integer :: irg, itg, ipg, sb, ii
00015 
00016   dis_bin = dis
00017   if(sb.eq.1) dis_bin = 0.0d0   
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037   do ipg = 0, npg
00038     do itg = 0, ntg
00039 
00040       rrgg = rg(irg)
00041       sth  = sinthg(itg)
00042       cth  = costhg(itg)
00043       sphi = sinphig(ipg)
00044       cphi = cosphig(ipg)
00045       vec_irg_cm_xg(itg,ipg,1) = - dis_bin + rrgg*sth*cphi
00046       vec_irg_cm_xg(itg,ipg,2) =             rrgg*sth*sphi
00047       vec_irg_cm_xg(itg,ipg,3) =             rrgg*cth
00048       vec_irg_cm_phig(itg,ipg,1) =           - rrgg*sth*sphi
00049       vec_irg_cm_phig(itg,ipg,2) = - dis_bin + rrgg*sth*cphi
00050       vec_irg_cm_phig(itg,ipg,3) = 0.0d0
00051       vec_irg_cbh_xg(itg,ipg,1) = rrgg*sth*cphi
00052       vec_irg_cbh_xg(itg,ipg,2) = rrgg*sth*sphi
00053       vec_irg_cbh_xg(itg,ipg,3) = rrgg*cth
00054       vec_irg_cbh_phig(itg,ipg,1) = - rrgg*sth*sphi
00055       vec_irg_cbh_phig(itg,ipg,2) =   rrgg*sth*cphi
00056       vec_irg_cbh_phig(itg,ipg,3) = 0.0d0
00057 
00058 
00059 
00060 
00061 
00062 
00063       if (itg.eq.0.or.ipg.eq.0) cycle
00064       rrgg = rg(irg) 
00065       sth  = hsinthg(itg)
00066       cth  = hcosthg(itg)
00067       sphi = hsinphig(ipg)
00068       cphi = hcosphig(ipg)
00069       hvec_irg_cm_xg(itg,ipg,1) = - dis_bin + rrgg*sth*cphi
00070       hvec_irg_cm_xg(itg,ipg,2) =             rrgg*sth*sphi
00071       hvec_irg_cm_xg(itg,ipg,3) =             rrgg*cth
00072       hvec_irg_cm_phig(itg,ipg,1) =           - rrgg*sth*sphi
00073       hvec_irg_cm_phig(itg,ipg,2) = - dis_bin + rrgg*sth*cphi
00074       hvec_irg_cm_phig(itg,ipg,3) = 0.0d0
00075       hvec_irg_cbh_xg(itg,ipg,1) = rrgg*sth*cphi
00076       hvec_irg_cbh_xg(itg,ipg,2) = rrgg*sth*sphi
00077       hvec_irg_cbh_xg(itg,ipg,3) = rrgg*cth
00078       hvec_irg_cbh_phig(itg,ipg,1) = - rrgg*sth*sphi
00079       hvec_irg_cbh_phig(itg,ipg,2) =   rrgg*sth*cphi
00080       hvec_irg_cbh_phig(itg,ipg,3) = 0.0d0
00081 
00082 
00083 
00084 
00085 
00086 
00087     end do
00088   end do
00089 end subroutine calc_vector_irg