Metal modules

Modules and functions for the handling of metals

Metals

Description

main module for handling metals

Quick access

Types:

element, element_list

Variables:

index_carbon, index_iron, n_elements, tracked_elements

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]

  • type  metals/element_list

    this list is a container for all

    Type fields:
    • % list (*) [element,allocatable]

    • % n [integer,optional/default=0]

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:

readelementid()

function  metals/init_element(el_name)
Parameters:

el_name [character,in]

Return:

this [element]

Call to:

get_element_info()

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:

init_element()

Call to:

assert()

Read Yields

Description

module for reading yields from the appropirate files

Quick access

Routines:

assign_yields(), assign_yields_general(), get_elem_num(), readelementid()

Needed modules

Subroutines and functions

subroutine  read_yields/assign_yields()
Called from:

asloth

Call to:

readelementid(), assign_yields_general()

subroutine  read_yields/readelementid()
Called from:

assign_yields()

Call to:

get_element_index()

subroutine  read_yields/assign_yields_general(fileyields, pop)
Parameters:
  • fileyields [character,in]

  • pop [population,in] :: go through IMF bins

Called from:

assign_yields()

Call to:

get_elem_num()

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:

assign_yields_general()

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

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:

sf_step()

subroutine  metal_functions/check_m_metals(thishalo)

if not yet allocated, allocate ThisHalo%m_metals and set to zero

Parameters:

thishalo [treenode]

Called from:

add_to_m_metals(), prepare_node(), sf_step()

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:
Called from:

hms_feedback()

Call to:

check_m_metals()

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:

get_m_metals(), add_parent_to_tree()

Call to:

get_m_metals()

function  metal_functions/get_melement(thishalo, index_metal)

get mass of this halo of one specific element

Parameters:
  • thishalo [treenode]

  • index_metal [integer,in]

Return:

get_melement [real]

Called from:

feh(), coh(), cfe()

function  metal_functions/feh(thishalo, dz_now)

gas metallicity of this halo [Fe/H]

Parameters:
Return:

feh [real]

Called from:

metalpoor()

Call to:

get_melement()

function  metal_functions/coh(thishalo, dz_now)

gas metallicity of this halo [C/H]

Parameters:
Return:

coh [real]

Called from:

metalpoor()

Call to:

get_melement()

function  metal_functions/cfe(thishalo)

gas metallicity of this halo [C/Fe]

Parameters:

thishalo [treenode]

Return:

cfe [real]

Call to:

get_melement()

function  metal_functions/metalpoor(thishalo, z_in, dz_now)
Parameters:
  • thishalo [treenode]

  • z_in [real,in]

  • dz_now [real,in]

Return:

metalpoor [logical]

Called from:

sf_step()

Call to:

feh(), assert(), coh()

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:

inherit_igm_z()

Needed modules

Subroutines and functions

subroutine  igm_z/inherit_igm_z(p_node)
Parameters:

p_node [treenode,inout] :: parent node

Called from:

prepare_node()

Metal Mix dZ

Quick access

Variables:

dztable_12, dztable_23, dztable_34, dztable_45, dztable_58

Routines:

calc_dz(), dz_external(), dz_internal(), read_lookups()

Needed modules

  • numerical_parameters

  • defined_types

  • 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:

init_tree()

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

Parameters:
  • rng_obj [rng,inout]

  • z [real,in]

Return:

dz_external [real]

Called from:

calc_dz()

Call to:

get_ran()

function  metalmix_dz/dz_internal(rng_obj)
Parameters:

rng_obj [rng,inout]

Return:

dz_internal [real] :: to be consistent with previous use of dZ

Called from:

calc_dz()

Call to:

get_ran()

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:

sf_step()

Call to:

dz_external(), dz_internal()

Metallicity distribution function

Quick access

Variables:

mdf_zarray, mdfdz, mdfnbin, mdfnpad, mdfzmax, mdfzmin

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:

init_tree()

Call to:

get_mdf_bin()

function  trace_mdf/get_mdf_bin(zgas)
Parameters:

zgas [real]

Return:

get_mdf_bin [integer] :: [Fe/H]

Called from:

imfsampling(), init_mdf()

subroutine  trace_mdf/add_to_node_mdf(this_node, mdf_nstar, mdf_index, idx2)

add MDF_Nstar stars to the MDF of This_Node

Parameters:
  • this_node [treenode,inout]

  • mdf_nstar [real,in]

  • mdf_index [integer,in]

  • idx2 [integer,in]

Called from:

imfsampling(), outputs_satellites(), write_files_reali()

subroutine  trace_mdf/add_to_base_mdf(this_node)

Inherit MDF to the base node at the final redshift

Parameters:

this_node [treenode,inout]

Called from:

asloth