Metal modules
Modules and functions for the handling of metals
Metals
Description
main module for handling metals
Quick access
- Types
- Variables
- Routines
append()
,get_element_index()
,get_element_info()
,init_element()
Needed modules
Types
- type metals/element
container type for individual elements
- Type fields
% atomic_mass [real]
% element_name [character]
% solar_abund [real]
Variables
- metals/index_carbon [integer,optional/default=0]
- metals/index_iron [integer,optional/default=0]
index of carbon and iron in yields and metal arrays
- metals/n_elements [integer]
- metals/tracked_elements [element_list]
Subroutines and functions
- subroutine metals/append(this, el)
appends an element to an element list
- Parameters
this [real] :: the list of elements
el [element] :: the element to be appended
- function metals/get_element_index(this, el_name)
returns the the index at which an element is found in the yield table
- Parameters
this [real] :: list of tracked elements
el_name [character,in] :: name of the element to look up
- Return
i [integer]
- Called from
- function metals/init_element(el_name)
- Parameters
el_name [character,in]
- Return
this [element]
- Call to
- subroutine metals/get_element_info(el_name, atomic_mass, solar_abund)
- Parameters
el_name [character,in] :: which element are we looking up?
atomic_mass [real,out] :: mean atomic weight
solar_abund [real,out] :: converting from the log(X/H)+12 scale
- Called from
- Call to
Read Yields
Description
module for reading yields from the appropirate files
Quick access
Needed modules
populations
: This module contains the type for storing IMFs, and the properties of the stellar populationsmetals
: main module for handling metals
Subroutines and functions
- subroutine read_yields/assign_yields()
- Called from
- Call to
- subroutine read_yields/readelementid()
- Called from
- Call to
- subroutine read_yields/assign_yields_general(fileyields, pop)
- Parameters
fileyields [character,in]
pop [population,in] :: go through IMF bins
- Called from
- Call to
- subroutine read_yields/get_elem_num(f, num_ele, mass_num)
defines the number of elements and the number of different stellar masses in the yields file hard-coded file names. If you want to use a different table, add it here.
- Parameters
f [character,in] :: file name
num_ele [integer,out] :: number of elements in the file
mass_num [integer,out] :: number of masses in the table
- Called from
Metal functions
Description
Helper functions for handling metals and computing abundances and metallicities
Quick access
- Routines
add_to_m_metals()
,cfe()
,check_m_metals()
,coh()
,feh()
,get_m_metals()
,get_melement()
,get_metallicity()
,metalpoor()
,zcal()
Needed modules
metals
: main module for handling metals
Subroutines and functions
- function metal_functions/get_metallicity(m_h, mmetals, ii)
gas metallicity of this halo This function assumed homogeneous mixing of metals with gas Because this homogeneous metallicity is needed as input to calculate dZ in order to corret to an inhomogeneous metallicity
- Parameters
m_h [real,in]
mmetals [real,in] :: mass hydrogen, mass metals
ii [integer,in] :: index in abundance array
- Return
get_metallicity [real]
- Called from
- subroutine metal_functions/check_m_metals(thishalo)
if not yet allocated, allocate ThisHalo%m_metals and set to zero
- Parameters
thishalo [treenode]
- Called from
- subroutine metal_functions/add_to_m_metals(thishalo, mmetal, iadd)
add metals to %m_metals node property :p integer iadd [in]: is index of which metal type should be added
- Parameters
thishalo [treenode]
mmetal (n_elements) [real,in]
- Called from
- Call to
- function metal_functions/get_m_metals(thishalo, iget)
get metal mass array from %m_metals node property :p integer iget [in]: is index of which metal type is wanted
- Parameters
thishalo [treenode]
- Return
get_m_metals (n_elements) [real] :: function returns an array
- Called from
- Call to
- function metal_functions/get_melement(thishalo, index_metal)
get mass of this halo of one specific element
- function metal_functions/feh(thishalo, dz_now)
gas metallicity of this halo [Fe/H]
- Parameters
thishalo [treenode]
dz_now [real,in]
- Return
feh [real]
- Called from
- Call to
- function metal_functions/coh(thishalo, dz_now)
gas metallicity of this halo [C/H]
- Parameters
thishalo [treenode]
dz_now [real,in]
- Return
coh [real]
- Called from
- Call to
- function metal_functions/cfe(thishalo)
gas metallicity of this halo [C/Fe]
- Parameters
thishalo [treenode]
- Return
cfe [real]
- Call to
- function metal_functions/metalpoor(thishalo, z_in, dz_now)
- subroutine metal_functions/zcal(metallicity, gas, metals)
20200820 Li-Hsin This routine also calculates the metallciity but in linear scale. This is simply for the convenience when we want to keep information from the last time step.
- Parameters
metallicity [real,out]
gas [real,in]
metals [real,in]
IGM Metallicity routines
Description
utility routine for inheriting the IGM metallicity accross time
Quick access
- Routines
Needed modules
Subroutines and functions
Metal Mix dZ
Quick access
- Variables
- Routines
Needed modules
random_object
: This is an object oriented version of the ran3 algorithm from numerical recipes Before using a rng type object it needs to be initialized by calling rng%init(seed) where seed is an integer seed Afterwards rng%get_ran() will return a random real in the range [0,1)
Variables
- metalmix_dz/dztable_12 (1000) [real,protected]
- metalmix_dz/dztable_23 (1000) [real,protected]
- metalmix_dz/dztable_34 (1000) [real,protected]
- metalmix_dz/dztable_45 (1000) [real,protected]
- metalmix_dz/dztable_58 (1000) [real,protected]
Subroutines and functions
- subroutine metalmix_dz/read_lookups()
- Called from
- function metalmix_dz/dz_external(rng_obj, z)
dilution from Yuta Tarumi: ApJ, Volume 897, Issue 1, id.58 based on Renaissance Simulation dZ = (Mmetals/Mgas)_densestGas / (Mmetals/Mgas)_halo hydrogen mass in this halo / dZ = hydrogen mass with which metals mix in densest region
- function metalmix_dz/dz_internal(rng_obj)
- function metalmix_dz/calc_dz(m_metals_int, rng_obj, z_now)
metal mixing correction based on Tarumi+20, ApJ, Volume 897, Issue 1, id.58 dZ: log-differenze between metallicity of all gas in a halo and the dense gas
- Parameters
m_metals_int [real,in]
rng_obj [rng,inout]
z_now [real,in]
- Return
calc_dz [real]
- Called from
- Call to
Metallicity distribution function
Quick access
- Variables
- Routines
add_to_base_mdf()
,add_to_node_mdf()
,get_mdf_bin()
,init_mdf()
Needed modules
Variables
- trace_mdf/mdf_zarray (*) [real,allocatable/protected]
- trace_mdf/mdfdz [real,parameter=0.1]
MDF range, bin width
- trace_mdf/mdfnbin [integer]
- trace_mdf/mdfnpad [integer,parameter=2]
- trace_mdf/mdfzmax [real,parameter=1]
- trace_mdf/mdfzmin [real,parameter=-9]
Subroutines and functions
- subroutine trace_mdf/init_mdf()
- Called from
- Call to
- function trace_mdf/get_mdf_bin(zgas)
- Parameters
zgas [real]
- Return
get_mdf_bin [integer] :: [Fe/H]
- Called from