monload Module

Reader of MONASH seq files into convdata%data.

Format and colour fields in "MONASH seq", docs/formats.md. Two passes: records and field ranges, then binned field layers. kcvtn codes as set in MONASH code (amanda/phys.f, closed source, no public reference).



Variables

Type Visibility Attributes Name Initial
integer(kind=int16), private, parameter :: MON_RADIATIVE = 0

kcvtn code of radiative cell.

integer(kind=int16), private, parameter :: MON_CONVECTIVE = 1

kcvtn code of convective cell.

integer(kind=int16), private, parameter :: MON_SEMICONV = 2

kcvtn code of gap between convective envelope base and a second convective zone below it.

Gap mixed when MONASH isemi flag is set.

integer(kind=int16), private, parameter :: MON_OVERSHOOT = 3

kcvtn code of overshoot cell.

integer(kind=int32), private, parameter :: MON_NFIELDS = 20

Number of colour fields.

real(kind=real64), private, parameter :: LSUN = 3.851d33

Solar luminosity (erg/s), from MONASH seqdump.

MONASH itself uses 3.8515d33, citing Guenther et al. 1992, ApJ 387, 372.

character(len=32), private, parameter :: MON_FIELD_NAMES(MON_NFIELDS) = [character(len=32)::'Temperature', 'Density', 'Pressure', 'Luminosity', 'H_reaction_rate', 'He3_reaction_rate', 'He4_reaction_rate', 'C_reaction_rate', 'N_reaction_rate', 'O_reaction_rate', 'Other_reaction_rate', 'Internal_energy', 'Convective_velocity', 'X_H', 'X_He3', 'X_He4', 'X_C', 'X_N', 'X_O', 'X_Other']

Colour-field names, in rawset%v column order.


Derived Types

type, private ::  rawset

Colour-field values of one model.

Components

Type Visibility Attributes Name Initial
real(kind=real64), public, allocatable :: v(:,:)

Value per cell (rows) and field (columns).


Functions

private pure function mon_type_char(m) result(c)

Return ZONE_CHAR type of kcvtn code.

Read more…

Arguments

Type IntentOptional Attributes Name
integer(kind=int16), intent(in) :: m

kcvtn code.

Return Value character(len=1)


Subroutines

public subroutine loadmon(path, ifirst, ilast)

Load models of MONASH seq file into data.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: path

Path of the seq file.

integer(kind=int32), intent(in) :: ifirst

First model number to load.

integer(kind=int32), intent(in) :: ilast

Last model number to load.

private subroutine grow_models(recs, ncap, nkeep)

Extend recs by GROW_FAC, keeping first nkeep records.

Arguments

Type IntentOptional Attributes Name
type(convtype), intent(inout), allocatable :: recs(:)

Record array.

integer(kind=int32), intent(inout) :: ncap

Capacity of recs, updated to the new size.

integer(kind=int32), intent(in) :: nkeep

Number of records to keep.

private subroutine build_mon_record(cnv, raw, model, nz, time, dt, mass, ltc, lpc, omx, rhop, up, vconvp, kcvtn, f, w, wd)

Build record of one MONASH model.

Read more…

Arguments

Type IntentOptional Attributes Name
type(convtype), intent(out) :: cnv

Record to build.

type(rawset), intent(out) :: raw

Colour-field values of model.

integer, intent(in) :: model

Model number.

integer, intent(in) :: nz

Number of cells.

real(kind=real64), intent(in) :: time

Age (s), stored as timesec.

real(kind=real64), intent(in) :: dt

Time step that reached this model (s), stored as dt.

real(kind=real64), intent(in) :: mass

Total mass (g).

real(kind=real64), intent(in) :: ltc

Central temperature, ln T.

real(kind=real64), intent(in) :: lpc

Central pressure, ln P.

real(kind=real64), intent(in) :: omx(:)

Mass coordinate omx of each cell.

real(kind=real64), intent(in) :: rhop(:)

Density of each cell.

real(kind=real64), intent(in) :: up(:)

Internal energy per gram of each cell.

real, intent(in) :: vconvp(:)

Convective velocity of each cell.

integer(kind=int16), intent(in) :: kcvtn(:)

Convection code of each cell.

real(kind=real64), intent(in) :: f(:,:)

Steps across each cell.

Read more…
real, intent(in) :: w(:,:)

Seven mass fractions of each cell.

real, intent(in) :: wd(:,:)

Seven reaction rates of each cell.

private subroutine build_mon_fields(raw, nz, ltc, lpc, rhop, up, vconvp, f, w, wd)

Fill colour-field values of one model, in MON_FIELD_NAMES order.

Read more…

Arguments

Type IntentOptional Attributes Name
type(rawset), intent(out) :: raw

Colour-field values.

integer, intent(in) :: nz

Number of cells.

real(kind=real64), intent(in) :: ltc

Central temperature, ln T.

real(kind=real64), intent(in) :: lpc

Central pressure, ln P.

real(kind=real64), intent(in) :: rhop(:)

Density of each cell.

real(kind=real64), intent(in) :: up(:)

Internal energy per gram of each cell.

real, intent(in) :: vconvp(:)

Convective velocity of each cell.

real(kind=real64), intent(in) :: f(:,:)

Steps across each cell.

Read more…
real, intent(in) :: w(:,:)

Seven mass fractions of each cell.

real, intent(in) :: wd(:,:)

Seven reaction rates of each cell.