diff --git a/.gitattributes b/.gitattributes
index dcf935afc..53245f5db 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -27,3 +27,4 @@ star/dev_cases_star_to_RSP2 export-ignore
star/dev_cases_test_RSP2 export-ignore
star/dev_cases_test_TDC export-ignore
star/rsp2_utils export-ignore
+data/colors_data/colors_data.txz filter=lfs diff=lfs merge=lfs -text
diff --git a/.github/actions/install-mesa/action.yml b/.github/actions/install-mesa/action.yml
index f12de9c65..b7816d50c 100644
--- a/.github/actions/install-mesa/action.yml
+++ b/.github/actions/install-mesa/action.yml
@@ -9,27 +9,23 @@ inputs:
required: false
default: '23.7.3'
+
runs:
using: 'composite'
steps:
- - name: Delete unused packages
- run: |
- # runners have 150GB of disk space and the Ubuntu image is big so we sometimes found it ran out of space for MESA
- # others have encountered this too so we took commands from this action
- # https://github.com/jlumbroso/free-disk-space
- # currently commented because we don't need it and these commands can need changing when the Ubuntu image changes
- sudo rm -rf /usr/local/lib/android
- # sudo apt-get remove -y '^aspnetcore-.*'
- # sudo apt-get remove -y '^dotnet-.*' # 990 MB
- # sudo apt-get remove -y '^llvm-.*' # 1052 MB
- # sudo apt-get remove -y 'php.*' # 56.6 MB
- # sudo apt-get remove -y '^mysql-.*' # 209 MB
- # sudo apt-get remove -y azure-cli google-cloud-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri # 2274 MB
- sudo apt-get autoremove -y # 771 MB
- sudo apt-get clean
- shell: bash
+ - name: Install SDK Linux
+ if: ${{ (runner.os == 'Linux') }}
+ uses: ./.github/actions/install-sdk-linux
+ with:
+ sdk: ${{inputs.sdk}}
+
+ - name: Install SDK Linux
+ if: ${{ (runner.os == 'Macos') }}
+ uses: ./.github/actions/install-sdk-macos
+ with:
+ sdk: ${{inputs.sdk}}
- name: Create LFS file list
run: |
@@ -53,69 +49,38 @@ runs:
shell: bash
if: steps.lfs-cache.outputs.cache-hit == 'true'
- - name: Install dependencies Linux
- run: |
- sudo apt-get -y update
- sudo apt-get -y install wget binutils make perl libx11-6 libx11-dev zlib1g zlib1g-dev tcsh
+ - name: Set MESA environment variables
shell: bash
-
- - uses: actions/cache@v4
- id: cache
- with:
- path: |
- mesasdk-x86_64-linux-${{inputs.sdk}}.tar.gz
- key: ${{ runner.os }}-${{inputs.sdk}}
-
- - name: Get SDK ${{ runner.os }} '21.4.1'
- if: ${{ (steps.cache.outputs.cache-hit != 'true') && ( inputs.sdk == '21.4.1') }}
run: |
- wget -q https://zenodo.org/record/5802444/files/mesasdk-x86_64-linux-21.4.1.tar.gz
- shell: bash
+ echo "MESA_DIR=$PWD" >> $GITHUB_ENV
- - name: Get SDK ${{ runner.os }} '22.6.1'
- if: ${{ (steps.cache.outputs.cache-hit != 'true') && ( inputs.sdk == '22.6.1') }}
- run: |
- wget -q https://zenodo.org/record/7457681/files/mesasdk-x86_64-linux-22.6.1.tar.gz
+ - name: Setup environment Linux
shell: bash
-
- - name: Get SDK ${{ runner.os }} '23.7.3'
- if: ${{ (steps.cache.outputs.cache-hit != 'true') && ( inputs.sdk == '23.7.3') }}
+ if: runner.os == 'Linux'
run: |
- wget -q https://zenodo.org/record/10624843/files/mesasdk-x86_64-linux-23.7.3.tar.gz
- shell: bash
+ # Linux runners have 4 cores
+ # https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for-public-repositories
+ echo "OMP_NUM_THREADS=4" >> $GITHUB_ENV
+ echo "NPROCS=4" >> $GITHUB_ENV
+ echo "SED=sed" >> $GITHUB_ENV
- - name: Get SDK ${{ runner.os }} '24.7.1'
- if: ${{ (steps.cache.outputs.cache-hit != 'true') && ( inputs.sdk == '24.7.1') }}
- run: |
- wget -q https://zenodo.org/records/13768913/files/mesasdk-x86_64-linux-24.7.1.tar.gz
+ - name: Setup environment MacOS
shell: bash
-
- - name: Unpack SDK ${{ runner.os }} ${{inputs.sdk}}
+ if: runner.os == 'macOS'
run: |
- tar xvf mesasdk-x86_64-linux-${{inputs.sdk}}.tar.gz
- shell: bash
+ # MacOS runners have 3 cores
+ # https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for-public-repositories
+ echo "OMP_NUM_THREADS=3" >> $GITHUB_ENV
+ echo "NPROCS=3" >> $GITHUB_ENV
+ echo "SED=gsed" >> $GITHUB_ENV
- name: Compile
run: |
- # Linux runners have 4 cores
- # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
- export OMP_NUM_THREADS=4
- export NPROCS=4
- export "MESASDK_ROOT=$(readlink -f mesasdk)"
source "${MESASDK_ROOT}/bin/mesasdk_init.sh"
- export "MESA_DIR=$(readlink -f ./)"
- # Save environment variables to Github environment
- echo "OMP_NUM_THREADS=${OMP_NUM_THREADS}" >> $GITHUB_ENV
- echo "NPROCS=${NPROCS}" >> $GITHUB_ENV
- echo "MESASDK_ROOT=${MESASDK_ROOT}" >> $GITHUB_ENV
- echo "MESA_DIR=${MESA_DIR}" >> $GITHUB_ENV
# Everything is run as root so we need to disable the root check in the install script
- sed -i 's/\${EUID:-\$(id -u)}/1/' install
+ $SED -i 's/\${EUID:-\$(id -u)}/1/' install
# Turn off caching during build to save more space
- sed -i 's/use_cache_for_eos = .true./use_cache_for_eos = .false./g' $MESA_DIR/eos/public/eos_def.f90
- sed -i 's/use_cache = .true./use_cache = .false./g' $MESA_DIR/star/private/star_private_def.f90
+ $SED -i 's/use_cache_for_eos = .true./use_cache_for_eos = .false./g' $MESA_DIR/eos/public/eos_def.f90
+ $SED -i 's/use_cache = .true./use_cache = .false./g' $MESA_DIR/star/private/star_private_def.f90
./install
- if [ ! -f lib/libbinary.a ]; then
- exit 1
- fi
shell: bash
diff --git a/.github/actions/install-sdk-linux/action.yml b/.github/actions/install-sdk-linux/action.yml
new file mode 100644
index 000000000..7a27fa387
--- /dev/null
+++ b/.github/actions/install-sdk-linux/action.yml
@@ -0,0 +1,54 @@
+---
+name: 'install-sdk-linux'
+description: 'Download and unpack the Linux MESA SDK and its required dependencies'
+
+inputs:
+ sdk:
+ description: 'The version of the MESA SDK to install'
+ required: true
+
+runs:
+ using: 'composite'
+ steps:
+ - name: Install dependencies
+ run: |
+ sudo apt-get -y update
+ sudo apt-get -y install wget binutils make perl libx11-6 libx11-dev zlib1g zlib1g-dev tcsh
+ sudo apt-get -y autoremove
+ sudo apt-get clean
+ shell: bash
+
+ - uses: actions/cache@v4
+ id: cache
+ with:
+ path: |
+ mesasdk-x86_64-linux-${{inputs.sdk}}.tar.gz
+ key: linux-${{inputs.sdk}}
+
+ - name: Download SDK '${{ inputs.sdk }}'
+ shell: bash
+ if: ${{ (steps.cache.outputs.cache-hit != 'true') }}
+ run: |
+ declare -A version
+ version[24.7.1]="https://zenodo.org/records/13768913"
+ version[25.12.1]="https://zenodo.org/records/18163992"
+ version[26.3.2]="https://zenodo.org/records/19210930"
+
+ curl -O ${version[${{inputs.sdk}}]}/files/mesasdk-x86_64-linux-${{inputs.sdk}}.tar.gz
+
+ - name: Unpack SDK
+ run: |
+ tar xvf mesasdk-x86_64-linux-${{inputs.sdk}}.tar.gz
+ shell: bash
+
+ - name: Set SDK environment
+ if: ${{ (inputs.sdk != '26.3.2') }}
+ run: |
+ echo "MESASDK_ROOT=$(readlink -f mesasdk)" >> $GITHUB_ENV
+ shell: bash
+
+ - name: Set SDK environment
+ if: ${{ (inputs.sdk == '26.3.2') }}
+ run: |
+ echo "MESASDK_ROOT=$(readlink -f mesasdk-26.3.2)" >> $GITHUB_ENV
+ shell: bash
diff --git a/.github/actions/install-sdk-macos/action.yml b/.github/actions/install-sdk-macos/action.yml
new file mode 100644
index 000000000..18c5049db
--- /dev/null
+++ b/.github/actions/install-sdk-macos/action.yml
@@ -0,0 +1,46 @@
+---
+name: 'install-sdk-macos'
+description: 'Download and unpack the MacOS MESA SDK and its required dependencies'
+
+inputs:
+ sdk:
+ description: 'The version of the MESA SDK to install'
+ required: true
+
+runs:
+ using: 'composite'
+ steps:
+ - name: Install dependencies
+ run: |
+ brew install --cask xquartz
+ brew install gnu-sed bash
+ shell: bash
+
+ - uses: actions/cache@v4
+ id: cache
+ with:
+ path: |
+ mesasdk-aarch64-macos-${{inputs.sdk}}.tar.gz
+ key: macos-${{inputs.sdk}}
+
+ - name: Download SDK
+ shell: bash
+ if: ${{ (steps.cache.outputs.cache-hit != 'true') }}
+ run: |
+ declare -A version
+ version[24.7.1]="https://zenodo.org/records/13769017/files"
+ version[25.12.1]="http://user.astro.wisc.edu/~townsend/resource/download/mesasdk/"
+ version[26.3.2]="https://zenodo.org/records/19210744/files"
+
+ curl -O ${version[${{inputs.sdk}}]}/mesasdk-aarch64-macos-${{inputs.sdk}}.pkg
+
+ - name: Unpack SDK
+ run: |
+ sudo installer -pkg mesasdk-aarch64-macos-${{inputs.sdk}}.pkg -target /
+ ln -s /Applications/mesasdk mesasdk
+ shell: bash
+
+ - name: Set SDK environment
+ run: |
+ echo "MESASDK_ROOT=$(readlink -f mesasdk)" >> $GITHUB_ENV
+ shell: bash
diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build.yml
similarity index 76%
rename from .github/workflows/build-linux.yml
rename to .github/workflows/build.yml
index 35b2bc5d9..2558c1de6 100644
--- a/.github/workflows/build-linux.yml
+++ b/.github/workflows/build.yml
@@ -1,5 +1,5 @@
---
-name: Build on Linux with SDK
+name: Build with SDK
on:
workflow_dispatch:
@@ -14,8 +14,9 @@ jobs:
strategy:
fail-fast: false
matrix:
- sdk: ["22.6.1", "23.7.3", "24.7.1"] # pick 2 or 3 most recent.
- runs-on: ubuntu-latest
+ sdk: ["24.7.1", "25.12.1", "26.3.2"] # pick 2 or 3 most recent.
+ os: [ubuntu-latest, macos-latest]
+ runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
diff --git a/.gitignore b/.gitignore
index 5b05d0e0c..7ef18ed6a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -115,6 +115,6 @@ TAGS
*~
## Colors
-**/colors/data/.extraction_complete
-colors/data/filters/
-colors/data/stellar_models/
+**/data/colors_data/.extraction_complete
+data/colors_data/filters/
+data/colors_data/stellar_models/
diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst
index 60f0e6163..523e4671d 100644
--- a/CODE_OF_CONDUCT.rst
+++ b/CODE_OF_CONDUCT.rst
@@ -41,10 +41,10 @@ Enforcement
Instances of Code-of-Conduct violations should be reported by contacting
one or more of the following MESA Responsible Persons (MRPs):
-- Lars Bildsten (bildsten@kitp.ucsb.edu)
-- Frank Timmes (fxt44@mac.com)
-- Anne Thoul (anne.thoul@uliege.be)
- Rich Townsend (rhtownsend@wisc.edu)
+- Bill Wolf (wolfwm@uwec.edu)
+- Meridith Joyce (meridith.joyce@gmail.com)
+- Jared Goldberg (goldstar@msu.edu)
All reports will be reviewed and investigated and will result in a
response that is deemed necessary and appropriate to the circumstances.
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 315e36224..775dc1586 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -41,7 +41,7 @@ New contributions must be proposed through GitHub's *pull request*
(PR) system. The process is roughly:
1. fork the ``mesa`` repo (click *Fork* in the top-right of the GitHub interface),
-2. clone your fork to your computer,
+2. clone your fork to your computer (since the mesa repository contains large files, you'll need to have `git-lfs `_ installed),
3. create a new branch for your additions (e.g. ``git switch -c my-new-hook``),
4. make, commit and push your changes and
5. open a PR against the ``main`` branch.
diff --git a/README.rst b/README.rst
index c955c9e8e..3ed620042 100644
--- a/README.rst
+++ b/README.rst
@@ -16,7 +16,7 @@ Modules for Experiments in Stellar Astrophysics (MESA)
:target: https://docs.mesastar.org/en/latest/
.. image:: https://img.shields.io/github/v/release/MESAHub/mesa
:alt: GitHub release (latest by date)
- :target: https://zenodo.org/records/13353788
+ :target: https://zenodo.org/records/18023257
.. image:: https://img.shields.io/badge/zenodo-community-blue
:alt: Zenodo
:target: https://zenodo.org/communities/mesa/records?q=&l=list&p=1&s=10
@@ -27,10 +27,10 @@ Modules for Experiments in Stellar Astrophysics (MESA)
:title: Coverage
:alt: Coverage
:target: http://MESAHub.github.io/mesa
-.. image:: https://github.com/MESAHub/mesa/actions/workflows/build-linux.yml/badge.svg
- :title: BuildLinux
- :alt: BuildLinux
- :target: https://github.com/MESAHub/mesa/actions/workflows/build-linux.yml
+.. image:: https://github.com/MESAHub/mesa/actions/workflows/build.yml/badge.svg
+ :title: Build
+ :alt: Build
+ :target: https://github.com/MESAHub/mesa/actions/workflows/build.yml
.. image:: https://github.com/MESAHub/mesa/actions/workflows/static-analysis.yml/badge.svg
:title: StaticAnalysis
:alt: StaticAnalysis
@@ -40,7 +40,7 @@ Modules for Experiments in Stellar Astrophysics (MESA)
**WARNING**: The default ``main`` branch is the development version of
MESA and is not guaranteed to function correctly. If you are using
- MESA, you should use an `official release version `__.
+ MESA, you should use an `official release version `__.
Overview
@@ -86,7 +86,7 @@ Links
Download
========
-* `MESA Official Release Version `__ for the latest release of MESA.
+* `MESA Official Release Version `__ for the latest release of MESA.
* `MESA SDK `__ for: `MacOS (ARM) `__, `MacOS (Intel) `__, `Linux (Intel/AMD) `__.
diff --git a/clean b/clean
index 6bd86df61..863c0b15b 100755
--- a/clean
+++ b/clean
@@ -15,7 +15,7 @@ rm -rf data/eosDT_data
rm -rf data/kap_data
rm -rf data/ionization_data
rm -rf data/chem_data
-rm -rf data/colors_data
+rm -rf data/colors_data/filters data/colors_data/stellar_models data/colors_data/.extraction_complete
rm -rf data/rates_data/cache
rm -rf data/rates_data/cache/*
diff --git a/colors/.gitattributes b/colors/.gitattributes
index 53a5b7059..7a9388bf7 100644
--- a/colors/.gitattributes
+++ b/colors/.gitattributes
@@ -1 +1 @@
-colors/data/colors_data.txz filter=lfs diff=lfs merge=lfs -text
+data/colors_data/colors_data.txz filter=lfs diff=lfs merge=lfs -text
diff --git a/colors/README.rst b/colors/README.rst
index 2730be587..d80216147 100644
--- a/colors/README.rst
+++ b/colors/README.rst
@@ -36,7 +36,7 @@ The colors module is controlled via the ``&colors`` namelist. Below is a detaile
instrument
----------
-**Default:** `'/colors/data/filters/Generic/Johnson'`
+**Default:** `'/data/colors_data/filters/Generic/Johnson'`
This points to the directory containing the filter transmission curves you wish to use. The path must be structured as ``facility/instrument``.
@@ -47,13 +47,13 @@ This points to the directory containing the filter transmission curves you wish
.. code-block:: fortran
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
stellar_atm
-----------
-**Default:** `'/colors/data/stellar_models/Kurucz2003all/'`
+**Default:** `'/data/colors_data/stellar_models/Kurucz2003all/'`
Specifies the path to the directory containing the grid of stellar atmosphere models. This directory must contain:
@@ -67,7 +67,7 @@ The module queries this grid using the star's current parameters. If the star ev
.. code-block:: fortran
- stellar_atm = '/colors/data/stellar_models/sg-SPHINX/'
+ stellar_atm = '/data/colors_data/stellar_models/sg-SPHINX/'
distance
@@ -140,7 +140,7 @@ Defines the zero-point system for magnitude calculations. Options are:
vega_sed
--------
-**Default:** `'/colors/data/stellar_models/vega_flam.csv'`
+**Default:** `'/data/colors_data/stellar_models/vega_flam.csv'`
Required only if ``mag_system = 'Vega'``. This points to the reference SED file for Vega. The default path points to a file provided with the MESA data distribution.
@@ -212,14 +212,14 @@ Below are the default values for the colors module parameters as defined in ``co
.. code-block:: fortran
use_colors = .false.
- instrument = '/colors/data/filters/Generic/Johnson'
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ instrument = '/data/colors_data/filters/Generic/Johnson'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! 10 parsecs in cm (Absolute Magnitude)
make_csv = .false.
colors_results_directory = 'SED'
mag_system = 'Vega'
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
Visual Summary of Data Flow
===========================
diff --git a/colors/build_data_and_export b/colors/build_data_and_export
index 75c310402..4187edfef 100755
--- a/colors/build_data_and_export
+++ b/colors/build_data_and_export
@@ -10,8 +10,8 @@ function check_okay {
}
# Create working directory
-mkdir -p data
-cd data
+mkdir -p ../data/colors_data
+cd ../data/colors_data
# Variables
ARCHIVE_NAME="colors_data.txz"
@@ -29,16 +29,20 @@ if [ ! -f "$EXTRACTED_FLAG" ]; then
# If the archive is missing
if [ ! -f "$ARCHIVE_NAME" ]; then
echo "Archive $ARCHIVE_NAME is missing."
- echo "Please ensure it is downloaded or available in this directory."
+ echo "Please ensure $ARCHIVE_NAME is downloaded or available in this directory."
# it should now auto-download from a LFS pointer... i think?
-
- exit 1
+ git -C "$MESA_DIR" lfs pull --include="data/colors_data/colors_data.txz" #like this
+
+ if [ ! -f "$ARCHIVE_NAME" ]; then
+ echo "Archive $ARCHIVE_NAME is still missing."
+ exit 1
+ fi
fi
# Validate it
if ! validate_archive; then
echo "Archive $ARCHIVE_NAME is invalid."
- # try again to download or something?
+ git -C "$MESA_DIR" lfs pull --include="data/colors_data/colors_data.txz" #and again...
# Validate it
if ! validate_archive; then
diff --git a/colors/defaults/colors.defaults b/colors/defaults/colors.defaults
index a6608676d..0bdb1719a 100644
--- a/colors/defaults/colors.defaults
+++ b/colors/defaults/colors.defaults
@@ -1,5 +1,5 @@
-! colors module controls
-! ======================
+! ``colors`` module controls
+! ==========================
! The MESA/colors parameters are given default values here.
@@ -7,22 +7,22 @@
! Colors User Parameters
! ----------------------
- ! use_colors
- ! ~~~~~~~~~~
- ! instrument
- ! ~~~~~~~~~~
- ! vega_sed
- ! ~~~~~~~~
- ! stellar_atm
- ! ~~~~~~~~~~~
- ! distance
- ! ~~~~~~~~
- ! make_csv
- ! ~~~~~~~~
- ! colors_results_directory
- ! ~~~~~~~~~~~~~~~~~~~~~~~~
- ! mag_system
- ! ~~~~~~~~~~
+ ! ``use_colors``
+ ! ~~~~~~~~~~~~~~
+ ! ``instrument``
+ ! ~~~~~~~~~~~~~~
+ ! ``vega_sed``
+ ! ~~~~~~~~~~~~
+ ! ``stellar_atm``
+ ! ~~~~~~~~~~~~~~~
+ ! ``distance``
+ ! ~~~~~~~~~~~~
+ ! ``make_csv``
+ ! ~~~~~~~~~~~~
+ ! ``colors_results_directory``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``mag_system``
+ ! ~~~~~~~~~~~~~~
! If ``use_colors`` is true, the colors module is turned on, which will calculate
! bolometric and synthetic magnitudes by interpolating stellar atmosphere model grids and convolving with photometric filter transmission curves.
@@ -31,13 +31,13 @@
! ::
use_colors = .false.
- instrument = '/colors/data/filters/Generic/Johnson'
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ instrument = '/data/colors_data/filters/Generic/Johnson'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19
make_csv = .false.
colors_results_directory = 'SED'
mag_system = 'Vega'
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Extra inlist controls
@@ -47,10 +47,10 @@
! It works recursively, so the extras can read extras too.
- ! read_extra_colors_inlist(1..5)
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! extra_colors_inlist_name(1..5)
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``read_extra_colors_inlist(1..5)``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``extra_colors_inlist_name(1..5)``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! If ``read_extra_colors_inlist(i)`` is true, then read ``&colors`` from the file ``extra_colors_inlist_name(i)``.
! ::
diff --git a/colors/private/bolometric.f90 b/colors/private/bolometric.f90
index 1ded8ebd3..6a8c5b36a 100644
--- a/colors/private/bolometric.f90
+++ b/colors/private/bolometric.f90
@@ -20,10 +20,10 @@
module bolometric
use const_def, only: dp
- use colors_utils, only: romberg_integration, load_lookup_table
+ use colors_utils, only: romberg_integration
use hermite_interp, only: construct_sed_hermite
- use linear_interp, only: construct_sed_linear
- use knn_interp, only: construct_sed_knn
+ use linear_interp, only: construct_sed_linear
+ use knn_interp, only: construct_sed_knn
implicit none
@@ -34,52 +34,47 @@ module bolometric
!****************************
! Calculate Bolometric Photometry Using Multiple SEDs
+ ! Accepts cached lookup table data instead of loading from file
!****************************
subroutine calculate_bolometric(teff, log_g, metallicity, R, d, bolometric_magnitude, &
- bolometric_flux, wavelengths, fluxes, sed_filepath, interpolation_radius)
+ bolometric_flux, wavelengths, fluxes, sed_filepath, interpolation_radius, &
+ lu_file_names, lu_teff, lu_logg, lu_meta)
real(dp), intent(in) :: teff, log_g, metallicity, R, d
character(len=*), intent(in) :: sed_filepath
real(dp), intent(out) :: bolometric_magnitude, bolometric_flux, interpolation_radius
real(dp), dimension(:), allocatable, intent(out) :: wavelengths, fluxes
- real(dp), allocatable :: lu_logg(:), lu_meta(:), lu_teff(:)
+ ! Cached lookup table data (passed in from colors_settings)
+ character(len=100), intent(in) :: lu_file_names(:)
+ real(dp), intent(in) :: lu_teff(:), lu_logg(:), lu_meta(:)
- REAL, dimension(:, :), allocatable :: lookup_table
- character(len=100), allocatable :: file_names(:)
- character(len=256) :: lookup_file
character(len=32) :: interpolation_method
-
-
- lookup_file = trim(sed_filepath)//'/lookup_table.csv'
-
- call load_lookup_table(lookup_file, lookup_table, file_names, lu_logg, lu_meta, lu_teff)
-
interpolation_method = 'Hermite' ! or 'Linear' / 'KNN' later
! Quantify how far (teff, log_g, metallicity) is from the grid points
interpolation_radius = compute_interp_radius(teff, log_g, metallicity, &
- lu_teff, lu_logg, lu_meta)
+ lu_teff, lu_logg, lu_meta)
select case (interpolation_method)
- case ('Hermite','hermite','HERMITE')
- call construct_sed_hermite(teff, log_g, metallicity, R, d, file_names, &
+ case ('Hermite', 'hermite', 'HERMITE')
+ call construct_sed_hermite(teff, log_g, metallicity, R, d, lu_file_names, &
lu_teff, lu_logg, lu_meta, sed_filepath, &
wavelengths, fluxes)
- case ('Linear','linear','LINEAR')
- call construct_sed_linear(teff, log_g, metallicity, R, d, file_names, &
+ case ('Linear', 'linear', 'LINEAR')
+ call construct_sed_linear(teff, log_g, metallicity, R, d, lu_file_names, &
lu_teff, lu_logg, lu_meta, sed_filepath, &
wavelengths, fluxes)
- case ('KNN','knn','Knn')
- call construct_sed_knn(teff, log_g, metallicity, R, d, file_names, &
+ case ('KNN', 'knn', 'Knn')
+ call construct_sed_knn(teff, log_g, metallicity, R, d, lu_file_names, &
lu_teff, lu_logg, lu_meta, sed_filepath, &
wavelengths, fluxes)
case default
! Fallback: Hermite
- call construct_sed_hermite(teff, log_g, metallicity, R, d, file_names, &
+ call construct_sed_hermite(teff, log_g, metallicity, R, d, lu_file_names, &
lu_teff, lu_logg, lu_meta, sed_filepath, &
wavelengths, fluxes)
end select
@@ -88,7 +83,6 @@ subroutine calculate_bolometric(teff, log_g, metallicity, R, d, bolometric_magni
call calculate_bolometric_phot(wavelengths, fluxes, bolometric_magnitude, bolometric_flux)
end subroutine calculate_bolometric
-
!****************************
! Calculate Bolometric Magnitude and Flux
!****************************
@@ -97,24 +91,17 @@ subroutine calculate_bolometric_phot(wavelengths, fluxes, bolometric_magnitude,
real(dp), intent(out) :: bolometric_magnitude, bolometric_flux
integer :: i
- ! Validate inputs and replace invalid wavelengths with 0
+ ! Validate inputs and replace invalid values with 0
do i = 1, size(wavelengths) - 1
if (wavelengths(i) <= 0.0d0 .or. fluxes(i) < 0.0d0) then
- fluxes(i) = 0.0d0 ! Replace invalid wavelength with 0
+ fluxes(i) = 0.0d0
end if
end do
- ! Call Romberg integration
+ ! Integrate to get bolometric flux
call romberg_integration(wavelengths, fluxes, bolometric_flux)
- ! Validate integration result
- if (bolometric_flux <= 0.0d0) then
- print *, "Error: Flux integration resulted in non-positive value."
- bolometric_magnitude = 99.0d0
- return
- end if
-
- ! Calculate bolometric magnitude
+ ! Validate and calculate magnitude
if (bolometric_flux <= 0.0d0) then
print *, "Error: Flux integration resulted in non-positive value."
bolometric_magnitude = 99.0d0
@@ -133,33 +120,17 @@ real(dp) function flux_to_magnitude(flux)
real(dp), intent(in) :: flux
if (flux <= 0.0d0) then
print *, "Error: Flux must be positive to calculate magnitude."
- flux_to_magnitude = 99.0d0 ! Return an error value
+ flux_to_magnitude = 99.0d0
else
- flux_to_magnitude = -2.5d0*log10(flux)
+ flux_to_magnitude = -2.5d0 * log10(flux)
end if
end function flux_to_magnitude
-
-
-
-
-
-
-
!--------------------------------------------------------------------
! Scalar metric: distance to nearest grid point in normalized space
- !
- ! - Uses lu_teff, lu_logg, lu_meta as the available atmosphere grid.
- ! - Normalize each dimension to [0,1] using min/max of the grid.
- ! - Compute Euclidean distance to the nearest grid point in that
- ! normalized space.
- !
- ! interp_radius ~ 0 => sitting very close to an atmosphere point
- ! interp_radius ~ O(1) => deep in-between points / extrapolating
!--------------------------------------------------------------------
-
real(dp) function compute_interp_radius(teff, log_g, metallicity, &
- lu_teff, lu_logg, lu_meta)
+ lu_teff, lu_logg, lu_meta)
real(dp), intent(in) :: teff, log_g, metallicity
real(dp), intent(in) :: lu_teff(:), lu_logg(:), lu_meta(:)
@@ -174,73 +145,64 @@ real(dp) function compute_interp_radius(teff, log_g, metallicity, &
logical :: use_teff, use_logg, use_meta
real(dp), parameter :: eps = 1.0d-12
- ! ---------------------------------------------------------
- ! Detect dummy columns (entire axis is 0 or 999 or -999)
- ! ---------------------------------------------------------
- use_teff = .not. ( all(lu_teff == 0.0d0) .or. &
- all(lu_teff == 999.0d0) .or. &
- all(lu_teff == -999.0d0) )
-
- use_logg = .not. ( all(lu_logg == 0.0d0) .or. &
- all(lu_logg == 999.0d0) .or. &
- all(lu_logg == -999.0d0) )
+ ! Detect dummy columns (entire axis is 0 or ±999)
+ use_teff = .not. (all(lu_teff == 0.0d0) .or. &
+ all(lu_teff == 999.0d0) .or. &
+ all(lu_teff == -999.0d0))
- use_meta = .not. ( all(lu_meta == 0.0d0) .or. &
- all(lu_meta == 999.0d0) .or. &
- all(lu_meta == -999.0d0) )
+ use_logg = .not. (all(lu_logg == 0.0d0) .or. &
+ all(lu_logg == 999.0d0) .or. &
+ all(lu_logg == -999.0d0))
- ! ---------------------------------------------------------
- ! Compute min/max only for VALID axes
- ! ---------------------------------------------------------
+ use_meta = .not. (all(lu_meta == 0.0d0) .or. &
+ all(lu_meta == 999.0d0) .or. &
+ all(lu_meta == -999.0d0))
+ ! Compute min/max for valid axes
if (use_teff) then
teff_min = minval(lu_teff)
teff_max = maxval(lu_teff)
teff_range = max(teff_max - teff_min, eps)
- norm_teff = (teff - teff_min)/teff_range
- endif
+ norm_teff = (teff - teff_min) / teff_range
+ end if
if (use_logg) then
logg_min = minval(lu_logg)
logg_max = maxval(lu_logg)
logg_range = max(logg_max - logg_min, eps)
- norm_logg = (log_g - logg_min)/logg_range
- endif
+ norm_logg = (log_g - logg_min) / logg_range
+ end if
if (use_meta) then
meta_min = minval(lu_meta)
meta_max = maxval(lu_meta)
meta_range = max(meta_max - meta_min, eps)
- norm_meta = (metallicity - meta_min)/meta_range
- endif
+ norm_meta = (metallicity - meta_min) / meta_range
+ end if
- ! ---------------------------------------------------------
- ! Compute minimum distance with dimension-dropping
- ! ---------------------------------------------------------
+ ! Find minimum distance to any grid point
d_min = huge(1.0d0)
- n = size(lu_teff)
+ n = size(lu_teff)
do i = 1, n
-
d = 0.0d0
if (use_teff) then
- grid_teff = (lu_teff(i) - teff_min)/teff_range
+ grid_teff = (lu_teff(i) - teff_min) / teff_range
d = d + (norm_teff - grid_teff)**2
end if
if (use_logg) then
- grid_logg = (lu_logg(i) - logg_min)/logg_range
+ grid_logg = (lu_logg(i) - logg_min) / logg_range
d = d + (norm_logg - grid_logg)**2
end if
if (use_meta) then
- grid_meta = (lu_meta(i) - meta_min)/meta_range
+ grid_meta = (lu_meta(i) - meta_min) / meta_range
d = d + (norm_meta - grid_meta)**2
end if
d = sqrt(d)
-
if (d < d_min) d_min = d
end do
@@ -248,8 +210,4 @@ real(dp) function compute_interp_radius(teff, log_g, metallicity, &
end function compute_interp_radius
-
-
-
-
-end module bolometric
+end module bolometric
\ No newline at end of file
diff --git a/colors/private/colors_ctrls_io.f90 b/colors/private/colors_ctrls_io.f90
index 793ed006b..dc560be8e 100644
--- a/colors/private/colors_ctrls_io.f90
+++ b/colors/private/colors_ctrls_io.f90
@@ -160,7 +160,6 @@ subroutine store_controls(rq, ierr)
rq%use_colors = use_colors
rq%mag_system = mag_system
-
end subroutine store_controls
subroutine write_namelist(handle, filename, ierr)
diff --git a/colors/private/colors_history.f90 b/colors/private/colors_history.f90
index 66f8bf724..e65c699e9 100644
--- a/colors/private/colors_history.f90
+++ b/colors/private/colors_history.f90
@@ -61,32 +61,44 @@ subroutine data_for_colors_history_columns( &
real(dp) :: vals(n)
integer, intent(out) :: ierr
- type(Colors_General_Info), pointer :: colors_settings
+ type(Colors_General_Info), pointer :: cs ! colors_settings
integer :: i, filter_offset
real(dp) :: d, bolometric_magnitude, bolometric_flux, interpolation_radius
- character(len=256) :: sed_filepath, filter_filepath, filter_name, filter_dir, vega_filepath!, mag_system
+ real(dp) :: zero_point
+ character(len=256) :: sed_filepath, filter_name
logical :: make_sed
- real(dp), dimension(:), allocatable :: wavelengths, fluxes, filter_wavelengths, filter_trans
-
+ real(dp), dimension(:), allocatable :: wavelengths, fluxes
- !mag_system = "ST"
ierr = 0
- call get_colors_ptr(colors_handle, colors_settings, ierr)
+ call get_colors_ptr(colors_handle, cs, ierr)
if (ierr /= 0) then
write (*, *) 'failed in get_colors_ptr'
return
end if
- !metallicity = colors_settings% metallicity
- d = colors_settings%distance
- sed_filepath = trim(mesa_dir)//colors_settings%stellar_atm
- filter_dir = trim(mesa_dir)//colors_settings%instrument
- vega_filepath = trim(mesa_dir)//colors_settings%vega_sed
- make_sed = colors_settings%make_csv
+ ! verify data was loaded at initialization
+ if (.not. cs%lookup_loaded) then
+ write (*, *) 'colors error: lookup table not loaded'
+ ierr = -1
+ return
+ end if
+ if (.not. cs%filters_loaded) then
+ write (*, *) 'colors error: filter data not loaded'
+ ierr = -1
+ return
+ end if
+
+ d = cs%distance
+ sed_filepath = trim(mesa_dir)//cs%stellar_atm
+ make_sed = cs%make_csv
+ ! Calculate bolometric magnitude using cached lookup table
call calculate_bolometric(t_eff, log_g, metallicity, R, d, &
- bolometric_magnitude, bolometric_flux, wavelengths, fluxes, sed_filepath, interpolation_radius)
+ bolometric_magnitude, bolometric_flux, wavelengths, fluxes, &
+ sed_filepath, interpolation_radius, &
+ cs%lu_file_names, cs%lu_teff, cs%lu_logg, cs%lu_meta)
+
names(1) = "Mag_bol"
vals(1) = bolometric_magnitude
names(2) = "Flux_bol"
@@ -100,14 +112,28 @@ subroutine data_for_colors_history_columns( &
filter_name = trim(remove_dat(color_filter_names(i)))
names(i + filter_offset) = filter_name
- filter_filepath = trim(filter_dir)//"/"//color_filter_names(i)
-
if (t_eff >= 0 .and. metallicity >= 0) then
+ ! Select precomputed zero-point based on magnitude system
+ select case (trim(cs%mag_system))
+ case ('VEGA', 'Vega', 'vega')
+ zero_point = cs%filters(i)%vega_zero_point
+ case ('AB', 'ab')
+ zero_point = cs%filters(i)%ab_zero_point
+ case ('ST', 'st')
+ zero_point = cs%filters(i)%st_zero_point
+ case default
+ write (*, *) 'colors error: unknown magnitude system: ', trim(cs%mag_system)
+ zero_point = -1.0_dp
+ end select
+
+ ! Calculate synthetic magnitude using cached filter data and precomputed zero-point
vals(i + filter_offset) = calculate_synthetic(t_eff, log_g, metallicity, ierr, &
- wavelengths, fluxes, filter_wavelengths, filter_trans, &
- filter_filepath, vega_filepath, color_filter_names(i), &
- make_sed, colors_settings%colors_results_directory, &
- colors_settings%mag_system)
+ wavelengths, fluxes, &
+ cs%filters(i)%wavelengths, &
+ cs%filters(i)%transmission, &
+ zero_point, &
+ color_filter_names(i), &
+ make_sed, cs%colors_results_directory)
if (ierr /= 0) vals(i + filter_offset) = -1.0_dp
else
vals(i + filter_offset) = -1.0_dp
@@ -119,6 +145,10 @@ subroutine data_for_colors_history_columns( &
call mesa_error(__FILE__, __LINE__, 'colors: data_for_colors_history_columns array size mismatch')
end if
+ ! Clean up allocated arrays from calculate_bolometric
+ if (allocated(wavelengths)) deallocate(wavelengths)
+ if (allocated(fluxes)) deallocate(fluxes)
+
end subroutine data_for_colors_history_columns
-end module colors_history
+end module colors_history
\ No newline at end of file
diff --git a/colors/private/colors_utils.f90 b/colors/private/colors_utils.f90
index 7e495560c..530e86af6 100644
--- a/colors/private/colors_utils.f90
+++ b/colors/private/colors_utils.f90
@@ -20,6 +20,7 @@
module colors_utils
use const_def, only: dp, strlen, mesa_dir
use colors_def, only: Colors_General_Info
+ use utils_lib, only: mesa_error
implicit none
@@ -39,7 +40,7 @@ subroutine dilute_flux(surface_flux, R, d, calibrated_flux)
! Check that the output array has the same size as the input
if (size(calibrated_flux) /= size(surface_flux)) then
print *, "Error in dilute_flux: Output array must have the same size as input array."
- stop 1
+ call mesa_error(__FILE__, __LINE__)
end if
! Apply the dilution factor (R/d)^2 to each element
@@ -59,25 +60,25 @@ subroutine trapezoidal_integration(x, y, result)
real(dp), intent(out) :: result
integer :: i, n
- REAL :: sum
+ real(dp) :: sum
n = size(x)
- sum = 0.0
+ sum = 0.0_dp
! Validate input sizes
if (size(x) /= size(y)) then
print *, "Error: x and y arrays must have the same size."
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
if (size(x) < 2) then
print *, "Error: x and y arrays must have at least 2 elements."
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
! Perform trapezoidal integration
do i = 1, n - 1
- sum = sum + 0.5*(x(i + 1) - x(i))*(y(i + 1) + y(i))
+ sum = sum + 0.5_dp*(x(i + 1) - x(i))*(y(i + 1) + y(i))
end do
result = sum
@@ -96,15 +97,15 @@ subroutine simpson_integration(x, y, result)
! Validate input sizes
if (size(x) /= size(y)) then
print *, "Error: x and y arrays must have the same size."
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
if (size(x) < 2) then
print *, "Error: x and y arrays must have at least 2 elements."
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
- ! Perform adaptive Simpson’s rule
+ ! Perform adaptive Simpson's rule
do i = 1, n - 2, 2
h1 = x(i + 1) - x(i) ! Step size for first interval
h2 = x(i + 2) - x(i + 1) ! Step size for second interval
@@ -139,12 +140,12 @@ subroutine romberg_integration(x, y, result)
! Validate input sizes
if (size(x) /= size(y)) then
print *, "Error: x and y arrays must have the same size."
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
if (n < 2) then
print *, "Error: x and y arrays must have at least 2 elements."
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
allocate (R(m))
@@ -192,14 +193,14 @@ subroutine load_vega_sed(filepath, wavelengths, flux)
open (unit, file=trim(filepath), status='OLD', action='READ', iostat=status)
if (status /= 0) then
print *, "Error: Could not open Vega SED file ", trim(filepath)
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
! Skip header line
read (unit, '(A)', iostat=status) line
if (status /= 0) then
print *, "Error: Could not read header from Vega SED file ", trim(filepath)
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
! Count the number of data lines
@@ -237,21 +238,21 @@ subroutine load_filter(directory, filter_wavelengths, filter_trans)
character(len=512) :: line
integer :: unit, n_rows, status, i
- REAL :: temp_wavelength, temp_trans
+ real(dp) :: temp_wavelength, temp_trans
! Open the file
unit = 20
open (unit, file=trim(directory), status='OLD', action='READ', iostat=status)
if (status /= 0) then
print *, "Error: Could not open file ", trim(directory)
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
! Skip header line
read (unit, '(A)', iostat=status) line
if (status /= 0) then
print *, "Error: Could not read the file", trim(directory)
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
! Count rows in the file
@@ -272,7 +273,7 @@ subroutine load_filter(directory, filter_wavelengths, filter_trans)
read (unit, '(A)', iostat=status) line
if (status /= 0) then
print *, "Error: Could not rewind file", trim(directory)
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
if (line(1:1) /= "#") exit
end do
@@ -313,14 +314,14 @@ subroutine load_lookup_table(lookup_file, lookup_table, out_file_names, &
open (unit, file=lookup_file, status='old', action='read', iostat=status)
if (status /= 0) then
print *, "Error: Could not open file", lookup_file
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
! Read header line
read (unit, '(A)', iostat=status) line
if (status /= 0) then
print *, "Error: Could not read header line"
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
call split_line(line, delimiter, headers)
@@ -474,7 +475,7 @@ subroutine load_sed(directory, index, wavelengths, flux)
open (unit, file=trim(directory), status='OLD', action='READ', iostat=status)
if (status /= 0) then
print *, "Error: Could not open file ", trim(directory)
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
! Skip header lines
@@ -482,7 +483,7 @@ subroutine load_sed(directory, index, wavelengths, flux)
read (unit, '(A)', iostat=status) line
if (status /= 0) then
print *, "Error: Could not read the file", trim(directory)
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
if (line(1:1) /= "#") exit
end do
@@ -505,7 +506,7 @@ subroutine load_sed(directory, index, wavelengths, flux)
read (unit, '(A)', iostat=status) line
if (status /= 0) then
print *, "Error: Could not rewind file", trim(directory)
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
if (line(1:1) /= "#") exit
end do
@@ -584,7 +585,7 @@ subroutine read_strings_from_file(colors_settings, strings, n, ierr)
if (status /= 0) then
ierr = -1
print *, "Error: Could not open file", filename
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
do
diff --git a/colors/private/hermite_interp.f90 b/colors/private/hermite_interp.f90
index 7eb6fb08d..43c6019f3 100644
--- a/colors/private/hermite_interp.f90
+++ b/colors/private/hermite_interp.f90
@@ -193,8 +193,6 @@ subroutine load_binary_data(filename, teff_grid, logg_grid, meta_grid, &
close (unit)
end subroutine load_binary_data
-
-
function hermite_tensor_interp3d(x_val, y_val, z_val, x_grid, y_grid, &
z_grid, f_values) result(f_interp)
real(dp), intent(in) :: x_val, y_val, z_val
@@ -248,11 +246,11 @@ function hermite_tensor_interp3d(x_val, y_val, z_val, x_grid, y_grid, &
end do
! Precompute Hermite basis functions and derivatives
- h_x = [h00(t_x), h01(t_x)]
+ h_x = [h00(t_x), h01(t_x)]
hx_d = [h10(t_x), h11(t_x)]
- h_y = [h00(t_y), h01(t_y)]
+ h_y = [h00(t_y), h01(t_y)]
hy_d = [h10(t_y), h11(t_y)]
- h_z = [h00(t_z), h01(t_z)]
+ h_z = [h00(t_z), h01(t_z)]
hz_d = [h10(t_z), h11(t_z)]
! Final interpolation sum
@@ -260,10 +258,10 @@ function hermite_tensor_interp3d(x_val, y_val, z_val, x_grid, y_grid, &
do iz = 1, 2
do iy = 1, 2
do ix = 1, 2
- sum = sum + h_x(ix)*h_y(iy)*h_z(iz) * values(ix, iy, iz)
- sum = sum + hx_d(ix)*h_y(iy)*h_z(iz) * dx * dx_values(ix, iy, iz)
- sum = sum + h_x(ix)*hy_d(iy)*h_z(iz) * dy * dy_values(ix, iy, iz)
- sum = sum + h_x(ix)*h_y(iy)*hz_d(iz) * dz * dz_values(ix, iy, iz)
+ sum = sum + h_x(ix)*h_y(iy)*h_z(iz)*values(ix, iy, iz)
+ sum = sum + hx_d(ix)*h_y(iy)*h_z(iz)*dx*dx_values(ix, iy, iz)
+ sum = sum + h_x(ix)*hy_d(iy)*h_z(iz)*dy*dy_values(ix, iy, iz)
+ sum = sum + h_x(ix)*h_y(iy)*hz_d(iz)*dz*dz_values(ix, iy, iz)
end do
end do
end do
@@ -271,8 +269,6 @@ function hermite_tensor_interp3d(x_val, y_val, z_val, x_grid, y_grid, &
f_interp = sum
end function hermite_tensor_interp3d
-
-
!---------------------------------------------------------------------------
! Find the cell containing the interpolation point
!---------------------------------------------------------------------------
@@ -344,7 +340,6 @@ subroutine find_interval(x, val, i, t)
t = (val - x(i))/(x(i + 1) - x(i))
end subroutine find_interval
-
!---------------------------------------------------------------------------
! Find the nearest grid point
!---------------------------------------------------------------------------
diff --git a/colors/private/knn_interp.f90 b/colors/private/knn_interp.f90
index d453b6f0d..172e92070 100644
--- a/colors/private/knn_interp.f90
+++ b/colors/private/knn_interp.f90
@@ -24,6 +24,7 @@
module knn_interp
use const_def, only: dp
use colors_utils, only: dilute_flux, load_sed
+ use utils_lib, only: mesa_error
implicit none
private
@@ -80,8 +81,8 @@ subroutine construct_sed_knn(teff, log_g, metallicity, R, d, file_names, &
distances(i) = sqrt((lu_teff(closest_indices(i)) - teff)**2 + &
(lu_logg(closest_indices(i)) - log_g)**2 + &
(lu_meta(closest_indices(i)) - metallicity)**2)
- if (distances(i) == 0.0) distances(i) = 1.0d-10 ! Prevent division by zero
- weights(i) = 1.0/distances(i)
+ if (distances(i) == 0.0_dp) distances(i) = 1.0d-10 ! Prevent division by zero
+ weights(i) = 1.0_dp/distances(i)
end do
! Normalize weights
@@ -91,7 +92,7 @@ subroutine construct_sed_knn(teff, log_g, metallicity, R, d, file_names, &
! Allocate output arrays
allocate (wavelengths(n_points), fluxes(n_points))
wavelengths = common_wavelengths
- fluxes = 0.0
+ fluxes = 0.0_dp
! Perform weighted combination of the model fluxes (still at the stellar surface)
do i = 1, 4
@@ -139,15 +140,15 @@ subroutine get_closest_stellar_models(teff, log_g, metallicity, lu_teff, &
! Allocate and scale lookup table values
allocate (scaled_lu_teff(n), scaled_lu_logg(n), scaled_lu_meta(n))
- if (teff_max - teff_min > 0.00) then
+ if (teff_max - teff_min > 0.0_dp) then
scaled_lu_teff = (lu_teff - teff_min)/(teff_max - teff_min)
end if
- if (logg_max - logg_min > 0.00) then
+ if (logg_max - logg_min > 0.0_dp) then
scaled_lu_logg = (lu_logg - logg_min)/(logg_max - logg_min)
end if
- if (meta_max - meta_min > 0.00) then
+ if (meta_max - meta_min > 0.0_dp) then
scaled_lu_meta = (lu_meta - meta_min)/(meta_max - meta_min)
end if
@@ -156,43 +157,35 @@ subroutine get_closest_stellar_models(teff, log_g, metallicity, lu_teff, &
norm_logg = (log_g - logg_min)/(logg_max - logg_min)
norm_meta = (metallicity - meta_min)/(meta_max - meta_min)
+ ! Detect dummy axes once (outside the loop)
+ use_teff_dim = .not. (all(lu_teff == 0.0_dp) .or. all(lu_teff == 999.0_dp) .or. all(lu_teff == -999.0_dp))
+ use_logg_dim = .not. (all(lu_logg == 0.0_dp) .or. all(lu_logg == 999.0_dp) .or. all(lu_logg == -999.0_dp))
+ use_meta_dim = .not. (all(lu_meta == 0.0_dp) .or. all(lu_meta == 999.0_dp) .or. all(lu_meta == -999.0_dp))
+
! Find closest models
do i = 1, n
- teff_dist = 0.0
- logg_dist = 0.0
- meta_dist = 0.0
+ teff_dist = 0.0_dp
+ logg_dist = 0.0_dp
+ meta_dist = 0.0_dp
- if (teff_max - teff_min > 0.00) then
+ if (teff_max - teff_min > 0.0_dp) then
teff_dist = scaled_lu_teff(i) - norm_teff
end if
- if (logg_max - logg_min > 0.00) then
+ if (logg_max - logg_min > 0.0_dp) then
logg_dist = scaled_lu_logg(i) - norm_logg
end if
- if (meta_max - meta_min > 0.00) then
+ if (meta_max - meta_min > 0.0_dp) then
meta_dist = scaled_lu_meta(i) - norm_meta
end if
-
- ! Detect dummy axes once
-
- use_teff_dim = .not.(all(lu_teff == 0.0_dp) .or. all(lu_teff == 999.0_dp) .or. all(lu_teff == -999.0_dp))
- use_logg_dim = .not.(all(lu_logg == 0.0_dp) .or. all(lu_logg == 999.0_dp) .or. all(lu_logg == -999.0_dp))
- use_meta_dim = .not.(all(lu_meta == 0.0_dp) .or. all(lu_meta == 999.0_dp) .or. all(lu_meta == -999.0_dp))
-
-
-
- ! Inside the loop:
+ ! Compute distance using only valid dimensions
distance = 0.0_dp
if (use_teff_dim) distance = distance + teff_dist**2
if (use_logg_dim) distance = distance + logg_dist**2
if (use_meta_dim) distance = distance + meta_dist**2
-
-
- distance = teff_dist**2 + logg_dist**2 + meta_dist**2
-
do j = 1, 4
if (distance < min_distances(j)) then
! Shift larger distances down
@@ -267,17 +260,17 @@ subroutine interpolate_array(x_in, y_in, x_out, y_out)
! Validate input sizes
if (size(x_in) < 2 .or. size(y_in) < 2) then
print *, "Error: x_in or y_in arrays have fewer than 2 points."
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
if (size(x_in) /= size(y_in)) then
print *, "Error: x_in and y_in arrays have different sizes."
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
if (size(x_out) <= 0) then
print *, "Error: x_out array is empty."
- stop
+ call mesa_error(__FILE__, __LINE__)
end if
do i = 1, size(x_out)
diff --git a/colors/private/linear_interp.f90 b/colors/private/linear_interp.f90
index a1dd0f8d3..f5aa09207 100644
--- a/colors/private/linear_interp.f90
+++ b/colors/private/linear_interp.f90
@@ -24,6 +24,7 @@
module linear_interp
use const_def, only: dp
use colors_utils, only: dilute_flux
+ use utils_lib, only: mesa_error
implicit none
private
@@ -68,7 +69,8 @@ subroutine construct_sed_linear(teff, log_g, metallicity, R, d, file_names, &
INQUIRE (file=bin_filename, EXIST=file_exists)
if (.not. file_exists) then
- stop 'Missing required binary file for interpolation'
+ print *, 'Missing required binary file for interpolation'
+ call mesa_error(__FILE__, __LINE__)
end if
! Load the data from binary file
@@ -76,7 +78,8 @@ subroutine construct_sed_linear(teff, log_g, metallicity, R, d, file_names, &
wavelengths, precomputed_flux_cube, status)
if (status /= 0) then
- stop 'Binary data loading error'
+ print *, 'Binary data loading error'
+ call mesa_error(__FILE__, __LINE__)
end if
n_teff = size(teff_grid)
@@ -86,21 +89,22 @@ subroutine construct_sed_linear(teff, log_g, metallicity, R, d, file_names, &
! Allocate space for interpolated flux
allocate (interp_flux(n_lambda))
+ allocate (flux_cube_lambda(n_teff, n_logg, n_meta))
! Perform trilinear interpolation for each wavelength
do i = 1, n_lambda
- ! !print progress updates at regular intervals
! Extract the 3D grid for this wavelength
- allocate (flux_cube_lambda(n_teff, n_logg, n_meta))
flux_cube_lambda = precomputed_flux_cube(:, :, :, i)
! Simple trilinear interpolation at the target parameters
interp_flux(i) = trilinear_interp(teff, log_g, metallicity, &
teff_grid, logg_grid, meta_grid, flux_cube_lambda)
-
end do
+
+ deallocate(flux_cube_lambda)
+
! Calculate statistics for validation
min_flux = minval(interp_flux)
max_flux = maxval(interp_flux)
@@ -257,12 +261,12 @@ function trilinear_interp(x_val, y_val, z_val, x_grid, y_grid, z_grid, f_values)
i_x, i_y, i_z, t_x, t_y, t_z)
! Boundary safety check
- if (i_x < 1) i_x = 1
- if (i_y < 1) i_y = 1
- if (i_z < 1) i_z = 1
- if (i_x >= size(x_grid)) i_x = size(x_grid) - 1
- if (i_y >= size(y_grid)) i_y = size(y_grid) - 1
- if (i_z >= size(z_grid)) i_z = size(z_grid) - 1
+ if (i_x < lbound(x_grid,1)) i_x = lbound(x_grid,1)
+ if (i_y < lbound(y_grid,1)) i_y = lbound(y_grid,1)
+ if (i_z < lbound(z_grid,1)) i_z = lbound(z_grid,1)
+ if (i_x >= ubound(x_grid,1)) i_x = ubound(x_grid,1) - 1
+ if (i_y >= ubound(y_grid,1)) i_y = ubound(y_grid,1) - 1
+ if (i_z >= ubound(z_grid,1)) i_z = ubound(z_grid,1) - 1
! Force interpolation parameters to be in [0,1]
t_x = max(0.0_dp, MIN(1.0_dp, t_x))
@@ -386,7 +390,6 @@ subroutine find_interval(x, val, i, t)
t = (val - x(i))/(x(i + 1) - x(i))
end subroutine find_interval
-
!---------------------------------------------------------------------------
! Find the nearest grid point
!---------------------------------------------------------------------------
diff --git a/colors/private/shared_funcs.f90 b/colors/private/shared_funcs.f90
index 8ed204933..59d371cb7 100644
--- a/colors/private/shared_funcs.f90
+++ b/colors/private/shared_funcs.f90
@@ -1,561 +1,535 @@
MODULE shared_funcs
- USE const_def, ONLY: dp, strlen
- IMPLICIT NONE
+ USE const_def, ONLY: dp, strlen
+ USE utils_lib, ONLY: mesa_error
+ IMPLICIT NONE
- PRIVATE
- PUBLIC :: dilute_flux, trapezoidalintegration, rombergintegration, SimpsonIntegration, loadsed,&
+ PRIVATE
+ PUBLIC :: dilute_flux, trapezoidalintegration, rombergintegration, SimpsonIntegration, loadsed, &
loadfilter, loadvegased, load_lookuptable, remove_dat
CONTAINS
+ !---------------------------------------------------------------------------
+ ! Apply dilution factor to convert surface flux to observed flux
+ !---------------------------------------------------------------------------
+ SUBROUTINE dilute_flux(surface_flux, R, d, calibrated_flux)
+ REAL(dp), INTENT(IN) :: surface_flux(:)
+ REAL(dp), INTENT(IN) :: R, d ! R = stellar radius, d = distance (both in the same units, e.g., cm)
+ REAL(dp), INTENT(OUT) :: calibrated_flux(:)
+
+ ! Check that the output array has the same size as the input
+ IF (SIZE(calibrated_flux) /= SIZE(surface_flux)) THEN
+ PRINT *, "Error in dilute_flux: Output array must have the same size as input array."
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
+ ! Apply the dilution factor (R/d)^2 to each element
+ calibrated_flux = surface_flux*((R/d)**2)
+ END SUBROUTINE dilute_flux
+ !###########################################################
+ !## MATHS
+ !###########################################################
- !---------------------------------------------------------------------------
- ! Apply dilution factor to convert surface flux to observed flux
- !---------------------------------------------------------------------------
- SUBROUTINE dilute_flux(surface_flux, R, d, calibrated_flux)
- REAL(dp), INTENT(IN) :: surface_flux(:)
- REAL(dp), INTENT(IN) :: R, d ! R = stellar radius, d = distance (both in the same units, e.g., cm)
- REAL(dp), INTENT(OUT) :: calibrated_flux(:)
+ !****************************
+ !Trapezoidal and Simpson Integration For Flux Calculation
+ !****************************
- ! Check that the output array has the same size as the input
- IF (SIZE(calibrated_flux) /= SIZE(surface_flux)) THEN
- PRINT *, "Error in dilute_flux: Output array must have the same size as input array."
- STOP 1
- END IF
+ SUBROUTINE trapezoidalintegration(x, y, result)
+ REAL(DP), DIMENSION(:), INTENT(IN) :: x, y
+ REAL(DP), INTENT(OUT) :: result
- ! Apply the dilution factor (R/d)^2 to each element
- calibrated_flux = surface_flux * ((R / d)**2)
- END SUBROUTINE dilute_flux
+ INTEGER :: i, n
+ REAL(DP) :: sum
+ n = SIZE(x)
+ sum = 0.0_dp
+ ! Validate input sizes
+ IF (SIZE(x) /= SIZE(y)) THEN
+ PRINT *, "Error: x and y arrays must have the same size."
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
+ IF (SIZE(x) < 2) THEN
+ PRINT *, "Error: x and y arrays must have at least 2 elements."
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
+ ! Perform trapezoidal integration
+ DO i = 1, n - 1
+ sum = sum + 0.5_dp*(x(i + 1) - x(i))*(y(i + 1) + y(i))
+ END DO
+ result = sum
+ END SUBROUTINE trapezoidalintegration
+ SUBROUTINE SimpsonIntegration(x, y, result)
+ REAL(DP), DIMENSION(:), INTENT(IN) :: x, y
+ REAL(DP), INTENT(OUT) :: result
+ INTEGER :: i, n
+ REAL(DP) :: sum, h1, h2, f1, f2, f0
- !###########################################################
- !## MATHS
- !###########################################################
+ n = SIZE(x)
+ sum = 0.0_DP
- !****************************
- !Trapezoidal and Simpson Integration For Flux Calculation
- !****************************
+ ! Validate input sizes
+ IF (SIZE(x) /= SIZE(y)) THEN
+ PRINT *, "Error: x and y arrays must have the same size."
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
- SUBROUTINE trapezoidalintegration(x, y, result)
- REAL(DP), DIMENSION(:), INTENT(IN) :: x, y
- REAL(DP), INTENT(OUT) :: result
+ IF (SIZE(x) < 2) THEN
+ PRINT *, "Error: x and y arrays must have at least 2 elements."
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
+
+ ! Perform adaptive Simpson's rule
+ DO i = 1, n - 2, 2
+ h1 = x(i + 1) - x(i) ! Step size for first interval
+ h2 = x(i + 2) - x(i + 1) ! Step size for second interval
+
+ f0 = y(i)
+ f1 = y(i + 1)
+ f2 = y(i + 2)
- INTEGER :: i, n
- REAL :: sum
+ ! Simpson's rule: (h/3) * (f0 + 4f1 + f2)
+ sum = sum + (h1 + h2)/6.0_DP*(f0 + 4.0_DP*f1 + f2)
+ END DO
+
+ ! Handle the case where n is odd (last interval)
+ IF (MOD(n, 2) == 0) THEN
+ sum = sum + 0.5_DP*(x(n) - x(n - 1))*(y(n) + y(n - 1))
+ END IF
- n = SIZE(x)
- sum = 0.0
+ result = sum
+ END SUBROUTINE SimpsonIntegration
- ! Validate input sizes
- IF (SIZE(x) /= SIZE(y)) THEN
+ SUBROUTINE rombergintegration(x, y, result)
+ REAL(DP), DIMENSION(:), INTENT(IN) :: x, y
+ REAL(DP), INTENT(OUT) :: result
+
+ INTEGER :: i, j, k, n, m
+ REAL(DP), DIMENSION(:), ALLOCATABLE :: R
+ REAL(DP) :: h, sum, factor
+
+ n = SIZE(x)
+ m = INT(LOG(REAL(n, DP))/LOG(2.0_DP)) + 1 ! Number of refinement levels
+
+ ! Validate input sizes
+ IF (SIZE(x) /= SIZE(y)) THEN
PRINT *, "Error: x and y arrays must have the same size."
- STOP
- END IF
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
- IF (SIZE(x) < 2) THEN
+ IF (n < 2) THEN
PRINT *, "Error: x and y arrays must have at least 2 elements."
- STOP
- END IF
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
- ! Perform trapezoidal integration
- DO i = 1, n - 1
- sum = sum + 0.5 * (x(i + 1) - x(i)) * (y(i + 1) + y(i))
- END DO
+ ALLOCATE (R(m))
- result = sum
- END SUBROUTINE trapezoidalintegration
+ ! Compute initial trapezoidal rule estimate
+ h = x(n) - x(1)
+ R(1) = 0.5_DP*h*(y(1) + y(n))
+ ! Refinement using Romberg's method
+ DO j = 2, m
+ sum = 0.0_DP
+ DO i = 1, 2**(j - 2)
+ sum = sum + y(1 + (2*i - 1)*(n - 1)/(2**(j - 1)))
+ END DO
- SUBROUTINE SimpsonIntegration(x, y, result)
- INTEGER, PARAMETER :: DP = KIND(1.0D0)
- REAL(DP), DIMENSION(:), INTENT(IN) :: x, y
- REAL(DP), INTENT(OUT) :: result
-
- INTEGER :: i, n
- REAL(DP) :: sum, h1, h2, f1, f2, f0
-
- n = SIZE(x)
- sum = 0.0_DP
-
- ! Validate input sizes
- IF (SIZE(x) /= SIZE(y)) THEN
- PRINT *, "Error: x and y arrays must have the same size."
- STOP
- END IF
-
- IF (SIZE(x) < 2) THEN
- PRINT *, "Error: x and y arrays must have at least 2 elements."
- STOP
- END IF
-
- ! Perform adaptive Simpson’s rule
- DO i = 1, n - 2, 2
- h1 = x(i+1) - x(i) ! Step size for first interval
- h2 = x(i+2) - x(i+1) ! Step size for second interval
-
- f0 = y(i)
- f1 = y(i+1)
- f2 = y(i+2)
-
- ! Simpson's rule: (h/3) * (f0 + 4f1 + f2)
- sum = sum + (h1 + h2) / 6.0_DP * (f0 + 4.0_DP * f1 + f2)
- END DO
-
- ! Handle the case where n is odd (last interval)
- IF (MOD(n,2) == 0) THEN
- sum = sum + 0.5_DP * (x(n) - x(n-1)) * (y(n) + y(n-1))
- END IF
-
- result = sum
- END SUBROUTINE SimpsonIntegration
+ h = h/2.0_DP
+ R(j) = 0.5_DP*R(j - 1) + h*sum
- SUBROUTINE rombergintegration(x, y, result)
- INTEGER, PARAMETER :: DP = KIND(1.0D0)
- REAL(DP), DIMENSION(:), INTENT(IN) :: x, y
- REAL(DP), INTENT(OUT) :: result
-
- INTEGER :: i, j, k, n, m
- REAL(DP), DIMENSION(:), ALLOCATABLE :: R
- REAL(DP) :: h, sum, factor
-
- n = SIZE(x)
- m = INT(LOG(REAL(n, DP)) / LOG(2.0_DP)) + 1 ! Number of refinement levels
-
- ! Validate input sizes
- IF (SIZE(x) /= SIZE(y)) THEN
- PRINT *, "Error: x and y arrays must have the same size."
- STOP
- END IF
-
- IF (n < 2) THEN
- PRINT *, "Error: x and y arrays must have at least 2 elements."
- STOP
- END IF
-
- ALLOCATE(R(m))
-
- ! Compute initial trapezoidal rule estimate
- h = x(n) - x(1)
- R(1) = 0.5_DP * h * (y(1) + y(n))
-
- ! Refinement using Romberg's method
- DO j = 2, m
- sum = 0.0_DP
- DO i = 1, 2**(j-2)
- sum = sum + y(1 + (2*i - 1) * (n-1) / (2**(j-1)))
- END DO
-
- h = h / 2.0_DP
- R(j) = 0.5_DP * R(j-1) + h * sum
-
- ! Richardson extrapolation
- factor = 4.0_DP
- DO k = j, 2, -1
- R(k-1) = (factor * R(k) - R(k-1)) / (factor - 1.0_DP)
- factor = factor * 4.0_DP
- END DO
- END DO
-
- result = R(1)
- DEALLOCATE(R)
- END SUBROUTINE rombergintegration
+ ! Richardson extrapolation
+ factor = 4.0_DP
+ DO k = j, 2, -1
+ R(k - 1) = (factor*R(k) - R(k - 1))/(factor - 1.0_DP)
+ factor = factor*4.0_DP
+ END DO
+ END DO
+ result = R(1)
+ DEALLOCATE (R)
+ END SUBROUTINE rombergintegration
+ !-----------------------------------------------------------------------
+ ! File I/O functions
+ !-----------------------------------------------------------------------
- !-----------------------------------------------------------------------
- ! File I/O functions
- !-----------------------------------------------------------------------
-
- !****************************
- ! Load Vega SED for Zero Point Calculation
- !****************************
- SUBROUTINE loadvegased(filepath, wavelengths, flux)
- CHARACTER(LEN=*), INTENT(IN) :: filepath
- REAL(dp), DIMENSION(:), ALLOCATABLE, INTENT(OUT) :: wavelengths, flux
- CHARACTER(LEN=512) :: line
- INTEGER :: unit, n_rows, status, i
- REAL(dp) :: temp_wave, temp_flux
-
- unit = 20
- OPEN(unit, FILE=TRIM(filepath), STATUS='OLD', ACTION='READ', IOSTAT=status)
- IF (status /= 0) THEN
- PRINT *, "Error: Could not open Vega SED file ", TRIM(filepath)
- STOP
- END IF
-
- ! Skip header line
- READ(unit, '(A)', IOSTAT=status) line
- IF (status /= 0) THEN
- PRINT *, "Error: Could not read header from Vega SED file ", TRIM(filepath)
- STOP
- END IF
-
- ! Count the number of data lines
- n_rows = 0
- DO
- READ(unit, '(A)', IOSTAT=status) line
- IF (status /= 0) EXIT
- n_rows = n_rows + 1
- END DO
-
- REWIND(unit)
- READ(unit, '(A)', IOSTAT=status) line ! Skip header again
-
- ALLOCATE(wavelengths(n_rows))
- ALLOCATE(flux(n_rows))
-
- i = 0
- DO
- READ(unit, *, IOSTAT=status) temp_wave, temp_flux ! Ignore any extra columns
- IF (status /= 0) EXIT
- i = i + 1
- wavelengths(i) = temp_wave
- flux(i) = temp_flux
- END DO
-
- CLOSE(unit)
- END SUBROUTINE loadvegased
-
- !****************************
- ! Load Filter File
- !****************************
- SUBROUTINE loadfilter(directory, filter_wavelengths, filter_trans)
- CHARACTER(LEN=*), INTENT(IN) :: directory
- REAL(dp), DIMENSION(:), ALLOCATABLE, INTENT(OUT) :: filter_wavelengths, filter_trans
-
- CHARACTER(LEN=512) :: line
- INTEGER :: unit, n_rows, status, i
- REAL :: temp_wavelength, temp_trans
-
- ! Open the file
- unit = 20
- OPEN(unit, FILE=TRIM(directory), STATUS='OLD', ACTION='READ', IOSTAT=status)
- IF (status /= 0) THEN
- PRINT *, "Error: Could not open file ", TRIM(directory)
- STOP
- END IF
-
- ! Skip header line
- READ(unit, '(A)', IOSTAT=status) line
- IF (status /= 0) THEN
- PRINT *, "Error: Could not read the file", TRIM(directory)
- STOP
- END IF
-
- ! Count rows in the file
- n_rows = 0
- DO
- READ(unit, '(A)', IOSTAT=status) line
- IF (status /= 0) EXIT
- n_rows = n_rows + 1
- END DO
-
- ! Allocate arrays
- ALLOCATE(filter_wavelengths(n_rows))
- ALLOCATE(filter_trans(n_rows))
-
- ! Rewind to the first non-comment line
- REWIND(unit)
- DO
- READ(unit, '(A)', IOSTAT=status) line
+ !****************************
+ ! Load Vega SED for Zero Point Calculation
+ !****************************
+ SUBROUTINE loadvegased(filepath, wavelengths, flux)
+ CHARACTER(LEN=*), INTENT(IN) :: filepath
+ REAL(dp), DIMENSION(:), ALLOCATABLE, INTENT(OUT) :: wavelengths, flux
+ CHARACTER(LEN=512) :: line
+ INTEGER :: unit, n_rows, status, i
+ REAL(dp) :: temp_wave, temp_flux
+
+ unit = 20
+ OPEN (unit, FILE=TRIM(filepath), STATUS='OLD', ACTION='READ', IOSTAT=status)
IF (status /= 0) THEN
- PRINT *, "Error: Could not rewind file", TRIM(directory)
- STOP
- END IF
- IF (line(1:1) /= "#") EXIT
- END DO
-
- ! Read and parse data
- i = 0
- DO
- READ(unit, *, IOSTAT=status) temp_wavelength, temp_trans
- IF (status /= 0) EXIT
- i = i + 1
-
- filter_wavelengths(i) = temp_wavelength
- filter_trans(i) = temp_trans
- END DO
-
- CLOSE(unit)
- END SUBROUTINE loadfilter
-
- !****************************
- ! Load Lookup Table For Identifying Stellar Atmosphere Models
- !****************************
- SUBROUTINE load_lookuptable(lookup_file, lookup_table, out_file_names, out_logg, out_meta, out_teff)
- CHARACTER(LEN=*), INTENT(IN) :: lookup_file
- REAL, DIMENSION(:,:), ALLOCATABLE, INTENT(OUT) :: lookup_table
- CHARACTER(LEN=100), ALLOCATABLE, INTENT(INOUT) :: out_file_names(:)
- REAL(dp), ALLOCATABLE, INTENT(INOUT) :: out_logg(:), out_meta(:), out_teff(:)
-
- INTEGER :: i, n_rows, status, unit
- CHARACTER(LEN=512) :: line
- CHARACTER(LEN=*), PARAMETER :: delimiter = ","
- CHARACTER(LEN=100), ALLOCATABLE :: columns(:), headers(:)
- INTEGER :: logg_col, meta_col, teff_col
-
- ! Open the file
- unit = 10
- OPEN(unit, FILE=lookup_file, STATUS='old', ACTION='read', IOSTAT=status)
- IF (status /= 0) THEN
- PRINT *, "Error: Could not open file", lookup_file
- STOP
- END IF
-
- ! Read header line
- READ(unit, '(A)', IOSTAT=status) line
- IF (status /= 0) THEN
- PRINT *, "Error: Could not read header line"
- STOP
- END IF
-
- CALL splitline(line, delimiter, headers)
-
- ! Determine column indices for logg, meta, and teff
- logg_col = getcolumnindex(headers, "logg")
- teff_col = getcolumnindex(headers, "teff")
-
- meta_col = getcolumnindex(headers, "meta")
- IF (meta_col < 0) THEN
- meta_col = getcolumnindex(headers, "feh")
- END IF
-
- n_rows = 0
- DO
- READ(unit, '(A)', IOSTAT=status) line
- IF (status /= 0) EXIT
- n_rows = n_rows + 1
- END DO
- REWIND(unit)
-
- ! Skip header
- READ(unit, '(A)', IOSTAT=status) line
-
- ! Allocate output arrays
- ALLOCATE(out_file_names(n_rows))
- ALLOCATE(out_logg(n_rows), out_meta(n_rows), out_teff(n_rows))
-
- ! Read and parse the file
- i = 0
- DO
- READ(unit, '(A)', IOSTAT=status) line
- IF (status /= 0) EXIT
- i = i + 1
-
- CALL splitline(line, delimiter, columns)
-
- ! Populate arrays
- out_file_names(i) = columns(1)
-
- IF (logg_col > 0) THEN
- IF (columns(logg_col) /= "") THEN
- READ(columns(logg_col), *) out_logg(i)
- ELSE
- out_logg(i) = 0.0
- END IF
- ELSE
- out_logg(i) = 0.0
+ PRINT *, "Error: Could not open Vega SED file ", TRIM(filepath)
+ CALL mesa_error(__FILE__, __LINE__)
END IF
- IF (meta_col > 0) THEN
- IF (columns(meta_col) /= "") THEN
- READ(columns(meta_col), *) out_meta(i)
- ELSE
- out_meta(i) = 0.0
- END IF
- ELSE
- out_meta(i) = 0.0
+ ! Skip header line
+ READ (unit, '(A)', IOSTAT=status) line
+ IF (status /= 0) THEN
+ PRINT *, "Error: Could not read header from Vega SED file ", TRIM(filepath)
+ CALL mesa_error(__FILE__, __LINE__)
END IF
- IF (teff_col > 0) THEN
- IF (columns(teff_col) /= "") THEN
- READ(columns(teff_col), *) out_teff(i)
- ELSE
- out_teff(i) = 0.0
- END IF
- ELSE
- out_teff(i) = 0.0
- END IF
- END DO
+ ! Count the number of data lines
+ n_rows = 0
+ DO
+ READ (unit, '(A)', IOSTAT=status) line
+ IF (status /= 0) EXIT
+ n_rows = n_rows + 1
+ END DO
+
+ REWIND (unit)
+ READ (unit, '(A)', IOSTAT=status) line ! Skip header again
- CLOSE(unit)
+ ALLOCATE (wavelengths(n_rows))
+ ALLOCATE (flux(n_rows))
- CONTAINS
+ i = 0
+ DO
+ READ (unit, *, IOSTAT=status) temp_wave, temp_flux ! Ignore any extra columns
+ IF (status /= 0) EXIT
+ i = i + 1
+ wavelengths(i) = temp_wave
+ flux(i) = temp_flux
+ END DO
+
+ CLOSE (unit)
+ END SUBROUTINE loadvegased
- FUNCTION getcolumnindex(headers, target) RESULT(index)
- CHARACTER(LEN=100), INTENT(IN) :: headers(:)
- CHARACTER(LEN=*), INTENT(IN) :: target
- INTEGER :: index, i
- CHARACTER(LEN=100) :: clean_header, clean_target
+ !****************************
+ ! Load Filter File
+ !****************************
+ SUBROUTINE loadfilter(directory, filter_wavelengths, filter_trans)
+ CHARACTER(LEN=*), INTENT(IN) :: directory
+ REAL(dp), DIMENSION(:), ALLOCATABLE, INTENT(OUT) :: filter_wavelengths, filter_trans
- index = -1
- clean_target = TRIM(ADJUSTL(target)) ! Clean the target string
+ CHARACTER(LEN=512) :: line
+ INTEGER :: unit, n_rows, status, i
+ REAL(dp) :: temp_wavelength, temp_trans
+
+ ! Open the file
+ unit = 20
+ OPEN (unit, FILE=TRIM(directory), STATUS='OLD', ACTION='READ', IOSTAT=status)
+ IF (status /= 0) THEN
+ PRINT *, "Error: Could not open file ", TRIM(directory)
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
+
+ ! Skip header line
+ READ (unit, '(A)', IOSTAT=status) line
+ IF (status /= 0) THEN
+ PRINT *, "Error: Could not read the file", TRIM(directory)
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
- DO i = 1, SIZE(headers)
- clean_header = TRIM(ADJUSTL(headers(i))) ! Clean each header
- IF (clean_header == clean_target) THEN
- index = i
- EXIT
- END IF
+ ! Count rows in the file
+ n_rows = 0
+ DO
+ READ (unit, '(A)', IOSTAT=status) line
+ IF (status /= 0) EXIT
+ n_rows = n_rows + 1
END DO
- END FUNCTION getcolumnindex
- SUBROUTINE splitline(line, delimiter, tokens)
- CHARACTER(LEN=*), INTENT(IN) :: line, delimiter
- CHARACTER(LEN=100), ALLOCATABLE, INTENT(OUT) :: tokens(:)
- INTEGER :: num_tokens, pos, start, len_delim
+ ! Allocate arrays
+ ALLOCATE (filter_wavelengths(n_rows))
+ ALLOCATE (filter_trans(n_rows))
- len_delim = LEN_TRIM(delimiter)
- start = 1
- num_tokens = 0
- IF (ALLOCATED(tokens)) DEALLOCATE(tokens)
+ ! Rewind to the first non-comment line
+ REWIND (unit)
+ DO
+ READ (unit, '(A)', IOSTAT=status) line
+ IF (status /= 0) THEN
+ PRINT *, "Error: Could not rewind file", TRIM(directory)
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
+ IF (line(1:1) /= "#") EXIT
+ END DO
+ ! Read and parse data
+ i = 0
DO
- pos = INDEX(line(start:), delimiter)
+ READ (unit, *, IOSTAT=status) temp_wavelength, temp_trans
+ IF (status /= 0) EXIT
+ i = i + 1
- IF (pos == 0) EXIT
- num_tokens = num_tokens + 1
- CALL AppendToken(tokens, line(start:start + pos - 2))
- start = start + pos + len_delim - 1
+ filter_wavelengths(i) = temp_wavelength
+ filter_trans(i) = temp_trans
END DO
- num_tokens = num_tokens + 1
- CALL AppendToken(tokens, line(start:))
- END SUBROUTINE splitline
-
- SUBROUTINE AppendToken(tokens, token)
- CHARACTER(LEN=*), INTENT(IN) :: token
- CHARACTER(LEN=100), ALLOCATABLE, INTENT(INOUT) :: tokens(:)
- CHARACTER(LEN=100), ALLOCATABLE :: temp(:)
- INTEGER :: n
-
- IF (.NOT. ALLOCATED(tokens)) THEN
- ALLOCATE(tokens(1))
- tokens(1) = token
- ELSE
- n = SIZE(tokens)
- ALLOCATE(temp(n))
- temp = tokens ! Backup the current tokens
- DEALLOCATE(tokens) ! Deallocate the old array
- ALLOCATE(tokens(n + 1)) ! Allocate with one extra space
- tokens(1:n) = temp ! Restore old tokens
- tokens(n + 1) = token ! Add the new token
- DEALLOCATE(temp) ! Clean up temporary array
+ CLOSE (unit)
+ END SUBROUTINE loadfilter
+
+ !****************************
+ ! Load Lookup Table For Identifying Stellar Atmosphere Models
+ !****************************
+ SUBROUTINE load_lookuptable(lookup_file, lookup_table, out_file_names, out_logg, out_meta, out_teff)
+ CHARACTER(LEN=*), INTENT(IN) :: lookup_file
+ REAL, DIMENSION(:, :), ALLOCATABLE, INTENT(OUT) :: lookup_table
+ CHARACTER(LEN=100), ALLOCATABLE, INTENT(INOUT) :: out_file_names(:)
+ REAL(dp), ALLOCATABLE, INTENT(INOUT) :: out_logg(:), out_meta(:), out_teff(:)
+
+ INTEGER :: i, n_rows, status, unit
+ CHARACTER(LEN=512) :: line
+ CHARACTER(LEN=*), PARAMETER :: delimiter = ","
+ CHARACTER(LEN=100), ALLOCATABLE :: columns(:), headers(:)
+ INTEGER :: logg_col, meta_col, teff_col
+
+ ! Open the file
+ unit = 10
+ OPEN (unit, FILE=lookup_file, STATUS='old', ACTION='read', IOSTAT=status)
+ IF (status /= 0) THEN
+ PRINT *, "Error: Could not open file", lookup_file
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
+
+ ! Read header line
+ READ (unit, '(A)', IOSTAT=status) line
+ IF (status /= 0) THEN
+ PRINT *, "Error: Could not read header line"
+ CALL mesa_error(__FILE__, __LINE__)
END IF
- END SUBROUTINE AppendToken
- END SUBROUTINE load_lookuptable
+ CALL splitline(line, delimiter, headers)
+ ! Determine column indices for logg, meta, and teff
+ logg_col = getcolumnindex(headers, "logg")
+ teff_col = getcolumnindex(headers, "teff")
+ meta_col = getcolumnindex(headers, "meta")
+ IF (meta_col < 0) THEN
+ meta_col = getcolumnindex(headers, "feh")
+ END IF
+ n_rows = 0
+ DO
+ READ (unit, '(A)', IOSTAT=status) line
+ IF (status /= 0) EXIT
+ n_rows = n_rows + 1
+ END DO
+ REWIND (unit)
+ ! Skip header
+ READ (unit, '(A)', IOSTAT=status) line
+ ! Allocate output arrays
+ ALLOCATE (out_file_names(n_rows))
+ ALLOCATE (out_logg(n_rows), out_meta(n_rows), out_teff(n_rows))
+ ! Read and parse the file
+ i = 0
+ DO
+ READ (unit, '(A)', IOSTAT=status) line
+ IF (status /= 0) EXIT
+ i = i + 1
- SUBROUTINE loadsed(directory, index, wavelengths, flux)
- CHARACTER(LEN=*), INTENT(IN) :: directory
- INTEGER, INTENT(IN) :: index
- REAL(DP), DIMENSION(:), ALLOCATABLE, INTENT(OUT) :: wavelengths, flux
+ CALL splitline(line, delimiter, columns)
- CHARACTER(LEN=512) :: line
- INTEGER :: unit, n_rows, status, i
- REAL(DP) :: temp_wavelength, temp_flux
+ ! Populate arrays
+ out_file_names(i) = columns(1)
+
+ IF (logg_col > 0) THEN
+ IF (columns(logg_col) /= "") THEN
+ READ (columns(logg_col), *) out_logg(i)
+ ELSE
+ out_logg(i) = 0.0
+ END IF
+ ELSE
+ out_logg(i) = 0.0
+ END IF
- ! Open the file
- unit = 20
- OPEN(unit, FILE=TRIM(directory), STATUS='OLD', ACTION='READ', IOSTAT=status)
- IF (status /= 0) THEN
+ IF (meta_col > 0) THEN
+ IF (columns(meta_col) /= "") THEN
+ READ (columns(meta_col), *) out_meta(i)
+ ELSE
+ out_meta(i) = 0.0
+ END IF
+ ELSE
+ out_meta(i) = 0.0
+ END IF
+
+ IF (teff_col > 0) THEN
+ IF (columns(teff_col) /= "") THEN
+ READ (columns(teff_col), *) out_teff(i)
+ ELSE
+ out_teff(i) = 0.0
+ END IF
+ ELSE
+ out_teff(i) = 0.0
+ END IF
+ END DO
+
+ CLOSE (unit)
+
+ CONTAINS
+
+ FUNCTION getcolumnindex(headers, target) RESULT(index)
+ CHARACTER(LEN=100), INTENT(IN) :: headers(:)
+ CHARACTER(LEN=*), INTENT(IN) :: target
+ INTEGER :: index, i
+ CHARACTER(LEN=100) :: clean_header, clean_target
+
+ index = -1
+ clean_target = TRIM(ADJUSTL(target)) ! Clean the target string
+
+ DO i = 1, SIZE(headers)
+ clean_header = TRIM(ADJUSTL(headers(i))) ! Clean each header
+ IF (clean_header == clean_target) THEN
+ index = i
+ EXIT
+ END IF
+ END DO
+ END FUNCTION getcolumnindex
+
+ SUBROUTINE splitline(line, delimiter, tokens)
+ CHARACTER(LEN=*), INTENT(IN) :: line, delimiter
+ CHARACTER(LEN=100), ALLOCATABLE, INTENT(OUT) :: tokens(:)
+ INTEGER :: num_tokens, pos, start, len_delim
+
+ len_delim = LEN_TRIM(delimiter)
+ start = 1
+ num_tokens = 0
+ IF (ALLOCATED(tokens)) DEALLOCATE (tokens)
+
+ DO
+ pos = INDEX(line(start:), delimiter)
+
+ IF (pos == 0) EXIT
+ num_tokens = num_tokens + 1
+ CALL AppendToken(tokens, line(start:start + pos - 2))
+ start = start + pos + len_delim - 1
+ END DO
+
+ num_tokens = num_tokens + 1
+ CALL AppendToken(tokens, line(start:))
+ END SUBROUTINE splitline
+
+ SUBROUTINE AppendToken(tokens, token)
+ CHARACTER(LEN=*), INTENT(IN) :: token
+ CHARACTER(LEN=100), ALLOCATABLE, INTENT(INOUT) :: tokens(:)
+ CHARACTER(LEN=100), ALLOCATABLE :: temp(:)
+ INTEGER :: n
+
+ IF (.NOT. ALLOCATED(tokens)) THEN
+ ALLOCATE (tokens(1))
+ tokens(1) = token
+ ELSE
+ n = SIZE(tokens)
+ ALLOCATE (temp(n))
+ temp = tokens ! Backup the current tokens
+ DEALLOCATE (tokens) ! Deallocate the old array
+ ALLOCATE (tokens(n + 1)) ! Allocate with one extra space
+ tokens(1:n) = temp ! Restore old tokens
+ tokens(n + 1) = token ! Add the new token
+ DEALLOCATE (temp) ! Clean up temporary array
+ END IF
+ END SUBROUTINE AppendToken
+
+ END SUBROUTINE load_lookuptable
+
+ SUBROUTINE loadsed(directory, index, wavelengths, flux)
+ CHARACTER(LEN=*), INTENT(IN) :: directory
+ INTEGER, INTENT(IN) :: index
+ REAL(DP), DIMENSION(:), ALLOCATABLE, INTENT(OUT) :: wavelengths, flux
+
+ CHARACTER(LEN=512) :: line
+ INTEGER :: unit, n_rows, status, i
+ REAL(DP) :: temp_wavelength, temp_flux
+
+ ! Open the file
+ unit = 20
+ OPEN (unit, FILE=TRIM(directory), STATUS='OLD', ACTION='READ', IOSTAT=status)
+ IF (status /= 0) THEN
PRINT *, "Error: Could not open file ", TRIM(directory)
- STOP
- END IF
+ CALL mesa_error(__FILE__, __LINE__)
+ END IF
- ! Skip header lines
- DO
- READ(unit, '(A)', IOSTAT=status) line
+ ! Skip header lines
+ DO
+ READ (unit, '(A)', IOSTAT=status) line
IF (status /= 0) THEN
- PRINT *, "Error: Could not read the file", TRIM(directory)
- STOP
+ PRINT *, "Error: Could not read the file", TRIM(directory)
+ CALL mesa_error(__FILE__, __LINE__)
END IF
IF (line(1:1) /= "#") EXIT
- END DO
+ END DO
- ! Count rows in the file
- n_rows = 0
- DO
- READ(unit, '(A)', IOSTAT=status) line
+ ! Count rows in the file
+ n_rows = 0
+ DO
+ READ (unit, '(A)', IOSTAT=status) line
IF (status /= 0) EXIT
n_rows = n_rows + 1
- END DO
+ END DO
- ! Allocate arrays
- ALLOCATE(wavelengths(n_rows))
- ALLOCATE(flux(n_rows))
+ ! Allocate arrays
+ ALLOCATE (wavelengths(n_rows))
+ ALLOCATE (flux(n_rows))
- ! Rewind to the first non-comment line
- REWIND(unit)
- DO
- READ(unit, '(A)', IOSTAT=status) line
+ ! Rewind to the first non-comment line
+ REWIND (unit)
+ DO
+ READ (unit, '(A)', IOSTAT=status) line
IF (status /= 0) THEN
- PRINT *, "Error: Could not rewind file", TRIM(directory)
- STOP
+ PRINT *, "Error: Could not rewind file", TRIM(directory)
+ CALL mesa_error(__FILE__, __LINE__)
END IF
IF (line(1:1) /= "#") EXIT
- END DO
+ END DO
- ! Read and parse data
- i = 0
- DO
- READ(unit, *, IOSTAT=status) temp_wavelength, temp_flux
+ ! Read and parse data
+ i = 0
+ DO
+ READ (unit, *, IOSTAT=status) temp_wavelength, temp_flux
IF (status /= 0) EXIT
i = i + 1
! Convert f_lambda to f_nu
wavelengths(i) = temp_wavelength
flux(i) = temp_flux
- END DO
-
- CLOSE(unit)
-
- END SUBROUTINE loadsed
-
-
- !-----------------------------------------------------------------------
- ! Helper function for file names
- !-----------------------------------------------------------------------
-
- function remove_dat(path) result(base)
- ! Extracts the portion of the string before the first dot
- character(len=*), intent(in) :: path
- character(len=strlen) :: base
- integer :: first_dot
-
- ! Find the position of the first dot
- first_dot = 0
- do while (first_dot < len_trim(path) .and. path(first_dot+1:first_dot+1) /= '.')
- first_dot = first_dot + 1
- end do
-
- ! Check if a dot was found
- if (first_dot < len_trim(path)) then
- ! Extract the part before the dot
- base = path(:first_dot)
- else
- ! No dot found, return the input string
- base = path
- end if
- end function remove_dat
-
-
-
-
-
+ END DO
-END MODULE shared_funcs
\ No newline at end of file
+ CLOSE (unit)
+
+ END SUBROUTINE loadsed
+
+ !-----------------------------------------------------------------------
+ ! Helper function for file names
+ !-----------------------------------------------------------------------
+
+ function remove_dat(path) result(base)
+ ! Extracts the portion of the string before the first dot
+ character(len=*), intent(in) :: path
+ character(len=strlen) :: base
+ integer :: first_dot
+
+ ! Find the position of the first dot
+ first_dot = 0
+ do while (first_dot < len_trim(path) .and. path(first_dot + 1:first_dot + 1) /= '.')
+ first_dot = first_dot + 1
+ end do
+
+ ! Check if a dot was found
+ if (first_dot < len_trim(path)) then
+ ! Extract the part before the dot
+ base = path(:first_dot)
+ else
+ ! No dot found, return the input string
+ base = path
+ end if
+ end function remove_dat
+
+END MODULE shared_funcs
diff --git a/colors/private/synthetic.f90 b/colors/private/synthetic.f90
index 30ac6c30c..85dadb2ad 100644
--- a/colors/private/synthetic.f90
+++ b/colors/private/synthetic.f90
@@ -1,71 +1,88 @@
! ***********************************************************************
!
-! Copyright (C) 2025 Niall Miller & The MESA Team
-! Modified to include AB and ST magnitude systems.
+! Copyright (C) 2025 The MESA Team
+!
+! This program is free software: you can redistribute it and/or modify
+! it under the terms of the GNU Lesser General Public License
+! as published by the Free Software Foundation,
+! either version 3 of the License, or (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+! See the GNU Lesser General Public License for more details.
+!
+! You should have received a copy of the GNU Lesser General Public License
+! along with this program. If not, see .
!
! ***********************************************************************
module synthetic
- ! Added clight for AB conversions
use const_def, only: dp, clight
use utils_lib, only: mkdir, folder_exists
- use colors_utils, only: remove_dat, romberg_integration, load_filter, load_vega_sed, load_lookup_table
+ use colors_utils, only: remove_dat, romberg_integration
use knn_interp, only: interpolate_array
implicit none
private
public :: calculate_synthetic
+ ! Export zero-point computation functions for precomputation at initialization
+ public :: compute_vega_zero_point, compute_ab_zero_point, compute_st_zero_point
contains
!****************************
! Calculate Synthetic Photometry Using SED and Filter
+ ! Uses precomputed zero-point from filter data
!****************************
real(dp) function calculate_synthetic(temperature, gravity, metallicity, ierr, &
- wavelengths, fluxes, filter_wavelengths, &
- filter_trans, &
- filter_filepath, vega_filepath, &
- filter_name, make_sed, colors_results_directory, &
- mag_system)
+ wavelengths, fluxes, &
+ filter_wavelengths, filter_trans, &
+ zero_point_flux, &
+ filter_name, make_sed, colors_results_directory)
! Input arguments
real(dp), intent(in) :: temperature, gravity, metallicity
- character(len=*), intent(in) :: filter_filepath, filter_name, vega_filepath, colors_results_directory
- character(len=*), intent(in) :: mag_system ! NEW: Arguments for 'Vega', 'AB', or 'ST'
+ character(len=*), intent(in) :: filter_name, colors_results_directory
integer, intent(out) :: ierr
- character(len=1000) :: line
- real(dp), dimension(:), intent(inout) :: wavelengths, fluxes
- real(dp), dimension(:), allocatable, intent(inout) :: filter_wavelengths, filter_trans
+ real(dp), dimension(:), intent(in) :: wavelengths, fluxes
+ real(dp), dimension(:), intent(in) :: filter_wavelengths, filter_trans
+ real(dp), intent(in) :: zero_point_flux ! precomputed at initialization
logical, intent(in) :: make_sed
! Local variables
- real(dp), dimension(:), allocatable :: convolved_flux
- character(len=100) :: csv_file
- real(dp) :: synthetic_flux, zero_point_flux
+ real(dp), dimension(:), allocatable :: convolved_flux, filter_on_sed_grid
+ character(len=256) :: csv_file
+ character(len=1000) :: line
+ real(dp) :: synthetic_flux
integer :: max_size, i
real(dp) :: wv, fl, cf, fwv, ftr
- if (.not. folder_exists(trim(colors_results_directory))) call mkdir(trim(colors_results_directory))
- csv_file = trim(colors_results_directory)//'/'//trim(remove_dat(filter_name))//'_SED.csv'
ierr = 0
- ! Load filter data
- call load_filter(filter_filepath, filter_wavelengths, filter_trans)
+ ! Allocate working arrays
+ allocate(convolved_flux(size(wavelengths)))
+ allocate(filter_on_sed_grid(size(wavelengths)))
+
+ ! Interpolate filter onto SED wavelength grid
+ call interpolate_array(filter_wavelengths, filter_trans, wavelengths, filter_on_sed_grid)
- ! Perform SED convolution (Source Object)
- allocate (convolved_flux(size(wavelengths)))
- call convolve_sed(wavelengths, fluxes, filter_wavelengths, filter_trans, convolved_flux)
+ ! Convolve SED with filter
+ convolved_flux = fluxes * filter_on_sed_grid
! Write SED to CSV if requested
if (make_sed) then
- max_size = max(size(wavelengths), size(filter_wavelengths), &
- size(fluxes), size(convolved_flux), size(filter_trans))
+ if (.not. folder_exists(trim(colors_results_directory))) call mkdir(trim(colors_results_directory))
+ csv_file = trim(colors_results_directory)//'/'//trim(remove_dat(filter_name))//'_SED.csv'
+
+ max_size = max(size(wavelengths), size(filter_wavelengths))
open (unit=10, file=csv_file, status='REPLACE', action='write', iostat=ierr)
if (ierr /= 0) then
print *, "Error opening file for writing"
+ deallocate(convolved_flux, filter_on_sed_grid)
return
end if
@@ -86,226 +103,143 @@ real(dp) function calculate_synthetic(temperature, gravity, metallicity, ierr, &
close (10)
end if
- ! ------------------------------------------------------------------
- ! Calculate Zero Point Flux based on System Selection
- ! ------------------------------------------------------------------
- select case (trim(mag_system))
- case ('VEGA', 'Vega', 'vega')
- zero_point_flux = calculate_vega_flux(vega_filepath, filter_wavelengths, filter_trans, &
- filter_name, make_sed, colors_results_directory)
- case ('AB', 'ab')
- zero_point_flux = calculate_ab_zero_point(filter_wavelengths, filter_trans)
- case ('ST', 'st')
- zero_point_flux = calculate_st_zero_point(filter_wavelengths, filter_trans)
- case default
- print *, "Error: Unknown magnitude system: ", mag_system
- calculate_synthetic = huge(1.0_dp)
- return
- end select
-
- ! Calculate synthetic flux (Source Object)
- call calculate_synthetic_flux(wavelengths, convolved_flux, synthetic_flux, &
- filter_wavelengths, filter_trans)
+ ! Calculate synthetic flux using photon-counting integration
+ call calculate_synthetic_flux(wavelengths, convolved_flux, filter_on_sed_grid, synthetic_flux)
- ! Calculate magnitude using the selected zero point
- if (zero_point_flux > 0.0_dp) then
- calculate_synthetic = -2.5d0*log10(synthetic_flux/zero_point_flux)
+ ! Calculate magnitude
+ if (zero_point_flux > 0.0_dp .and. synthetic_flux > 0.0_dp) then
+ calculate_synthetic = -2.5d0 * log10(synthetic_flux / zero_point_flux)
else
- print *, "Error: Zero point flux is zero, magnitude calculation is invalid."
+ if (zero_point_flux <= 0.0_dp) then
+ print *, "Error: Zero point flux is zero or negative for filter ", trim(filter_name)
+ end if
+ if (synthetic_flux <= 0.0_dp) then
+ print *, "Error: Synthetic flux is zero or negative for filter ", trim(filter_name)
+ end if
calculate_synthetic = huge(1.0_dp)
end if
- ! Clean up
- deallocate (convolved_flux)
+ deallocate(convolved_flux, filter_on_sed_grid)
end function calculate_synthetic
- !-----------------------------------------------------------------------
- ! Internal functions for synthetic photometry
- !-----------------------------------------------------------------------
-
!****************************
- ! Convolve SED With Filter
+ ! Calculate Synthetic Flux (photon-counting integration)
!****************************
- subroutine convolve_sed(wavelengths, fluxes, filter_wavelengths, filter_trans, convolved_flux)
- real(dp), dimension(:), intent(inout) :: wavelengths, fluxes
- real(dp), dimension(:), intent(inout) :: filter_wavelengths, filter_trans
- real(dp), dimension(:), allocatable, intent(out) :: convolved_flux
- real(dp), dimension(:), allocatable :: interpolated_filter
- integer :: n
-
- n = size(wavelengths)
- allocate (interpolated_filter(n))
- call interpolate_array(filter_wavelengths, filter_trans, wavelengths, interpolated_filter)
- convolved_flux = fluxes*interpolated_filter
- deallocate (interpolated_filter)
- end subroutine convolve_sed
-
- !****************************
- ! Calculate Synthetic Flux (Integration)
- !****************************
- subroutine calculate_synthetic_flux(wavelengths, fluxes, synthetic_flux, &
- filter_wavelengths, filter_trans)
-
- real(dp), dimension(:), intent(in) :: wavelengths, fluxes
- real(dp), dimension(:), intent(inout) :: filter_wavelengths, filter_trans
+ subroutine calculate_synthetic_flux(wavelengths, convolved_flux, filter_on_sed_grid, synthetic_flux)
+ real(dp), dimension(:), intent(in) :: wavelengths, convolved_flux, filter_on_sed_grid
real(dp), intent(out) :: synthetic_flux
- integer :: i
- real(dp) :: integrated_flux, integrated_filter
- ! Validate inputs
- do i = 1, size(wavelengths) - 1
- if (wavelengths(i) <= 0.0_dp .or. fluxes(i) < 0.0_dp) then
- print *, "synthetic Invalid input at index", i, ":", wavelengths(i), fluxes(i)
- stop
- end if
- end do
+ real(dp) :: integrated_flux, integrated_filter
- call romberg_integration(wavelengths, fluxes*wavelengths, integrated_flux)
- call romberg_integration(filter_wavelengths, &
- filter_trans*filter_wavelengths, integrated_filter)
+ ! Photon-counting: weight by wavelength
+ call romberg_integration(wavelengths, convolved_flux * wavelengths, integrated_flux)
+ call romberg_integration(wavelengths, filter_on_sed_grid * wavelengths, integrated_filter)
if (integrated_filter > 0.0_dp) then
- synthetic_flux = integrated_flux/integrated_filter
+ synthetic_flux = integrated_flux / integrated_filter
else
print *, "Error: Integrated filter transmission is zero."
synthetic_flux = -1.0_dp
- return
end if
end subroutine calculate_synthetic_flux
!****************************
- ! Calculate Vega Flux for Zero Point
+ ! Compute Vega Zero Point Flux
+ ! Called once at initialization, result cached in filter_data
!****************************
- function calculate_vega_flux(vega_filepath, filt_wave, filt_trans, &
- filter_name, make_sed, colors_results_directory) result(vega_flux)
- character(len=*), intent(in) :: vega_filepath, filter_name, colors_results_directory
- character(len=100) :: output_csv
- real(dp), dimension(:), intent(inout) :: filt_wave, filt_trans
- real(dp) :: vega_flux
+ real(dp) function compute_vega_zero_point(vega_wave, vega_flux, filt_wave, filt_trans)
+ real(dp), dimension(:), intent(in) :: vega_wave, vega_flux
+ real(dp), dimension(:), intent(in) :: filt_wave, filt_trans
+
real(dp) :: int_flux, int_filter
- real(dp), allocatable :: vega_wave(:), vega_flux_arr(:), conv_flux(:)
- logical, intent(in) :: make_sed
- integer :: i, max_size, ierr
- real(dp) :: wv, fl, cf, fwv, ftr
- character(len=1000) :: line
+ real(dp), allocatable :: filt_on_vega_grid(:), conv_flux(:)
+
+ allocate(filt_on_vega_grid(size(vega_wave)))
+ allocate(conv_flux(size(vega_wave)))
- ! Load the Vega SED
- call load_vega_sed(vega_filepath, vega_wave, vega_flux_arr)
+ ! Interpolate filter onto Vega wavelength grid
+ call interpolate_array(filt_wave, filt_trans, vega_wave, filt_on_vega_grid)
- ! Convolve the Vega SED with the filter transmission
- allocate (conv_flux(size(vega_wave)))
- call convolve_sed(vega_wave, vega_flux_arr, filt_wave, filt_trans, conv_flux)
+ ! Convolve Vega with filter
+ conv_flux = vega_flux * filt_on_vega_grid
- ! Integrate
- call romberg_integration(vega_wave, vega_wave*conv_flux, int_flux)
- call romberg_integration(filt_wave, filt_wave*filt_trans, int_filter)
+ ! Photon-counting integration
+ call romberg_integration(vega_wave, vega_wave * conv_flux, int_flux)
+ call romberg_integration(vega_wave, vega_wave * filt_on_vega_grid, int_filter)
if (int_filter > 0.0_dp) then
- vega_flux = int_flux/int_filter
+ compute_vega_zero_point = int_flux / int_filter
else
- vega_flux = -1.0_dp
+ compute_vega_zero_point = -1.0_dp
end if
- ! Write Vega SED to CSV if requested
- if (make_sed) then
- max_size = max(size(vega_wave), size(vega_flux_arr), size(conv_flux), &
- size(filt_wave), size(filt_trans))
-
- if (.not. folder_exists(trim(colors_results_directory))) call mkdir(trim(colors_results_directory))
- output_csv = trim(colors_results_directory)//'/VEGA_'//trim(remove_dat(filter_name))//'_SED.csv'
-
- open (unit=10, file=output_csv, status='REPLACE', action='write', iostat=ierr)
- if (ierr /= 0) then
- print *, "Error opening file for writing"
- return
- end if
-
- write (10, '(A)') "wavelengths,fluxes,convolved_flux,filter_wavelengths,filter_trans"
-
- do i = 1, max_size
- wv = 0.0_dp; fl = 0.0_dp; cf = 0.0_dp; fwv = 0.0_dp; ftr = 0.0_dp
- if (i <= size(vega_wave)) wv = vega_wave(i)
- if (i <= size(vega_flux_arr)) fl = vega_flux_arr(i)
- if (i <= size(conv_flux)) cf = conv_flux(i)
- if (i <= size(filt_wave)) fwv = filt_wave(i)
- if (i <= size(filt_trans)) ftr = filt_trans(i)
-
- write (line, '(ES14.6, ",", ES14.6, ",", ES14.6, ",", ES14.6, ",", ES14.6)') &
- wv, fl, cf, fwv, ftr
- write (10, '(A)') trim(line)
- end do
- close (10)
- end if
- deallocate (conv_flux, vega_wave, vega_flux_arr)
- end function calculate_vega_flux
+ deallocate(filt_on_vega_grid, conv_flux)
+ end function compute_vega_zero_point
!****************************
- ! Calculate AB Zero Point Flux
+ ! Compute AB Zero Point Flux
! f_nu = 3631 Jy = 3.631e-20 erg/s/cm^2/Hz
! f_lambda = f_nu * c / lambda^2
+ ! Called once at initialization, result cached in filter_data
!****************************
- function calculate_ab_zero_point(filt_wave, filt_trans) result(ab_flux)
- real(dp), dimension(:), intent(inout) :: filt_wave, filt_trans
- real(dp) :: ab_flux
+ real(dp) function compute_ab_zero_point(filt_wave, filt_trans)
+ real(dp), dimension(:), intent(in) :: filt_wave, filt_trans
+
real(dp) :: int_flux, int_filter
real(dp), allocatable :: ab_sed_flux(:)
integer :: i
allocate(ab_sed_flux(size(filt_wave)))
- ! Construct AB Spectrum (f_lambda) on the filter wavelength grid
- ! Assumes wavelengths are in Angstroms and clight is in Angstroms/sec
+ ! Construct AB spectrum (f_lambda) on the filter wavelength grid
! 3631 Jy = 3.631E-20 erg/s/cm^2/Hz
+ ! clight in cm/s, wavelength in Angstroms, need to convert
do i = 1, size(filt_wave)
if (filt_wave(i) > 0.0_dp) then
- ab_sed_flux(i) = 3.631d-20 * (clight / (filt_wave(i)**2))
+ ab_sed_flux(i) = 3.631d-20 * ((clight * 1.0d8) / (filt_wave(i)**2))
else
ab_sed_flux(i) = 0.0_dp
- endif
+ end if
end do
- ! Integrate using same method as source (f_lambda * T * lambda)
- ! Note: We multiply by filt_wave inside the integration because the
- ! romberg helper expects (flux * lambda)
+ ! Photon-counting integration
call romberg_integration(filt_wave, ab_sed_flux * filt_trans * filt_wave, int_flux)
call romberg_integration(filt_wave, filt_wave * filt_trans, int_filter)
if (int_filter > 0.0_dp) then
- ab_flux = int_flux / int_filter
+ compute_ab_zero_point = int_flux / int_filter
else
- ab_flux = -1.0_dp
+ compute_ab_zero_point = -1.0_dp
end if
deallocate(ab_sed_flux)
- end function calculate_ab_zero_point
+ end function compute_ab_zero_point
!****************************
- ! Calculate ST Zero Point Flux
+ ! Compute ST Zero Point Flux
! f_lambda = 3.63e-9 erg/s/cm^2/A (Constant)
+ ! Called once at initialization, result cached in filter_data
!****************************
- function calculate_st_zero_point(filt_wave, filt_trans) result(st_flux)
- real(dp), dimension(:), intent(inout) :: filt_wave, filt_trans
- real(dp) :: st_flux
+ real(dp) function compute_st_zero_point(filt_wave, filt_trans)
+ real(dp), dimension(:), intent(in) :: filt_wave, filt_trans
+
real(dp) :: int_flux, int_filter
real(dp), allocatable :: st_sed_flux(:)
- ! For ST system, flux is constant in wavelength
- ! However, to maintain exact consistency with how the source is integrated
- ! (numerical integration over the filter grid), we integrate the constant array.
-
allocate(st_sed_flux(size(filt_wave)))
st_sed_flux = 3.63d-9
+ ! Photon-counting integration
call romberg_integration(filt_wave, st_sed_flux * filt_trans * filt_wave, int_flux)
call romberg_integration(filt_wave, filt_wave * filt_trans, int_filter)
if (int_filter > 0.0_dp) then
- st_flux = int_flux / int_filter
+ compute_st_zero_point = int_flux / int_filter
else
- st_flux = -1.0_dp
+ compute_st_zero_point = -1.0_dp
end if
deallocate(st_sed_flux)
- end function calculate_st_zero_point
+ end function compute_st_zero_point
end module synthetic
\ No newline at end of file
diff --git a/colors/public/colors_def.f90 b/colors/public/colors_def.f90
index 25ae1b531..ec37f2326 100644
--- a/colors/public/colors_def.f90
+++ b/colors/public/colors_def.f90
@@ -26,6 +26,17 @@ module colors_def
! Make everything in this module public by default
public
+ ! Type to hold individual filter data
+ type :: filter_data
+ character(len=100) :: name
+ real(dp), allocatable :: wavelengths(:)
+ real(dp), allocatable :: transmission(:)
+ ! Precomputed zero-point fluxes (computed once at initialization)
+ real(dp) :: vega_zero_point = -1.0_dp
+ real(dp) :: ab_zero_point = -1.0_dp
+ real(dp) :: st_zero_point = -1.0_dp
+ end type filter_data
+
! Colors Module control parameters
type :: Colors_General_Info
character(len=256) :: instrument
@@ -37,13 +48,28 @@ module colors_def
real(dp) :: distance
logical :: make_csv
logical :: use_colors
- ! bookkeeping
integer :: handle
logical :: in_use
+
+ ! Cached lookup table data
+ logical :: lookup_loaded = .false.
+ character(len=100), allocatable :: lu_file_names(:)
+ real(dp), allocatable :: lu_logg(:)
+ real(dp), allocatable :: lu_meta(:)
+ real(dp), allocatable :: lu_teff(:)
+
+ ! Cached Vega SED
+ logical :: vega_loaded = .false.
+ real(dp), allocatable :: vega_wavelengths(:)
+ real(dp), allocatable :: vega_fluxes(:)
+
+ ! Cached filter data (includes precomputed zero-points)
+ logical :: filters_loaded = .false.
+ type(filter_data), allocatable :: filters(:)
+
end type Colors_General_Info
- ! TODO: Use handles/caching in the future once we have more colors tables
- ! For now, we will just point to a single file
+ ! Global filter name list (shared across handles)
integer :: num_color_filters
character(len=100), allocatable :: color_filter_names(:)
@@ -75,6 +101,9 @@ subroutine colors_def_init(colors_cache_dir_in)
do i = 1, max_colors_handles
colors_handles(i)%handle = i
colors_handles(i)%in_use = .false.
+ colors_handles(i)%lookup_loaded = .false.
+ colors_handles(i)%vega_loaded = .false.
+ colors_handles(i)%filters_loaded = .false.
end do
colors_temp_cache_dir = trim(mesa_temp_caches_dir)//'/colors_cache'
@@ -108,10 +137,50 @@ end function do_alloc_colors
subroutine do_free_colors(handle)
integer, intent(in) :: handle
- if (handle >= 1 .and. handle <= max_colors_handles) &
+ if (handle >= 1 .and. handle <= max_colors_handles) then
colors_handles(handle)%in_use = .false.
+ call free_colors_cache(handle)
+ end if
end subroutine do_free_colors
+ subroutine free_colors_cache(handle)
+ integer, intent(in) :: handle
+ integer :: i
+
+ if (handle < 1 .or. handle > max_colors_handles) return
+
+ ! Free lookup table arrays
+ if (allocated(colors_handles(handle)%lu_file_names)) &
+ deallocate(colors_handles(handle)%lu_file_names)
+ if (allocated(colors_handles(handle)%lu_logg)) &
+ deallocate(colors_handles(handle)%lu_logg)
+ if (allocated(colors_handles(handle)%lu_meta)) &
+ deallocate(colors_handles(handle)%lu_meta)
+ if (allocated(colors_handles(handle)%lu_teff)) &
+ deallocate(colors_handles(handle)%lu_teff)
+ colors_handles(handle)%lookup_loaded = .false.
+
+ ! Free Vega SED arrays
+ if (allocated(colors_handles(handle)%vega_wavelengths)) &
+ deallocate(colors_handles(handle)%vega_wavelengths)
+ if (allocated(colors_handles(handle)%vega_fluxes)) &
+ deallocate(colors_handles(handle)%vega_fluxes)
+ colors_handles(handle)%vega_loaded = .false.
+
+ ! Free filter data arrays
+ if (allocated(colors_handles(handle)%filters)) then
+ do i = 1, size(colors_handles(handle)%filters)
+ if (allocated(colors_handles(handle)%filters(i)%wavelengths)) &
+ deallocate(colors_handles(handle)%filters(i)%wavelengths)
+ if (allocated(colors_handles(handle)%filters(i)%transmission)) &
+ deallocate(colors_handles(handle)%filters(i)%transmission)
+ end do
+ deallocate(colors_handles(handle)%filters)
+ end if
+ colors_handles(handle)%filters_loaded = .false.
+
+ end subroutine free_colors_cache
+
subroutine get_colors_ptr(handle, rq, ierr)
integer, intent(in) :: handle
type(Colors_General_Info), pointer, intent(out) :: rq
@@ -125,12 +194,16 @@ subroutine get_colors_ptr(handle, rq, ierr)
end subroutine get_colors_ptr
subroutine do_free_colors_tables
+ integer :: i
- ! TODO: implement me if needed, see kap
+ ! Free the filter names array
+ if (allocated(color_filter_names)) deallocate(color_filter_names)
- ! for now, free the strings tables
- if (allocated(color_filter_names)) deallocate (color_filter_names)
+ ! Free cached data for all handles
+ do i = 1, max_colors_handles
+ call free_colors_cache(i)
+ end do
end subroutine do_free_colors_tables
-end module colors_def
+end module colors_def
\ No newline at end of file
diff --git a/colors/public/colors_lib.f90 b/colors/public/colors_lib.f90
index a3cc804af..fbc9566d3 100644
--- a/colors/public/colors_lib.f90
+++ b/colors/public/colors_lib.f90
@@ -19,10 +19,10 @@
module colors_lib
- use const_def, only: dp, strlen
+ use const_def, only: dp, strlen, mesa_dir
use bolometric, only: calculate_bolometric
use synthetic, only: calculate_synthetic
- use colors_utils, only: read_strings_from_file
+ use colors_utils, only: read_strings_from_file, load_lookup_table, load_filter, load_vega_sed
use colors_history, only: how_many_colors_history_columns, data_for_colors_history_columns
implicit none
@@ -117,22 +117,72 @@ subroutine colors_ptr(handle, rq, ierr)
end subroutine colors_ptr
subroutine colors_setup_tables(handle, ierr)
- use colors_def, only: colors_General_Info, get_colors_ptr, color_filter_names, num_color_filters
- ! TODO: use load_colors, only: Setup_colors_Tables
+ use colors_def, only: Colors_General_Info, get_colors_ptr, color_filter_names, num_color_filters
+ use synthetic, only: compute_vega_zero_point, compute_ab_zero_point, compute_st_zero_point
integer, intent(in) :: handle
integer, intent(out):: ierr
- type(colors_General_Info), pointer :: rq
- logical, parameter :: use_cache = .true.
- logical, parameter :: load_on_demand = .true.
+ type(Colors_General_Info), pointer :: rq
+ character(len=256) :: lookup_file, filter_dir, filter_filepath, vega_filepath
+ REAL, allocatable :: lookup_table(:,:) ! unused but required by load_lookup_table
+ integer :: i
ierr = 0
call get_colors_ptr(handle, rq, ierr)
- ! TODO: call Setup_colors_Tables(rq, use_cache, load_on_demand, ierr)
+ if (ierr /= 0) return
- ! TODO: For now, don't use cache (future feature)
- ! but rely on user specifying a single filters directory, and read it here
+ ! Read filter names from instrument directory
call read_strings_from_file(rq, color_filter_names, num_color_filters, ierr)
+ if (ierr /= 0) return
+
+ ! =========================================
+ ! Load lookup table (stellar atmosphere grid)
+ ! =========================================
+ if (.not. rq%lookup_loaded) then
+ lookup_file = trim(mesa_dir)//trim(rq%stellar_atm)//'/lookup_table.csv'
+ call load_lookup_table(lookup_file, lookup_table, &
+ rq%lu_file_names, rq%lu_logg, rq%lu_meta, rq%lu_teff)
+ rq%lookup_loaded = .true.
+ if (allocated(lookup_table)) deallocate(lookup_table)
+ end if
+
+ ! =========================================
+ ! Load Vega SED (needed for Vega mag system)
+ ! =========================================
+ if (.not. rq%vega_loaded) then
+ vega_filepath = trim(mesa_dir)//trim(rq%vega_sed)
+ call load_vega_sed(vega_filepath, rq%vega_wavelengths, rq%vega_fluxes)
+ rq%vega_loaded = .true.
+ end if
+
+ ! =========================================
+ ! Load all filter transmission curves and precompute zero-points
+ ! =========================================
+ if (.not. rq%filters_loaded) then
+ filter_dir = trim(mesa_dir)//trim(rq%instrument)
+
+ allocate(rq%filters(num_color_filters))
+
+ do i = 1, num_color_filters
+ rq%filters(i)%name = color_filter_names(i)
+ filter_filepath = trim(filter_dir)//'/'//trim(color_filter_names(i))
+ call load_filter(filter_filepath, rq%filters(i)%wavelengths, rq%filters(i)%transmission)
+
+ ! Precompute zero-points for all magnitude systems
+ ! These are constant for each filter and never need recalculation
+ rq%filters(i)%vega_zero_point = compute_vega_zero_point( &
+ rq%vega_wavelengths, rq%vega_fluxes, &
+ rq%filters(i)%wavelengths, rq%filters(i)%transmission)
+
+ rq%filters(i)%ab_zero_point = compute_ab_zero_point( &
+ rq%filters(i)%wavelengths, rq%filters(i)%transmission)
+
+ rq%filters(i)%st_zero_point = compute_st_zero_point( &
+ rq%filters(i)%wavelengths, rq%filters(i)%transmission)
+ end do
+
+ rq%filters_loaded = .true.
+ end if
end subroutine colors_setup_tables
@@ -258,4 +308,4 @@ real(dp) function get_lum_band_by_id(id, log_Teff, log_g, M_div_h, lum, ierr)
get_lum_band_by_id = -99.d0
end function get_lum_band_by_id
-end module colors_lib
+end module colors_lib
\ No newline at end of file
diff --git a/colors/data/colors_data.txz b/data/colors_data/colors_data.txz
similarity index 100%
rename from colors/data/colors_data.txz
rename to data/colors_data/colors_data.txz
diff --git a/docs/source/about.rst b/docs/source/about.rst
index 2ed74a101..c2a764b36 100644
--- a/docs/source/about.rst
+++ b/docs/source/about.rst
@@ -128,7 +128,7 @@ Past Developers
* `Ed Brown `__
* `Aaron Dotter `__
-* Robert Farmer
+* `Robert Farmer `__
* `Eoin Farrell `__
* `Falk Herwig `__
* `Adam Jermyn `__
diff --git a/docs/source/auto_diff/example.rst b/docs/source/auto_diff/example.rst
index af689f652..0ca44508f 100644
--- a/docs/source/auto_diff/example.rst
+++ b/docs/source/auto_diff/example.rst
@@ -1,7 +1,7 @@
.. _autodiff example:
-Example of auto_diff in run_star_extras
-=======================================
+Example of ``auto_diff`` in ``run_star_extras``
+===============================================
.. toctree::
:maxdepth: 1
diff --git a/docs/source/auto_diff/more_detail.rst b/docs/source/auto_diff/more_detail.rst
index 974898c4a..1fa6ed8f1 100644
--- a/docs/source/auto_diff/more_detail.rst
+++ b/docs/source/auto_diff/more_detail.rst
@@ -1,11 +1,11 @@
-===================================
-More detail on the auto_diff module
-===================================
+=======================================
+More detail on the ``auto_diff`` module
+=======================================
Adapted from a `post `_ on Adam Jermyn's website describing the implementation of ``auto_diff`` in MESA.
-What is auto_diff?
-==================
+What is ``auto_diff``?
+======================
Forward-mode automatic differentiation via operator overloading:
@@ -309,7 +309,7 @@ Config Files
In ``MESA/auto_diff/config`` there are a bunch of files, one per
``auto_diff`` type. These are yaml files, and look like:
-::
+.. code:: yaml
name: auto_diff_real_2var_order1
orders: [[1,0],[0,1]]
@@ -324,7 +324,7 @@ This says:
Another example:
-::
+.. code:: yaml
name: auto_diff_real_2var_order3
orders: [[3,0],[2,1],[1,2],[0,3]]
@@ -340,7 +340,7 @@ which says
Finally, the star example:
-::
+.. code:: yaml
name: auto_diff_real_star_order1
orders: [[1]]
@@ -435,8 +435,8 @@ them to the ``compilation_list`` and ``use_list``:
compilation_list.append(data['name'] + '.f90')
use_list.append(tab + 'use ' + data['name'] + '_module')
-AutoDiffType
-------------
+``AutoDiffType``
+----------------
The ``AutoDiffType`` class lives in ``auto_diff_type.py``. This type is
the internal representation of an ``auto_diff`` Fortran type on the
@@ -532,8 +532,8 @@ constructed in
``unary_specific_chain_rule(self, operator, fixed_length=self.array_length)``
(and there are equivalent functions for binary operators).
-chain_rule
-----------
+``chain_rule``
+--------------
The real magic on the Python side all happens in ``chain_rule.py``.
That’s where functions like
@@ -706,8 +706,8 @@ code for this dummy operator, and that gets everything in terms of the
partial derivatives of ``z(x)``, which we can then supply as inputs to
the custom operator builders.
-make_auto_diff_type
--------------------
+``make_auto_diff_type``
+-----------------------
This file puts it all together, going over all the functions and all the
Fortran boiler plate and doing a bunch of accounting to make sure every
diff --git a/docs/source/auto_diff/overview.rst b/docs/source/auto_diff/overview.rst
index 85bbdccca..690f2cdd2 100644
--- a/docs/source/auto_diff/overview.rst
+++ b/docs/source/auto_diff/overview.rst
@@ -1,3 +1,4 @@
+============================
Overview of auto_diff module
============================
diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
index e7206471e..e0056bf21 100644
--- a/docs/source/changelog.rst
+++ b/docs/source/changelog.rst
@@ -4,15 +4,76 @@ Changelog
.. warning:: As of r24.08.1, building MESA now requires Python (3.5 or newer) be installed.
-.. note:: This section describes changes present in the development version of MESA (``main`` branch) relative to the most recent release.
+Changes in r26.3.1
+===================
+
+.. _Backwards-incompatible changes r26.3.1:
+
+Colors data is no longer located in ``colors/data`` and has moved to ``data/colors``.
+
+Backwards-incompatible changes
+------------------------------
+
+.. _New Features r26.3.1:
+
+New Features
+------------
+
+``TDC`` now contains new controls and physics bringing it into closer alignment with the Radial Stellar Pulsation module ``RSP``:
+
+- ``TDC_alpha_M`` : The prefactor on the term accounting for hydrodynamic eddy viscous dissipation. This control is analogous to ``RSP_alfam``.
+- ``TDC_alpha_C`` : The prefactor on the convective flux. This control is analogous to ``RSP_alfac``
+- ``TDC_alpha_S`` : The prefactor on the convective source term, S . This control is analogous to ``RSP_alfas``
+- ``TDC_alpha_M_use_explicit_mlt_vc_in_momentum_equation`` : A more numerically stable stencil for ``TDC_alpha_M`` in MESA's momentum equation.
+- ``TDC_include_eturb_in_energy_equation`` : The option to include turbulent energy and eddy viscosity into MESA's energy equation.
+- ``include_mlt_corr_to_TDC`` : The option to remove the Gamma/(1+Gamma) mlt correction to TDC, yielding the pure (Kuhfuß 1986) local convection model.
+- ``use_rsp_form_of_scale_height`` : The option to calculate scale height by averaging P/rho onto faces together, similar to ``RSP``.
+- ``TDC_num_innermost_cells_forced_nonturbulent`` : An optional control for forcing central zones to be radiative.
+- ``TDC_num_outermost_cells_forced_nonturbulent`` : An optional control for forcing surface zones to be radiative.
+
+``star`` now contains optional controls allowing one to remesh an envelope model similar to ``RSP``, by calling the public ``remesh_for_TDC_pulsation`` function contained within ``$MESA_DIR/star/public/star_lib.f90`` :
+
+- ``TDC_hydro_nz`` : Analogous to ``RSP_nz``
+- ``TDC_hydro_nz_outer`` : Analogous to ``RSP_nz_outer``
+- ``TDC_hydro_T_anchor`` : Analogous to ``RSP_T_anchor``
+- ``TDC_hydro_dq_1_factor`` : Analogous to ``RSP_dq_1_factor``
+- ``TDC_hydro_use_mass_interp_face_values`` : This option determines whether face quantites are computed from simple averages or mass weighted averaging.
+- ``remesh_for_TDC_pulsations_log_core_zoning`` : This option allows log zoning in the interior as opposed to a power law ( similar to ``RSP``).
+
+A new optional boundary condition ``use_RSP_L_eqn_outer_BC`` is available.
+
+Further details on the changes to ``TDC`` can be found in `Farag et al. (2026) `_
+
+Various documentation pages have received updates, fixing typos, cleaning up formatting, and fixing broken links. Notably, a description of the default nuclear network and its dynamic nature have been added.
+
+Support for SDK version 26.3.2.
+
+
+.. _Bug Fixes r26.3.1:
+
+Bug Fixes
+---------
+
+Colors
+~~~~~~
+
+- Fix wrong scale used in AB zero-point.
+
+Other
+~~~~~
+
+- stella install has been updated to work with the new colors module
+- realigned first row of headers in terminal output after changing ``lg_Lnuc`` to ``lg_Lnuc_tot``
+- incorrect EoS blending near some FreeEoS edges `(gh-911) `_.
+- kinetic energy calculations did not take ``mass_correction`` fully into account `(gh-913) `_.
Changes in r25.12.1
-=======================
+===================
Upgraded software license from LGPL-v2.1 to LGPL-v3.0
-.. _Backwards-incompatible changes main:
+.. _Backwards-incompatible changes r25.12.1:
Backwards-incompatible changes
------------------------------
@@ -22,16 +83,16 @@ Backwards-incompatible changes
Removed ``file_extension`` option because it is redundant with ``file_device``. Delete ``file_extension`` from your inlists.
-Renamed pgstar ``pause``` option to ``pause_flag``` because pause is a reserved Fortran 77 keyword.
+Renamed pgstar ``pause`` option to ``pause_flag`` because pause is a reserved Fortran 77 keyword.
-For greater consistency and clarity between ``TDC`` and ``RSP``, the controls for ``mlt_option = TDC`` have been renamed to match their respective ``RSP``
-counter part. See below :
+For greater consistency and clarity between ``TDC`` and ``RSP``, the controls for ``MLT_option = TDC`` have been renamed to match their respective ``RSP``
+counterpart. See below:
- ``alpha_TDC_DAMP`` has been renamed to ``TDC_alpha_D`` and is analogous to ``RSP_alfad``
- ``alpha_TDC_DAMPR`` has been renamed to ``TDC_alpha_R`` and is analogous to ``RSP_gammar``
- ``alpha_TDC_PtdVdt`` has been renamed to ``TDC_alpha_Pt`` and is analogous to ``RSP_alfap``
-.. _New Features main:
+.. _New Features r25.12.1:
New Features
------------
@@ -117,7 +178,7 @@ See the ``&controls`` for further details.
L2 mass-loss fraction according to Lu et al. (2023) is available as a public function in the binary module:
``binary_L2_mass_loss_fraction(donor_mass, accretor_mass, mass_transfer_rate, orbital_separation, disk_alpha, disk_mu, ierr)``.
-.. _Bug Fixes main:
+.. _Bug Fixes r25.12.1:
Bug Fixes
---------
@@ -130,14 +191,12 @@ Fixed bug in binary photos. They were not saving the variables: ``CE_years_detac
Fixed bug that ``Orbit_win_flag = .true.`` was not showing Orbit plot (pgbinary)
-Fixed a bug in ``other_mlt_results`` which resulted in the pre-ms model builder reporting a segfault. ``other_mlt_results`` should now support ``mlt_option = TDC`` as well. see `gh-874 `_.
Removed unused parameters: ``fp_error_limit``, ``fp_min``, ``ft_error_limit``, ``ft_min``, ``retain_fallback_at_each_step``.
Fixed bug in residual calculation near P = 1, or T = 1
-.. note:: Before releasing a new version of MESA, move `Changes in main` to a new section below with the version number as the title, and add a new `Changes in main` section at the top of the file (see ```changelog_template.rst```).
-
Changes in r24.08.1
===================
@@ -469,7 +528,7 @@ near 0.697.
The ``fixed_Teff``, ``fixed_Tsurf``, ``fixed_Psurf``, and ``fixed_Psurf_and_Tsurf``
atmosphere options were removed in r15140. We have reimplemented them although we
-caution users that their implementation could conflict with ``mlt_option = 'TDC'``.
+caution users that their implementation could conflict with ``MLT_option = 'TDC'``.
The EOS coverage regions have been updated to fall back to ideal gas in a region
previously covered by HELM where it returned unphysical floor values of ``1e-20``
@@ -794,7 +853,7 @@ net
The derived type net_info (conventional given the symbol ``n``) is no longer a pointer. If you declare a local copy of the variable, you should also ensure to do ``n% g => g`` to make sure that net_info knows
about the ``net_general_info`` derived type. ``g`` can be had from a call to ``get_net_ptr(handle, g, ierr)``.
-The pointer array ``net_work`` and its size ``net_lwork`` have been removed from the net interface, thus these variables should be removed form any ``other_net_get`` and ``other_split_burn`` hooks.
+The pointer array ``net_work`` and its size ``net_lwork`` have been removed from the net interface, thus these variables should be removed from any ``other_net_get`` and ``other_split_burn`` hooks.
The following routines have also been removed as they are no longer needed ``net_work_size``, ``get_net_rate_ptrs``, ``net_1_zone_burn_work_size``, ``get_burn_work_array_pointers``, ``net_1_zone_burn_const_density_work_size``, and ``get_burn_const_density_work_array_pointers``
Previously you could pass ``arg_not_provided`` for either the temperature (density) or log(temperature) (log(density)). Now you must pass both explicitly.
@@ -802,7 +861,7 @@ Previously you could pass ``arg_not_provided`` for either the temperature (densi
ADIPLS
------
-ADIPLS now has a ``USE_ADIPLS`` flag in ``utils/makefile_header`` to enable is build to be disabled.
+ADIPLS now has a ``USE_ADIPLS`` flag in ``utils/makefile_header`` to enable its build to be disabled.
Changes in r22.05.1
@@ -1254,7 +1313,7 @@ neu
The call signature of other_neu has changed. You no longer need to pass in z2bar
-The value of the Weinberg angle was updated to be be consistent with CODATA 2018.
+The value of the Weinberg angle was updated to be consistent with CODATA 2018.
net
@@ -1801,7 +1860,7 @@ rates & net
A number of rates have had their defaults switched to using JINA's REACLIB.
-When using a custom user rate (i.e from a rate table) the reverse rate is now computed in detailed
+When using a custom user rate (i.e., from a rate table) the reverse rate is now computed in detailed
balance from the user rate. Previously the reverse rate was computed using the default rate choice.
A bug with burning li7 at low temperatures rate has been fixed. Users stuck using previous versions of MESA and
diff --git a/docs/source/changelog_template.rst b/docs/source/changelog_template.rst
index 25e41c5c1..1a592d61f 100644
--- a/docs/source/changelog_template.rst
+++ b/docs/source/changelog_template.rst
@@ -22,4 +22,4 @@ Bug Fixes
---------
-.. note:: Before releasing a new version of MESA, move `Changes in main` to a new section below with the version number as the title, and add a new `Changes in main` section at the top of the file (see ```changelog_template.rst```).
+.. note:: Before releasing a new version of MESA, move `Changes in main` to a new section below with the version number as the title, and add a new `Changes in main` section at the top of the file (see ``changelog_template.rst``).
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 811162de2..df7170dfc 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -92,7 +92,7 @@
"icon_links": [
{
"name": "Official Release Version",
- "url": "https://zenodo.org/records/13353788",
+ "url": "https://zenodo.org/records/18023257",
"icon": "fa-solid fa-star",
},
{
diff --git a/docs/source/developing/code_style.rst b/docs/source/developing/code_style.rst
index 0efad8d54..e166cfc13 100644
--- a/docs/source/developing/code_style.rst
+++ b/docs/source/developing/code_style.rst
@@ -148,7 +148,7 @@ and this name should differ from any other code entities (e.g. subroutines).
Each named critical block will be executed by one thread at a time. Different named critical blocks can be executed
at the same time. However, all unnamed critical blocks act like one block and thus can not be executed in parallel.
-Therefore you should always named your OMP critical blocks to ensure the best performance.
+Therefore you should always name your OMP critical blocks to ensure the best performance.
Do not name your OMP critical block with a name that has already been used for a variable, procedure, module or any other object.
diff --git a/docs/source/developing/collaboration.rst b/docs/source/developing/collaboration.rst
index ff5c5df69..c0c5d3e55 100644
--- a/docs/source/developing/collaboration.rst
+++ b/docs/source/developing/collaboration.rst
@@ -82,7 +82,7 @@ is appropriate and documented, and communicating individual developer
contributions to the astrophysics community so that the careers of
developers are enhanced by their engagement.
-Currently, the MAC is Lars, Rich, and Frank.
+Currently, the MAC is Rich, Meridith, Bill (Wolf) and Jared.
**Onboarding and offboarding processes**
diff --git a/docs/source/developing/contributing.rst b/docs/source/developing/contributing.rst
index 19b173591..3e6e08704 100644
--- a/docs/source/developing/contributing.rst
+++ b/docs/source/developing/contributing.rst
@@ -13,7 +13,7 @@ There are two ways to submit changes to MESA, depending on who you are.
MESA developer
--------------
-If you are a MESA developer then you will have commit access to the MESA repository on Github.
+If you are a MESA developer then you will have commit access to the MESA repository on GitHub.
You must create an account on `GitHub `__. The
MESA organization is called `MESAHub `__.
After you are registered on GitHub, you can be invited to the
@@ -63,11 +63,11 @@ clone over SSH, do::
This will create the MESA repository in a directory named ``mesa``.
-For this to work you will need to have setup ssh keys and added them to your github account:
+For this to work you will need to have set up SSH keys and added them to your GitHub account:
-#. `Generate a ssh key `__
+#. `Generate an SSH key `__
-#. `Add a ssh key to Github `__
+#. `Add an SSH key to GitHub `__
#. `Verify it works `__
diff --git a/docs/source/developing/debugging.rst b/docs/source/developing/debugging.rst
index 075be0de6..97238a75b 100644
--- a/docs/source/developing/debugging.rst
+++ b/docs/source/developing/debugging.rst
@@ -819,7 +819,7 @@ Set the environment variable
MESA_FPE_CHECKS_ON=1
-Then run ./clean and ./install in MESA_DIR.
+Then run ``./clean`` and ``./install`` in MESA_DIR.
This setting adds the following options in ``utils/makefile_header``
@@ -851,7 +851,7 @@ Alter star/test_suite/1.3M_ms_high_Z/src/run_star_extras.f90 and in extras_finis
Step 0: Notice your code has a problem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Run ./mk and ./rn to run the test case and you'll get the following output:
+Run ``./mk`` and ``./rn`` to run the test case and you'll get the following output:
.. code-block:: console
diff --git a/docs/source/developing/infrastructure.rst b/docs/source/developing/infrastructure.rst
index 4887d7513..3d6fdfd75 100644
--- a/docs/source/developing/infrastructure.rst
+++ b/docs/source/developing/infrastructure.rst
@@ -15,29 +15,30 @@ this currently grants us a 100% discount, meaning this costs $0/yr.
Unsubsidized, it would cost about $1200/yr.
To classify MESAHub as an education account requires someone in the MESAHub
-organization to sign up for a education plan. This requires that the user has
-an University ID card with an expiry date (this is important). Steps to get
+organization to sign up for an education plan. This requires that the user has
+a university ID card with an expiry date (this is important). Steps to get
access to this:
-- Add your university email address to Github.
-- Follow instructions `Apply to Github Global campus `__
+- Add your university email address to GitHub.
+- Follow instructions `Apply to GitHub Global campus `__
- It is set up, if you have access to the `Global-Campus-Teachers repository `__
-- Github claims they will periodically require revalidation of your credentials, so this may need repeating in the future.
+- GitHub claims they will periodically require revalidation of your credentials, so this may need repeating in the future.
If MESAHub gets unsynced from this and is no longer on the education plan:
-- Goto `Global campus `__
+- Go to `Global Campus `__
- Find ``Upgrade your academic organizations``
-- Click ``Upgrade to Github Team``
+- Click ``Upgrade to GitHub Team``
- Upgrade ``MESAHub``
This is currently tied to Rob's account.
+
mesastar.org
------------
This is a long-standing domain name used by MESA.
-The main website redirects to a landing page hosted on `GitHub Pages `__
+The `https://mesastar.org `__ redirects to a landing page hosted on `GitHub Pages `__
Domain Name
^^^^^^^^^^^
@@ -49,7 +50,7 @@ DNS Servers
^^^^^^^^^^^
The mesastar.org domain is configured to use `Cloudflare `__ nameservers
-and the DNS records are managed by Philip.
+and the DNS records are managed by Matteo.
Mailing lists
^^^^^^^^^^^^^
@@ -66,15 +67,16 @@ Marketplace
^^^^^^^^^^^
The `MESA marketplace
-`__ is controlled and
-hosted by Frank at ASU.
+`__ is an archive of shared resources prior to 2022,
+hosted on `GitHub Pages `__.
+For more recent contributions, see the `MESA Zenodo Community `__.
ReadTheDocs
-----------
The Sphinx documentation is hosted by `ReadTheDocs `__.
-Rich controls the account (and Earl, Joey, Meridith, and Philip have access to it). This is
+Rich controls the account (and Earl, Joey, Meridith, and Eb have access to it). This is
currently free for open source software.
@@ -93,6 +95,7 @@ redirect to docs.mesastar.org.
The source code for the old sourceforge site lives at
``__.
+
Slack
-----
@@ -106,10 +109,10 @@ TestHub
The MESA TestHub runs on Heroku and the account is controlled by Bill
Wolf. It is funded by Frank and Bill W. The Heroku account costs
around $600/yr, though its cost has been higher during the GitHub
-transition.
+transition. Contact Bill for any help with setting up an account.
The testing `log archive `__ lives on a
-server at the Flatiron Institute, with Philip Mocz as a point of contact.
+server at the Flatiron Institute, with Matteo as a point of contact.
Jenkins
^^^^^^^
@@ -118,7 +121,7 @@ The Flatiron `Scientific Computing Core `__
@@ -130,12 +133,12 @@ We have multiple resources archived on Zenodo. This is a free service.
Community
^^^^^^^^^
-The `MESA community `__ on Zenodo
-is controlled by Philip.
+The `MESA Zenodo Community `__ on Zenodo
+is controlled by Eb and Mathieu.
Records
^^^^^^^
-* The `record for MESA releases `__ is controlled by Philip.
-* The records for MESA SDK releases (`macOS `__, `linux `__) are controlled by Philip.
+* The `record for MESA releases `__ is controlled by Matteo.
+* The records for MESA SDK releases (`macOS `__, `linux `__) are controlled by Matteo.
* The `record for OP Mono data `__ is controlled by Josiah.
diff --git a/docs/source/developing/release.rst b/docs/source/developing/release.rst
index fae21baa4..35785c2a2 100644
--- a/docs/source/developing/release.rst
+++ b/docs/source/developing/release.rst
@@ -94,13 +94,13 @@ For version ``rXX.YY.Z`` this script will make a branch ``release/rXX.YY.Z`` and
To the new version ``rXX.YY.Z``.
-This script will also make zip archive, which can be used for local testing to make sure the release builds.
+This script will also make a zip archive, which can be used for local testing to make sure the release builds.
.. note::
- This zip folder is not what we release. The actual zip folder is generated by Github, so that should be downloaded and tested as well once it has been made.
- This next part is important: to get Github to download the git-lfs files correctly, we have to make sure that in the `github repository settings `_
+ This zip folder is not what we release. The actual zip folder is generated by GitHub, so that should be downloaded and tested as well once it has been made.
+ This next part is important: to get GitHub to download the Git LFS files correctly, we have to make sure that in the `GitHub repository settings `_
the option to ``Include Git LFS objects in archives`` is enabled. But then we need to disable it again after the release to avoid hitting our bandwidth limits.
- Since 2024, AI companies have been non-stop downloading MESA source code via Github, which has caused us to hit our Git LFS bandwidth limits multiple times and receive bills that are several thousand dollars.
+ Since 2024, AI companies have been non-stop downloading MESA source code via GitHub, which has caused us to hit our Git LFS bandwidth limits multiple times and receive bills that are several thousand dollars.
Hopefully this means LLMs will have a fantastic understanding of astrophysics and MESA in the future, but for now we need to be careful about our Git LFS usage.
.. note::
@@ -117,7 +117,7 @@ To make an actual release (once testing is complete), first push the git tag mad
- ``git push origin XX.YY.Z``
-This is the key bit, as the Github release will be anchored to this tag.
+This is the key bit, as the GitHub release will be anchored to this tag.
.. note::
The tag follows PEP440 standards -- there is no ``r`` or ``-`` (hyphen) in the tag (unlike the branch name) -- so readthedocs can automatically determine the stable version and add version warning banners.
@@ -185,7 +185,7 @@ needs fixes to simply push a new release, and flag the current release as not wo
Add new release version to readthedocs
--------------------------------------
-First gain access to the readthedocs account (that is currently accessible by Rich, Evan, Joey, Earl, Meridith, and Philip). Then:
+First gain access to the readthedocs account (that is currently accessible by Rich, Evan, Joey, Earl, and Meridith). Then:
- Go to the ``Versions`` page
- Find the release tag (not the branch) and ``Activate`` it
diff --git a/docs/source/developing/test_suite.rst b/docs/source/developing/test_suite.rst
index 00a755ec6..09bc652bc 100644
--- a/docs/source/developing/test_suite.rst
+++ b/docs/source/developing/test_suite.rst
@@ -300,22 +300,22 @@ to the ``testhub.yml`` file.
This output is generated each time MESA terminates (except after a restart). Therefore, the per-inlist quantities that can be reported by TestHub are those accessible within a single part of a MESA run. By default, we report
- + ``runtime_minutes``
- + ``steps``
- + ``retries``
- + ``redos``
- + ``solver_calls_made``
- + ``solver_calls_failed``
- + ``solver_iterations``
++ ``runtime_minutes``
++ ``steps``
++ ``retries``
++ ``redos``
++ ``solver_calls_made``
++ ``solver_calls_failed``
++ ``solver_iterations``
In a multi-part test case, the per-part values can be summed to give the properties of the complete run.
TestHub also reports quantities that can reflect information preserved by MESA across parts. These are transmitted via their inclusion in the model file. That means the values reported by cases that use saved models to skip optional parts will be influenced by the performance at the time the saved model was generated. Additionally, some parts may include inlist options that reset or modify these quantities. TestHub reports the values at the end of each part, but the precise meaning of these quantities cannot be understood without reference to the details of the test case.
- + ``model_number``
- + ``star_age``
- + ``num_retries``
- + ``log_rel_run_E_err``
++ ``model_number``
++ ``star_age``
++ ``num_retries``
++ ``log_rel_run_E_err``
.. note ::
@@ -368,23 +368,23 @@ Setting up new machine with MESA TestHub
2. Make sure ruby is installed, for example using the `Ruby version manager `_ (rvm).
- * If using the rvm, follow the instructions on that page to install the gpg keys. If this does not work, then execute the next line (``\curl -sSL https://get.rvm.io | bash -s stable``) instead, and follow the instructions printed in the terminal.
+ * If using the rvm, follow the instructions on that page to install the gpg keys. If this does not work, then execute the next line (``\curl -sSL https://get.rvm.io | bash -s stable``) instead, and follow the instructions printed in the terminal.
- * That line only installs the rvm; you also need Ruby itself. One can execute ``\curl -sSL https://get.rvm.io | bash -s stable --ruby`` as per the rvm installation page, but that requires sudo access. For a local installation, one can follow `this StackOverflow answer `_.
+ * That line only installs the rvm; you also need Ruby itself. One can execute ``\curl -sSL https://get.rvm.io | bash -s stable --ruby`` as per the rvm installation page, but that requires sudo access. For a local installation, one can follow `this StackOverflow answer `_.
3. Download and set up `mesa_test `_, by doing the following:
- * ``gem install mesa_test``
+ * ``gem install mesa_test``
- * ``mesa_test setup`` (here you will supply your email, password, and token from earlier; this will create a settings file in ``~/.mesa_test/config.yml``)
+ * ``mesa_test setup`` (here you will supply your email, password, and token from earlier; this will create a settings file in ``~/.mesa_test/config.yml``)
- * ``mesa_test install_and_test main`` will check out the main branch, test it, and submit the results to the testhub.
+ * ``mesa_test install_and_test main`` will check out the main branch, test it, and submit the results to the testhub.
4. If you want to set up ``mesa_test`` to run automatically on a cluster, Rob Farmer has created `a set of scripts `_ that work with the Slurm workload manager. These scripts pull all commits and submit a job to the cluster queue for each new commit. You must edit the paths in all of the scripts to point to your own directories.
- * You can set up ``mesa_test`` or Rob's cluster script to run recurrently as a cronjob by doing ``crontab -e`` to edit the cronjob table.
+ * You can set up ``mesa_test`` or Rob's cluster script to run recurrently as a cronjob by doing ``crontab -e`` to edit the cronjob table.
- * Add for example: ``10 * * * * ~/mesa/mesa-helios-test/runMesaTest.sh >/dev/null 2>&1`` to make it run every 10 minutes (or swap out ``runMesaTest`` with a ``mesa_test`` command). The parts at the end of that line prevent it from emailing you each time it runs.
+ * Add for example: ``10 * * * * ~/mesa/mesa-helios-test/runMesaTest.sh >/dev/null 2>&1`` to make it run every 10 minutes (or swap out ``runMesaTest`` with a ``mesa_test`` command). The parts at the end of that line prevent it from emailing you each time it runs.
Continuous integration testing
diff --git a/docs/source/eos/overview.rst b/docs/source/eos/overview.rst
index 3e539510e..f2b4342e7 100644
--- a/docs/source/eos/overview.rst
+++ b/docs/source/eos/overview.rst
@@ -33,7 +33,7 @@ both results are evaluated, blended, and returned. Smooth blends are
assured via the smoothness of the functions that define the component
fractions.
-This approach means that that EOS components have an order of
+This approach means that EOS components have an order of
precedence:
(CMS) > Skye > PC > FreeEOS > OPAL/SCVH > HELM.
@@ -122,7 +122,6 @@ Component EOSes
===============
-
OPAL/SCVH
---------
@@ -207,7 +206,6 @@ CMS
CMS is the EOS for dense H/He mixtures of |CMS|.
-
.. |CMS| replace:: `Chabrier, Mazevet, & Soubiran (2019) `__
.. |SCVH| replace:: `(Saumon, Chabrier, & van Horn 1995) `__
diff --git a/docs/source/faq.rst b/docs/source/faq.rst
index 0ad52b72f..9a8e2698a 100644
--- a/docs/source/faq.rst
+++ b/docs/source/faq.rst
@@ -502,7 +502,7 @@ It is necessary to take the following actions on recent versions of OS X
previous version of OS X.
- Install or reinstall the current version of
- `Xquartz `__.
+ `Xquartz `__.
- Install the `command line
tools `__,
@@ -515,7 +515,7 @@ previous version of OS X.
the `Xcode 10 release
notes `__).
As a workaround, Apple provides an extra package that will install
- the headers to the base system. At present, one must do this:::
+ the headers to the base system. At present, one must do this::
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
diff --git a/docs/source/installation.rst b/docs/source/installation.rst
index 788885e42..6eaea90f0 100644
--- a/docs/source/installation.rst
+++ b/docs/source/installation.rst
@@ -84,7 +84,7 @@ free to rename it, just make sure to set MESA_DIR accordingly (see the
next section).
You can also download zip files of `older MESA releases `__.
-If you plan to do so, please read :ref:`this FAQ entry `.
+If you plan to do so, please read :ref:`this FAQ entry `.
.. _environment:
@@ -93,8 +93,8 @@ Set your environment variables
The easiest way to make sure that your system is always configured
appropriately is to define the necessary environment variables in
-your `shell start-up file `__. The file that
-you need to edit will depend on `which shell you're using
+your `shell start-up file `__.
+The file that you need to edit will depend on `which shell you're using
`__.
You can find out by running ``echo $0``. The default on most Linux
distros is bash, in which case you need to edit ``$HOME/.bashrc``. If
diff --git a/docs/source/reference/env_vars.rst b/docs/source/reference/env_vars.rst
index 54b08e5a8..62134bd35 100644
--- a/docs/source/reference/env_vars.rst
+++ b/docs/source/reference/env_vars.rst
@@ -7,14 +7,14 @@ The following lists environment variables that can affect the way MESA runs.
Essential
---------
-MESA_DIR
-~~~~~~~~
+``MESA_DIR``
+~~~~~~~~~~~~
Location of the MESA source code.
-GYRE_DIR
-~~~~~~~~
+``GYRE_DIR``
+~~~~~~~~~~~~
Location of the GYRE source code (only needed if running GYRE). If
you haven't moved it from the ``$MESA_DIR`` then set as
@@ -25,14 +25,14 @@ you haven't moved it from the ``$MESA_DIR`` then set as
Recommended
-----------
-OMP_NUM_THREADS
-~~~~~~~~~~~~~~~
+``OMP_NUM_THREADS``
+~~~~~~~~~~~~~~~~~~~
Number of threads MESA will run with. Should be between 1 and 2 * number of logical cores.
-MESASDK_ROOT
-~~~~~~~~~~~~
+``MESASDK_ROOT``
+~~~~~~~~~~~~~~~~
Location of the SDK.
@@ -41,8 +41,8 @@ Location of the SDK.
Optional
--------
-MESA_CACHES_DIR
-~~~~~~~~~~~~~~~
+``MESA_CACHES_DIR``
+~~~~~~~~~~~~~~~~~~~
Location where MESA will store and read cache files.
See :ref:`star_job.defaults cache directories
@@ -51,16 +51,16 @@ Beware when using this and changing MESA versions;
best practice would be to remove its contents upon changing versions.
-MESA_TEMP_CACHES_DIR
-~~~~~~~~~~~~~~~~~~~~
+``MESA_TEMP_CACHES_DIR``
+~~~~~~~~~~~~~~~~~~~~~~~~
Location where MESA will write the cache file temporarily before moving to
``$MESA_CACHES_DIR``. If set, this folder MUST be unique for each
MESA run. If not set defaults to ``./.mesa_temp_cache``.
-MESA_OP_MONO_DATA_PATH
-~~~~~~~~~~~~~~~~~~~~~~
+``MESA_OP_MONO_DATA_PATH``
+~~~~~~~~~~~~~~~~~~~~~~~~~~
Location of the OP_MONO data files.
See the :ref:`radiative levitation ` test suite
@@ -68,16 +68,16 @@ See the :ref:`radiative levitation ` test suite
for more details.
-MESA_INLIST
-~~~~~~~~~~~
+``MESA_INLIST``
+~~~~~~~~~~~~~~~
By default MESA will look for a file called ``inlist`` in the local
working directory for its configuration. This overrides the filename
and can point to a file somewhere else.
-MESA_FORCE_PGSTAR_FLAG
-~~~~~~~~~~~~~~~~~~~~~~
+``MESA_FORCE_PGSTAR_FLAG``
+~~~~~~~~~~~~~~~~~~~~~~~~~~
If set, this shell variable will override the inlist variable ``pgstar_flag``.
@@ -86,8 +86,8 @@ If set to either ``false`` or ``FALSE`` MESA will act as if the user had set ``p
If set to anything else (or not set at all) MESA will use the value as set in the inlists.
-MESA_SKIP_OPTIONAL
-~~~~~~~~~~~~~~~~~~
+``MESA_SKIP_OPTIONAL``
+~~~~~~~~~~~~~~~~~~~~~~
If set then when running a test_suite case, then certain optional inlists will be skipped.
If not set, then all inlists will be run.
@@ -107,14 +107,14 @@ inlist file. This will also override the environment variable ``$MESA_INLIST``.
./star some_other_inlist_file
-skip_build
-~~~~~~~~~~
+``skip_build``
+~~~~~~~~~~~~~~
Empty file. If present in ``$MESA_DIR`` then no compiling is done when ``./install`` is invoked.
If present in a sub folder (e.g ``$MESA_DIR/eos``) then no compiling is done in the sub-folder.
-skip_test
-~~~~~~~~~
+``skip_test``
+~~~~~~~~~~~~~
Empty file. Similar to ``skip_build``, but this will skip the compile time tests.
If placed in a sub-folder, then only the tests in that folder are skipped.
@@ -126,36 +126,36 @@ Private
These options are for developers; you do not need them for normal usage.
If you use them and things break then stop using them.
-MESA_DIR_INTENTIONALLY_EMPTY
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+``MESA_DIR_INTENTIONALLY_EMPTY``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bypass checks done at compile time for checking if ``$MESA_DIR`` is set.
-MESA_TEMP_CACHES_DISABLE
-~~~~~~~~~~~~~~~~~~~~~~~~
+``MESA_TEMP_CACHES_DISABLE``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If set, then we do not use the temp cache mechanism, writing cache
files directly to the ``$MESA_DIR/data/`` folder.
-MESA_ERROR_BACKTRACE_DISABLE
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+``MESA_ERROR_BACKTRACE_DISABLE``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If set, disables the generation of backtraces when we call ``mesa_error()``.
This is mostly helpful on macs, as they don't generate useful backtraces.
-MESA_FPE_CHECKS_ON
-~~~~~~~~~~~~~~~~~~
+``MESA_FPE_CHECKS_ON``
+~~~~~~~~~~~~~~~~~~~~~~
When set to 1 this will turn on a series of compile time checks as well as
certain inlist options designed to catch floating point exceptions.
This should not be set during a normal run.
-MESA_TEST_SUITE_RESOLUTION_FACTOR
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+``MESA_TEST_SUITE_RESOLUTION_FACTOR``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If set to a value other than 1, then ``mesh_delta_coeff`` and
``time_delta_coeff`` will be multiplied by its value, and
diff --git a/docs/source/test_suite.rst b/docs/source/test_suite.rst
index 10c1fdd5d..fbcd1aac2 100644
--- a/docs/source/test_suite.rst
+++ b/docs/source/test_suite.rst
@@ -152,7 +152,7 @@ This test suite evolves a 12 |MSun| model from the pre-ms to core collapse.
:ref:`20M_pre_ms_to_core_collapse`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-This test suite evolves a low metalicity 20 |MSun| model from the pre-ms to core collapse.
+This test suite evolves a low metallicity 20 |MSun| model from the pre-ms to core collapse.
:ref:`20M_z2m2_high_rotation`
@@ -583,22 +583,22 @@ III|.
:ref:`wd_c_core_ignition`
^^^^^^^^^^^^^^^^^^^^^^^^^
-This test case the checks the onset of a thermonuclear runaway in an accreting Chandrasekhar mass carobon-oxygen white dwarf.
+This test case checks the onset of a thermonuclear runaway in an accreting Chandrasekhar mass carbon-oxygen white dwarf.
:ref:`wd_cool_0.6M`
^^^^^^^^^^^^^^^^^^^
-This test case the checks the evolution of a cooling, element diffusing 0.6 |Msun| white dwarf.
+This test case checks the evolution of a cooling, element diffusing 0.6 |Msun| white dwarf.
:ref:`wd_diffusion`
^^^^^^^^^^^^^^^^^^^
-This test case the checks element diffusion in a 0.6 |Msun| carbon-oxygen white dwarf.
+This test case checks element diffusion in a 0.6 |Msun| carbon-oxygen white dwarf.
:ref:`wd_he_shell_ignition`
^^^^^^^^^^^^^^^^^^^^^^^^^^^
-This test case the ignition of a helium layer in an accreting in a 0.96 |Msun| carbon-oxygen white dwarf model.
+This test case checks the ignition of a helium layer in an accreting 0.96 |Msun| carbon-oxygen white dwarf model.
:ref:`wd_nova_burst`
^^^^^^^^^^^^^^^^^^^^
diff --git a/docs/source/using_mesa/best_practices.rst b/docs/source/using_mesa/best_practices.rst
index 8e0835bc3..fac65de72 100644
--- a/docs/source/using_mesa/best_practices.rst
+++ b/docs/source/using_mesa/best_practices.rst
@@ -107,81 +107,95 @@ First, copy the default ``history_columns.list`` to your work directory
and modify your local ``history_columns.list``
-.. code-block:: console
- add
+* add
- mixing_regions 20
- burning_regions 20
+ .. code-block:: fortran
- change
+ mixing_regions 20
+ burning_regions 20
- !log_center_T ! temperature
- !log_center_Rho ! density
+* change
- to
+ .. code-block:: fortran
- log_center_T ! temperature
- log_center_Rho ! density
+ !log_center_T ! temperature
+ !log_center_Rho ! density
- and save the file changes.
+ to
+ .. code-block:: fortran
-Second, modify ``inlist_semiconvection_header``
+ log_center_T ! temperature
+ log_center_Rho ! density
-.. code-block:: console
+ and save the file changes.
+
+
+Second, modify ``inlist_semiconvection_header``:
- change
- !read_extra_pgstar_inlist(1) = .true.
- !extra_pgstar_inlist_name(1)= 'inlist_semiconvection'
+* change
+
+ .. code-block:: fortran
+
+ !read_extra_pgstar_inlist(1) = .true.
+ !extra_pgstar_inlist_name(1)= 'inlist_semiconvection'
to
- read_extra_pgstar_inlist(1) = .true.
- extra_pgstar_inlist_name(1)= 'inlist_semiconvection'
- and save the file changes.
+ .. code-block:: fortran
+
+ read_extra_pgstar_inlist(1) = .true.
+ extra_pgstar_inlist_name(1)= 'inlist_semiconvection'
+
+ and save the file changes.
Third, modify ``inlist_semiconvection`` to change the pgstar namelist to
-.. code-block:: console
- add to the star_job namelist:
+* add to the ``star_job`` namelist:
- pgstar_flag = .true.
- save_pgstar_files_when_terminate = .true.
+ .. code-block:: fortran
+ pgstar_flag = .true.
+ save_pgstar_files_when_terminate = .true.
- and to make the stopping condition more precise, add to the controls namelist:
- when_to_stop_rtol = 1e-4
- when_to_stop_atol = 1e-4
+* and to make the stopping condition more precise, add to the ``controls`` namelist:
- and finally replace the pgstar namelist with
+ .. code-block:: fortran
- &pgstar
+ when_to_stop_rtol = 1e-4
+ when_to_stop_atol = 1e-4
- pgstar_interval = 1
+* and finally replace the ``pgstar`` namelist with
- Grid4_win_flag = .true.
- Grid4_win_width = 8
- Kipp_mass_max = 0.2 ! (Msun units) negative means use default
- Kipp_show_mixing = .true.
- Kipp_show_burn = .false.
- Kipp_show_luminosities = .true.
- Kipp_show_mass_boundaries = .false.
+ .. code-block:: fortran
- Grid4_file_flag = .true.
- Grid4_file_dir = 'pgstar_out'
- Grid4_file_prefix = 'grid4_'
- Grid4_file_interval = 10
- Grid4_file_width = -1
- Grid4_file_aspect_ratio = -1
+ &pgstar
- / ! end of pgstar namelist
+ pgstar_interval = 1
- and save the file changes.
+ Grid4_win_flag = .true.
+ Grid4_win_width = 8
+ Kipp_mass_max = 0.2 ! (Msun units) negative means use default
+ Kipp_show_mixing = .true.
+ Kipp_show_burn = .false.
+ Kipp_show_luminosities = .true.
+ Kipp_show_mass_boundaries = .false.
+
+ Grid4_file_flag = .true.
+ Grid4_file_dir = 'pgstar_out'
+ Grid4_file_prefix = 'grid4_'
+ Grid4_file_interval = 10
+ Grid4_file_width = -1
+ Grid4_file_aspect_ratio = -1
+
+ / ! end of pgstar namelist
+
+ and save the file changes.
Now run the executable egain
@@ -202,21 +216,28 @@ Explore Physics Variations
Make the following changes to your ``inlist_semiconvection``:
-.. code-block:: console
- change
+* change
+
+ .. code-block:: fortran
max_model_number = 1000
- to
+ to
+
+ .. code-block:: fortran
max_model_number = 40000
- and change
+* and change
+
+ .. code-block:: fortran
history_interval = 10
- to
+ to
+
+ .. code-block:: fortran
history_interval = 1
@@ -240,9 +261,9 @@ Change the nuclear reaction network
It is usually useful to examine history and profile quantities.
- Change the default control namelist parameter ``log_directory = `LOGS``` to the more descriptive
- ``log_directory = `TableNN_network_name``` where NN is your table number and network_name is one of the choices above,
- for example, ``log_directory = `Table08_approx21```.
+ Change the default control namelist parameter ``log_directory = 'LOGS'`` to the more descriptive
+ ``log_directory = 'TableNN_network_name'`` where NN is your table number and network_name is one of the choices above,
+ for example, ``log_directory = 'Table08_approx21'``.
After the runs, each table should upload their ``log_directory``
to our shared Dropbox directory timmes/Experiment01.
@@ -264,9 +285,9 @@ Repeat answering the questions above.
For the 2021 MESA Summer School, each TA will be given a block of 4 values, one for each participant at their table.
The TA will then distribute the values to the team.
- Change the default control namelist parameter ``log_directory = `LOGS``` to the more descriptive
- ``log_directory = `TableNN_NpN``` where NN is your table number and NpN is your value,
- for example, ``log_directory = `Table03_1p8```.
+ Change the default control namelist parameter ``log_directory = 'LOGS'`` to the more descriptive
+ ``log_directory = 'TableNN_NpN'`` where NN is your table number and NpN is your value,
+ for example, ``log_directory = 'Table03_1p8'``.
After a run is complete, each participant should upload a ``log_directory`` to our shared Dropbox directory timmes/Experiment02.
@@ -288,9 +309,9 @@ Repeat answering the questions above.
For the 2021 MESA Summer School, each TA will be given a block of 4 values, one for each participant at their table.
The TA will then distribute the values to the team.
- Change the default control namelist parameter ``log_directory = `LOGS``` to the more descriptive
- ``log_directory = `TableNN_NpNN``` where NN is your table number and NpNN is your value,
- for example, ``log_directory = `Table11_1p80```.
+ Change the default control namelist parameter ``log_directory = 'LOGS'`` to the more descriptive
+ ``log_directory = 'TableNN_NpNN'`` where NN is your table number and NpNN is your value,
+ for example, ``log_directory = 'Table11_1p80'``.
After a run is complete, each participant should upload a ``log_directory`` to our shared Dropbox directory timmes/Experiment03.
@@ -306,7 +327,7 @@ Experiment with the mass resolution I
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Change the mass resolution setting
-``max_dq`` = 5.0e-2, 2.0e-2, 1.0e-2 (default), 5.0e-3, 2.0e-3, and 1.0e-3.
+``max_dq`` = ``5.0e-2``, ``2.0e-2``, ``1.0e-2`` (default), ``5.0e-3``, ``2.0e-3``, and ``1.0e-3``.
Repeat answering the questions above.
.. note::
@@ -314,9 +335,9 @@ Repeat answering the questions above.
For the 2021 MESA Summer School, each TA will be given a block of 4 values, one for each participant at their table.
The TA will then distribute the values to the team.
- Change the default control namelist parameter ``log_directory = `LOGS``` to the more descriptive
- ``log_directory = `TableNN_NpNNN``` where NN is your table number and NpNNN is your value,
- for example, ``log_directory = `Table05_0p002```.
+ Change the default control namelist parameter ``log_directory = 'LOGS'`` to the more descriptive
+ ``log_directory = 'TableNN_NpNNN'`` where NN is your table number and NpNNN is your value,
+ for example, ``log_directory = 'Table05_0p002'``.
After a run is complete, each participant should upload a ``log_directory`` to our shared Dropbox directory timmes/Experiment04.
@@ -337,9 +358,9 @@ Repeat answering the questions above.
For the 2021 MESA Summer School, each TA will be given a block of 4 values, one for each participant at their table.
The TA will then distribute the values to the team.
- Change the default control namelist parameter ``log_directory = `LOGS``` to the more descriptive
- ``log_directory = `TableNN_NpNNN``` where NN is your table number and NpN is your value,
- for example, ``log_directory = `Table08_1p2```.
+ Change the default control namelist parameter ``log_directory = 'LOGS'`` to the more descriptive
+ ``log_directory = 'TableNN_NpNNN'`` where NN is your table number and NpN is your value,
+ for example, ``log_directory = 'Table08_1p2'``.
After a run is complete, each participant should upload a ``log_directory`` to our shared Dropbox directory timmes/Experiment05.
@@ -352,7 +373,7 @@ Experiment with the temporal resolution
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Change the temporal resolution setting
-``max_years_for_timestep`` = 1.0e8, 5.0e7, 2.0e7, 1.0e7, 5.0e6, 2.0e6, and 1.0e6.
+``max_years_for_timestep`` = ``1.0e8``, ``5.0e7``, ``2.0e7``, ``1.0e7``, ``5.0e6``, ``2.0e6``, and ``1.0e6``.
Repeat answering the questions above.
.. note::
@@ -360,9 +381,9 @@ Repeat answering the questions above.
For the 2021 MESA Summer School, each TA will be given a block of 4 values, one for each participant at their table.
The TA will then distribute the values to the team.
- Change the default control namelist parameter ``log_directory = `LOGS``` to the more descriptive
- ``log_directory = `TableNN_NeN``` where NN is your table number and NeN is your value,
- for example, ``log_directory = `Table01_2e7```.
+ Change the default control namelist parameter ``log_directory = 'LOGS'`` to the more descriptive
+ ``log_directory = 'TableNN_NeN'`` where NN is your table number and NeN is your value,
+ for example, ``log_directory = 'Table01_2e7'``.
After a run is complete, each participant should upload a ``log_directory`` to our shared Dropbox directory timmes/Experiment06.
diff --git a/docs/source/using_mesa/building_inlists.rst b/docs/source/using_mesa/building_inlists.rst
index 3b27d81fb..b2a4f8bc2 100644
--- a/docs/source/using_mesa/building_inlists.rst
+++ b/docs/source/using_mesa/building_inlists.rst
@@ -6,8 +6,8 @@ Inlists for MESA are composed of five main sections labeled ``&star_job``, ``&co
``&eos``, ``&skap`` and ``&pgstar``. The ``&star_job`` section contains instructions about which MESA modules should be used, while the ``&controls`` section is where the star module options are specified. The ``&kap`` and ``&eos`` sections are where you specify controls for the opacity and the equation of state, respectively.
The ``&pgstar`` section contains the commands for creating pgstar plots.
-&star_job
-=========
+``&star_job``
+=============
The main modules of MESA (other than **star**) are the :ref:`eos`, the :ref:`kap`, the :ref:`atm`, the nuclear reactions.
In this section of the inlist, you'll have to make choices for which atmosphere and nuclear reactions network you want to use, as well as which nuclear reactions rates you want to use.
@@ -77,8 +77,8 @@ For example when evolving a stellar model on the horizontal branch (helium burni
:end-before: ! eos
-&controls
-=========
+``&controls``
+=============
Energy equation
---------------
@@ -152,14 +152,14 @@ Overshooting
Timestep and grid controls
--------------------------
-&kap
-====
+``&kap``
+========
-&eos
-====
+``&eos``
+========
-&colors
-=======
+``&colors``
+===========
The ``&colors`` section configures the custom colors module for calculating synthetic photometry during stellar evolution. This module interpolates stellar atmosphere models to compute bolometric magnitudes and synthetic magnitudes in specified photometric filters, adding these as extra history columns.
diff --git a/docs/source/using_mesa/extending_mesa.rst b/docs/source/using_mesa/extending_mesa.rst
index 3e8f63f8e..b9f515ba7 100644
--- a/docs/source/using_mesa/extending_mesa.rst
+++ b/docs/source/using_mesa/extending_mesa.rst
@@ -21,8 +21,8 @@ community.
First Steps
-----------
-Activate run_star_extras.f90
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Activate ``run_star_extras.f90``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The first step in making use of these capabilities is to activate them.
In the MESA work directory you made as part of the tutorial, navigate to
@@ -32,8 +32,8 @@ the src directory
cd tutorial/src
-and open up run_star_extras.f90 in your text editor of choice. The stock
-version of run_star_extras.f90 is quite boring. It “includes” another file
+and open up ``run_star_extras.f90`` in your text editor of choice. The stock
+version of ``run_star_extras.f90`` is quite boring. It “includes” another file
which holds the default set of routines.
.. code-block:: fortran
@@ -46,7 +46,7 @@ working copy of MESA, and not to MESA as a whole, we want to replace
this include statement with the contents of the included file.
Delete the aforementioned include line and insert the contents of
-$MESA_DIR/include/standard_run_star_extras.inc.
+``$MESA_DIR/include/standard_run_star_extras.inc``.
Before we make any changes, we should check that the code compiles.
@@ -61,7 +61,7 @@ removed the include line.
Control flow
^^^^^^^^^^^^
-The different run_star_extras.f90 routines get called at different
+The different ``run_star_extras.f90`` routines get called at different
points during MESA execution. Here is a flowchart summarizing this.
|flowchart|
@@ -80,13 +80,13 @@ stellar structure.
When writing Fortran code for run_star_extras.f90, here are a few
important and useful things to know.
-The star_info structure
-^^^^^^^^^^^^^^^^^^^^^^^
+The ``star_info`` structure
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``star_info`` structure contains all the information about the star
that is being evolved. By convention, the variable name ``s`` is used
throughout ``run_star_extras.f90`` to refer to this structure. In
-Fortran, the percent (%) operator is used to access the components of
+Fortran, the percent (``%``) operator is used to access the components of
the structure. (So you can read ``s% x = 3`` in the same way that you
would read ``s.x = 3`` in C.)
@@ -98,7 +98,7 @@ different categories documented in the ``star_data.inc`` file. In addition, ``s
contains the values for the parameters that you set in your ``controls``
inlist (i.e., ``initial_mass``, ``xa_central_lower_limit``). Recall that
the list of controls is located in
-$MESA_DIR/star/defaults/controls.defaults.
+``$MESA_DIR/star/defaults/controls.defaults``.
The ``s% xtra(1:30)`` array is a place to write temporary data of type ``real(dp)``
which follow the logic of a time-step and so get carried over across restarts, restored in retries, etc.
@@ -290,8 +290,8 @@ of milestones along the way. This is especially true for the profiles,
when it's not possible (or even desirable) to save and store a profile
every few steps.
-The star_info structure has a couple of flags –
-need_to_save_profiles_now and need_to_update_history_now – that let you
+The ``star_info`` structure has a couple of flags –
+``need_to_save_profiles_now`` and ``need_to_update_history_now`` – that let you
tell MESA that it is time to output data.
The place to set these is in the function extras_finish_step which will
@@ -302,7 +302,7 @@ intervals in central density. We will let the user specify the number of
divisions per decade. We need to be careful, because the trajectory in
rho-T space is not guaranteed to be monotonic.
-Here's some code to do just that. Again, read though it as the comments
+Here's some code to do just that. Again, read through it as the comments
discuss some useful MESA features.
.. code-block:: fortran
@@ -362,11 +362,11 @@ discuss some useful MESA features.
To prevent you from filling up your disk, MESA will only save a
limited number of profiles. The default is 100. If you want to be
-sure the profiles that you're triggering in extras_finish_step stick
+sure the profiles that you're triggering in ``extras_finish_step`` stick
around – perhaps you're making a movie – you should set
-max_num_profile_models to be greater that the number of profiles you
+``max_num_profile_models`` to be greater that the number of profiles you
anticipate generating. You might also want to crank up the priority
-which with they are saved by setting save_profiles_model_priority to
+which with they are saved by setting ``save_profiles_model_priority`` to
be 10. This will prevent MESA from discarding them in lieu of other
automatically saved profiles.
@@ -439,7 +439,7 @@ Using the "other" hooks
-----------------------
MESA provides a way to override most of the physics routines with no
-need to modify anything more than run_star_extras. There are two main
+need to modify anything more than ``run_star_extras``. There are two main
steps needed to take advantage of this functionality. In the following
example, we will add controls that allow us to control the various
non-nuclear neutrino losses (e.g., plasmon, bremsstrahlung) in our
@@ -448,7 +448,7 @@ massive star.
Writing a routine
^^^^^^^^^^^^^^^^^
-Navigate to $MESA_DIR/star/other, where you will see a set of files
+Navigate to ``$MESA_DIR/star/other``, where you will see a set of files
named with the pattern ``other_*.f90``. The routines in this directory
allow you to override/modify many physical and numerical aspects of
MESA.
@@ -531,14 +531,14 @@ There are two things that you must do in order to have MESA execute your
people encounter when using the ``other_*`` hooks.
First, edit the controls section of your inlist to set the appropriate
-``use_other_*`` flag to .true. . In our example, this means adding the line
+``use_other_*`` flag to ``.true.``. In our example, this means adding the line
.. code-block:: fortran
use_other_neu = .true.
-Second, edit the extras_controls routine in run_star_extras.f90 to point
-the other_neu at the routine you want to be executed.
+Second, edit the ``extras_controls`` routine in ``run_star_extras.f90`` to point
+the ``other_neu`` at the routine you want to be executed.
.. code-block:: fortran
:emphasize-lines: 11
diff --git a/docs/source/using_mesa/just_a_module.rst b/docs/source/using_mesa/just_a_module.rst
index 40b3740c2..a62a3ec51 100644
--- a/docs/source/using_mesa/just_a_module.rst
+++ b/docs/source/using_mesa/just_a_module.rst
@@ -112,13 +112,13 @@ As mentioned in sample_eos.f90, it can be useful to look at the integer indices
Edit sample_kap.f90 and change the variable
-.. code-block:: console
+.. code-block:: fortran
my_mesa_dir = '../..'
-to your $MESA_DIR, or use a blank string, in which case your $MESA_DIR is automagically used
+to your ``$MESA_DIR``, or use a blank string, in which case your ``$MESA_DIR`` is automagically used
-.. code-block:: console
+.. code-block:: fortran
my_mesa_dir = ''
@@ -168,13 +168,13 @@ Explore the output with, for example,
Edit sample_net.f90 and change the variable
-.. code-block:: console
+.. code-block:: fortran
my_mesa_dir = '../..'
-to your $MESA_DIR, or use a blank string, in which case your $MESA_DIR is automagically used
+to your ``$MESA_DIR``, or use a blank string, in which case your ``$MESA_DIR`` is automagically used
-.. code-block:: console
+.. code-block:: fortran
my_mesa_dir = ''
diff --git a/docs/source/using_mesa/using_pgstar.rst b/docs/source/using_mesa/using_pgstar.rst
index c3c7fbfea..c172d761f 100644
--- a/docs/source/using_mesa/using_pgstar.rst
+++ b/docs/source/using_mesa/using_pgstar.rst
@@ -11,9 +11,9 @@ Devote lots of time watching models evolve. It's a fun way to learn!
If you're using the MESA SDK, you should have everything you need to use
PGSTAR. Otherwise, you need to have installed PGPLOT, Xwindows, and a
-few libraries that they need. See the makefile_header_non_mesasdk in
-$MESA_DIR/utils for details. You'll find pgplot.tar.bz2 in
-$MESA_DIR/scripts in case you need to install PGPLOT (thanks to Tim
+few libraries that they need. See the ``makefile_header_non_mesasdk`` in
+``$MESA_DIR/utils`` for details. You'll find pgplot.tar.bz2 in
+``$MESA_DIR/scripts`` in case you need to install PGPLOT (thanks to Tim
Pearson of CalTech for creating PGPLOT and giving us permission to
distribute it with MESA).
@@ -35,9 +35,9 @@ history_columns.list. If it is in your history_columns.list, you can
show it in a history plot. The name for a history item must be the same
as one of the column headings in your current LOGS/history.data - these
are the same as the entries in the history_columns.list but with any
-spaces replaced by "\_". For example, "center h1" in
-history_columns.list changes to "center_h1" as a column heading in
-LOGS/history.data, so you should use "center_h1" as the name in the
+spaces replaced by ``_``. For example, ``center h1`` in
+history_columns.list changes to ``center_h1`` as a column heading in
+LOGS/history.data, so you should use ``center_h1`` as the name in the
plot.
Single Panel, Multiple Panel, and Grid Plots
@@ -52,31 +52,31 @@ General Controls
~~~~~~~~~~~~~~~~
You can change the width, aspect ratio, margins, text scale, title, and
-axis limits of any plot by editing your pgstar_controls inlist file. The
+axis limits of any plot by editing your ``pgstar_controls`` inlist file. The
file is reread at each timestep, so you can make changes while the
evolution is running. For user-specified plots, you can also change any
of the specs on-the-fly including what is plotted for the axes and the
-number of panels or grid layout. You can change the "win_flag" from
-.false. to .true. on-the-fly to create a new window. Changing the
-win_flag from .true. to .false. removes the window, but because of
+number of panels or grid layout. You can change the ``win_flag`` from
+``.false.`` to ``.true.`` on-the-fly to create a new window. Changing the
+win_flag from ``.true.`` to ``.false.`` removes the window, but because of
quirks of pgplot and/or Xwindows, it will pause and ask you to hit a
return.
-You can have the code pause at each step by setting pause = .true. It
-will pause every nth step if you set pause_interval = n.
+You can have the code pause at each step by setting ``pause = .true.`` It
+will pause every nth step if you set ``pause_interval = n``.
-You can slow it down by setting pgstar_sleep to the minimum number of
+You can slow it down by setting ``pgstar_sleep`` to the minimum number of
seconds to allow between plot updates.
-It will update the windows every nth step if you set pgstar_interval = n.
+It will update the windows every nth step if you set ``pgstar_interval = n``.
-To save the plot as a png file, set the "file_flag" for the window to
-.true. You can specify a directory and prefix for the files, as well as
+To save the plot as a png file, set the ``file_flag`` for the window to
+``.true.`` You can specify a directory and prefix for the files, as well as
the frequency of writing (every nth step) and the size of the plot for
the file. You can even get files written when the star moves a given
distance on the HR diagram!
-To switch from black background to white change the white_on_black_flag.
+To switch from black background to white change the ``white_on_black_flag``.
There are separate flags for windows and files.
The Inventory of Plots
@@ -85,25 +85,25 @@ The Inventory of Plots
single panel profile plots
~~~~~~~~~~~~~~~~~~~~~~~~~~
-- TRho_Profile - current model in T-Rho plane
-- Summary_Profile - various profile properties
-- Summary_Burn - current model T, rho, eps burning, and eps neutrinos
-- Abundance - current model abundance profiles
-- Power - current model nuclear power profiles
-- Mixing - current model mixing diffusion coefficients
-- Dynamo - current model dynamo magnetic field info
-- Mode_Prop - asteroseimology mode propagation diagram
+- ``TRho_Profile`` - current model in T-Rho plane
+- ``Summary_Profile`` - various profile properties
+- ``Summary_Burn`` - current model T, rho, eps burning, and eps neutrinos
+- ``Abundance`` - current model abundance profiles
+- ``Power`` - current model nuclear power profiles
+- ``Mixing`` - current model mixing diffusion coefficients
+- ``Dynamo`` - current model dynamo magnetic field info
+- ``Mode_Prop`` - asteroseimology mode propagation diagram
single panel history plots
~~~~~~~~~~~~~~~~~~~~~~~~~~
-- Kipp - "Kippenhann" history of mixing, burning, and more
-- Summary_History - various history properties
-- TRho - history of central temperature vs. density
-- HR - history of log_L vs. log_Teff
-- logg_Teff - history of logg vs. Teff
-- logg_logT - history of logg vs. log_Teff
-- dPg_dnu - delta_Pg vs. delta_nu (for asteroseismology)
+- ``Kipp`` - "Kippenhann" history of mixing, burning, and more
+- ``Summary_History`` - various history properties
+- ``TRho`` - history of central temperature vs. density
+- ``HR`` - history of log_L vs. log_Teff
+- ``logg_Teff`` - history of logg vs. Teff
+- ``logg_logT`` - history of logg vs. log_Teff
+- ``dPg_dnu`` - delta_Pg vs. delta_nu (for asteroseismology)
Keep in mind that if it isn't in your current history list, then it
won't be available for plotting in PGSTAR history plots. For example, if
@@ -115,72 +115,72 @@ to your history_columns.list - e.g., add these:
mixing_regions 40
burning_regions 80
-profile panel plots: Profile_Panels1 to Profile_Panels9
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+profile panel plots: ``Profile_Panels1`` to ``Profile_Panels9``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You select axes from anything allowed in a profile_columns.list. In
addition, a panel can be any of these pre-defined plots: Abundance,
Power, Mixing, Dynamo, Mode_prop, or Summary_Profile.
-- Profile_Panels1 - default has X = mass, panels = (logT,entropy) and
+- ``Profile_Panels1`` - default has X = mass, panels = (logT,entropy) and
(logRho,logP).
-- Profile_Panels2 - default has X = logP, panels = Abundance and Power.
-- Profile_Panels3 - default has X = logP, panels = Abundance, Power,
+- ``Profile_Panels2`` - default has X = logP, panels = Abundance and Power.
+- ``Profile_Panels3`` - default has X = logP, panels = Abundance, Power,
and Mixing.
-- Profile_Panels4 - default has X = logP, panels = Abundance, Power,
+- ``Profile_Panels4`` - default has X = logP, panels = Abundance, Power,
Mixing, and Dynamo.
-- Profile_Panels5 - default has X = logP, panels = Summary_Profile,
+- ``Profile_Panels5`` - default has X = logP, panels = Summary_Profile,
Mode_prop, and Mixing.
-history track plots: History_Track1 to History_Track9
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+history track plots: ``History_Track1`` to ``History_Track9``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Like TRho, HR, and other history plots, but you select the axes from
items in your current history_columns.list.
-- History_Track1 - default shows log_L vs. log_center_T
+- ``History_Track1`` - default shows log_L vs. log_center_T
-history panel plots: History_Panels1 to History_Panels9
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+history panel plots: ``History_Panels1`` to ``History_Panels9``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You select Y axes from the column heading in current LOGS/history.data.
-- History_Panels1 - default shows logT, logRho, log_L, log_Teff, mass,
+- ``History_Panels1`` - default shows logT, logRho, log_L, log_Teff, mass,
mdot
-text summary plots: Text_Summary1 to Text_Summary9
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+text summary plots: ``Text_Summary1`` to ``Text_Summary9``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- Text_Summary1 - default gives info similar to standard terminal
+- ``Text_Summary1`` - default gives info similar to standard terminal
output
-grids: Grid1 to Grid9
-~~~~~~~~~~~~~~~~~~~~~
+grids: ``Grid1`` to ``Grid9``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- Grid1 - default TRho_Profile, HR, TRho, Text_Summary1
-- Grid2 - default TRho_Profile, Kipp
-- Grid3 - default TRho_Profile, Summary_Profile, Kipp
-- Grid4 - default TRho_Profile, Summary_Profile, HR, TRho, Kipp,
+- ``Grid1`` - default TRho_Profile, HR, TRho, Text_Summary1
+- ``Grid2`` - default TRho_Profile, Kipp
+- ``Grid3`` - default TRho_Profile, Summary_Profile, Kipp
+- ``Grid4`` - default TRho_Profile, Summary_Profile, HR, TRho, Kipp,
Text_Summary1
-- Grid5 - default TRho_Profile, Summary_Profile, HR, TRho, Kipp
-- Grid6 - default Summary_Burn, Abundance, HR, TRho, Text_Summary1
-- Grid7 - default Abundance, TRho, Text_Summary1
-- Grid8 - default Summary_Burn, Abundance, HR, TRho, TRho_Profile,
+- ``Grid5`` - default TRho_Profile, Summary_Profile, HR, TRho, Kipp
+- ``Grid6`` - default Summary_Burn, Abundance, HR, TRho, Text_Summary1
+- ``Grid7`` - default Abundance, TRho, Text_Summary1
+- ``Grid8`` - default Summary_Burn, Abundance, HR, TRho, TRho_Profile,
Text_Summary1
-- Grid9 - default Abundance, HR, TRho, TRho_Profile, Text_Summary1
+- ``Grid9`` - default Abundance, HR, TRho, TRho_Profile, Text_Summary1
Hands-on Tutorial
-----------------
-Do this tutorial while $MESA_DIR/star is running and pgstar_flag is set
-.true. so you can watch as the plots change as you edit and save your
+Do this tutorial while ``$MESA_DIR/star`` is running and ``pgstar_flag`` is set
+``.true.`` so you can watch as the plots change as you edit and save your
inlist.
I suggest using the test case 1M_pre_ms_to_wd. Go to the directory,
$MESA_DIR/star/test_suite/1M_pre_ms_to_wd, and open "inlist_1.0" in your
-text editor. In the &star_job section, set pgstar_flag = .true. and
-check the &pgstar section to make sure it starts empty. Then do the
-usual ./mk and ./rn to start the test case.
+text editor. In the ``&star_job`` section, set ``pgstar_flag = .true.`` and
+check the ``&pgstar`` section to make sure it starts empty. Then do the
+usual ``./mk`` and ``./rn`` to start the test case.
First, open some plot windows and take a look at what's available. Just
edit your pgstar inlist to set the "win_flag" for the plot; the changes
@@ -229,7 +229,7 @@ previous ones.
Grid2_win_flag = .true.
-When you're finished admiring these beauties, delete the "win_flag"
+When you're finished admiring these beauties, delete the "``win_flag``"
lines from your inlist, and we'll take a look at how you can modify
plots.
@@ -274,7 +274,7 @@ of the PGPLOT symbol for "omega".
Summary_Profile_legend(4) = 'log (0650) rel'
Open the Summary_Profile window, then make some changes. Note that you
-can remove a line just by setting the name to ''; you don't have to
+can remove a line just by setting the name to ``''``; you don't have to
renumber the other lines.
.. code-block:: fortran
@@ -302,7 +302,7 @@ of PGPLOT text controls for the subscript "c" for center values.
Summary_History_legend(2) = 'log Rho\dc\u rel'
Open the Summary_History window, then make some changes. Note that
-you can remove a line just by setting the name to ''; you don't have
+you can remove a line just by setting the name to ``''``; you don't have
to renumber the other lines.
.. code-block:: fortran
@@ -327,7 +327,7 @@ the column headings in your current LOGS/history.data.
History_Track1_xaxis_label = 'log P\dcenter'
History_Track1_title = 'L vs Center P'
-Turn on Profile\_Panels1 and History\_Panels1; they are set up with
+Turn on ``Profile_Panels1`` and ``History_Panels1``; they are set up with
defaults for the number of panels and axes. Change the defaults to
show other things -- for the profiles you can select anything that can
be in a profile_columns.list; for the history you have to select one
diff --git a/eos/defaults/eos.defaults b/eos/defaults/eos.defaults
index 913881517..5373861c4 100644
--- a/eos/defaults/eos.defaults
+++ b/eos/defaults/eos.defaults
@@ -9,26 +9,26 @@
! PC EOS controls
! ---------------
- ! use_PC
- ! ~~~~~~
+ ! ``use_PC``
+ ! ~~~~~~~~~~
! Select whether to use the PC eos.
! ::
use_PC = .false.
- ! mass_fraction_limit_for_PC
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``mass_fraction_limit_for_PC``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Only consider isotopes in the EOS if their mass fraction is above this value.
! ::
mass_fraction_limit_for_PC = 1d-4
- ! logRho1_PC_limit
- ! ~~~~~~~~~~~~~~~~
- ! logRho2_PC_limit
- ! ~~~~~~~~~~~~~~~~
+ ! ``logRho1_PC_limit``
+ ! ~~~~~~~~~~~~~~~~~~~~
+ ! ``logRho2_PC_limit``
+ ! ~~~~~~~~~~~~~~~~~~~~
! Blend in logRho from no PC for below ``logRho1_PC_limit``
! to all PC above ``logRho2_PC_limit``.
! ::
@@ -37,10 +37,10 @@
logRho2_PC_limit = 2.8d0 ! must be > 2.8 or so to avoid NaN's from PC
- ! logT1_PC_limit
- ! ~~~~~~~~~~~~~~
- ! logT2_PC_limit
- ! ~~~~~~~~~~~~~~
+ ! ``logT1_PC_limit``
+ ! ~~~~~~~~~~~~~~~~~~
+ ! ``logT2_PC_limit``
+ ! ~~~~~~~~~~~~~~~~~~
! Blend in logT from all PC for below ``logT1_PC_limit``
! to no PC above ``logT2_PC_limit``.
! Unused by default. See subsequent controls.
@@ -50,12 +50,12 @@
logT2_PC_limit = 7.7d0 ! don't use PC for logT > this (like logT_all_HELM)
- ! PC_use_Gamma_limit_instead_of_T
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! log_Gamma_e_all_HELM
- ! ~~~~~~~~~~~~~~~~~~~~
- ! log_Gamma_e_all_PC
- ! ~~~~~~~~~~~~~~~~~~
+ ! ``PC_use_Gamma_limit_instead_of_T``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``log_Gamma_e_all_HELM``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``log_Gamma_e_all_PC``
+ ! ~~~~~~~~~~~~~~~~~~~~~~
! If ``PC_use_Gamma_limit_instead_of_T`` is true, then these
! controls are active instead of ``logT1_PC_limit`` and
! ``logT2_PC_limit``. Here, :math:`\Gamma_e` is the electron
@@ -68,10 +68,10 @@
log_Gamma_e_all_HELM = -1.8d0
log_Gamma_e_all_PC = -1.7d0
- ! PC_Gamma_start_crystal
- ! ~~~~~~~~~~~~~~~~~~~~~~
- ! PC_Gamma_full_crystal
- ! ~~~~~~~~~~~~~~~~~~~~~
+ ! ``PC_Gamma_start_crystal``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``PC_Gamma_full_crystal``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~
! PC crystallization boundaries.
! Here, :math:`\Gamma` is the mean ion Coulomb coupling parameter.
@@ -84,8 +84,8 @@
! FreeEOS controls
! ----------------
- ! use_FreeEOS
- ! ~~~~~~~~~~~
+ ! ``use_FreeEOS``
+ ! ~~~~~~~~~~~~~~~
! Select whether to use FreeEOS.
! ::
@@ -127,8 +127,8 @@
! OPAL/SCVH controls
! ------------------
- ! use_OPAL_SCVH
- ! ~~~~~~~~~~~~~
+ ! ``use_OPAL_SCVH``
+ ! ~~~~~~~~~~~~~~~~~
! Select whether to use the OPAL/SCVH EOS. These two EOSes are pre-blended with each other.
! ::
@@ -167,24 +167,24 @@
! Skye controls
! -------------
- ! use_Skye
- ! ~~~~~~~~
+ ! ``use_Skye``
+ ! ~~~~~~~~~~~~
! Select whether to use the Skye EOS.
! ::
use_Skye = .true.
- ! mass_fraction_limit_for_Skye
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``mass_fraction_limit_for_Skye``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Only consider isotopes in the EOS if their mass fraction is above this value.
! ::
mass_fraction_limit_for_Skye = 1d-4
- ! Skye_use_ion_offsets
- ! ~~~~~~~~~~~~~~~~~~~~
+ ! ``Skye_use_ion_offsets``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~
! If true, set neutral ground state as zero point for each ion species energy.
! If false, zero point assumes fully ionized.
! ::
@@ -231,24 +231,24 @@
! CMS controls
! ------------
- ! use_CMS
- ! ~~~~~~~
+ ! ``use_CMS``
+ ! ~~~~~~~~~~~
! Select whether to use the CMS EOS. (EXPERIMENTAL)
! ::
use_CMS = .false.
- ! CMS_use_fixed_composition
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``CMS_use_fixed_composition``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Use a single table for a fixed composition. Don't interpolate in H mass fraction.
! ::
CMS_use_fixed_composition = .false.
- ! CMS_fixed_composition_index
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``CMS_fixed_composition_index``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Integer with valid values from 0 to 10 inclusive corresponding to the table
! to use in the fixed composition case. A value of 0 corresponds to the pure Helium
! table while a value of 10 corresponds to the pure Hydrogen table.
@@ -304,8 +304,8 @@
! Other EOS controls
! ------------------
- ! use_other_eos_component
- ! ~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``use_other_eos_component``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Select whether to use the other (i.e., user-provided) EOS component.
! If true, the user must provide the routines
! ``other_eos_component`` and ``other_eos_frac``.
@@ -315,8 +315,8 @@
use_other_eos_component = .false.
- ! use_other_eos_results
- ! ~~~~~~~~~~~~~~~~~~~~~
+ ! ``use_other_eos_results``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~
! Select whether to call the other_eos_results hook. This provides
! an opportunity for the user to modify the results from the EOS right
! before they are returned. If true, the user must provide the routine
@@ -361,12 +361,12 @@
! One can split an eos inlist into pieces using the following parameters.
! It works recursively, so the extras can read extras too.
- ! read_extra_eos_inlist(1..5)
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! extra_eos_inlist_name(1..5)
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``read_extra_eos_inlist(1..5)``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``extra_eos_inlist_name(1..5)``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! If ``read_extra_eos_inlist(i)`` is true, then read &eos from the file ``extra_eos_inlist_name(i)``.
+ ! If ``read_extra_eos_inlist(i)`` is true, then read ``&eos`` from the file ``extra_eos_inlist_name(i)``.
! ::
read_extra_eos_inlist(:) = .false.
diff --git a/eos/private/eosdt_eval.f90 b/eos/private/eosdt_eval.f90
index 344dd5c6d..607173a6f 100644
--- a/eos/private/eosdt_eval.f90
+++ b/eos/private/eosdt_eval.f90
@@ -880,7 +880,7 @@ subroutine Get_FreeEOS_alfa( &
! logRho blend
if (logRho_auto < rq% logRho_min_FreeEOS_lo) then
blend_logRho = 0d0
- else if (logRho_auto < rq% logRho_min_FreeEOS_lo) then
+ else if (logRho_auto < rq% logRho_min_FreeEOS_hi) then
blend_logRho = (logRho_auto - rQ% logRho_min_FreeEOS_lo) / (rq% logRho_min_FreeEOS_hi - rq% logRho_min_FreeEOS_lo)
else if (logRho_auto < rq% logRho_max_FreeEOS_lo) then
blend_logRho = 1d0
diff --git a/install b/install
index 612459587..76d447b54 100755
--- a/install
+++ b/install
@@ -2,12 +2,6 @@
set -o pipefail
-# Get version number from git
-if [ -d ".git" ] || [ -f ".git" ]; then
- # Limits hashes to 7 characters
- version=$(git rev-parse HEAD)
- printf "%s" "${version:0:7}" > data/version_number
-fi
# Create file for TestHub
# This file will be populated during math/test
@@ -102,55 +96,6 @@ then
exit 1
fi
-# Check we are on git and if so did git lfs work?
-if [ -d ".git" ] || [ -f ".git" ]
-then
- # First check if git lfs is installed
- if ! command -v git-lfs >/dev/null 2>&1
- then
- echo
- echo "****************************************************************"
- echo "* git lfs is not installed *"
- echo "* *"
- echo "****************************************************************"
- echo
- exit 1
- fi
-
- # empirically on lustre filesystems the LFS files don't immediately appear
- # if requested, sleep for a bit before proceeding and doing the check
- if [ -n "${MESA_GIT_LFS_SLEEP}" ]; then
- sleep "${MESA_GIT_LFS_SLEEP}"
- fi
-
- # check that each LFS file has a full copy on disk
- FILE_LIST=$(git-lfs ls-files | awk '{print $NF}')
- for LFS_FILE in ${FILE_LIST}; do
- # the checks have this form to handle uncommitted changes to LFS files
- # if no file exists, that means the file was probably deleted and that's OK
- # if the file exists, but is short, then it is probably the bare LFS pointer
- # and that indicates a problem retrieving the file
- if [ -f "${LFS_FILE}" ] && [ $(du -k "${LFS_FILE}" | cut -f1) -le 4 ];
- then
- echo
- echo "${LFS_FILE} is smaller than expected for a file tracked by git LFS"
- echo
- echo "****************************************************************"
- echo "* Some data files were not successfully retrieved *"
- echo "* *"
- echo "* Try running: *"
- echo "* git lfs install --force *"
- echo "* and then *"
- echo "* git lfs pull *"
- echo "* *"
- echo "****************************************************************"
- echo
- exit 1
- fi
- done
-
-fi
-
@@ -181,7 +126,7 @@ then
echo "* *"
echo "* MESA_DIR can not contain whitespace *"
echo "* Please move your MESA_DIR to a folder *"
- echo "* without spaces in its name *"
+ echo "* without spaces in its name *"
echo "* *"
echo "****************************************************************"
echo
@@ -323,7 +268,7 @@ then
fi
do_one_parallel chem
-if [ ! -r data/colors_data ]
+if [ ! -r data/colors_data/.extraction_complete ]
then
do_input_data colors
fi
diff --git a/kap/defaults/kap.defaults b/kap/defaults/kap.defaults
index fa1ce6be2..51875e184 100644
--- a/kap/defaults/kap.defaults
+++ b/kap/defaults/kap.defaults
@@ -2,8 +2,8 @@
! ===================
! The MESA/kap parameters are given default values here.
- ! The actual values as modified by your inlist are stored in the Kap_General_Info data structure.
- ! They can be accessed by code at runtime using the kap_handle to get a pointer to it.
+ ! The actual values as modified by your inlist are stored in the ``Kap_General_Info`` data structure.
+ ! They can be accessed by code at runtime using the ``kap_handle`` to get a pointer to it.
! Base metallicity
@@ -61,17 +61,17 @@
!The OPLIB Type1 tables offer additional table density, for 1194 (X,Z) pairs from the following sets:
!
! + X: 0.0, 0.000001, 0.00001, 0.0001, 0.001, 0.01, 0.05, 0.1,
- ! + 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5,
- ! + 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9,
- ! + 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97,
- ! + 0.98, 0.99, 1-Z
+ ! 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5,
+ ! 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9,
+ ! 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97,
+ ! 0.98, 0.99, 1-Z
! + Z: 0.0, 0.000001, 0.00001, 0.00003, 0.00007, 0.0001,
- ! + 0.0003, 0.0007, 0.001, 0.002, 0.003, 0.004,0.006,
- ! + 0.008, 0.01, 0.012, 0.014, 0.015, 0.016, 0.017, 0.018,
- ! + 0.019, 0.02, 0.021, 0.022, 0.023, 0.024, 0.025, 0.026,
- ! + 0.028, 0.03, 0.035, 0.04, 0.05, 0.06, 0.07, 0.08,
- ! + 0.09, 0.1, 0.15, 0.2
+ ! 0.0003, 0.0007, 0.001, 0.002, 0.003, 0.004,0.006,
+ ! 0.008, 0.01, 0.012, 0.014, 0.015, 0.016, 0.017, 0.018,
+ ! 0.019, 0.02, 0.021, 0.022, 0.023, 0.024, 0.025, 0.026,
+ ! 0.028, 0.03, 0.035, 0.04, 0.05, 0.06, 0.07, 0.08,
+ ! 0.09, 0.1, 0.15, 0.2
! Available options:
@@ -166,8 +166,8 @@
! Blend controls
! --------------
- ! use_Zbase_for_Type1
- ! ~~~~~~~~~~~~~~~~~~~
+ ! ``use_Zbase_for_Type1``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~
! If true, then if ``use_Type2_opacities = .true.``, Type1 opacities will be computed
! using ``Zbase`` instead of ``Z`` when Z > Zbase. This helps with blending from Type1 to Type2.
! Ignored if ``use_Type2_opacities = .false.``.
@@ -176,8 +176,8 @@
use_Zbase_for_Type1 = .true.
- ! use_Type2_opacities
- ! ~~~~~~~~~~~~~~~~~~~
+ ! ``use_Type2_opacities``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~
! Select whether to use Type2 opacity tables (see :ref:`kap/defaults:kap_CO_prefix`).
! Even when true, in regions where hydrogen is
! above a given threshold, or the metallicity is not significantly higher than
@@ -189,10 +189,10 @@
use_Type2_opacities = .true.
- ! kap_Type2_full_off_X
- ! ~~~~~~~~~~~~~~~~~~~~
- ! kap_Type2_full_on_X
- ! ~~~~~~~~~~~~~~~~~~~
+ ! ``kap_Type2_full_off_X``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``kap_Type2_full_on_X``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~
! Switch to Type1 if X too large.
! Type2 is full off for ``X >= kap_Type2_full_off_X``
! Type2 can be full on for ``X <= kap_Type2_full_on_X``.
@@ -202,10 +202,10 @@
kap_Type2_full_on_X = 1d-6
- ! kap_Type2_full_off_dZ
- ! ~~~~~~~~~~~~~~~~~~~~~
- ! kap_Type2_full_on_dZ
- ! ~~~~~~~~~~~~~~~~~~~~
+ ! ``kap_Type2_full_off_dZ``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``kap_Type2_full_on_dZ``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~
! Switch to Type1 if dZ too small ``(dZ = Z - Zbase)``.
! Type2 is full off for ``dZ <= kap_Type2_full_off_dZ``.
! Type2 can be full on for ``dZ >= kap_Type2_full_on_dZ``.
@@ -223,10 +223,10 @@
! Add ``kap_frac_Type2`` to your profile columns list to see ``frac_Type2`` for each cell.
- ! kap_blend_logT_upper_bdy
- ! ~~~~~~~~~~~~~~~~~~~~~~~~
- ! kap_blend_logT_lower_bdy
- ! ~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``kap_blend_logT_upper_bdy``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``kap_blend_logT_lower_bdy``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Region to blend between higher temperature tables
! (see :ref:`kap/defaults:kap_file_prefix` and :ref:`kap/defaults:kap_CO_prefix`) and lower
! temperature tables (see :ref:`kap/defaults:kap_lowT_prefix`).
@@ -250,8 +250,8 @@
! Interpolation options
! ---------------------
- ! cubic_interpolation_in_X
- ! ~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``cubic_interpolation_in_X``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! type of interpolation in X.
! true is cubic; false is linear.
! ::
@@ -259,8 +259,8 @@
cubic_interpolation_in_X = .false.
- ! cubic_interpolation_in_Z
- ! ~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``cubic_interpolation_in_Z``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! type of interpolation in Z.
! true is cubic; false is linear.
! ::
@@ -278,16 +278,16 @@
! Separate controls exist for each class of prefix.
- ! user_num_kap_Xs
- ! ~~~~~~~~~~~~~~~
+ ! ``user_num_kap_Xs``
+ ! ~~~~~~~~~~~~~~~~~~~
! Number of X values.
! ::
!! user_num_kap_Xs = 10
- ! user_kap_Xs
- ! ~~~~~~~~~~~
+ ! ``user_kap_Xs``
+ ! ~~~~~~~~~~~~~~~
! X values for the tables (length ``user_num_kap_Xs``).
! Values such that X + Z > 1 will have X reduced to 1-Z.
@@ -297,24 +297,24 @@
!! user_kap_Xs = 0.0d0, 0.1d0, 0.2d0, 0.35d0, 0.5d0, 0.7d0, 0.8d0, 0.9d0, 0.95d0, 1.0d0
- ! user_num_kap_Zs
- ! ~~~~~~~~~~~~~~~
+ ! ``user_num_kap_Zs``
+ ! ~~~~~~~~~~~~~~~~~~~
! Number of Z values.
! ::
!! user_num_kap_Zs = 13
- ! user_kap_Zs
- ! ~~~~~~~~~~~
+ ! ``user_kap_Zs``
+ ! ~~~~~~~~~~~~~~~
! Z values for the tables (length ``user_num_kap_Zs``).
! ::
!! user_kap_Zs = 0.000d0, 0.0001d0, 0.0003d0, 0.001d0, 0.002d0, 0.004d0, 0.01d0, 0.02d0, 0.03d0, 0.04d0, 0.06d0, 0.08d0, 0.100d0
- ! user_num_kap_Xs_for_this_Z
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``user_num_kap_Xs_for_this_Z``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! At different values of Z, the number of values of X may change. In particular, tables with ``X > 1-Z`` will not exist.
! Use the first N (``<= user_num_kap_Xs``) X values for the tables of the corresponding Z (length ``user_num_kap_Zs``).
@@ -323,8 +323,8 @@
!! user_num_kap_Xs_for_this_Z = 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 8
- ! user_num_kap_CO_Xs
- ! ~~~~~~~~~~~~~~~~~~
+ ! ``user_num_kap_CO_Xs``
+ ! ~~~~~~~~~~~~~~~~~~~~~~
! Number of X values.
! ::
@@ -332,32 +332,32 @@
!! user_num_kap_CO_Xs = 5
- ! user_kap_CO_Xs
- ! ~~~~~~~~~~~~~~
+ ! ``user_kap_CO_Xs``
+ ! ~~~~~~~~~~~~~~~~~~
! X values for the tables (length ``user_num_kap_CO_Xs``).
! ::
!! user_kap_CO_Xs = 0.00d0, 0.03d0, 0.10d0, 0.35d0, 0.70d0
- ! user_num_kap_CO_Zs
- ! ~~~~~~~~~~~~~~~~~~
+ ! ``user_num_kap_CO_Zs``
+ ! ~~~~~~~~~~~~~~~~~~~~~~
! Number of Z values.
! ::
!! user_num_kap_CO_Zs = 8
- ! user_kap_CO_Zs
- ! ~~~~~~~~~~~~~~
+ ! ``user_kap_CO_Zs``
+ ! ~~~~~~~~~~~~~~~~~~
! Z values for the tables (length ``user_num_kap_CO_Zs``).
! ::
!! user_kap_CO_Zs = 0.000d0, 0.001d0, 0.004d0, 0.010d0, 0.020d0, 0.030d0, 0.050d0, 0.100d0
- ! user_num_kap_CO_Xs_for_this_Z
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``user_num_kap_CO_Xs_for_this_Z``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! At different values of Z, the number of values of X may change. In particular, tables with ``X > 1-Z`` will not exist.
! Use the first N (``<= user_num_kap_CO_Xs``) X values for the tables of the corresponding Z (length ``user_num_kap_CO_Zs``).
! ::
@@ -365,16 +365,16 @@
!! user_num_kap_CO_Xs_for_this_Z = 5, 5, 5, 5, 5, 5, 5, 5
- ! user_num_kap_lowT_Xs
- ! ~~~~~~~~~~~~~~~~~~~~
+ ! ``user_num_kap_lowT_Xs``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~
! Number of X values.
! ::
!! user_num_kap_lowT_Xs = 10
- ! user_kap_lowT_Xs
- ! ~~~~~~~~~~~~~~~~
+ ! ``user_kap_lowT_Xs``
+ ! ~~~~~~~~~~~~~~~~~~~~
! X values for the tables (length ``user_num_kap_lowT_Xs``).
! Values such that X + Z > 1 will have X reduced to 1-Z.
! Choose ``user_num_kap_lowT_Xs_for_this_Z`` such that at most 1 X value for each Z will be reduced in this way.
@@ -383,24 +383,24 @@
!! user_kap_lowT_Xs = 0.0d0, 0.1d0, 0.2d0, 0.35d0, 0.5d0, 0.7d0, 0.8d0, 0.9d0, 0.95d0, 1.0d0
- ! user_num_kap_lowT_Zs
- ! ~~~~~~~~~~~~~~~~~~~~
+ ! ``user_num_kap_lowT_Zs``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~
! Number of Z values.
! ::
!! user_num_kap_lowT_Zs = 13
- ! user_kap_lowT_Zs
- ! ~~~~~~~~~~~~~~~~
+ ! ``user_kap_lowT_Zs``
+ ! ~~~~~~~~~~~~~~~~~~~~
! Z values for the tables (length ``user_num_kap_lowT_Zs``).
! ::
!! user_kap_lowT_Zs = 0.000d0, 0.0001d0, 0.0003d0, 0.001d0, 0.002d0, 0.004d0, 0.01d0, 0.02d0, 0.03d0, 0.04d0, 0.06d0, 0.08d0, 0.100d0
- ! user_num_kap_lowT_Xs_for_this_Z
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``user_num_kap_lowT_Xs_for_this_Z``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! At different values of Z, the number of values of X may change. In particular, tables with ``X > 1-Z`` will not exist.
! Use the first N (``<= user_num_kap_lowT_Xs``) X values for the tables of the corresponding Z (length ``user_num_kap_lowT_Zs``).
! ::
@@ -411,8 +411,8 @@
! Conductive opacity options
! --------------------------
- ! include_electron_conduction
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``include_electron_conduction``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! add conduction opacities to radiative opacities
! ::
@@ -420,8 +420,8 @@
include_electron_conduction = .true.
- ! use_blouin_conductive_opacities
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``use_blouin_conductive_opacities``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Use fits from Blouin et al. (2020) for H and He in the regime of
! moderate coupling and moderate degeneracy.
! ::
@@ -432,8 +432,8 @@
! Miscellaneous controls
! ----------------------
- ! show_info
- ! ~~~~~~~~~
+ ! ``show_info``
+ ! ~~~~~~~~~~~~~
! if true, then output additional information as the opacities are loaded.
! this is particularly useful to see the detailed composition coverage of
! the AESOPUS opacity files.
@@ -447,24 +447,24 @@
! Control whether to use other hooks. See ``kap/other``.
- ! use_other_elect_cond_opacity
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``use_other_elect_cond_opacity``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Replace electron conduction opacity routine
! ::
use_other_elect_cond_opacity = .false.
- ! use_other_compton_opacity
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``use_other_compton_opacity``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Replace Compton opacity routine
! ::
use_other_compton_opacity = .false.
- ! use_other_radiative_opacity
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``use_other_radiative_opacity``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Replace radiative opacity routine.
! The standard routine evaluates the opacity using the low-T and high-T tables.
! ::
@@ -491,10 +491,10 @@
! It works recursively, so the extras can read extras too.
- ! read_extra_kap_inlist(1..5)
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! extra_kap_inlist_name(1..5)
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``read_extra_kap_inlist(1..5)``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! ``extra_kap_inlist_name(1..5)``
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! If ``read_extra_kap_inlist(i)`` is true, then read ``&eos`` from the file ``extra_kap_inlist_name(i)``.
! ::
diff --git a/mtx/public/mtx_solve_routines.inc b/mtx/public/mtx_solve_routines.inc
index a3138bfac..736220990 100644
--- a/mtx/public/mtx_solve_routines.inc
+++ b/mtx/public/mtx_solve_routines.inc
@@ -215,7 +215,6 @@
real(dp) :: temp
integer :: i, k
info = 0
- !$omp simd private(temp)
do i = 1,n
temp = b(i)
b(i) = b(ipiv(i))
@@ -251,7 +250,6 @@
real(dp) :: temp
integer :: i, k
info = 0
- !$omp simd private(temp)
do i = 1,n
temp = b(i)
b(i) = b(ipiv(i))
@@ -287,7 +285,6 @@
real(dp) :: temp
integer :: i, k
info = 0
- !$omp simd private(temp)
do i = 1,n
temp = b(i)
b(i) = b(ipiv(i))
diff --git a/num/private/mod_newton.f90 b/num/private/mod_newton.f90
index bcf27f3a9..9eab6cbbd 100644
--- a/num/private/mod_newton.f90
+++ b/num/private/mod_newton.f90
@@ -639,11 +639,11 @@ subroutine do_newton(nz, nvar, x1, xold1, AF1, ldAF, neq, matrix_type, mljac, mu
exit
end if
if (is_bad(residual_norm)) then
- call oops('residual_norm is a a bad number (NaN or Infinity)')
+ call oops('residual_norm is a bad number (NaN or Infinity)')
exit
end if
if (is_bad(max_residual)) then
- call oops('max_residual is a a bad number (NaN or Infinity)')
+ call oops('max_residual is a bad number (NaN or Infinity)')
exit
end if
residual_norm = abs(residual_norm)
diff --git a/star/defaults/FORMAT b/star/defaults/FORMAT
index e6a5c5713..e5cd1bc6b 100644
--- a/star/defaults/FORMAT
+++ b/star/defaults/FORMAT
@@ -136,8 +136,8 @@
! Boolean options are great. They can take one of two values:
- ! + .true.
- ! + .false.
+ ! + ``.true.``
+ ! + ``.false.``
! ::
diff --git a/star/defaults/controls.defaults b/star/defaults/controls.defaults
index a238afe5a..840cf31a5 100644
--- a/star/defaults/controls.defaults
+++ b/star/defaults/controls.defaults
@@ -1072,8 +1072,8 @@
log_center_temp_lower_limit = -1d99
- ! surface_accel_div_grav_limit = -1
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! surface_accel_div_grav_limit
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! This is used when do not have a velocity variable.
! The acceleration ratio is ``abs(accel)/grav`` at surface,
@@ -1747,6 +1747,8 @@
max_number_retries = -1
+ ! relax_max_number_retries
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~
! ::
relax_max_number_retries = 300
@@ -1950,7 +1952,6 @@
! Definitions for stop_at_phase_* can be found in
! $MESA_DIR/star/private/star_utils.f90 inside the
! subroutine ``set_phase_of_evolution``
- ! ::
! ::
@@ -2274,7 +2275,7 @@
! mlt_use_rotation_correction
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! When doing rotation, multiply ``grad_rad`` by ``ft_rot/ft_rot`` if this flag is true.
+ ! When doing rotation, multiply ``grad_rad`` by ``ft_rot/fp_rot`` if this flag is true.
! ::
@@ -2331,14 +2332,96 @@
! + ``TDC_alpha_D`` : The turbulent viscous damping parameter which determines the saturation of TDC. Increasing this decreases convection speeds. This control is analogous to ``RSP_alfad``, and previously called ``alpha_TDC_DAMP``
! + ``TDC_alpha_R`` : The radiative damping parameter which determines the saturation of TDC. Increasing this decreases convection speeds. This control is analogous to ``RSP_gammar``, and previously called ``alpha_TDC_DAMPR``
! + ``TDC_alpha_Pt`` : The prefactor on the term accounting for work done against turbulent pressure (P_turb * dV/dt). Physically this should be unity. This control is analogous to ``RSP_alfap``, and previously called ``alpha_TDC_PtdVdt``
+ ! + ``TDC_alpha_M`` : The prefactor on the term accounting for eddy viscous dissipation. This control is analogous to ``RSP_alfam``.
+ ! + ``TDC_alpha_C`` : The prefactor on the convective flux. This control is analogous to ``RSP_alfac``
+ ! + ``TDC_alpha_S`` : The prefactor on the convective source term, S . This control is analogous to ``RSP_alfas``
+
! + ``steps_before_use_TDC`` : TDC often struggles with models on the pre-main-sequence. Set this option to pick MLT_option='Cox' for the first several steps to get past the pre-MS. Note that if this option is positive then only either TDC or Cox will be used (depending on model number). THIS OVERRIDES MLT_option!
! ::
- TDC_alpha_D = 1d0
- TDC_alpha_R = 0d0
- TDC_alpha_Pt = 0d0
- steps_before_use_TDC = 0
+ TDC_alpha_D = 1d0
+ TDC_alpha_R = 0d0
+ TDC_alpha_Pt = 0d0
+ TDC_alpha_C = 1d0
+ TDC_alpha_S = 1d0
+ steps_before_use_TDC = 0
+
+
+ ! If ``TDC_alpha_M > 0``, then include eddy viscous damping in TDC ``TDC_alpha_M``
+ ! This control is analogous to ``RSP_alfam``, where the default is ``RSP_alfam = 0.25d0``.
+
+ ! If hydrostatic (``v_flag``, ``u_flag = .false.``, ``v = 0`` ) there are no velocity gradients,
+ ! and thus no shear to drive turbulence. Without shear, the eddy viscosity term becomes zero.
+ ! Details on the implementation of ``TDC_alpha_M`` can be found in `Farag et al. (2026) `_
+
+ ! ::
+
+ TDC_alpha_M = 0d0
+
+
+ ! TDC_alpha_M_use_explicit_mlt_vc_in_momentum_equation
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ! if ``TDC_alpha_M_use_explicit_mlt_vc_in_momentum_equation = .true.``, ``mlt_vc_old`` (the start of step value)
+ ! is used in place of the current solver iterate ``mlt_vc_ad`` inside the hydro momentum equation. This option can
+ ! provide greater numerical stability in extremely dynamic situations, with very little loss in accuracy.
+
+ ! ::
+
+ TDC_alpha_M_use_explicit_mlt_vc_in_momentum_equation = .false.
+
+
+ ! include_mlt_corr_to_TDC
+ ! ~~~~~~~~~~~~~~~~~~~~~~~
+
+ ! If include_mlt_corr_to_TDC = .true. , mlt correction to TDC follows MESA VI (Jermyn et a. 2023)
+ ! in which we correct TDC on long timescales with Y_face ~ Y*Gamma/(1+Gamma). If .false., abandon
+ ! mlt limit of tdc and adopt original form of (Kuhfuß 1986) convection model in the local limit.
+
+ ! ::
+
+ include_mlt_corr_to_TDC = .true.
+
+ ! TDC_include_eturb_in_energy_equation
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ! While ``TDC`` is already implicitly coupled to the total energy equation, this
+ ! controls feedsback the turbulent energy into the total energy equation by
+ ! calculating and incorporating det/dt from TDC as a negative source term in
+ ! the total energy equation, along with the eddy viscous heating Eq. This comes
+ ! at the cost of numerical stability on long timescales, be warned.
+
+ ! ::
+
+ TDC_include_eturb_in_energy_equation = .false.
+
+
+ ! use_rsp_form_of_scale_height
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ! calculate scale height by averaging P/rho onto faces together instead
+ ! of of wrapping P and rho separately by default. Both forms assume HSE.
+
+ ! ::
+
+ use_rsp_form_of_scale_height = .false.
+
+
+ ! TDC_num_innermost_cells_forced_nonturbulent
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! TDC_num_outermost_cells_forced_nonturbulent
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ! Forces innermost TDC_num_innermost_cells_forced_nonturbulent or
+ ! TDC_num_outermost_cells_forced_nonturbulent cells
+ ! to be nonturbulent, and sets gradT = gradr in these cells.
+ ! Useful for pulsation models in TDC.
+
+ ! ::
+
+ TDC_num_innermost_cells_forced_nonturbulent = 0
+ TDC_num_outermost_cells_forced_nonturbulent = 0
! Henyey_MLT_y_param
@@ -2561,9 +2644,10 @@
gradT_excess_max_log_tau_full_off = -99
- !### max_logT_for_mlt
+ ! max_logT_for_mlt
+ ! ~~~~~~~~~~~~~~~~
- ! No mlt at cell if local logT > this limit.
+ ! No MLT at cell if local logT > this limit.
max_logT_for_mlt = 99
@@ -2580,7 +2664,7 @@
! superad_reduction_limit
! ~~~~~~~~~~~~~~~~~~~~~~~
- ! Implicit alternative to okay_to_reduce_gradT_excess
+ ! Implicit alternative to ``okay_to_reduce_gradT_excess``
! ::
@@ -3481,8 +3565,11 @@
redo_conv_for_dr_lt_mixing_length = .false.
- ! smooth_convective_bdy has been deleted.
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! smooth_convective_bdy
+ ! ~~~~~~~~~~~~~~~~~~~~~
+
+ ! ``smooth_convective_bdy`` has been removed.
+
! remove_mixing_glitches
! ~~~~~~~~~~~~~~~~~~~~~~
@@ -3721,7 +3808,7 @@
! ::
! f = 1 when logT <= D_mix_rotation_max_logT_full_on = full_on
- ! = 0 when logT >= D_mix_rotation_min_logT_full_on = full_off
+ ! = 0 when logT >= D_mix_rotation_min_logT_full_off = full_off
! = (log(T)-full_on)/(full_off-full_on) else
! note that for regions with brunt N^2 < 0, we set Richardson number to 1
@@ -3989,6 +4076,10 @@
! ~~~~~~~~~~~~~~~~
! adjust_J_fraction
! ~~~~~~~~~~~~~~~~~
+ ! min_q_for_adjust_J_lost
+ ! ~~~~~~~~~~~~~~~~~~~~~~~
+ ! min_J_div_delta_J
+ ! ~~~~~~~~~~~~~~~~~
! adjust angular momentum
! With do_adjust_J_lost = .false., the angular momentum removed via winds
@@ -4047,8 +4138,8 @@
! angular_momentum_error_warn
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! angular_momentum_error_stop
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! angular_momentum_error_retry
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! if the relative change in total angular momentum exceeds these values,
! then a warning is given on the terminal output, or the simulation is stopped
@@ -4072,8 +4163,9 @@
! w_div_wcrit_max
! ~~~~~~~~~~~~~~~
- ! When fitted_fp_ft_i_rot = .true., limit fp and ft to their values at this
- ! w_div_wcrit
+ ! Maximum value for ``w_div_w_crit_roche``. When ``w_div_wc_flag`` is false (default),
+ ! this is a hard limit. When ``w_div_wc_flag`` is true, this works together with
+ ! ``w_div_wcrit_max2`` to provide a smooth transition (see below).
! ::
@@ -4126,7 +4218,7 @@
D_mix_rotation_min_tau_full_off = 0d0
- ! D_mix_rotation_max_tau_full_on
+ ! D_mix_rotation_min_tau_full_on
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Use rotational components of ``D_mix`` for locations where tau >= this.
@@ -4137,14 +4229,14 @@
D_mix_rotation_min_tau_full_on = 0d0
- ! D_omega_max_replacement_fraction
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! D_omega_growth_rate
- ! ~~~~~~~~~~~~~~~~~~~
! D_omega_mixing_rate
! ~~~~~~~~~~~~~~~~~~~
- ! D_omega_mixing_across_convection_boundary (previously called D_omega_mixing_in_convection_regions)
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! D_omega_mixing_across_convection_boundary
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! max_q_for_D_omega_zero_in_convection_region
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ! ``D_omega_mixing_across_convection_boundary`` was previously called ``D_omega_mixing_in_convection_regions``.
! ::
@@ -4153,14 +4245,12 @@
max_q_for_D_omega_zero_in_convection_region = 0.8d0
- ! nu_omega_max_replacement_fraction
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! nu_omega_growth_rate
- ! ~~~~~~~~~~~~~~~~~~~~
! nu_omega_mixing_rate
! ~~~~~~~~~~~~~~~~~~~~
! nu_omega_mixing_across_convection_boundary
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! max_q_for_nu_omega_zero_in_convection_region
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! ::
@@ -4178,12 +4268,12 @@
! Controls how the surface temperature Tsurf and pressure Psurf are evaluated when
! setting up outer boundary conditions. We caution that the use of ``'fixed_'`` atmosphere
- ! options might conflict with mlt_option = ``TDC``.
+ ! options might conflict with MLT_option = ``TDC``.
! + ``'T_tau'``:
! set Tsurf and Psurf by solving for the atmosphere structure given a T(tau) relation.
! The choice of relation is set by the ``atm_T_tau_relation`` control. See also
- ! the ``atm_T_tau_opacity``, ``atm_T_tau_errtol``, ``atm_T_tau_max_tries`` and
+ ! the ``atm_T_tau_opacity``, ``atm_T_tau_errtol``, ``atm_T_tau_max_iters`` and
! ``atm_T_tau_max_steps`` controls.
!
! + ``'table'``:
@@ -4201,8 +4291,8 @@
! set Tsurf by solving for the atmosphere structure given the irradiated-grey
! T(tau) relation of Guillot, T, and Havel, M., A&A 527, A20 (2011).
! See also the ``atm_irradiated_opacity``, ``atm_irradiated_errtol``, ``atm_irradiated_T_eq``,
- ! ``atm_irradiated_T_eq``, ``atm_irradiated_kap_v``, ``atm_irradiated_kap_v_div_kap_th``,
- ! ``atm_irradiated_P_surf`` and ``atm_irradiated_max_tries`` controls.
+ ! ``atm_irradiated_kap_v``, ``atm_irradiated_kap_v_div_kap_th``,
+ ! ``atm_irradiated_P_surf`` and ``atm_irradiated_max_iters`` controls.
!
! + ``'fixed_Teff'`` :
! set Tsurf from Eddington T(tau) relation
@@ -4290,7 +4380,7 @@
! e.g. try ``Pextra_factor = 2``
! Note that ``Pextra_factor`` is only applied when ``atm_option`` = ``'T_tau'``
- ! and ``atm_T_tau_opacity`` = ``'fixed'`` or '``iterated'``.
+ ! and ``atm_T_tau_opacity`` = ``'fixed'`` or ``'iterated'``.
! ::
@@ -4558,6 +4648,21 @@
use_zero_Pgas_outer_BC = .false.
+ ! use_RSP_L_eqn_outer_BC
+ ! ~~~~~~~~~~~~~~~~~~~~~~
+
+ ! use RSP2 luminosity equation
+ ! as the outer boundary condition on L rather than the
+ ! default atmospheric BC for temperature.
+ ! solves L1 - s% RSP2_Lsurf_factor*4*pi*r^2*c*a*T1^4 = 0
+ ! uses dev control s% RSP2_Lsurf_factor = 0.5 (default),
+ ! see controls_dev.defaults.list
+
+ ! ::
+
+ use_RSP_L_eqn_outer_BC = .false.
+
+
! use_fixed_vsurf_outer_BC
! ~~~~~~~~~~~~~~~~~~~~~~~~
! fixed_vsurf
@@ -4924,8 +5029,8 @@
Reimers_scaling_factor = 0
- ! Blocker_scaling_factor = 0
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! Blocker_scaling_factor
+ ! ~~~~~~~~~~~~~~~~~~~~~~
! Blocker's mass loss for AGB stars.
@@ -5063,6 +5168,8 @@
! use_accreted_material_j
! ~~~~~~~~~~~~~~~~~~~~~~~
+ ! accreted_material_j
+ ! ~~~~~~~~~~~~~~~~~~~
! Angular momentum of accreted material.
@@ -5563,8 +5670,8 @@
accretion_he4 = 0
- ! accretion_zfracs =
- ! ~~~~~~~~~~~~~~~~~~
+ ! accretion_zfracs
+ ! ~~~~~~~~~~~~~~~~
! One of the following identifiers for different Z fractions from ``chem_def``.
@@ -5769,6 +5876,9 @@
min_dq = 1d-14
+ ! min_dq_for_split
+ ! ~~~~~~~~~~~~~~~~
+
! Min size for cell to be split.
! ::
@@ -5797,6 +5907,9 @@
min_dq_for_xa_convective = 1d-6
+ ! min_dq_for_log_T
+ ! ~~~~~~~~~~~~~~~~
+
! Min size for cell to be split because of jump in logT.
! ::
@@ -5942,6 +6055,8 @@
! E_function_weight
! ~~~~~~~~~~~~~~~~~
+ ! E_function_param
+ ! ~~~~~~~~~~~~~~~~
! internal energy gradient, ``E_function = E_function_weight*max(E_function_param,log10(energy))``.
@@ -6395,6 +6510,45 @@
remesh_dt_limit = -1
+ ! TDC_hydro_nz
+ ! ~~~~~~~~~~~~
+ ! TDC_hydro_nz_outer
+ ! ~~~~~~~~~~~~~~~~~~
+ ! TDC_hydro_T_anchor
+ ! ~~~~~~~~~~~~~~~~~~
+ ! TDC_hydro_dq_1_factor
+ ! ~~~~~~~~~~~~~~~~~~~~~
+ ! TDC_hydro_use_mass_interp_face_values
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! remesh_for_TDC_pulsations_log_core_zoning
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ! If calling the public ``remesh_for_TDC_pulsations`` function, the model will be rezoned below ``TDC_hydro_T_anchor`` with logarithmic
+ ! spacing in mass. If .false., remeshing scheme will do a bisection root find such
+ ! that each zone increases in mass inward following a power law, similar to RSP's static model builder.
+
+ ! The total number of zones is set by ``TDC_hydro_nz``, with constant spacing in mass between the surface and
+ ! ``TDC_hydro_T_anchor``, and increasing spacing in mass between the anchor and the inner boundary condition.
+ ! The number of zones in between the anchor and the surface is set by ``TDC_hydro_nz_outer``, and the number of
+ ! zones in the interior is set by ``TDC_hydro_nz`` - ``TDC_hydro_nz_outer``.
+ ! The ``TDC_hydro_dq_1_factor`` sets the dq of the surface cell to this multiple of the cell beneath it, k = 2.
+
+ ! ``TDC_hydro_use_mass_interp_face_values`` determines whether quantities are averaged to faces using simple average or
+ ! mass weighted averaging.
+
+ ! This remeshing scheme works well for most Cepheid envelopes, but it is not designed for AGB stars with deep convective envelopes.
+
+ ! ::
+
+ remesh_for_TDC_pulsations_log_core_zoning = .false.
+ TDC_hydro_use_mass_interp_face_values = .false.
+
+ TDC_hydro_nz = 150
+ TDC_hydro_nz_outer = 40
+ TDC_hydro_T_anchor = 11d3
+ TDC_hydro_dq_1_factor = 2d0
+
+
! use_split_merge_amr
! ~~~~~~~~~~~~~~~~~~~
@@ -7486,8 +7640,8 @@
! min_logT_for_opacity_factor_off
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! min_logT_for_opacity_factor_on and
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! min_logT_for_opacity_factor_on
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! max_logT_for_opacity_factor_on
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! max_logT_for_opacity_factor_off
@@ -7936,10 +8090,10 @@
use_time_centered_eps_grav = .true.
- ! Gamma_lnS_eps_grav_full_off
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Gamma_lnS_eps_grav_full_on
! ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! Gamma_lnS_eps_grav_full_off
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Automatic switch to lnS form for eps_grav (:math:`\epsilon_{\rm grav} = -T\frac{Ds}{Dt}`) in regions with high Gamma (plasma interaction parameter).
! These controls only apply when using the PC EOS. This is necessary to get the
@@ -8320,6 +8474,8 @@
! Hydrodynamic drag
! =================
+ ! use_drag_energy
+ ! ~~~~~~~~~~~~~~~
! drag_coefficient
! ~~~~~~~~~~~~~~~~
! min_q_for_drag
@@ -8389,16 +8545,16 @@
! ~~~~~
! RTI_D
! ~~~~~
+ ! RTI_C_X0_frac
+ ! ~~~~~~~~~~~~~
! RTI_C_X_factor
! ~~~~~~~~~~~~~~
- ! RTI_C_X0
- ! ~~~~~~~~
! RTI_max_alpha
! ~~~~~~~~~~~~~
! RTI_min_dm_behind_shock_for_full_on
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! RTI_dm_for_center_alpha_nondecreasing
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! RTI_dm_for_center_eta_nondecreasing
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! RTI_energy_floor
! ~~~~~~~~~~~~~~~~
! RTI_D_mix_floor
@@ -9014,8 +9170,8 @@
min_xa_hard_limit_for_highT = -3d-5
- ! logT_max_for_xa_hard_limit
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! logT_max_for_min_xa_hard_limit
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Use ``min_xa_hard_limit`` for center logT <= this.
@@ -9024,8 +9180,8 @@
logT_max_for_min_xa_hard_limit = 9.49d0
- ! logT_min_for_xa_hard_limit_for_highT
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! logT_min_for_min_xa_hard_limit_for_highT
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! Use ``min_xa_hard_limit_for_highT`` for center logT >= this.
! Linear interpolate in logT for intermediate center temperatures.
@@ -9137,6 +9293,8 @@
! ~~~~~~~~~~~~~~~~~~~~~~~~
! gold_tol_residual_norm1
! ~~~~~~~~~~~~~~~~~~~~~~~
+ ! gold_tol_max_residual1
+ ! ~~~~~~~~~~~~~~~~~~~~~~
! gold_iter_for_resid_tol2
! ~~~~~~~~~~~~~~~~~~~~~~~~
! gold_tol_residual_norm2
@@ -9189,6 +9347,8 @@
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! gold2_tol_residual_norm1
! ~~~~~~~~~~~~~~~~~~~~~~~~
+ ! gold2_tol_max_residual1
+ ! ~~~~~~~~~~~~~~~~~~~~~~~
! gold2_iter_for_resid_tol2
! ~~~~~~~~~~~~~~~~~~~~~~~~~
! gold2_tol_residual_norm2
@@ -9229,8 +9389,8 @@
! include_rotation_in_total_energy
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! previously called `include_rotation_in_energy_error_report`
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ! previously called ``include_rotation_in_energy_error_report``
! ::
@@ -9564,8 +9724,8 @@
neg_mass_fraction_hold = 2
- ! timestep_dt_factor = 0.9
- ! ~~~~~~~~~~~~~~~~~~~~~~~~
+ ! timestep_dt_factor
+ ! ~~~~~~~~~~~~~~~~~~
! dt reduction factor exceed timestep limits.
@@ -9990,8 +10150,8 @@
delta_lgRho_limit = 1
- ! delta_lgRho_hard_limit = -1
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! delta_lgRho_hard_limit
+ ! ~~~~~~~~~~~~~~~~~~~~~~
! If max ``delta_lgRho`` is greater than ``delta_lgRho_hard_limit``,
! retry with smaller timestep.
@@ -10119,6 +10279,9 @@
! ::
+ ! delta_Ye_highT_hard_limit
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~
+
delta_Ye_highT_hard_limit = -1
@@ -10552,10 +10715,10 @@
check_remnant_only_for_dt_div_min_dr_div_cs_limit = .false.
- ! min_abs_du_div_cs_for_dt_div_min_dr_div_cs_limit
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! min_abs_u_div_cs_for_dt_div_min_dr_div_cs_limit
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! min_abs_du_div_cs_for_dt_div_min_dr_div_cs_limit
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! only use ``dt_div_min_dr_div_cs_limit`` at cells where
! ``abs_du_div_cs`` > ``min_abs_du_div_cs_for_dt_div_min_dr_div_cs_limit`` and
@@ -11193,6 +11356,11 @@
delta_lg_star_mass_limit = 5d-3
delta_lg_star_mass_hard_limit = -1
+ ! delta_mdot_atol
+ ! ~~~~~~~~~~~~~~~
+ ! delta_mdot_rtol
+ ! ~~~~~~~~~~~~~~~
+
! limit for change in mdot in Msun/yr
! + ``delta_mdot_atol`` tolerance for absolute changes
! + ``delta_mdot_rtol`` tolerance for relative changes
@@ -11419,6 +11587,8 @@
! warn_rates_for_high_temp
! ~~~~~~~~~~~~~~~~~~~~~~~~
+ ! max_safe_logT_for_rates
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~
! If true, then when any zone tries to evaluate a rate above ``max_safe_logT_for_rates``
! it generates a warning message. The code will cap the rate at the value
@@ -11457,8 +11627,6 @@
absolute_cumulative_energy_err = .true.
- ! warn_when_stop_checking_residuals obsolete
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! warning_limit_for_max_residual
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -11528,6 +11696,9 @@
zams_filename = 'zams_z2m2_y28.data'
+ ! set_rho_to_dm_div_dV
+ ! ~~~~~~~~~~~~~~~~~~~~
+
! ::
set_rho_to_dm_div_dV = .true.
diff --git a/star/defaults/controls_dev.defaults b/star/defaults/controls_dev.defaults
index 531bcb869..59666ad67 100644
--- a/star/defaults/controls_dev.defaults
+++ b/star/defaults/controls_dev.defaults
@@ -180,105 +180,14 @@
! ===
- ! TDC_alpha_M
- ! ~~~~~~~~~~~
- ! TDC_alpha_C
- ! ~~~~~~~~~~~
- ! TDC_alpha_S
- ! ~~~~~~~~~~~
! TDC_use_density_form_for_eddy_viscosity
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! TDC_alpha_M_use_explicit_mlt_vc_in_momentum_equation
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- ! If ``TDC_alpha_M>0``, then include eddy viscous damping in TDC ``TDC_alpha_M``
- ! This control is analogous to ``RSP_alfam``, where the default is ``RSP_alfam = 0.25d0``.
-
- ! If hydrostatic (``v_flag``, ``u_flag = .false.``, ``v = 0`` ) there are no velocity gradients,
- ! and thus no shear to drive turbulence. Without shear, the eddy viscosity term becomes zero.
-
- ! ``TDC_alpha_C`` and ``TDC_alpha_S`` are pre-factors to scale the flux and source terms.
! If ``u_flag = .true.`` or ``TDC_use_density_form_for_eddy_viscosity = .true.``, use density
! derivative from newton solver to form d(v/r)/dr, used to compute Eq and Uq.
- ! if ``TDC_alpha_M_use_explicit_mlt_vc_in_momentum_equation = .true.``, ``mlt_vc_old`` (the start of step value)
- ! is used in place of the current solver iterate ``mlt_vc_ad`` inside the hydro momentum equation. This option can
- ! provide greater numerical stability in extremely dynamic situations, with very little loss in accuracy.
-
- ! ::
-
- TDC_alpha_M = 0d0
- TDC_alpha_C = 1.0d0
- TDC_alpha_S = 1.0d0
TDC_use_density_form_for_eddy_viscosity = .false.
- TDC_alpha_M_use_explicit_mlt_vc_in_momentum_equation = .false.
-
- ! TDC_include_eturb_in_energy_equation
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- ! While ``TDC`` is already implicitly coupled to the total energy equation, this
- ! controls feedsback the turbulent energy into the total energy equation by
- ! calculating and incorporating det/dt from TDC as a negative source term in
- ! the total energy equation, along with the eddy viscous heating Eq. This comes
- ! at the cost of numerical stability on long timescales, be warned.
-
- ! ::
-
- TDC_include_eturb_in_energy_equation = .false.
-
- ! use_rsp_form_of_scale_height
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- ! calculate scale height by averaging P/rho onto faces together instead
- ! of of wrapping P and rho separately by default. Both forms assume HSE.
-
- ! ::
-
- use_rsp_form_of_scale_height = .false.
-
-
- ! use_RSP_L_eqn_outer_BC
- ! ~~~~~~~~~~~~~~~~~~~~~~
- ! use RSP2 luminosity equation
- ! as the outer boundary condition on L rather than the
- ! default atmospheric BC for temperature.
- ! solves L1 - s% RSP2_Lsurf_factor*4*pi*r^2*c*a*T1^4 = 0
- ! uses dev control s% RSP2_Lsurf_factor = 0.5 (default),
- ! see controls_dev.defaults.list
-
- ! ::
-
- use_RSP_L_eqn_outer_BC = .false.
-
-
- ! TDC_num_innermost_cells_forced_nonturbulent
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! TDC_num_outermost_cells_forced_nonturbulent
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- ! Forces innermost TDC_num_innermost_cells_forced_nonturbulent or
- ! TDC_num_outermost_cells_forced_nonturbulent cells
- ! to be nonturbulent, and sets gradT = gradr in these cells.
- ! Useful for pulsation models in TDC.
-
- ! ::
-
- TDC_num_innermost_cells_forced_nonturbulent = 0
- TDC_num_outermost_cells_forced_nonturbulent = 0
-
-
- ! include_mlt_corr_to_TDC
- ! ~~~~~~~~~~~~~~~~~~~~~~~
-
- ! If include_mlt_corr_to_TDC = .true. , mlt correction to TDC follows MESA VI (Jermyn et a. 2023)
- ! in which we correct TDC on long timescales with Y_face ~ Y*Gamma/(1+Gamma). If .false., abandon
- ! mlt limit of tdc and adopt original form of (Kuhfuß 1986) convection model in the local limit.
-
- ! ::
-
- include_mlt_corr_to_TDC = .true.
! use_TDC_enthalpy_flux_limiter
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -318,23 +227,6 @@
! Remeshing
! =========
- ! remesh_for_TDC_pulsations_log_core_zoning
- ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- ! If remesh_for_TDC_pulsations, .true. will rezone below RSP2_Tanchor with logarithmic
- ! spacing in mass. If .false., remeshing scheme will do a bisection root find such
- ! that each zone increases in mass inward following a power law.
-
- ! ::
-
- remesh_for_TDC_pulsations_log_core_zoning = .false.
- TDC_hydro_use_mass_interp_face_values = .false.
-
- TDC_hydro_nz = 150
- TDC_hydro_nz_outer = 40
- TDC_hydro_T_anchor = 11d3
- TDC_hydro_dq_1_factor = 2d0
-
! use_hydro_merge_limits_in_mesh_plan
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/star/defaults/star_job.defaults b/star/defaults/star_job.defaults
index d5b2b1105..5be8eaf2e 100644
--- a/star/defaults/star_job.defaults
+++ b/star/defaults/star_job.defaults
@@ -855,6 +855,8 @@
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! relax_composition_filename
! ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! timescale_for_relax_composition
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! relax composition from current to specified over number of steps.
! ``relax_composition_filename`` holds the desired composition profile information
@@ -2007,11 +2009,11 @@
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! remove_initial_center_by_delta_mass_gm
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! remove_initial_center_by_delta_mass_msun
+ ! remove_initial_center_by_delta_mass_Msun
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! remove_initial_center_by_mass_gm
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! remove_initial_center_by_mass_msun
+ ! remove_initial_center_by_mass_Msun
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! remove_initial_center_by_radius_cm
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2182,7 +2184,7 @@
limit_center_logP_at_each_step = -1d99
- ! zero_initial_inner_v_by_mass_msun
+ ! zero_initial_inner_v_by_mass_Msun
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! zero_inner_v_by_mass_Msun
! ~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2215,7 +2217,7 @@
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! remove_initial_surface_by_mass_gm
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! remove_initial_surface_by_mass_msun
+ ! remove_initial_surface_by_mass_Msun
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! remove_initial_surface_by_radius_cm
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2351,8 +2353,12 @@
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
! set_cumulative_energy_error_at_step
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! set_cumulative_energy_error_each_step_if_age_less_than
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! set_cumulative_energy_error_each_relax
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ! new_cumulative_energy_error
+ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
! set_initial_cumulative_energy_error is done when execute rn script
! set_cumulative_energy_error is done when execute rn script or re script
diff --git a/star/private/adjust_mass.f90 b/star/private/adjust_mass.f90
index 5c6891c71..1bf13de85 100644
--- a/star/private/adjust_mass.f90
+++ b/star/private/adjust_mass.f90
@@ -20,7 +20,7 @@
module adjust_mass
use star_private_def
- use const_def, only: dp, i8, ln10, msun, msun, secyer, one_third, four_thirds_pi
+ use const_def, only: dp, i8, ln10, msun, secyer, one_third, four_thirds_pi
use utils_lib
implicit none
diff --git a/star/private/conv_premix.f90 b/star/private/conv_premix.f90
index 84ec6f316..25bc99e6c 100644
--- a/star/private/conv_premix.f90
+++ b/star/private/conv_premix.f90
@@ -731,7 +731,7 @@ subroutine create_zone_info_ (s, kc_t, kc_b, zi)
if (in_conv .AND. s%mlt_mixing_type(kf) /= convective_mixing) then
! Transitioning out of a convective zone; complete
- ! definition of new zone info and add to to the table
+ ! definition of new zone info and add to the table
zi_new%kc_t = kf
zi_new%vc_t = s%mlt_vc(kf+1)
diff --git a/star/private/diffusion_procs.f90 b/star/private/diffusion_procs.f90
index ec6cdfacd..015226467 100644
--- a/star/private/diffusion_procs.f90
+++ b/star/private/diffusion_procs.f90
@@ -1447,7 +1447,7 @@ subroutine set1_g_rad_mombarg( &
return
end if
- if (ierr /= 0) stop 'set1_g_rad' !return
+ if (ierr /= 0) call mesa_error(__FILE__,__LINE__,'set1_g_rad') !return
do ii = 1, 17 !kk
do i = 1, nc
diff --git a/star/private/do_one_utils.f90 b/star/private/do_one_utils.f90
index 5208b25c0..43dfcc403 100644
--- a/star/private/do_one_utils.f90
+++ b/star/private/do_one_utils.f90
@@ -146,7 +146,7 @@ subroutine output_terminal_header(s,io)
'___________________________________________________________________________'
write(io,'(A)')
write(io,'(a)') &
- ' step lg_Tmax Teff lg_LH lg_Lnuc_tot Mass ' // &
+ ' step lg_Tmax Teff lg_LH lg_Lnuc_tot Mass ' // &
'H_rich H_cntr N_cntr Y_surf eta_cntr zones retry'
! note that if the age is in days, then the timestep is automatically in seconds.
diff --git a/star/private/evolve_support.f90 b/star/private/evolve_support.f90
index da32dca78..46c692e92 100644
--- a/star/private/evolve_support.f90
+++ b/star/private/evolve_support.f90
@@ -197,7 +197,7 @@ subroutine set_current_to_old(s)
call set_qs(s, s% nz, s% q, s% dq, ierr)
if (ierr /= 0) then
write(*,*) 'set_current_to_old failed in set_qs'
- stop
+ call mesa_error(__FILE__,__LINE__,'set_current_to_old')
end if
call set_m_and_dm(s)
call set_dm_bar(s, s% nz, s% dm, s% dm_bar)
@@ -212,7 +212,7 @@ subroutine set_current_to_old(s)
if (is_bad_num(s% omega(k)) .or. abs(s% omega(k)) > 1d50) then
if (s% stop_for_bad_nums) then
write(*,2) 's% omega(k)', k, s% omega(k)
- stop 'set_current_to_old'
+ call mesa_error(__FILE__,__LINE__,'set_current_to_old')
end if
end if
end do
diff --git a/star/private/mesh_adjust.f90 b/star/private/mesh_adjust.f90
index 84457b7dd..3e939771a 100644
--- a/star/private/mesh_adjust.f90
+++ b/star/private/mesh_adjust.f90
@@ -344,14 +344,14 @@ subroutine do_mesh_adjust( &
density_new, energy_new, op_err)
if (op_err /= 0) then
write(*,2) 'failed for do1_lnT', k
- stop
write(message,*) 'do1_lnT for k', k
ierr = op_err
+ call mesa_error(__FILE__,__LINE__,'mesh adjust: do1_lnT')
end if
if (is_bad(energy_new(k)) .or. is_bad(dq(k))) then
write(*,2) 'energy_new', k, energy_new(k)
write(*,2) 'dq', k, dq(k)
- stop ''
+ call mesa_error(__FILE__,__LINE__,'mesh adjust: bad energy_new or dq')
end if
end do
diff --git a/star/private/rsp_def.f90 b/star/private/rsp_def.f90
index 5c57b2383..4553a242b 100644
--- a/star/private/rsp_def.f90
+++ b/star/private/rsp_def.f90
@@ -101,7 +101,7 @@ module rsp_def
real(dp), pointer :: xa(:)
real(dp) :: X, Z, Y, abar, zbar, z53bar, XC, XN, XO, Xne
- ! these for for rsp.f90 period and work calculations
+ ! these are for rsp.f90 period and work calculations
real(dp) :: ETOT, EGRV, ETHE, EKIN, EDE_start, ECON, &
TE, ELSTA, TEFF, E0, TT1, TE_start, T0, UN, ULL, &
VMAX, RMAX, LMAX, LMIN, EKMAX, EKMIN, EKMAXL, EKDEL, &
diff --git a/star/private/star_solver.f90 b/star/private/star_solver.f90
index bd9121292..9c3050626 100644
--- a/star/private/star_solver.f90
+++ b/star/private/star_solver.f90
@@ -465,7 +465,7 @@ subroutine do_solver_work
end if
if (is_bad_num(residual_norm)) then
- call oops('residual_norm is a a bad number (NaN or Infinity)')
+ call oops('residual_norm is a bad number (NaN or Infinity)')
if (s% stop_for_bad_nums) then
write(*,1) 'residual_norm', residual_norm
call mesa_error(__FILE__,__LINE__,'solver')
@@ -474,7 +474,7 @@ subroutine do_solver_work
end if
if (is_bad_num(max_residual)) then
- call oops('max_residual is a a bad number (NaN or Infinity)')
+ call oops('max_residual is a bad number (NaN or Infinity)')
if (s% stop_for_bad_nums) then
write(*,1) 'max_residual', max_residual
call mesa_error(__FILE__,__LINE__,'solver')
diff --git a/star/private/star_utils.f90 b/star/private/star_utils.f90
index dc3132179..051678cdf 100644
--- a/star/private/star_utils.f90
+++ b/star/private/star_utils.f90
@@ -2197,7 +2197,7 @@ real(qp) function cell_specific_KE_qp(s,k,d_dv00,d_dvp1)
if (s% u_flag) then
v0 = s% u(k)
cell_specific_KE_qp = qhalf*Mbar*v0**2
- d_dv00 = s% u(k)
+ d_dv00 = Mbar*s% u(k)
d_dvp1 = 0d0
else if (s% v_flag) then
v0 = s% v(k)
diff --git a/star/test_suite/custom_colors/README.rst b/star/test_suite/custom_colors/README.rst
index f53f0d9f8..1395a9e9e 100644
--- a/star/test_suite/custom_colors/README.rst
+++ b/star/test_suite/custom_colors/README.rst
@@ -4,10 +4,12 @@
custom_colors
*************
+This test suite was tested against SDK 25.12.1
+
This test suite case demonstrates the functionality of the MESA ``colors`` module, a framework introduced in MESA r25.10.1 for calculating synthetic photometry and bolometric quantities during stellar evolution.
What is MESA colors?
-=======================
+====================
MESA colors is a post-processing and runtime module that allows users to generate "observer-ready" data directly from stellar evolution models. Instead of limiting output to theoretical quantities like Luminosity (:math:`L`) and Surface Temperature (:math:`T_{\rm eff}`), the colors module computes:
@@ -18,7 +20,7 @@ MESA colors is a post-processing and runtime module that allows users to generat
This bridges the gap between theoretical evolutionary tracks and observational color-magnitude diagrams (CMDs).
How does the MESA colors module work?
-========================================
+=====================================
The module operates by coupling the stellar structure model with pre-computed grids of stellar atmospheres.
@@ -29,7 +31,7 @@ The module operates by coupling the stellar structure model with pre-computed gr
3. **Integration**: The fluxes are converted into magnitudes using the user-selected magnitude system (AB, ST, or Vega).
The Test Suite
-=========================
+==============
This test suite evolves a complete stellar model (from the pre–main sequence onward) while the ``colors`` module runs *continuously* in the background.
At every timestep, MESA computes synthetic photometry by interpolating a stellar atmosphere grid and convolving the resulting SED with the filters you specify in the inlist.
@@ -109,13 +111,13 @@ This test problem is designed to demonstrate:
Inlist Options & Parameters
-==============================
+===========================
The colors module is controlled via the ``&colors`` namelist. Below is a detailed guide to the key parameters.
instrument
----------
-**Default:** `'/colors/data/filters/Generic/Johnson'`
+**Default:** `'/data/colors_data/filters/Generic/Johnson'`
This points to the directory containing the filter transmission curves you wish to use. The path must be structured as ``facility/instrument``.
@@ -126,12 +128,13 @@ This points to the directory containing the filter transmission curves you wish
.. code-block:: fortran
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
stellar_atm
-----------
-**Default:** `'/colors/data/stellar_models/Kurucz2003all/'`
+
+**Default:** `'/data/colors_data/stellar_models/Kurucz2003all/'`
Specifies the path to the directory containing the grid of stellar atmosphere models. This directory must contain:
@@ -145,11 +148,12 @@ The module queries this grid using the star's current parameters. If the star ev
.. code-block:: fortran
- stellar_atm = '/colors/data/stellar_models/sg-SPHINX/'
+ stellar_atm = '/data/colors_data/stellar_models/sg-SPHINX/'
distance
--------
+
**Default:** `3.0857d19` (10 parsecs in cm)
The distance to the star in centimeters.
@@ -166,6 +170,7 @@ The distance to the star in centimeters.
make_csv
--------
+
**Default:** `.false.`
If set to ``.true.``, the module exports the full calculated SED at every profile interval.
@@ -183,6 +188,7 @@ If set to ``.true.``, the module exports the full calculated SED at every profil
colors_results_directory
------------------------
+
**Default:** `'SED'`
The folder where csv files (if ``make_csv = .true.``) and other debug outputs are saved.
@@ -196,6 +202,7 @@ The folder where csv files (if ``make_csv = .true.``) and other debug outputs ar
mag_system
----------
+
**Default:** `'Vega'`
Defines the zero-point system for magnitude calculations. Options are:
@@ -213,7 +220,8 @@ Defines the zero-point system for magnitude calculations. Options are:
vega_sed
--------
-**Default:** `'/colors/data/stellar_models/vega_flam.csv'`
+
+**Default:** `'/data/colors_data/stellar_models/vega_flam.csv'`
Required only if ``mag_system = 'Vega'``. This points to the reference SED file for Vega. The default path points to a file provided with the MESA data distribution.
@@ -225,7 +233,7 @@ Required only if ``mag_system = 'Vega'``. This points to the reference SED file
Data Preparation (SED_Tools)
-===============================
+============================
The ``colors`` module requires pre-processed stellar atmospheres and filter
profiles organized in a very specific directory structure. To automate this
@@ -278,21 +286,22 @@ This server provides a live view of:
Defaults Reference
-=====================
+==================
Below are the default values for the colors module parameters as defined in ``colors.defaults``. These are used if you do not override them in your inlist.
.. code-block:: fortran
use_colors = .false.
- instrument = '/colors/data/filters/Generic/Johnson'
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ instrument = '/data/colors_data/filters/Generic/Johnson'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! 10 parsecs in cm (Absolute Magnitude)
make_csv = .false.
colors_results_directory = 'SED'
mag_system = 'Vega'
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
+
Visual Summary of Data Flow
===========================
@@ -324,12 +333,8 @@ Visual Summary of Data Flow
-
-================================================
-================================================
-
Python Helper Scripts
-========================
+=====================
A collection of Python scripts is provided in the ``python_helpers/`` directory to assist with real-time monitoring, visualization, and analysis of the colors module output.
@@ -341,6 +346,7 @@ Dependencies:
HISTORY_check.py
----------------
+
**Usage:** ``python python_helpers/HISTORY_check.py``
A real-time dashboard that monitors your ``history.data`` file as MESA runs. It automatically refreshes when new data is written.
@@ -367,6 +373,7 @@ Monitors the ``colors_results_directory`` (default: ``SED/``) for new CSV output
interactive_cmd_3d.py
---------------------
+
**Usage:** ``python python_helpers/interactive_cmd_3d.py``
Generates an interactive 3D Color-Magnitude Diagram.
@@ -377,6 +384,7 @@ Generates an interactive 3D Color-Magnitude Diagram.
Movie Makers
------------
+
Scripts to generate MP4 animations of your run. Requires ``ffmpeg``.
* **make_history_movie.py**: Creates ``history.mp4``, an animated version of the ``HISTORY_check.py`` dashboard showing the evolution over time.
diff --git a/star/test_suite/custom_colors/inlist_colors b/star/test_suite/custom_colors/inlist_colors
index 9da4dc09e..cfdf11b54 100644
--- a/star/test_suite/custom_colors/inlist_colors
+++ b/star/test_suite/custom_colors/inlist_colors
@@ -57,14 +57,14 @@
! This points to a directory containing Johnson filter transmission curves.
! The Johnson directory should contain files like:
! - U.dat, B.dat, V.dat, R.dat, I.dat, J.dat, M.dat (filter transmission curves)
- instrument = '/colors/data/filters/Generic/Johnson'
+ instrument = '/data/colors_data/filters/Generic/Johnson'
! Stellar atmosphere model directory
! Should contain:
! - lookup_table.csv: mapping file with columns for filename, Teff, log_g, metallicity
! - Individual SED files: wavelength vs surface flux for each stellar model
! - flux_cube.bin: pre-computed interpolation grid (if using linear/hermite interpolation)
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
! Physical parameters for synthetic photometry
distance = 3.0857d19 ! Distance to star in cm (1 pc = 3.0857e16 m for absolute mags)
@@ -80,7 +80,7 @@
! Vega spectrum for zero-point calibration
! This file should contain wavelength (Å) and flux (erg/s/cm²/Å) columns
! Used to define the zero-point of the magnitude system (Vega = 0.0 mag)
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
/ ! end of colors namelist
diff --git a/star/test_suite/custom_colors/python_helpers/HISTORY_check.py b/star/test_suite/custom_colors/python_helpers/HISTORY_check.py
index ba8470da7..1ec53db49 100644
--- a/star/test_suite/custom_colors/python_helpers/HISTORY_check.py
+++ b/star/test_suite/custom_colors/python_helpers/HISTORY_check.py
@@ -1,24 +1,19 @@
#!/usr/bin/env python3
import glob
import os
+
+# ---------------------------
+# Insert after imports (HISTORY_check.py)
+# ---------------------------
+import matplotlib as mpl
import matplotlib.pyplot as plt
import mesa_reader as mr
import numpy as np
from matplotlib.animation import FuncAnimation
# Import functions from static version for consistency
-from static_HISTORY_check import (
- # get_mesa_phase_info,
- read_header_columns,
- setup_hr_diagram_params,
- MesaView,
-)
-
-
-# ---------------------------
-# Insert after imports (HISTORY_check.py)
-# ---------------------------
-import matplotlib as mpl
+from static_HISTORY_check import MesaView # get_mesa_phase_info,
+from static_HISTORY_check import read_header_columns, setup_hr_diagram_params
def age_colormap_colors(ages, cmap_name="inferno", recent_fraction=0.25, stretch=5.0):
@@ -388,9 +383,7 @@ def update_plot(self, frame):
else:
self.axes[1, 0].plot(self.Star_Age, self.color_index, "kx")
- # Bottom-right plot: Age vs. All Filter Magnitudes with filter-specific colors
for i, filt in enumerate(self.filter_columns):
- # Retrieve filter magnitude data
try:
col_data = getattr(self.md, filt)
except AttributeError:
@@ -400,12 +393,26 @@ def update_plot(self, frame):
print(f"Warning: Could not retrieve data for filter {filt}")
continue
- # Use filter-specific color
+ col_data = np.asarray(col_data, dtype=float)
+ age = np.asarray(self.Star_Age, dtype=float)
+
+ # --- physical mask ---
+ mask = (
+ np.isfinite(col_data)
+ & np.isfinite(age)
+ & (col_data < 90.0) # magnitude sanity bound
+ & (col_data > -50.0) # avoid garbage negatives
+ )
+
+ if not np.any(mask):
+ # Entire column is non-physical → skip it
+ continue
+
color = self.filter_colors[i] if i < len(self.filter_colors) else "black"
self.axes[1, 1].plot(
- self.Star_Age,
- col_data,
+ age[mask],
+ col_data[mask],
marker="o",
linestyle="-",
label=filt,
diff --git a/star/test_suite/custom_colors/python_helpers/SED_check.py b/star/test_suite/custom_colors/python_helpers/SED_check.py
index d91f6bf46..8dddd1ccb 100644
--- a/star/test_suite/custom_colors/python_helpers/SED_check.py
+++ b/star/test_suite/custom_colors/python_helpers/SED_check.py
@@ -1,5 +1,6 @@
-import os
import csv
+import os
+
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.animation import FFMpegWriter, FuncAnimation
@@ -52,6 +53,7 @@ def __init__(
# keep track of file changes for monitoring
self.file_timestamps = {}
self.full_sed_plotted = False
+ self.vega_sed_plotted = False
# set up the matplotlib figure
self.fig, self.ax = plt.subplots(figsize=(12, 6))
@@ -413,6 +415,7 @@ def update_plot(self, frame):
# clear the plot and reset flags
self.ax.clear()
self.full_sed_plotted = False
+ self.vega_sed_plotted = False
# find all the CSV files
output_files = self.find_output_files()
@@ -452,12 +455,41 @@ def update_plot(self, frame):
# process each CSV file
for file_path in output_files:
+ # Handle VEGA files - plot the Vega SED once
if (
- "VEGA" not in file_path
+ "VEGA" in file_path
and "bright" not in file_path
and "faint" not in file_path
):
- linestyle = "--" if "VEGA" in file_path else "-"
+ if not self.vega_sed_plotted:
+ try:
+ data_dict = self.read_csv_file(
+ os.path.join(self.directory, file_path)
+ )
+ if data_dict:
+ vega_wavelengths = self.ensure_numeric(
+ data_dict.get("wavelengths", [])
+ )
+ vega_flux = self.ensure_numeric(data_dict.get("fluxes", []))
+
+ if len(vega_wavelengths) > 0 and len(vega_flux) > 0:
+ line = self.ax.plot(
+ vega_wavelengths,
+ vega_flux,
+ color="purple",
+ linewidth=1.5,
+ linestyle="--",
+ alpha=0.7,
+ )[0]
+ legend_handles.append(line)
+ legend_labels_list.append("Vega SED")
+ self.vega_sed_plotted = True
+ except Exception:
+ pass
+ continue
+
+ if "bright" not in file_path and "faint" not in file_path:
+ linestyle = "-"
try:
data_dict = self.read_csv_file(
diff --git a/star/test_suite/custom_colors/python_helpers/interactive_cmd_3d.py b/star/test_suite/custom_colors/python_helpers/interactive_cmd_3d.py
index abf84aff3..d69635200 100644
--- a/star/test_suite/custom_colors/python_helpers/interactive_cmd_3d.py
+++ b/star/test_suite/custom_colors/python_helpers/interactive_cmd_3d.py
@@ -2,10 +2,10 @@
import glob
import textwrap
+
import matplotlib.pyplot as plt
-from mpl_toolkits.mplot3d import Axes3D # noqa: F401
import mesa_reader as mr
-
+from mpl_toolkits.mplot3d import Axes3D # noqa: F401
from static_HISTORY_check import MesaView, read_header_columns, setup_hr_diagram_params
diff --git a/star/test_suite/custom_colors/python_helpers/make_CMD_InterpRad_movie.py b/star/test_suite/custom_colors/python_helpers/make_CMD_InterpRad_movie.py
index b1d1d8f79..905c61bf0 100644
--- a/star/test_suite/custom_colors/python_helpers/make_CMD_InterpRad_movie.py
+++ b/star/test_suite/custom_colors/python_helpers/make_CMD_InterpRad_movie.py
@@ -1,16 +1,12 @@
#!/usr/bin/env python3
import glob
+
import matplotlib.pyplot as plt
-from mpl_toolkits.mplot3d import Axes3D # noqa: F401
-from matplotlib.animation import FuncAnimation, FFMpegWriter
import mesa_reader as mr
-
-from static_HISTORY_check import (
- MesaView,
- read_header_columns,
- setup_hr_diagram_params,
-)
+from matplotlib.animation import FFMpegWriter, FuncAnimation
+from mpl_toolkits.mplot3d import Axes3D # noqa: F401
+from static_HISTORY_check import MesaView, read_header_columns, setup_hr_diagram_params
def make_cmd_rotation_video(
diff --git a/star/test_suite/custom_colors/python_helpers/make_history_movie.py b/star/test_suite/custom_colors/python_helpers/make_history_movie.py
index 1d75b178a..f83bc5397 100644
--- a/star/test_suite/custom_colors/python_helpers/make_history_movie.py
+++ b/star/test_suite/custom_colors/python_helpers/make_history_movie.py
@@ -2,11 +2,10 @@
# Make a movie that visually matches the live HISTORY_check viewer.
# One frame per row; each frame shows the full chain up to that row.
-import numpy as np
import matplotlib.pyplot as plt
-from matplotlib.animation import FFMpegWriter
+import numpy as np
from HISTORY_check import HistoryChecker # uses static_HISTORY_check under the hood
-
+from matplotlib.animation import FFMpegWriter
do_tqdm = True
try:
diff --git a/star/test_suite/custom_colors/python_helpers/static_HISTORY_check.py b/star/test_suite/custom_colors/python_helpers/static_HISTORY_check.py
index 572ad645e..1a5780158 100644
--- a/star/test_suite/custom_colors/python_helpers/static_HISTORY_check.py
+++ b/star/test_suite/custom_colors/python_helpers/static_HISTORY_check.py
@@ -8,6 +8,7 @@
#
####################################################
import glob
+
import matplotlib.pyplot as plt
import mesa_reader as mr
import numpy as np
diff --git a/star/test_suite/custom_colors/python_helpers/zero_point_check.py b/star/test_suite/custom_colors/python_helpers/zero_point_check.py
new file mode 100644
index 000000000..6986fbac4
--- /dev/null
+++ b/star/test_suite/custom_colors/python_helpers/zero_point_check.py
@@ -0,0 +1,241 @@
+#!/usr/bin/env python3
+"""
+compare_mag_systems.py
+
+Runs MESA 3 times with different magnitude zero-point systems (Vega, AB, ST)
+and overlays the resulting CMDs for comparison.
+
+Usage: python compare_mag_systems.py
+ (Run from the custom_colors test suite directory)
+
+Niall Miller (2025)
+"""
+
+import os
+import re
+import shutil
+import subprocess
+
+import matplotlib.pyplot as plt
+import numpy as np
+
+# Configuration
+MAG_SYSTEMS = ["Vega", "AB", "ST"]
+COLORS = {"Vega": "blue", "AB": "red", "ST": "green"}
+INLIST_COLORS = "inlist_colors"
+INLIST_HEADER = "inlist_colors_header"
+
+os.chdir("../")
+
+# Fast run parameters - override these in the inlist for quick comparison
+FAST_RUN_OVERRIDES = {
+ "initial_mass": "3.0d0", # Lower mass = faster evolution
+ "xa_central_lower_limit(1)": "0.5", # Stop at 50% He depletion (faster)
+ "varcontrol_target": "1d-2", # Looser tolerance
+ "mesh_delta_coeff": "1.0", # Coarser mesh
+}
+
+
+def read_inlist(filename):
+ """Read inlist file content."""
+ with open(filename, "r") as f:
+ return f.read()
+
+
+def write_inlist(filename, content):
+ """Write inlist file content."""
+ with open(filename, "w") as f:
+ f.write(content)
+
+
+def modify_mag_system(content, mag_system):
+ """Change the mag_system parameter in inlist content."""
+ pattern = r"(mag_system\s*=\s*')[^']*(')"
+ return re.sub(pattern, rf"\g<1>{mag_system}\g<2>", content)
+
+
+def modify_for_fast_run(content):
+ """Modify inlist for faster execution."""
+ # Disable pgstar for batch runs
+ content = re.sub(r"pgstar_flag\s*=\s*\.true\.", "pgstar_flag = .false.", content)
+
+ # Apply fast run overrides
+ for param, value in FAST_RUN_OVERRIDES.items():
+ pattern = rf"({param}\s*=\s*)[^\s!]+"
+ if re.search(pattern, content):
+ content = re.sub(pattern, rf"\g<1>{value}", content)
+
+ return content
+
+
+def run_mesa(mag_system, run_dir):
+ """Run MESA with specified mag_system, saving LOGS to run_dir."""
+ print(f"\n{'=' * 60}")
+ print(f"Running MESA with mag_system = {mag_system}")
+ print(f"{'=' * 60}")
+
+ # Backup original inlist
+ original_content = read_inlist(INLIST_COLORS)
+
+ # Modify inlist
+ modified_content = modify_mag_system(original_content, mag_system)
+ modified_content = modify_for_fast_run(modified_content)
+ write_inlist(INLIST_COLORS, modified_content)
+
+ # Clean LOGS directory
+ if os.path.exists("LOGS"):
+ shutil.rmtree("LOGS")
+ os.makedirs("LOGS", exist_ok=True)
+
+ # Run MESA
+ try:
+ result = subprocess.run(
+ ["./rn"],
+ capture_output=True,
+ text=True,
+ timeout=3600, # 1 hour timeout
+ )
+ if result.returncode != 0:
+ print(f"MESA run failed for {mag_system}")
+ print(result.stderr)
+ except subprocess.TimeoutExpired:
+ print(f"MESA run timed out for {mag_system}")
+ except Exception as e:
+ print(f"Error running MESA: {e}")
+ finally:
+ # Restore original inlist
+ write_inlist(INLIST_COLORS, original_content)
+
+ # Copy LOGS to run-specific directory
+ if os.path.exists("LOGS"):
+ if os.path.exists(run_dir):
+ shutil.rmtree(run_dir)
+ shutil.copytree("LOGS", run_dir)
+ print(f"Results saved to {run_dir}")
+
+
+def read_mesa_history(logs_dir):
+ """Read MESA history.data file and return as dict of arrays."""
+ history_file = os.path.join(logs_dir, "history.data")
+
+ if not os.path.exists(history_file):
+ print(f"Warning: {history_file} not found")
+ return None
+
+ # Read header to get column names
+ with open(history_file, "r") as f:
+ lines = f.readlines()
+
+ # Find header line (line with column names, typically line 6)
+ header_line = 5 # 0-indexed, so line 6
+ for i, line in enumerate(lines):
+ if line.strip().startswith("model_number") or "model_number" in line:
+ header_line = i
+ break
+
+ column_names = lines[header_line].split()
+
+ # Read data (skip header lines)
+ data = np.loadtxt(history_file, skiprows=header_line + 1)
+
+ # Create dictionary
+ result = {}
+ for i, name in enumerate(column_names):
+ if i < data.shape[1]:
+ result[name] = data[:, i]
+
+ return result
+
+
+def plot_cmd_comparison(results):
+ """Plot CMD comparison for all mag systems."""
+ fig, axes = plt.subplots(1, 2, figsize=(14, 6))
+
+ # CMD 1: B-V vs V
+ ax1 = axes[0]
+ for mag_system, data in results.items():
+ if data is None:
+ continue
+ if "B" in data and "V" in data:
+ color = data["B"] - data["V"]
+ mag = data["V"]
+ ax1.plot(
+ color,
+ mag,
+ "-",
+ color=COLORS[mag_system],
+ label=mag_system,
+ alpha=0.8,
+ linewidth=1.5,
+ )
+
+ ax1.set_xlabel("B - V", fontsize=12)
+ ax1.set_ylabel("V (mag)", fontsize=12)
+ ax1.set_title("CMD: B-V vs V", fontsize=14)
+ ax1.invert_yaxis()
+ ax1.legend(loc="best")
+ ax1.grid(True, alpha=0.3)
+
+ # CMD 2: U-B vs B
+ ax2 = axes[1]
+ for mag_system, data in results.items():
+ if data is None:
+ continue
+ if "U" in data and "B" in data:
+ color = data["U"] - data["B"]
+ mag = data["B"]
+ ax2.plot(
+ color,
+ mag,
+ "-",
+ color=COLORS[mag_system],
+ label=mag_system,
+ alpha=0.8,
+ linewidth=1.5,
+ )
+
+ ax2.set_xlabel("U - B", fontsize=12)
+ ax2.set_ylabel("B (mag)", fontsize=12)
+ ax2.set_title("CMD: U-B vs B", fontsize=14)
+ ax2.invert_yaxis()
+ ax2.legend(loc="best")
+ ax2.grid(True, alpha=0.3)
+
+ plt.suptitle("Magnitude System Comparison", fontsize=16, y=1.02)
+ plt.tight_layout()
+
+ output_file = "mag_system_comparison.png"
+ plt.savefig(output_file, dpi=150, bbox_inches="tight")
+ print(f"\nPlot saved to {output_file}")
+ # plt.show()
+
+
+def main():
+ """Main execution."""
+ # Check we're in the right directory
+ if not os.path.exists(INLIST_COLORS):
+ print(f"Error: {INLIST_COLORS} not found. Run from custom_colors directory.")
+ return
+
+ if not os.path.exists("./rn"):
+ print("Error: ./rn not found. Run from custom_colors directory.")
+ return
+
+ results = {}
+
+ # Run MESA for each mag system
+ for mag_system in MAG_SYSTEMS:
+ run_dir = f"LOGS_{mag_system}"
+ run_mesa(mag_system, run_dir)
+ results[mag_system] = read_mesa_history(run_dir)
+
+ # Plot comparison
+ plot_cmd_comparison(results)
+
+ print("\n" + "=" * 60)
+ print("Comparison complete!")
+ print("=" * 60)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/star/test_suite/rsp_BEP/inlist_rsp_BEP b/star/test_suite/rsp_BEP/inlist_rsp_BEP
index 79a524016..c59ee8670 100644
--- a/star/test_suite/rsp_BEP/inlist_rsp_BEP
+++ b/star/test_suite/rsp_BEP/inlist_rsp_BEP
@@ -57,13 +57,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_BEP/inlist_rsp_BEP_make_cycle0 b/star/test_suite/rsp_BEP/inlist_rsp_BEP_make_cycle0
index d1b66508f..a530cdec4 100644
--- a/star/test_suite/rsp_BEP/inlist_rsp_BEP_make_cycle0
+++ b/star/test_suite/rsp_BEP/inlist_rsp_BEP_make_cycle0
@@ -57,13 +57,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_BEP/inlist_rsp_BEP_std b/star/test_suite/rsp_BEP/inlist_rsp_BEP_std
index 79a524016..c59ee8670 100644
--- a/star/test_suite/rsp_BEP/inlist_rsp_BEP_std
+++ b/star/test_suite/rsp_BEP/inlist_rsp_BEP_std
@@ -57,13 +57,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_BEP/inlist_rsp_BEP_test_cycle0 b/star/test_suite/rsp_BEP/inlist_rsp_BEP_test_cycle0
index d85297c52..e22978bb4 100644
--- a/star/test_suite/rsp_BEP/inlist_rsp_BEP_test_cycle0
+++ b/star/test_suite/rsp_BEP/inlist_rsp_BEP_test_cycle0
@@ -56,13 +56,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_BLAP/inlist_rsp_BLAP b/star/test_suite/rsp_BLAP/inlist_rsp_BLAP
index d70d5ba84..3907d3d7c 100644
--- a/star/test_suite/rsp_BLAP/inlist_rsp_BLAP
+++ b/star/test_suite/rsp_BLAP/inlist_rsp_BLAP
@@ -53,13 +53,13 @@ use_Skye = .false.
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_make_cycle0 b/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_make_cycle0
index a61e0e0a0..3c9deb053 100644
--- a/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_make_cycle0
+++ b/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_make_cycle0
@@ -51,13 +51,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_std b/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_std
index 412fe227d..3c1cee856 100644
--- a/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_std
+++ b/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_std
@@ -51,13 +51,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_test_cycle0 b/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_test_cycle0
index 803e28ba7..424307efb 100644
--- a/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_test_cycle0
+++ b/star/test_suite/rsp_BLAP/inlist_rsp_BLAP_test_cycle0
@@ -50,13 +50,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid b/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid
index a27dccbb7..ca6a41ff5 100644
--- a/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid
+++ b/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid
@@ -57,13 +57,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_make_cycle0 b/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_make_cycle0
index 2a064ea81..c6e1544c9 100644
--- a/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_make_cycle0
+++ b/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_make_cycle0
@@ -56,13 +56,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_std b/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_std
index a27dccbb7..ca6a41ff5 100644
--- a/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_std
+++ b/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_std
@@ -57,13 +57,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_test_cycle0 b/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_test_cycle0
index fb2258c61..dc0de07e0 100644
--- a/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_test_cycle0
+++ b/star/test_suite/rsp_Cepheid/inlist_rsp_Cepheid_test_cycle0
@@ -55,13 +55,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid b/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid
index 3df50ef79..57fc23585 100644
--- a/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid
+++ b/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid
@@ -48,13 +48,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_make_cycle0 b/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_make_cycle0
index 2c310d732..11207c60d 100644
--- a/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_make_cycle0
+++ b/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_make_cycle0
@@ -48,13 +48,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_std b/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_std
index 9ed9e615c..0c9120603 100644
--- a/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_std
+++ b/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_std
@@ -48,13 +48,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_test_cycle0 b/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_test_cycle0
index 08c4991bb..96bfa2ebf 100644
--- a/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_test_cycle0
+++ b/star/test_suite/rsp_Cepheid_6M/inlist_rsp_Cepheid_test_cycle0
@@ -47,13 +47,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti b/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti
index 1db2b817e..14ce81924 100644
--- a/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti
+++ b/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti
@@ -57,13 +57,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_make_cycle0 b/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_make_cycle0
index e231cd7d4..d2d98dbb1 100644
--- a/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_make_cycle0
+++ b/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_make_cycle0
@@ -57,13 +57,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_std b/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_std
index 1db2b817e..14ce81924 100644
--- a/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_std
+++ b/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_std
@@ -57,13 +57,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_test_cycle0 b/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_test_cycle0
index d9ffbd0c7..9468bb0b0 100644
--- a/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_test_cycle0
+++ b/star/test_suite/rsp_Delta_Scuti/inlist_rsp_Delta_Scuti_test_cycle0
@@ -56,13 +56,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae b/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae
index 8093f3824..912ff917c 100644
--- a/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae
+++ b/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae
@@ -132,13 +132,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_make_cycle0 b/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_make_cycle0
index c9efa601a..0afca600f 100644
--- a/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_make_cycle0
+++ b/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_make_cycle0
@@ -51,13 +51,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_std b/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_std
index 687146e71..dcd5a73cf 100644
--- a/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_std
+++ b/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_std
@@ -52,13 +52,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_test_cycle0 b/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_test_cycle0
index 4420b9f8c..5fb52037e 100644
--- a/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_test_cycle0
+++ b/star/test_suite/rsp_RR_Lyrae/inlist_rsp_RR_Lyrae_test_cycle0
@@ -51,13 +51,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid b/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid
index b9d8d52a6..9b1d51f03 100644
--- a/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid
+++ b/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid
@@ -57,13 +57,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_make_cycle0 b/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_make_cycle0
index 767251b2b..47b971101 100644
--- a/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_make_cycle0
+++ b/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_make_cycle0
@@ -57,13 +57,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_std b/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_std
index 74b2e9df9..da9ed5e71 100644
--- a/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_std
+++ b/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_std
@@ -57,13 +57,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_test_cycle0 b/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_test_cycle0
index bc291808c..483d8c46a 100644
--- a/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_test_cycle0
+++ b/star/test_suite/rsp_Type_II_Cepheid/inlist_rsp_Type_II_Cepheid_test_cycle0
@@ -56,13 +56,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_check_2nd_crossing/inlist_rsp_check_2nd_crossing b/star/test_suite/rsp_check_2nd_crossing/inlist_rsp_check_2nd_crossing
index a642a436b..2abcc28ab 100644
--- a/star/test_suite/rsp_check_2nd_crossing/inlist_rsp_check_2nd_crossing
+++ b/star/test_suite/rsp_check_2nd_crossing/inlist_rsp_check_2nd_crossing
@@ -55,13 +55,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_gyre/inlist_rsp_gyre b/star/test_suite/rsp_gyre/inlist_rsp_gyre
index 7b1b92a51..b3de848b2 100644
--- a/star/test_suite/rsp_gyre/inlist_rsp_gyre
+++ b/star/test_suite/rsp_gyre/inlist_rsp_gyre
@@ -49,13 +49,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star/test_suite/rsp_save_and_load_file/inlist_rsp_common b/star/test_suite/rsp_save_and_load_file/inlist_rsp_common
index a5aa15b9f..eae6780c8 100644
--- a/star/test_suite/rsp_save_and_load_file/inlist_rsp_common
+++ b/star/test_suite/rsp_save_and_load_file/inlist_rsp_common
@@ -40,13 +40,13 @@
use_colors = .true. ! Activate synthetic photometry calculations
! Filter transmission curves directory
- instrument = '/colors/data/filters/GAIA/GAIA'
+ instrument = '/data/colors_data/filters/GAIA/GAIA'
! Vega spectrum for zero-point magnitude calibration
- vega_sed = '/colors/data/stellar_models/vega_flam.csv'
+ vega_sed = '/data/colors_data/stellar_models/vega_flam.csv'
! Directory containing stellar atmosphere SEDs for interpolation
- stellar_atm = '/colors/data/stellar_models/Kurucz2003all/'
+ stellar_atm = '/data/colors_data/stellar_models/Kurucz2003all/'
distance = 3.0857d19 ! Distance to star in cm
diff --git a/star_data/private/star_controls.inc b/star_data/private/star_controls.inc
index cff5b944e..e3813700e 100644
--- a/star_data/private/star_controls.inc
+++ b/star_data/private/star_controls.inc
@@ -258,6 +258,14 @@
real(dp) :: TDC_alpha_D ! ~ RSP2_alfad
real(dp) :: TDC_alpha_R ! ~ RSP2_alfar
real(dp) :: TDC_alpha_Pt ! RSP2_alfap
+ real(dp) :: TDC_alpha_M
+ real(dp) :: TDC_alpha_C
+ real(dp) :: TDC_alpha_S
+ logical :: TDC_alpha_M_use_explicit_mlt_vc_in_momentum_equation
+ logical :: include_mlt_corr_to_TDC
+ logical :: TDC_include_eturb_in_energy_equation, use_rsp_form_of_scale_height
+ real(dp) :: TDC_num_innermost_cells_forced_nonturbulent
+ real(dp) :: TDC_num_outermost_cells_forced_nonturbulent
real(dp) :: threshold_for_smooth_gradL_composition_term
real(dp) :: clip_D_limit
logical :: alt_scale_height_flag
@@ -421,6 +429,7 @@
real(dp) :: fixed_vsurf
logical :: use_fixed_Psurf_outer_BC
real(dp) :: fixed_Psurf
+ logical :: use_RSP_L_eqn_outer_BC
real(dp) :: Tsurf_factor
@@ -696,6 +705,11 @@
logical :: split_merge_amr_avoid_repeated_remesh
+ logical :: remesh_for_TDC_pulsations_log_core_zoning
+ logical :: TDC_hydro_use_mass_interp_face_values
+ integer :: TDC_hydro_nz, TDC_hydro_nz_outer
+ real(dp) :: TDC_hydro_T_anchor, TDC_hydro_dq_1_factor
+
! nuclear reaction parameters
character (len=strlen) :: screening_mode, default_net_name
diff --git a/star_data/private/star_controls_dev.inc b/star_data/private/star_controls_dev.inc
index cffb14c1f..4b8d983e1 100644
--- a/star_data/private/star_controls_dev.inc
+++ b/star_data/private/star_controls_dev.inc
@@ -1,23 +1,11 @@
logical :: compare_TDC_to_MLT
- real(dp) :: TDC_alpha_M
- real(dp) :: TDC_alpha_C
- real(dp) :: TDC_alpha_S
- logical :: TDC_alpha_M_use_explicit_mlt_vc_in_momentum_equation
- logical :: remesh_for_TDC_pulsations_log_core_zoning
logical :: TDC_use_density_form_for_eddy_viscosity
- logical :: use_RSP_L_eqn_outer_BC
- real(dp) :: TDC_num_innermost_cells_forced_nonturbulent
- real(dp) :: TDC_num_outermost_cells_forced_nonturbulent
logical :: include_mlt_Pturb_in_thermodynamic_gradients
- logical :: include_mlt_corr_to_TDC, use_TDC_enthalpy_flux_limiter
- logical :: TDC_include_eturb_in_energy_equation, use_rsp_form_of_scale_height
+ logical :: use_TDC_enthalpy_flux_limiter
logical :: include_mlt_in_velocity_time_centering
- logical :: TDC_hydro_use_mass_interp_face_values
logical :: use_hydro_merge_limits_in_mesh_plan
- integer :: TDC_hydro_nz, TDC_hydro_nz_outer
- real(dp) :: TDC_hydro_T_anchor, TDC_hydro_dq_1_factor
real(dp) :: RSP2_Lsurf_factor
real(dp) :: RSP2_alfap
diff --git a/stella/res/stella_extras.f90 b/stella/res/stella_extras.f90
index fb0837a8c..35d20150f 100644
--- a/stella/res/stella_extras.f90
+++ b/stella/res/stella_extras.f90
@@ -3,7 +3,7 @@ program main
use interp_2d_lib_db, only: interp_mkbicub_db, interp_evbicub_db
use interp_1d_lib, only: interp_pm, interp_value
use interp_1d_def, only: pm_work_size
- use const_def, only: dp
+ use const_def
use const_lib, only: const_init
use colors_def
use colors_lib
@@ -17,15 +17,15 @@ program main
r, v, temp, den, kap, tempr, xm, smooth, tau, lum, n_bar, n_e
real(dp), allocatable, dimension(:) :: &
t, m, dm, h, he, c, n, o, ne, na, mg, al, si, s, ar, ca, fe, ni
- real(dp) :: dum, time, X, sum_tau, tauph, tau_extra, denmax, gdepos
- character(len=132) :: runname, filestr, fname, test_str
+ real(dp) :: dum, time, sum_tau, tauph, tau_extra, gdepos
+ character(len=132) :: filestr, fname, test_str
character(len=256) :: line, my_mesa_dir
real(dp), parameter :: &
A_Fe56 = 56d0, lambda0 = 5169.02d-8, f = 0.023d0, Z_div_X_solar = 0.02293d0, &
tau_sob_hi = 2d0, tau_sob_med = 1d0, tau_sob_lo = 0.2d0
integer, parameter :: num_logRhos = 41, num_logTs = 117, iounit = 33, &
- max_lbol = 10000, n_colors = 5
+ max_lbol = 10000
integer :: ilinx, iliny, ibcxmin, ibcxmax, ibcymin, ibcymax, ict(6), num_lbol, num_lbol_max
real(dp) :: bcxmin(num_logTs), bcxmax(num_logTs), Ts(num_logTs)
real(dp) :: bcymin(num_logRhos), bcymax(num_logRhos)
@@ -52,9 +52,7 @@ program main
call math_init()
- call colors_init(1, &
- [trim(my_mesa_dir)//'/data/colors_data/blackbody_johnson.dat'], &
- [n_colors], ierr)
+ call colors_init(.false., '', ierr)
if (ierr /= 0) then
write (*, *) 'colors_init failed during initialization'
return
@@ -358,6 +356,8 @@ program main
Zsurf = max(1d-99, min(1d0, 1d0 - (Xsurf + Ysurf)))
Z_div_X = Zsurf/max(1d-99, Xsurf)
Fe_H = log10(Z_div_X/Z_div_X_solar)
+ ! TODO: use new colors module/filters to get color magnitude
+ ! The below are stubs from the old colors module, and just return -99
bb_magU = get1_synthetic_color_abs_mag('bb_U')
bb_magB = get1_synthetic_color_abs_mag('bb_B')
bb_magV = get1_synthetic_color_abs_mag('bb_V')
diff --git a/stella/src/cp2k/kinds.f90 b/stella/src/cp2k/kinds.f
similarity index 100%
rename from stella/src/cp2k/kinds.f90
rename to stella/src/cp2k/kinds.f