Calculating a Chemical Abundance Table Using FastChem
February 15, 2026 ยท View on GitHub
In this section, we outline the process of running FastChem with tabulated lnK files, as opposed to using fitting functions for lnK. This is achieved by employing the lnk_interpolate_dev branch. The utility prep_FastChem is employed to generate lnK files for molecules. These files are derived from the original fitting functions. In contrast, lnK files for atomic ions are produced from the energy level data utilized in Optab.
Warning: It is important to note that for certain atomic ions at elevated temperatures, the lnK values may be subject to inaccuracies, specifically underestimations. This is because these values are calculated using NIST energy level data, which does not comprehensively cover higher levels.
-
Build
FastChem:cd <some_working_dir> git clone https://github.com/exoclime/FastChem.git cd FastChem/ git checkout lnk_interpolate_dev- Comment out the following line 37 in
fastchem_src/check.cpp:
if (this->number_density < min_limit) this->number_density = min_limit;
mkdir build cd build/ cmake .. && make cd ../ - Comment out the following line 37 in
-
Generate necessary files for
FastChemincluding lnK files ininput/:cd $OPTAB/work/FastChem-lnk_interpolate_dev/input- Update the
OPTAB_DATABASE_DIRpreprocessor macro inprep_FastChem.F90to the correct path. - Update the
FASTCHEM_INPUT_DIRpreprocessor macro inprep_FastChem.F90to the correct path.
make prep_FastChem- Verify the settings in
prep_FastChem.dat, including the label, temperature grid, and pressure grid.
./prep_FastChemWarning:
prep_FastChemuses quadruple precision and does not run correctly on arm64 Macs due to ABI constraints. arm64 Mac users must runprep_FastChemon a separate x86_64 platform. - Update the
-
Run
FastChem: Warning:FastChembuilt with quadruple precision does not run correctly on arm64 Macs due to ABI constraints. arm64 Mac users must runFastChemon a separate x86_64 platform.cd $FASTCHEM ./fastchem input/config.input_<label>- Find the created chemical abundance table at
output/<label>.dat. Here,<label>issamplein the default setting.
- Find the created chemical abundance table at