MPI-AMRVAC  3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code
Functions/Subroutines | Variables
mod_cak_opacity Module Reference

This module reads in CAK line opacities in the Gayley (1995) notation (alpha, Qbar, Q0, kappae) from corresponding tables. Tabulated values assume LTE conditions and are a function of mass density (D) and temperature (T), which are both given in base 10 logarithm. The construction of the tables is outlined in Poniatowski+ (2021), A&A, 667. More...

Functions/Subroutines

subroutine, public init_cak_table (tabledir)
 This routine is called when the FLD radiation module is initialised. More...
 
subroutine, public set_cak_opacity (rho, temp, alpha_output, Qbar_output, Q0_output, kappae_output)
 This subroutine calculates the opacity for a given temperature-density structure. Opacities are read from a table with given metalicity. More...
 
subroutine read_table (D, T, K, filename)
 This routine reads in 1-D (T,rho) values from a line opacity table and gives back as output the 1-D (T,rho) values and 2-D line opacity value. More...
 
subroutine get_val_comb (K1_vals, K2_vals, K3_vals, K4_vals, logD_list, logT_list, D, T, K1, K2, K3, K4)
 This subroutine looks in the table for the four couples (T,rho) surrounding a given input T and rho. More...
 
subroutine get_low_up_index (var_in, var_list, imin, imax, low_i, up_i)
 This subroutine finds the indices in rho and T arrays of the two values surrounding the input rho and T. More...
 
subroutine interpolate_krt (low_r, up_r, low_t, up_t, logD_list, logT_list, Kappa_vals, D, T, kappa_interp)
 This subroutine does a bilinear interpolation in the R,T-plane. More...
 
subroutine interpolate1d (x1, x2, x, y1, y2, y)
 Interpolation in one dimension. More...
 

Variables

integer, parameter idmin = 2
 min and max indices for R,T-range in opacity table More...
 
integer, parameter idmax = 16
 
integer, parameter itmin = 2
 
integer, parameter itmax = 51
 
double precision, dimension(idmin:idmax, itmin:itmax), public alpha_vals
 The opacity tables are read once and stored globally. More...
 
double precision, dimension(idmin:idmax, itmin:itmax), public qbar_vals
 
double precision, dimension(idmin:idmax, itmin:itmax), public q0_vals
 
double precision, dimension(idmin:idmax, itmin:itmax), public kappae_vals
 
double precision, dimension(idmin:idmax), public logd_list
 
double precision, dimension(itmin:itmax), public logt_list
 

Detailed Description

This module reads in CAK line opacities in the Gayley (1995) notation (alpha, Qbar, Q0, kappae) from corresponding tables. Tabulated values assume LTE conditions and are a function of mass density (D) and temperature (T), which are both given in base 10 logarithm. The construction of the tables is outlined in Poniatowski+ (2021), A&A, 667.

Function/Subroutine Documentation

◆ get_low_up_index()

subroutine mod_cak_opacity::get_low_up_index ( double precision, intent(in)  var_in,
double precision, dimension(imin:imax), intent(in)  var_list,
integer, intent(in)  imin,
integer, intent(in)  imax,
integer, intent(out)  low_i,
integer, intent(out)  up_i 
)

This subroutine finds the indices in rho and T arrays of the two values surrounding the input rho and T.

Definition at line 151 of file mod_cak_opacity.t.

◆ get_val_comb()

subroutine mod_cak_opacity::get_val_comb ( double precision, dimension(idmin:idmax,itmin:itmax), intent(in)  K1_vals,
double precision, dimension(idmin:idmax,itmin:itmax), intent(in)  K2_vals,
double precision, dimension(idmin:idmax,itmin:itmax), intent(in)  K3_vals,
double precision, dimension(idmin:idmax,itmin:itmax), intent(in)  K4_vals,
double precision, dimension(idmin:idmax), intent(in)  logD_list,
double precision, dimension(itmin:itmax), intent(in)  logT_list,
double precision, intent(in)  D,
double precision, intent(in)  T,
double precision, intent(out)  K1,
double precision, intent(out)  K2,
double precision, intent(out)  K3,
double precision, intent(out)  K4 
)

This subroutine looks in the table for the four couples (T,rho) surrounding a given input T and rho.

Definition at line 96 of file mod_cak_opacity.t.

Here is the call graph for this function:

◆ init_cak_table()

subroutine, public mod_cak_opacity::init_cak_table ( character(len=*), intent(in)  tabledir)

This routine is called when the FLD radiation module is initialised.

Definition at line 28 of file mod_cak_opacity.t.

Here is the call graph for this function:

◆ interpolate1d()

subroutine mod_cak_opacity::interpolate1d ( double precision, intent(in)  x1,
double precision, intent(in)  x2,
double precision, intent(in)  x,
double precision, intent(in)  y1,
double precision, intent(in)  y2,
double precision, intent(out)  y 
)

Interpolation in one dimension.

Definition at line 220 of file mod_cak_opacity.t.

◆ interpolate_krt()

subroutine mod_cak_opacity::interpolate_krt ( integer, intent(in)  low_r,
integer, intent(in)  up_r,
integer, intent(in)  low_t,
integer, intent(in)  up_t,
double precision, dimension(idmin:idmax), intent(in)  logD_list,
double precision, dimension(itmin:itmax), intent(in)  logT_list,
double precision, dimension(idmin:idmax,itmin:itmax), intent(in)  Kappa_vals,
double precision, intent(in)  D,
double precision, intent(in)  T,
double precision, intent(out)  kappa_interp 
)

This subroutine does a bilinear interpolation in the R,T-plane.

Definition at line 175 of file mod_cak_opacity.t.

Here is the call graph for this function:

◆ read_table()

subroutine mod_cak_opacity::read_table ( double precision, dimension(idmin:idmax), intent(out)  D,
double precision, dimension(itmin:itmax), intent(out)  T,
double precision, dimension(idmin:idmax,itmin:itmax), intent(out)  K,
character(*), intent(in)  filename 
)

This routine reads in 1-D (T,rho) values from a line opacity table and gives back as output the 1-D (T,rho) values and 2-D line opacity value.

Definition at line 71 of file mod_cak_opacity.t.

◆ set_cak_opacity()

subroutine, public mod_cak_opacity::set_cak_opacity ( double precision, intent(in)  rho,
double precision, intent(in)  temp,
double precision, intent(out)  alpha_output,
double precision, intent(out)  Qbar_output,
double precision, intent(out)  Q0_output,
double precision, intent(out)  kappae_output 
)

This subroutine calculates the opacity for a given temperature-density structure. Opacities are read from a table with given metalicity.

Definition at line 47 of file mod_cak_opacity.t.

Here is the call graph for this function:

Variable Documentation

◆ alpha_vals

double precision, dimension(idmin:idmax,itmin:itmax), public mod_cak_opacity::alpha_vals

The opacity tables are read once and stored globally.

Definition at line 16 of file mod_cak_opacity.t.

◆ idmax

integer, parameter mod_cak_opacity::idmax = 16

Definition at line 12 of file mod_cak_opacity.t.

◆ idmin

integer, parameter mod_cak_opacity::idmin = 2

min and max indices for R,T-range in opacity table

Definition at line 12 of file mod_cak_opacity.t.

◆ itmax

integer, parameter mod_cak_opacity::itmax = 51

Definition at line 13 of file mod_cak_opacity.t.

◆ itmin

integer, parameter mod_cak_opacity::itmin = 2

Definition at line 13 of file mod_cak_opacity.t.

◆ kappae_vals

double precision, dimension(idmin:idmax,itmin:itmax), public mod_cak_opacity::kappae_vals

Definition at line 19 of file mod_cak_opacity.t.

◆ logd_list

double precision, dimension(idmin:idmax), public mod_cak_opacity::logd_list

Definition at line 20 of file mod_cak_opacity.t.

◆ logt_list

double precision, dimension(itmin:itmax), public mod_cak_opacity::logt_list

Definition at line 20 of file mod_cak_opacity.t.

◆ q0_vals

double precision, dimension(idmin:idmax,itmin:itmax), public mod_cak_opacity::q0_vals

Definition at line 18 of file mod_cak_opacity.t.

◆ qbar_vals

double precision, dimension(idmin:idmax,itmin:itmax), public mod_cak_opacity::qbar_vals

Definition at line 17 of file mod_cak_opacity.t.