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

This module reads in opacities from opal tables. More...

Functions/Subroutines

subroutine, public init_opal (He_abundance, tablename)
 This routine is called when the fld radiation module is initialised. Here, the tables for different He Abndcs are read and interpolated. More...
 
subroutine, public set_opal_opacity (rho, temp, kappa)
 This subroutine calculates the opacity for a given temperature-density structure. The opacities are read from a table that has the initialised metalicity. More...
 
subroutine read_table (R, T, K, filename)
 This routine reads out values and arguments from an opacity table. More...
 
subroutine interpolate_two_tables (Y1, Y2, Y_in, K1, K2, K_interp)
 This subroutine creates a new table for a given He abundance,. More...
 
subroutine get_kappa (Kappa_vals, Log_R_list, Log_T_list, R, T, K)
 This subroutine looks in the table for the four couples (T,R) More...
 
subroutine get_low_up_index (x, x_list, imin, imax, low_i, up_i)
 this subroutine finds the indexes in R and T arrays of the two values surrounding the input R and T More...
 
subroutine interpolate_krt (low_r, up_r, low_t, up_t, Log_R_list, Log_T_list, Kappa_vals, R, T, k_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 rmin = 2
 min and max indices for R,T-range in opacity table More...
 
integer, parameter rmax = 20
 
integer, parameter tmin = 7
 
integer, parameter tmax = 76
 
double precision, dimension(7:76, 2:20), public kappa_vals
 The opacity tables are read once and stored globally in Kappa_vals. More...
 
double precision, dimension(7:76, 2:20), public kappa_vals1
 
double precision, dimension(7:76, 2:20), public kappa_vals2
 
double precision, dimension(2:20), public log_r_list
 
double precision, dimension(7:76), public log_t_list
 
character(255), public amrvac_dir
 
character(255), public fileplace
 

Detailed Description

This module reads in opacities from opal tables.

Function/Subroutine Documentation

◆ get_kappa()

subroutine mod_opal_opacity::get_kappa ( double precision, dimension(7:76,2:20), intent(in)  Kappa_vals,
double precision, dimension(2:20), intent(in)  Log_R_list,
double precision, dimension(7:76), intent(in)  Log_T_list,
double precision, intent(in)  R,
double precision, intent(in)  T,
double precision, intent(out)  K 
)

This subroutine looks in the table for the four couples (T,R)

Definition at line 196 of file mod_opal_opacity.t.

Here is the call graph for this function:

◆ get_low_up_index()

subroutine mod_opal_opacity::get_low_up_index ( double precision, intent(in)  x,
double precision, dimension(imin:imax), intent(in)  x_list,
integer, intent(in)  imin,
integer, intent(in)  imax,
integer, intent(out)  low_i,
integer, intent(out)  up_i 
)

this subroutine finds the indexes in R and T arrays of the two values surrounding the input R and T

Definition at line 238 of file mod_opal_opacity.t.

◆ init_opal()

subroutine, public mod_opal_opacity::init_opal ( double precision, intent(in)  He_abundance,
character(6), intent(in)  tablename 
)

This routine is called when the fld radiation module is initialised. Here, the tables for different He Abndcs are read and interpolated.

Y1 actually 1.0, NOT 0.1???

WR

RSG

General

Definition at line 36 of file mod_opal_opacity.t.

Here is the call graph for this function:

◆ interpolate1d()

subroutine mod_opal_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 312 of file mod_opal_opacity.t.

◆ interpolate_krt()

subroutine mod_opal_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(2:20), intent(in)  Log_R_list,
double precision, dimension(7:76), intent(in)  Log_T_list,
double precision, dimension(7:76,2:20), intent(in)  Kappa_vals,
double precision, intent(in)  R,
double precision, intent(in)  T,
double precision, intent(out)  k_interp 
)

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

Definition at line 263 of file mod_opal_opacity.t.

Here is the call graph for this function:

◆ interpolate_two_tables()

subroutine mod_opal_opacity::interpolate_two_tables ( double precision, intent(in)  Y1,
double precision, intent(in)  Y2,
double precision, intent(in)  Y_in,
double precision, dimension(7:76,2:20), intent(in)  K1,
double precision, dimension(7:76,2:20), intent(in)  K2,
double precision, dimension(7:76,2:20), intent(out)  K_interp 
)

This subroutine creates a new table for a given He abundance,.

Definition at line 177 of file mod_opal_opacity.t.

Here is the call graph for this function:

◆ read_table()

subroutine mod_opal_opacity::read_table ( double precision, dimension(2:20), intent(out)  R,
double precision, dimension(7:76), intent(out)  T,
double precision, dimension(7:76,2:20), intent(out)  K,
character(*), intent(in)  filename 
)

This routine reads out values and arguments from an opacity table.

Parameters
[out]kThis routine reads in the the values for log kappa, and the values for log T and log R on the x and y axis
[out]rThis routine reads in the the values for log kappa, and the values for log T and log R on the x and y axis
[out]tThis routine reads in the the values for log kappa, and the values for log T and log R on the x and y axis

Skip first 4 lines

Read R

Read T and K

NOT READING ENTIRE TABLE

Definition at line 144 of file mod_opal_opacity.t.

◆ set_opal_opacity()

subroutine, public mod_opal_opacity::set_opal_opacity ( double precision, intent(in)  rho,
double precision, intent(in)  temp,
double precision, intent(out)  kappa 
)

This subroutine calculates the opacity for a given temperature-density structure. The opacities are read from a table that has the initialised metalicity.

If the outcome is 9.999, look right in the table

If the outcome is NaN, look left in the table

Definition at line 111 of file mod_opal_opacity.t.

Here is the call graph for this function:

Variable Documentation

◆ amrvac_dir

character(255), public mod_opal_opacity::amrvac_dir

Definition at line 20 of file mod_opal_opacity.t.

◆ fileplace

character(255), public mod_opal_opacity::fileplace

Definition at line 21 of file mod_opal_opacity.t.

◆ kappa_vals

double precision, dimension(7:76,2:20), public mod_opal_opacity::kappa_vals

The opacity tables are read once and stored globally in Kappa_vals.

Definition at line 13 of file mod_opal_opacity.t.

◆ kappa_vals1

double precision, dimension(7:76,2:20), public mod_opal_opacity::kappa_vals1

Definition at line 14 of file mod_opal_opacity.t.

◆ kappa_vals2

double precision, dimension(7:76,2:20), public mod_opal_opacity::kappa_vals2

Definition at line 15 of file mod_opal_opacity.t.

◆ log_r_list

double precision, dimension(2:20), public mod_opal_opacity::log_r_list

Definition at line 17 of file mod_opal_opacity.t.

◆ log_t_list

double precision, dimension(7:76), public mod_opal_opacity::log_t_list

Definition at line 18 of file mod_opal_opacity.t.

◆ rmax

integer, parameter mod_opal_opacity::rmax = 20

Definition at line 8 of file mod_opal_opacity.t.

◆ rmin

integer, parameter mod_opal_opacity::rmin = 2

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

Definition at line 7 of file mod_opal_opacity.t.

◆ tmax

integer, parameter mod_opal_opacity::tmax = 76

Definition at line 10 of file mod_opal_opacity.t.

◆ tmin

integer, parameter mod_opal_opacity::tmin = 7

Definition at line 9 of file mod_opal_opacity.t.