How daviddahlbudding/chelio works
1. What this repository is
Chelio is an orchestration layer that couples two external scientific codes: HELIOS for 1D radiative transfer / temperature-pressure structure, and GGchem for equilibrium chemistry. The repository itself does not implement those solvers; it coordinates them, converts their inputs/outputs, and repeats the exchange until the atmosphere is self-consistent.
2. Main runtime boundary
The core architectural boundary is between Chelio scripts and the two external executables. The repo expects HELIOS_PATH, GGCHEM_PATH, and CHELIO_PATH to point to installed locations, so the workflow is built around filesystem-based handoff rather than in-process library calls.
3. Top-level orchestration
run_coupled.bash is the main entry point for a single simulation. It accepts physical parameters such as top/bottom pressure, internal temperature, albedo, elemental abundances, and a start iteration index for resuming. This script is the control plane for the iterative HELIOS ↔ GGchem loop.
4. Parameter-sweep orchestration
multiple_runs.bash is a batch driver that invokes the single-run workflow repeatedly across arrays of parameter values. Architecturally, this is a thin experiment manager: it expands a grid of atmospheric/chemical cases and produces a set of independent run directories under the output tree.
5. Coupling data flow
The coupling cycle is likely:
- create or update a pressure-temperature profile,
- derive elemental abundances and chemistry inputs,
- run GGchem to compute equilibrium composition,
- convert chemistry output into HELIOS mixing ratios,
- run HELIOS to recompute the P–T structure,
- convert the new P–T profile back for the next GGchem iteration.
The key architectural point is that the loop is mediated by file conversions between incompatible formats.
6. Utility scripts in source/
The Python scripts in source/ are the transformation layer:
- create_pt.py generates initial P–T profiles.
- calc_abundances.py computes starting abundances for GGchem.
- convert_tp.py converts HELIOS temperature-pressure output into a GGchem-readable form.
- convert_mixfile.py converts GGchem mixing ratios into the HELIOS mixfile format.
- calc_escape.py performs post-run escape/stability calculations.
- mark_bad_last_iters.py flags problematic iterations in output.
These scripts are the glue that enforces format compatibility and preserve the coupling boundary between the solvers.
7. Input templates and configuration
ggchem_inputs/ and helios_inputs/ hold the template files that define each solver’s static configuration, including parameter files and species definitions. These directories are important because they separate model setup from run-specific generated files. The root-level pt_helios.in appears to be a seed profile used at startup or as a template for initial coupling.
8. Outputs as a run-centric artifact
Simulation results are written under output/ in per-run subdirectories named by --NAME. That directory is the primary persistence boundary for both raw solver outputs and derived coupling artifacts. Because runs can be resumed with --i_min, the output layout likely encodes iteration history as well as final state.
9. Analysis layer
The analyze/ directory is a separate post-processing subsystem, not part of the simulation runtime. It contains Jupyter notebooks for common scientific analyses and a small Python package, analyze_modules, that centralizes data loading and plotting. This layer consumes files from output/ and turns them into comparative plots, histograms, and matrices.
10. Analysis package structure
analyze_modules/data_loader.py likely abstracts the repository’s output layout so notebooks do not have to know file-by-file details. plot_utils.py provides reusable plotting logic. This is a good sign of a deliberate separation between data access and presentation inside the analysis stack.
11. Operational model
The project is shell- and Python-based rather than service-based: there is no daemon, API server, or database. The architecture is essentially a scientific workflow engine built from scripts, templates, and generated files. Reproducibility comes from fixed inputs, explicit environment variables, and named output folders.
12. How to draw the architecture
A correct diagram should show:
- user-triggered entry points (run_coupled.bash, multiple_runs.bash);
- the Chelio utility scripts as the conversion/initialization layer;
- HELIOS and GGchem as external executables on either side of the coupling loop;
- ggchem_inputs/ and helios_inputs/ as static templates feeding each solver;
- output/ as the shared persistence layer;
- analyze/ as a downstream consumer of output data.
Main entry points: run_coupled.bash Coupled run · analyze Notebooks · convert_tp.py TP convert · convert_mixfile.py Mix convert
Components 16
Simulation runtime
Entry points, coupling scripts, converters, and external executables used for one atmosphere run.
- Coupled run · Main single-run driver for the iterative HELIOS ↔ GGchem workflow.
run_coupled.bash - Batch runs · Expands parameter sweeps into multiple independent coupled simulations.
multiple_runs.bash - Init PT · Generates starting pressure-temperature profiles for a coupled run.
source/create_pt.py - Init abundances · Computes starting elemental abundances for chemistry input.
source/calc_abundances.py - TP convert · Converts HELIOS temperature-pressure output into GGchem-readable form.
source/convert_tp.py - Mix convert · Converts GGchem mixing ratios into HELIOS mixfile format.
source/convert_mixfile.py - Escape calc · Post-run escape or stability calculation on produced atmosphere states.
source/calc_escape.py - Flag bad iters · Marks problematic iterations in the run history.
source/mark_bad_last_iters.py - HELIOS · External radiative-transfer and temperature-pressure solver.
- GGchem · External equilibrium chemistry solver.
Static inputs
Templates and seed files that configure the coupled solvers.
- HELIOS inputs · Static configuration and species definitions for HELIOS.
helios_inputs - GGchem inputs · Static parameter file and chemistry inputs for GGchem.
ggchem_inputs - PT seed · Initial pressure-temperature profile used to bootstrap coupling.
pt_helios.in
Post-processing
Notebook-driven analysis layer and shared plotting/data-loading helpers.
- Notebooks · Interactive post-processing notebooks for single runs, comparisons, matrices, and escape statistics.
analyze - Analysis utils · Shared data-loading and plotting helpers used by the notebooks.
analyze/analyze_modules
Run outputs
Per-run output tree used as the handoff boundary for simulation artifacts.
- Output tree · Per-run directories containing raw solver results and derived coupling products.
Connections 17
- Batch runs → Coupled run: invokes · Launches repeated coupled simulations over parameter grids.
- Coupled run → Init PT: initializes · Builds or updates the starting pressure-temperature profile.
- Coupled run → Init abundances: prepares · Derives starting abundances for the chemistry solver.
- Coupled run → PT seed: seeds · Uses the seed profile as a starting template.
- Coupled run → HELIOS inputs: configures · Reads static HELIOS configuration templates.
- Coupled run → GGchem inputs: configures · Reads static GGchem configuration templates.
- Coupled run → GGchem: calls · Runs chemistry after assembling chemistry inputs.
- GGchem → Mix convert: outputs · Chemistry output is transformed into HELIOS mixing-ratio format.
- Mix convert → HELIOS: feeds · Produces mixfiles consumed by HELIOS.
- HELIOS → TP convert: outputs · HELIOS temperature-pressure output is normalized for the next chemistry step.
- TP convert → GGchem: feeds · Converted profiles become input for the next GGchem iteration.
- Coupled run → Output tree: writes · Stores iteration artifacts and final run results.
- Flag bad iters → Output tree: edits · Flags problematic iterations in existing run outputs.
- Escape calc → Output tree: reads · Consumes run artifacts for escape/stability calculations.
- Notebooks → Output tree: consumes · Notebook analyses load results from the run output tree.
- Notebooks → Analysis utils: uses · Notebooks share reusable loading and plotting helpers.
- Analysis utils → Output tree: loads · Data loader abstracts the output layout for analysis.