mod_solar_atmosphere Module

Module to set a realistic solar atmosphere, using tabulated density and temperature profiles (see mod_atmosphere_curves), in Cartesian geometries only.



Contents


Variables

TypeVisibilityAttributesNameInitial
real(kind=dp), public, allocatable:: h_interp(:)

interpolated heights from atmosphere tables

real(kind=dp), public, allocatable:: T_interp(:)

interpolated temperatures from atmosphere tables

real(kind=dp), public, allocatable:: nh_interp(:)

interpolated numberdensity from atmosphere tables

real(kind=dp), public, allocatable:: dT_interp(:)

derivative of interpolated temperature with respect to height

integer, public :: nbpoints

amount of points used for interpolation, defaults to ncool

real(kind=dp), public, allocatable:: rho_values(:)

integrated density profile

real(kind=dp), public :: unit_length
real(kind=dp), public :: unit_time
real(kind=dp), public :: unit_magneticfield

Functions

private function ax_values(x)

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(in) :: x

Return Value real(kind=dp)

private function bx_values(x)

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(in) :: x

Return Value real(kind=dp)

private function B02()

Arguments

None

Return Value real(kind=dp)

private function dB02()

Arguments

None

Return Value real(kind=dp)

private function B03()

Arguments

None

Return Value real(kind=dp)

private function dB03()

Arguments

None

Return Value real(kind=dp)

private function g0(x)

Default profile for the solar gravitational field

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(in) :: x

Return Value real(kind=dp)

private function rho0(x)

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(in) :: x

Return Value real(kind=dp)

private function T0(x)

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(in) :: x

Return Value real(kind=dp)

private function dT0(x)

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(in) :: x

Return Value real(kind=dp)

private function drho0(x)

Sets density derivative using the differential equation to ensure force balance, instead of relying on numerical differentiation.

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(in) :: x

Return Value real(kind=dp)


Subroutines

public subroutine set_solar_atmosphere(settings, background, physics, n_interp)

Sets the density, temperature, gravity and magnetic field attributes of the respective fields to a realistic solar atmosphere profile. This routine first interpolates the temperature and numberdensity table at n_interp resolution, then solves the following ODE for the density: using a fifth order Runge-Kutta method. If the optional argument save_to is provided then the density profiles are saved to that file, which can be loaded back in on subsequent runs through the optional argument load_from. The integration is done over the entire table, the curve is sampled on the Gaussian grid, meaning that grid variations can all use the same result.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(settings_t), intent(inout) :: settings
type(background_t), intent(inout) :: background
type(physics_t), intent(inout) :: physics
integer, intent(in), optional :: n_interp

points used for interpolation, defaults to 4000 if not present

private subroutine create_atmosphere_curves(settings)

Interpolates the atmospheric tables to the desired resolution. The temperature derivative is obtained numerically.

Arguments

TypeIntentOptionalAttributesName
type(settings_t), intent(in) :: settings

public subroutine solar_atmosphere_dealloc()

Arguments

None