GWtool
Gravitational-wave tool
 All Classes Files Functions Variables Pages
gw_m1m2-mceta.f90
Go to the documentation of this file.
1 !> \file gw_m1m2-mceta.f90 Compute Mc and eta from M1 and M2
2 
3 
4 !
5 ! GWtool: Simple tools for working with gravitational waves
6 ! http://gwtool.sourceforge.net/
7 !
8 !
9 ! Copyright 2007-2013 AstroFloyd - astrofloyd.org
10 !
11 !
12 ! This file is part of GWtool.
13 !
14 ! GWtool is free software: you can redistribute it and/or modify
15 ! it under the terms of the GNU General Public License as published by
16 ! the Free Software Foundation, either version 3 of the License, or
17 ! (at your option) any later version.
18 !
19 ! GWtool is distributed in the hope that it will be useful,
20 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ! GNU General Public License for more details.
23 !
24 ! You should have received a copy of the GNU General Public License
25 ! along with GWtool. If not, see <http://www.gnu.org/licenses/>.
26 
27 
28 
29 !***********************************************************************************************************************************
31  use sufr_kinds, only: double
32  use sufr_system, only: syntax_quit
33 
34  implicit none
35  real(double) :: eta,mc,m1,m2,m
36  character :: bla*(99)
37 
38  if(command_argument_count().eq.2) then
39  call get_command_argument(1,bla)
40  read(bla,*)m1
41  call get_command_argument(2,bla)
42  read(bla,*)m2
43  else
44  call syntax_quit('<m1> <m2>', 0, 'This program converts masses in M1, M2 to Mchirp and eta')
45  end if
46 
47  m = m1+m2
48  eta = m1*m2/(m*m)
49  mc = m*eta**0.6d0
50 
51  write(*,*)''
52  write(*,'(2x,A,2F15.8)') 'M1, M2: ',m1,m2
53  write(*,'(2x,A,2F15.8)') 'Mc, eta: ',mc,eta
54  write(*,'(2x,A,3F15.8)') 'M1/M2, M2/M1, M: ',m1/m2,m2/m1,m
55  write(*,*)''
56 
57 end program gw_m1m2_mceta
58 !***********************************************************************************************************************************
59 
program gw_m1m2_mceta