~abenson/galacticus/v0.9.0

« back to all changes in this revision

Viewing changes to source/stellar_astrophysics.supernovae_type_Ia.Nagashima.F90

  • Committer: Andrew Benson
  • Date: 2010-05-27 14:18:28 UTC
  • Revision ID: abesnson@its.caltech.edu-20100527141828-dzvnjovtiq02impa
* Importing full Galacticus code as developed to date.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
!% Contains a module which implements calculations related to Type Ia supernovae.
 
2
 
 
3
module Supernovae_Type_Ia_Nagashima
 
4
  !% Implements calculations related to Type Ia supernovae.
 
5
  private
 
6
  public :: Supernovae_Type_Ia_Nagashima_Initialize
 
7
  
 
8
  ! Parameters of the distribution of binaries from Nagashima et al. (2005; MNRAS; 358; 1427; eqn. 17).
 
9
  double precision :: binaryMassMinimum  =3.00d0, binaryMassMaximum=12.0d0
 
10
  double precision :: typeIaNormalization=0.07d0, gamma            = 2.0d0
 
11
 
 
12
  ! Total yield of metals from Type Ia supernova.
 
13
  double precision :: totalYield
 
14
 
 
15
contains
 
16
 
 
17
  !# <supernovaeIaMethod>
 
18
  !#  <unitName>Supernovae_Type_Ia_Nagashima_Initialize</unitName>
 
19
  !# </supernovaeIaMethod>
 
20
  subroutine Supernovae_Type_Ia_Nagashima_Initialize(supernovaeIaMethod,SNeIa_Cumulative_Number_Get,SNeIa_Cumulative_Yield_Get)
 
21
    !% Initialize the ``Nagashima'' Type Ia supernovae module.
 
22
    use Numerical_Constants_Units
 
23
    use Numerical_Constants_Prefixes
 
24
    use Numerical_Constants_Astronomical
 
25
    use ISO_Varying_String
 
26
    use Galacticus_Error
 
27
    use FoX_dom
 
28
    implicit none
 
29
    type(varying_string), intent(in) :: supernovaeIaMethod
 
30
    procedure(),          pointer    :: SNeIa_Cumulative_Number_Get,SNeIa_Cumulative_Yield_Get
 
31
    type(Node),           pointer    :: doc,thisIsotope,thisYield
 
32
    type(NodeList),       pointer    :: isotopesList,propertyList
 
33
    integer                          :: iIsotope,ioErr
 
34
    double precision                 :: isotopeYield
 
35
 
 
36
    if (supernovaeIaMethod == 'Nagashima') then
 
37
       ! Set up pointers to our procedures.
 
38
       SNeIa_Cumulative_Number_Get => SNeIa_Cumulative_Number_Nagashima
 
39
       SNeIa_Cumulative_Yield_Get  => SNeIa_Cumulative_Yield_Nagashima
 
40
       ! Read in Type Ia yields.
 
41
       !$omp critical (FoX_DOM_Access)
 
42
       ! Open the XML file containing yields.
 
43
       doc => parseFile('data/Supernovae_Type_Ia_Yields.xml',iostat=ioErr)
 
44
       if (ioErr /= 0) call Galacticus_Error_Report('Supernovae_Type_Ia_Nagashima_Initialize','Unable to parse yields file')
 
45
 
 
46
       ! Get a list of all isotopes.
 
47
       isotopesList => getElementsByTagname(doc,"isotope")
 
48
 
 
49
       ! Loop through isotopes and compute the net metal yield.
 
50
       do iIsotope=0,getLength(isotopesList)-1
 
51
          thisIsotope  => item(isotopesList,iIsotope)
 
52
          propertyList => getElementsByTagname(thisIsotope,"yield")
 
53
          if (getLength(propertyList) /= 1) call Galacticus_Error_Report('Supernovae_Type_Ia_Nagashima_Initialize','isotope must have precisely one yield')
 
54
          thisYield => item(propertyList,0)
 
55
          call extractDataContent(thisYield,isotopeYield)
 
56
          totalYield=totalYield+isotopeYield
 
57
       end do
 
58
 
 
59
       ! Destroy the document.
 
60
       call destroy(doc)
 
61
 
 
62
       !$omp end critical (FoX_DOM_Access)
 
63
    end if
 
64
    return
 
65
  end subroutine Supernovae_Type_Ia_Nagashima_Initialize
 
66
 
 
67
  double precision function SNeIa_Cumulative_Number_Nagashima(initialMass,age,metallicity)
 
68
    !% Compute the cumulative number of Type Ia supernovae originating per unit mass of stars that form with given {\tt
 
69
    !% initialMass} and {\tt metallicity} after a time {\tt age}. The calculation is based on that of \cite{nagashima_metal_2005}. The
 
70
    !% number returned here assumes a distribution of binary mass ratios and so only makes sense once it is integrated over an initial
 
71
    !% mass function.
 
72
    use Stellar_Astrophysics
 
73
    implicit none
 
74
    double precision, intent(in) :: initialMass,age,metallicity
 
75
    double precision             :: dyingStarMass,muMinimum
 
76
 
 
77
    ! Check if initial mass is within the range of binary masses that lead to Type Ia supernovae.
 
78
    if (initialMass > binaryMassMinimum .and. initialMass < binaryMassMaximum) then
 
79
       
 
80
       ! Get the initial mass of a star which is just dying at this age.
 
81
       dyingStarMass=Star_Initial_Mass(age,metallicity)
 
82
       
 
83
       ! Compute the cumulative number of Type Ia supernovae originating from stars of this mass.
 
84
       muMinimum=max(dyingStarMass/initialMass,(1.0d0-binaryMassMaximum/2.0d0/initialMass))
 
85
       if (muMinimum < 0.5d0) then
 
86
          SNeIa_Cumulative_Number_Nagashima=typeIaNormalization*(1.0d0-(2.0d0*muMinimum)**(1.0d0+gamma))
 
87
       else
 
88
          SNeIa_Cumulative_Number_Nagashima=0.0d0      
 
89
       end if
 
90
      
 
91
    else
 
92
       ! Mass is not in range - assume that no Type Ia SNe are produced.
 
93
       SNeIa_Cumulative_Number_Nagashima=0.0d0
 
94
    end if
 
95
    return
 
96
  end function SNeIa_Cumulative_Number_Nagashima
 
97
 
 
98
  double precision function SNeIa_Cumulative_Yield_Nagashima(initialMass,age,metallicity)
 
99
    !% Compute the cumulative yield from Type Ia supernovae originating per unit mass of stars that form with given {\tt
 
100
    !% initialMass} and {\tt metallicity} after a time {\tt age}. The calculation is based on the Type Ia rate calculation of
 
101
    !% \cite{nagashima_metal_2005} and the Type Ia yields from \cite{nomoto_nucleosynthesis_1997}. The number returned here
 
102
    !% assumes a distribution of binary mass ratios and so only makes sense once it is integrated over an initial mass function.
 
103
    use Stellar_Astrophysics
 
104
    implicit none
 
105
    double precision, intent(in) :: initialMass,age,metallicity
 
106
 
 
107
    SNeIa_Cumulative_Yield_Nagashima=SNeIa_Cumulative_Number_Nagashima(initialMass,age,metallicity)*totalYield
 
108
    return
 
109
  end function SNeIa_Cumulative_Yield_Nagashima
 
110
 
 
111
end module Supernovae_Type_Ia_Nagashima