Skip to content

BG_MCMC_NA#1

Open
gerardb-fr wants to merge 4 commits into
mainfrom
BG_MCMC_NA
Open

BG_MCMC_NA#1
gerardb-fr wants to merge 4 commits into
mainfrom
BG_MCMC_NA

Conversation

@gerardb-fr
Copy link
Copy Markdown
Owner

Purpose: the erosion model for ero_type = 2 was extended to support up to five erosion intervals, defined by pairs of erosion thicknesses and time breakpoints.

Command-line interface (tc1d_cli.py):

  • Added new CLI options --ero-option9 and --ero-option10 to specify additional erosion intervals.

Erosion rate calculation (tc1d.py):

  • Function calculate_erosion_rate updated to dynamically handle up to five erosion intervals.
  • Thicknesses and time breakpoints are read from ero_option1 to ero_option10.
  • The model applies erosion rates piecewise based on the current simulation time.

Total exhumation calculation:

  • calculate_exhumation_magnitude now includes ero_option9 in the sum of total erosion thickness.
  • Function signature updated to accept ero_option9 and ero_option10 with default values.

Inversion constraints (MCMC & NA):

  • In log_prior (MCMC) and batch_run_na (NA), new constraints added to ensure the cumulative sum of erosion thicknesses does not exceed the defined maximum exhumation (global_max_ehumation).
  • Logic follows the same pattern as for the first three intervals.

Batch mode handling:

  • New erosion options added to the batch_keys list for correct batch run detection.

Output logging:

  • Run log headers and data rows extended to include ero_option9 and ero_option10.

This update also extends the Neighbourhood Algorithm (NA) and MCMC inversion to support negative erosion values (i.e. burial). Negative thickness values (e.g. ero_option3 = -5) are now accepted as long as cumulative erosion stays within a physically meaningful range (between -15 and +35 km).
Changes include:

  • Progressive enforcement of constraints (ero_option3/5/7/9).
  • New cumulative check to avoid total net uplift above the surface.
  • Fix for interpolation error by clipping depths below 0.
  • Clean logging of parameters and misfit per iteration.

These changes allow inversion scenarios that include temporary burial events (e.g. sedimentation before renewed exhumation), which were previously not supported.

- Refactored inversion logic: added separate `batch_run_na` and `batch_run_mcmc` functions
- Introduced `--inverse-mode` CLI flag to switch between NA and MCMC
- Preserved existing TC1D architecture and compatibility with CLI erosion parameters
- Automatic generation of MCMC output plots (corner plots, trace plots, misfit scatter)
…nable support for negative erosion values (burial) for NA and MCMC inversions

- Added CLI options: --ero-option9 and --ero-option10
- Extended erosion rate calculation for up to 5 intervals (thickness + time)
- Updated total exhumation calculation to include ero_option9
- Applied constraints in MCMC and NA to prevent exceeding max exhumation
- Extended batch mode detection and output logging for new parameters
- Added bounds logic in ‘batch_run_na’ to handle negative erosion values (up to -15 km) using max_burial and max_exhumation constraints.
- Enforced cumulative erosion thickness to avoid total uplift above surface.
- Safeguarded temperature and pressure interpolation for depth < 0 (to avoid scipy interpolation errors).
- Updated MCMC log_prior constraints to support negative values for ero_option1, 3, 5, 7, 9
- Enforced dynamic upper/lower bounds for each interval based on cumulative exhumation and burial limits
- Introduced `max_burial` (default 15 km) as lower limit for allowed burial
- Rejected models with cumulative erosion < 0 km to avoid unrealistic above-surface placement
- Applied identical logic for both NA and MCMC to ensure consistent inversion behavior
- All changes clearly marked with '# BG:’
- Preserved full backward compatibility for previous 3-interval configurations

This enables testing of more complex, stepwise erosion histories in both forward and inversion modes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant