GWtool
Gravitational-wave tool
 All Classes Files Functions Variables Pages
gw_coalescence_time.f90
Go to the documentation of this file.
1 !> \file gw_coalescence_time.f90 Calculates the time needed to reach a certain Porb (default 0) using gravitational-wave evolution
2 
3 !
4 ! GWtool: Simple tools for working with gravitational waves
5 ! http://gwtool.sourceforge.net/
6 !
7 !
8 ! Copyright 2007-2013 AstroFloyd - astrofloyd.org
9 !
10 !
11 ! This file is part of GWtool.
12 !
13 ! GWtool is free software: you can redistribute it and/or modify
14 ! it under the terms of the GNU General Public License as published by
15 ! the Free Software Foundation, either version 3 of the License, or
16 ! (at your option) any later version.
17 !
18 ! GWtool is distributed in the hope that it will be useful,
19 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ! GNU General Public License for more details.
22 !
23 ! You should have received a copy of the GNU General Public License
24 ! along with GWtool. If not, see <http://www.gnu.org/licenses/>.
25 
26 
27 
28 !***********************************************************************************************************************************
29 !> \brief Calculates the time needed to reach a certain Porb (default 0) using gravitational-wave evolution
30 
32  use sufr_kinds, only: double
33  use sufr_constants, only: set_sufr_constants, pi2,msun,julyear,solday,c3rd, pc_g,pc_c
34  use sufr_system, only: syntax_quit
35 
36  implicit none
37  integer :: narg
38  real(double) :: trl,m1,m2,pin,pf,cst
39  character :: tmpstr*(99)
40 
41  ! Check command-line arguments:
42  narg = command_argument_count()
43  if(narg.eq.3.or.narg.eq.4) then
44  call get_command_argument(1,tmpstr)
45  read(tmpstr,*) m1
46  call get_command_argument(2,tmpstr)
47  read(tmpstr,*) m2
48  call get_command_argument(3,tmpstr)
49  read(tmpstr,*) pin
50 
51  pf = 0.d0
52  if(narg.eq.4) then
53  call get_command_argument(4,tmpstr)
54  read(tmpstr,*) pf
55  end if
56  else
57  call syntax_quit('<M1> <M2> <Pi> [<Pf>] (Mo and days, default Pf=0)',0, &
58  'This program calculates the time needed to reach a ceratain Porb with gravitational waves')
59  end if
60 
61 
62  call set_sufr_constants()
63 
64  cst = 5.d0/256.d0 * pi2**(-8.d0*c3rd) * pc_c**5 / pc_g**(5*c3rd) * (m1+m2)**c3rd/(m1*m2 * msun**(5*c3rd))
65 
66  pin = pin * solday
67  pf = pf * solday
68  trl = ( pin**(8*c3rd) - pf**(8*c3rd) ) * cst/julyear
69 
70  write(*,'(A,ES15.7,A,/)')' Time needed: ',trl,' yr'
71 
72 end program gw_coalescence_time
73 !***********************************************************************************************************************************
74 
program gw_coalescence_time
Calculates the time needed to reach a certain Porb (default 0) using gravitational-wave evolution...