31 use sufr_kinds
, only: double
32 use sufr_system
, only: quit_program_error, syntax_quit
35 real(double) :: eta,eta1,mc,m1,m2,mtot
36 character :: tmpstr*(99)
38 if(command_argument_count().eq.2)
then
39 call get_command_argument(1,tmpstr)
41 call get_command_argument(2,tmpstr)
44 call syntax_quit(
'<Mc> <eta>', 0,
'This program converts masses expressed in Mchirp and eta to M1 and M2')
47 if(eta.lt.0.d0.or.eta.gt.0.5d0) call quit_program_error(
'eta should be 0.0 <= eta <= 0.5', 0)
49 if(eta.le.0.25d0)
then
50 write(6,
'(/,A,2F15.8)')
' Mc, eta: ',mc,eta
53 write(*,
'(/,A,2F15.8,A,F8.5,A1)')
' Warning: eta > 0.25; Mapping it to 0.5-eta:'
54 write(*,
'(A,2F15.8,A,F8.5,A1)')
' Mc, eta: ',mc,eta,
' (->',eta1,
')'
58 mtot = mc/eta**(3.d0/5.d0)
59 m1 = mtot/2.d0 * (1.d0 + sqrt(1.d0 - 4*eta))
60 m2 = mtot/2.d0 * (1.d0 - sqrt(1.d0 - 4*eta))
63 write(*,
'(2x,A,2F15.8)')
'M1, M2: ',m1,m2
64 write(*,
'(2x,A,2F15.8)')
'M1/M2, M: ',m1/m2,m1+m2