00001 subroutine read_parameter_pbh 00002 use phys_constant, only : long, pi 00003 use def_bh_parameter 00004 implicit none 00005 character(len=3) :: spin_input 00006 real(long) :: spin_bh_xy 00007 open(1,file='pbhpar.dat',status='old') 00008 read(1,'(1p,1e14.6,2x,a3)') mass_pBH, spin_input 00009 read(1,'(1p,2e14.6)') ome_bh, spin_bh 00010 read(1,'(1p,2e14.6)') th_spin_bh_deg, phi_spin_bh_deg 00011 read(1,'(1p,2e14.6)') mom_pBH(1), spin_pBH(1) 00012 read(1,'(1p,2e14.6)') mom_pBH(2), spin_pBH(2) 00013 read(1,'(1p,2e14.6)') mom_pBH(3), spin_pBH(3) 00014 close(1) 00015 if (spin_input.eq.'ANG') then 00016 th_spin_bh = pi* th_spin_bh_deg/180.0d0 00017 phi_spin_bh = pi*phi_spin_bh_deg/180.0d0 00018 spin_pBH(1) = spin_bh*dsin(th_spin_bh)*dcos(phi_spin_bh) 00019 spin_pBH(2) = spin_bh*dsin(th_spin_bh)*dsin(phi_spin_bh) 00020 spin_pBH(3) = spin_bh*dcos(th_spin_bh) 00021 else 00022 spin_bh = dsqrt(spin_pBH(1)**2 + spin_pBH(2)**2 + spin_pBH(3)**2) 00023 spin_bh_xy = dsqrt(spin_pBH(1)**2 + spin_pBH(2)**2) 00024 if (spin_bh.eq.0.0d0) then 00025 th_spin_bh = 0.0d0 ; th_spin_bh_deg = 0.0 00026 phi_spin_bh = 0.0d0 ; phi_spin_bh_deg = 0.0 00027 else if (spin_bh_xy.eq.0.0d0) then 00028 th_spin_bh = dmod(atan2(spin_bh_xy,spin_pbh(3))+2.0d0*pi,2.0d0*pi) 00029 th_spin_bh_deg = th_spin_bh*180.0d0/pi 00030 phi_spin_bh = 0.0d0 ; phi_spin_bh_deg = 0.0 00031 else 00032 th_spin_bh = dmod(atan2(spin_bh_xy,spin_pbh(3))+2.0d0*pi,2.0d0*pi) 00033 th_spin_bh_deg = th_spin_bh*180.0d0/pi 00034 phi_spin_bh = dmod(atan2(spin_pbh(2),spin_pbh(1))+2.0d0*pi,2.0d0*pi) 00035 phi_spin_bh_deg = phi_spin_bh*180.0d0/pi 00036 end if 00037 end if 00038 bh_sptype = 'SP' 00039 if (th_spin_bh_deg.eq.90.0.or.phi_spin_bh_deg.eq. 0.0) bh_sptype = 'Xp' 00040 if (th_spin_bh_deg.eq.90.0.or.phi_spin_bh_deg.eq. 90.0) bh_sptype = 'Yp' 00041 if (th_spin_bh_deg.eq.90.0.or.phi_spin_bh_deg.eq.180.0) bh_sptype = 'Xm' 00042 if (th_spin_bh_deg.eq.90.0.or.phi_spin_bh_deg.eq.270.0) bh_sptype = 'Ym' 00043 if (th_spin_bh_deg.eq. 0.0) bh_sptype = 'Zp' 00044 if (th_spin_bh_deg.eq.180.0) bh_sptype = 'Zm' 00045 end subroutine read_parameter_pbh