Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a133dce
Adjust age output file format for new age data file options
davewhipp Nov 13, 2025
460f10f
Update Tc1d terminal animation
davewhipp Nov 19, 2025
b2bced2
Make animation larger
davewhipp Nov 19, 2025
53bcef0
Format animation size
davewhipp Nov 19, 2025
ef25b01
Formatting
davewhipp Nov 19, 2025
7804ac1
Update build env
davewhipp Nov 19, 2025
39f2c92
Fix minor bug with explicit cli flag
davewhipp Nov 21, 2025
261384c
Add CLI-controlled NA parameters and integrate defaults into init_par…
gerardb-fr Nov 27, 2025
1164210
Merge branch 'develop' of https://github.com/HUGG/Tc1D into develop
gerardb-fr Nov 27, 2025
ed010a6
Add CLI-controlled MCMC parameters and integrate defaults into init_p…
gerardb-fr Nov 28, 2025
c1e25e6
BG: Add CSV-driven multi-stage erosion model (ero_type=0) with consta…
gerardb-fr Dec 24, 2025
4cf7004
BG: Add YAML-based input file support to tc1d-cli
gerardb-fr Jan 20, 2026
5c18a43
BG: Switch ero_type=0 to YAML-defined multi-stage erosion (remove CSV…
gerardb-fr Jan 26, 2026
b69d722
BG: Enable NA inversion of YAML multi-stage erosion (ero_type=0) dura…
gerardb-fr Feb 2, 2026
43e1ec8
BG: Enable MCMC inversion of YAML-defined ero_type=0 multi-stage erosion
gerardb-fr Feb 17, 2026
3e02656
Fix equation typo for ero type 3
davewhipp Feb 17, 2026
4748528
Align MCMC likelihood with Gaussian chi-square form and preserve misf…
gerardb-fr Mar 13, 2026
60f6824
Format code with ruff
davewhipp Mar 30, 2026
41a34d3
Resolve merge conflict
davewhipp Mar 30, 2026
85800c4
Format code with ruff
davewhipp Apr 14, 2026
4f63c8f
Format code with ruff
davewhipp Apr 17, 2026
3eac1df
Fix f-string format
davewhipp Apr 17, 2026
51c7253
Fix f-string format
davewhipp Apr 17, 2026
0a8c906
Bump version to v0.4.0
davewhipp Apr 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ repos:
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies: []
additional_dependencies: [types-PyYAML]
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
os: ubuntu-24.04
tools:
python: "3.9"
python: "3.13"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
Expand Down
7 changes: 7 additions & 0 deletions data/ero_file.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type,unit,duration_myr,parameter1,parameter2,parameter3
exponential,erosion_rate,150.0,-0.030,40.0,-0.010
exponential,erosion_rate,200.0,-0.010,50.0,0.060
linear,erosion_rate,200.0,0.060,0.000,
constant,erosion_rate,200.0,0.000,,
linear,erosion_rate,100.0,0.000,0.030,
exponential,erosion_rate,150.0,0.030,60.0,0.005
265 changes: 265 additions & 0 deletions data/input_file.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
# Tc1D input file (YAML)
#
# Goal:
# - Replace command lines with a readable config file
# - If a key is omitted, Tc1D falls back to tc1d-cli defaults
#
# IMPORTANT:
# - YAML keys present here override argparse values (and thus override CLI flags)
# - Avoid defining the same key twice in this file: the last occurrence wins
#
# ---------------------------------------------------------------------------
# Inversion syntax (NA / MCMC)
#
# For any parameter you want to invert, write it as a 2-element range:
# param: [min, max]
#
# Examples:
# ero_option1: [0.0, 20.0] # invert within 0..20 km for instance
# temp_base: [1200, 1400] #
#
# For any parameter you want to fix, write it as a scalar:
# param: 7.0
#
# Notes:
# - Ranges are equivalent to the CLI syntax: --param min max
# - Scalars are equivalent to the CLI syntax: --param value
# ---------------------------------------------------------------------------

# Units:
# - time: Myr
# - dt: years
# - lengths/depths/thicknesses: km
# - erosion rates: depend on ero_type (see comments below)

# ==============================================================================
# 1) General / run control
# ==============================================================================
general:
run_type: "mcmc" # forward / batch / na / mcmc
batch_mode: false
inverse_mode: true
debug: false

# Screen output toggles
echo_inputs: false
no_echo_info: true
no_echo_thermal_info: true
no_echo_ages: true

# ==============================================================================
# 2) Geometry and time
# ==============================================================================
geometry_time:
length: 125.0 # --length (model depth extent)
nx: 251 # --nx
time: 15.0 # --time
dt: 10000.0 # --dt

init_moho_depth: 50.0 # --init-moho-depth
crustal_uplift: false # --crustal-uplift
fixed_moho: false # --fixed-moho

removal_fraction: 0.0 # --removal-fraction
removal_start_time: 0.0 # --removal-start-time
removal_end_time: -1.0 # --removal-end-time

# ==============================================================================
# 3) Materials
# ==============================================================================
materials:
rho_crust: 2850.0
cp_crust: 800.0
k_crust: 2.75
heat_prod_crust: 0.5
heat_prod_decay_depth: -1.0
alphav_crust: 3.0e-5

rho_mantle: 3250.0
cp_mantle: 1000.0
k_mantle: 2.5
heat_prod_mantle: 0.0
alphav_mantle: 3.0e-5

rho_a: 3250.0
k_a: 20.0

# ==============================================================================
# 4) Thermal model
# ==============================================================================
thermal_model:
explicit: false # false => implicit scheme
mantle_adiabat: true

temp_surf: 0.0
temp_base: 1300.0

# ==============================================================================
# 5) Magmatic intrusion (optional)
# ==============================================================================
intrusion_model:
intrusion_temperature: 750.0
intrusion_start_time: -1.0
intrusion_duration: -1.0
intrusion_thickness: -1.0
intrusion_base_depth: -1.0

# ==============================================================================
# 6) Erosion model
# ==============================================================================
erosion_model:
vx_init: 0.0 # --vx-init (mm/yr)

# Select erosion model (0 to 7)
# 0: multi-stage erosion defined directly in YAML (ero_stages)
# 1: constant erosion magnitude (total thickness in km over the run)
# 2: stepwise thicknesses with transition times
# 3: exponential decay
# 4: thrust sheet emplacement + erosional removal
# 5: tectonic exhumation + erosion
# 6: linear change in erosion rate
# 7: extensional tectonics
ero_type: 0

# ---- Active parameters (EDIT THESE) ----------------------------------------
# Define only the options used by your selected ero_type.
# Unused options can be omitted; tc1d-cli defaults will apply.

# ero_type = 2 (example: two intervals)
#ero_option1: 10.0
#ero_option2: 5.0
#ero_option3: 2.0
#ero_option4: 10.0

# ---- Optional: ero_type = 0 (Multi-stage erosion) ---------------
# BG: YAML-defined multi-stage erosion/burial history
ero_stages:
# Stage 1: exponential decay
- type: exponential
unit: erosion_rate
duration_myr: [0.1, 5.0]
parameter1: [0.1, 4.0] # r_start (km/Myr)
parameter2: [0.1, 3.0] # tau (Myr)
parameter3: 0.01 # t_target (km/Myr)

# Stage 2: constant erosion
- type: constant
unit: erosion_rate
duration_myr: [1.0, 10.0]
parameter1: 0.01

# Stage 3: linear increase
- type: linear
unit: erosion_rate
duration_myr: [0.1, 6.0]
parameter1: 0.01
parameter2: [0.1, 3.0]

# ---- Optional: other erosion types (examples) ------------------------------
# ero_type = 1 (constant magnitude over the run)
# ero_type: 1
# ero_option1: 2.0

# ero_type = 3 (exponential decay)
# ero_type: 3
# ero_option1: 15.0
# ero_option2: 20.0
# ero_option3: 0.0

# ==============================================================================
# 7) Age prediction
# ==============================================================================
age_prediction:
no_calc_ages: false

ketch_aft: true
madtrax_aft: false
madtrax_aft_kinetic_model: 1
madtrax_zft_kinetic_model: 1

ap_rad: 45.0
ap_uranium: 10.0
ap_thorium: 40.0

zr_rad: 60.0
zr_uranium: 100.0
zr_thorium: 40.0

pad_time: 0.0
past_age_increment: 0.0

# ==============================================================================
# 8) Observations and misfit
# ==============================================================================
observations:
obs_age_file: "sample_data.csv" # CSV file containing measured ages

obs_ahe: []
obs_ahe_stdev: []
obs_aft: []
obs_aft_stdev: []
obs_zhe: []
obs_zhe_stdev: []
obs_zft: []
obs_zft_stdev: []

misfit_num_params: 0
misfit_type: 1

# ==============================================================================
# 9) Plotting
# ==============================================================================
plotting:
no_plot_results: false
no_display_plots: false

plot_myr: false
plot_depth_history: false
plot_fault_depth_history: false
invert_tt_plot: false

t_plots: [1, 3, 5, 7, 9, 10]

crust_solidus: false
crust_solidus_comp: "wet_intermediate"
mantle_solidus: false
mantle_solidus_xoh: 0.0
solidus_ranges: false

# ==============================================================================
# 10) Output
# ==============================================================================
output:
log_output: false
log_file: ""
model_id: ""

write_temps: false
write_past_ages: false
write_age_output: false
save_plots: true

# ==============================================================================
# 11) Advanced
# ==============================================================================
advanced:
read_temps: false
compare_temps: false

# ==============================================================================
# 12) Inversion hyperparameters
# ==============================================================================
inversion:
neighbourhood_algorithm:
na_ns: 20
na_nr: 5
na_ni: 50
na_n: 5
na_n_resample: 2000
na_n_walkers: 5

mcmc:
mcmc_nwalkers: 24
mcmc_nsteps: 300
mcmc_discard: 0
mcmc_thin: 3
3 changes: 2 additions & 1 deletion docs/rtd-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
myst-nb
numpydoc
sphinx-book-theme
sphinxcontrib-bibtex
sphinxcontrib-bibtex
tc1d
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Configuration file for the Sphinx documentation builder.

# -- Path setup
from pathlib import Path
import sys
# from pathlib import Path
# import sys

sys.path.insert(0, str(Path("..", "..", "src").resolve()))
# sys.path.insert(0, str(Path("..", "..", "src").resolve()))

# -- Project information

Expand Down
2 changes: 1 addition & 1 deletion docs/source/erosion-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ The maximum erosion rate $\dot{e}_{\mathrm{max}}$ is calculated as:

$$
\begin{equation}
\dot{e}_{\mathrm{max}} = \frac{m}{\uptau - \exp{(-(t_{\mathrm{total}} - t_{\mathrm{start}}) / \uptau)}}.
\dot{e}_{\mathrm{max}} = \frac{m}{\uptau (1 - \exp{(-(t_{\mathrm{total}} - t_{\mathrm{start}}) / \uptau))}}.
\end{equation}
$$

Expand Down
Binary file modified docs/source/gif/tc1d-2025.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Documentation for T\ :sub:`c`\ 1D
=================================

.. image:: gif/tc1d-2025.gif
:width: 600
:width: 720
:alt: TC1D running

T\ :sub:`c`\ 1D is a one-dimensional thermal and thermochronometer age prediction model that can simulate the effects of various geodynamic and geomorphic processes on thermochronometer ages.
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "tc1d"
version = "0.3.2"
version = "0.4.0"
authors = [
{name = "Dave Whipp", email = "david.whipp@helsinki.fi"},
{name= "Benjamin Gérard", email = "benjamin.gerard@helsinki.fi"},
Expand Down Expand Up @@ -127,3 +127,5 @@ hatchling = ">=1.27.0,<2"
mypy = ">=1.17.1,<2"
pip = ">=25.2,<26"
pre-commit = ">=4.3.0,<5"
types-pyyaml = ">=6.0.12.20250915,<7"
pyyaml = ">=6.0.3,<7"
Loading
Loading