GWtool
Gravitational-wave tool
 All Classes Files Functions Variables Pages
gw_final_period.f90
Go to the documentation of this file.
1 !> \file gw_final_period.f90 Calculates the orbital period of a detached stellar binary after a given time of GW 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 orbital period of a detached stellar binary after a given time of GW evolution
30 
32  use sufr_kinds, only: double
33  use sufr_system, only: syntax_quit
34  use sufr_constants, only: set_sufr_constants, c3rd,pi2, pc_g,pc_c, msun, solday,julyear
35 
36  implicit none
37  real(double) :: m1,m2,time,cst,pin,pf83,pf
38  character :: tmpstr*(99)
39 
40  if(command_argument_count().eq.4) then
41  call get_command_argument(1, tmpstr)
42  read(tmpstr,*) m1
43  call get_command_argument(2, tmpstr)
44  read(tmpstr,*) m2
45  call get_command_argument(3, tmpstr)
46  read(tmpstr,*) pin
47  call get_command_argument(4, tmpstr)
48  read(tmpstr,*) time
49  else
50  call syntax_quit('<M1> <M2> <Pi> <t> (Mo, days and yr)', 0, &
51  'This program calculates the orbital period of a detached stellar binary after a given time of GW evolution')
52  end if
53 
54  call set_sufr_constants()
55 
56  cst = 5.d0/256.d0 * pi2**(-8.d0*c3rd) * pc_c**5 / pc_g**(5.d0*c3rd) * (m1+m2)**c3rd / (m1*m2*msun**(5.d0*c3rd))
57  pf83 = (pin*solday)**(8.d0*c3rd) - time*julyear/cst ! Pf^8/3
58 
59 
60  write(*,*)
61  if(pf83.lt.0.d0) then
62  write(*,'(2x,A,ES11.3,A)') 'System has already merged after ',time,' yr.'
63  pf83 = 0.d0
64  end if
65 
66  pf = pf83 ** 0.375d0 / solday
67 
68  write(*,'(2x,A,ES20.9,A5)') 'Pf: ',pf,' days'
69  write(*,'(2x,A,ES20.9,A5)') 'Pf/Pi: ',pf/pin,''
70  write(*,*)
71 
72 end program gw_final_period
73 !***********************************************************************************************************************************
74 
program gw_final_period
Calculates the orbital period of a detached stellar binary after a given time of GW evolution...