Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
64 changes: 64 additions & 0 deletions docs/How-to/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,67 @@ Environment variables
FWL_DATA: ok
RAD_DIR: ok
```

## Melting Curves

PROTEUS uses precomputed solidus and liquidus curves from laboratory experiments
and theoretical parametrizations of silicate melting. These curves define the
temperatures at which a silicate material begins to melt (solidus) and becomes
fully molten (liquidus) as a function of pressure.

The melting-curve exporter generates lookup tables in both pressure–temperature
(P–T) and pressure–entropy (P–S) space for several literature parametrizations
of peridotite / silicate melting.

### What the exporter does

The script `tools/solidus_func.py` is designed to work with the legacy EOS lookup
tables:

- `temperature_solid.dat`
- `temperature_melt.dat`

These tables provide temperature as a function of entropy and pressure,
on structured grids. The exporter therefore performs the following
steps:

1. Build solidus and liquidus curves in P–T space from literature fits.
2. Convert those curves into P–S space by inverting the EOS relation \(T(S, P)\).
3. Resample the solidus and liquidus entropy curves onto a common pressure grid.
4. Save both the P–T and P–S versions to disk for later use by PROTEUS.

### Available parametrizations

The following directory names are supported and should be used exactly as written
in the TOML configuration in the `melting_dir` parameter:


| Directory name | Reference | DOI |
|--------------------|------------------------------|-----|
| `andrault_2011` | Andrault et al. (2011) | [10.1016/j.epsl.2011.02.006](https://doi.org/10.1016/j.epsl.2011.02.006) |
| `monteux_2016` | Monteux et al. (2016) | [10.1016/j.epsl.2016.05.010](https://doi.org/10.1016/j.epsl.2016.05.010) |
| `wolf_bower_2018` | Wolf & Bower (2018) | [10.1016/j.pepi.2017.11.004](https://doi.org/10.1016/j.pepi.2017.11.004) <br> [10.1051/0004-6361/201935710](https://doi.org/10.1051/0004-6361/201935710) |
| `katz_2003` | Katz et al. (2003) | [10.1029/2002GC000433](https://doi.org/10.1029/2002GC000433) |
| `fei_2021` | Fei et al. (2021) | [10.1038/s41467-021-21170-y](https://doi.org/10.1038/s41467-021-21170-y) |
| `belonoshko_2005` | Belonoshko et al. (2005) | [10.1103/PhysRevLett.94.195701](https://doi.org/10.1103/PhysRevLett.94.195701) |
| `fiquet_2010` | Fiquet et al. (2010) | [10.1126/science.1192448](https://doi.org/10.1126/science.1192448) |
| `hirschmann_2000` | Hirschmann (2000) | [10.1029/2000GC000070](https://doi.org/10.1029/2000GC000070) |
| `stixrude_2014` | Stixrude (2014) | [10.1098/rsta.2013.0076](https://doi.org/10.1098/rsta.2013.0076) |
| `lin_2024` | Lin et al. (2024) | [10.1038/s41561-024-01495-1](https://doi.org/10.1038/s41561-024-01495-1) |


### Generate melting curves

Before running PROTEUS, generate the lookup tables:

```console
python tools/solidus_func.py --all
```

Alternatively, you can generate a single parametrization using a specific flag (e.g.--katz2003, --lin2024).

This will compute all parametrizations, convert them to P–T and P–S space, and store them in:

```console
$FWL_DATA/interior_lookup_tables/Melting_curves/
```
2 changes: 1 addition & 1 deletion input/all_options.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ version = "2.0"
core_density = 10738.33 # Core density [kg m-3]
core_heatcap = 880.0 # Core specific heat capacity [J K-1 kg-1]

module = "zalmoxis" # self | zalmoxis
module = "self" # self | zalmoxis
Comment thread
planetmariana marked this conversation as resolved.
Comment thread
planetmariana marked this conversation as resolved.
update_interval = 0 # max interval (ceiling) between structure updates [yr]; 0 = only at init
update_min_interval = 0 # min interval (floor) between updates [yr]; prevents thrashing
update_dtmagma_frac = 0.03 # trigger on relative T_magma change (3%)
Expand Down
52 changes: 42 additions & 10 deletions src/proteus/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,33 +1210,65 @@ def download_interior_lookuptables(clean=False):
)


def download_melting_curves(config: Config, clean=False):
def download_melting_curves(config: Config, clean: bool = False):
"""
Download melting curve data
Ensure melting curve data are available locally.

Expected layout:
interior_lookup_tables/
Melting_curves/
<melting_dir>/
solidus_P-T.dat
liquidus_P-T.dat
solidus_P-S.dat
liquidus_P-S.dat
"""
log.debug('Download melting curve data')
dir = 'Melting_curves/' + config.interior.melting_dir
rel_dir = Path('Melting_curves') / config.interior.melting_dir

data_dir = GetFWLData() / 'interior_lookup_tables'
data_dir.mkdir(parents=True, exist_ok=True)

folder_dir = data_dir / dir
folder_dir = data_dir / rel_dir

if clean:
safe_rm(folder_dir.as_posix())
source_info = get_data_source_info(dir)

# ------------------------------------------------------------------
# Canonical flat layout: if files already exist locally, do not download.
# ------------------------------------------------------------------
solidus_pt = folder_dir / 'solidus_P-T.dat'
liquidus_pt = folder_dir / 'liquidus_P-T.dat'
solidus_ps = folder_dir / 'solidus_P-S.dat'
liquidus_ps = folder_dir / 'liquidus_P-S.dat'

if all(p.is_file() for p in (solidus_pt, liquidus_pt, solidus_ps, liquidus_ps)):
Comment thread
planetmariana marked this conversation as resolved.
log.debug('Melting curve data already present locally: %s', folder_dir)
return
Comment thread
planetmariana marked this conversation as resolved.

# ------------------------------------------------------------------
# Fallback: try remote source mapping.
# ------------------------------------------------------------------
source_info = get_data_source_info(rel_dir.as_posix())
if not source_info:
raise ValueError(f'No data source mapping found for folder: {dir}')
raise ValueError(
f'No data source mapping found for folder: {rel_dir}. '
f'Also did not find local melting curve data in: {folder_dir}'
)

download(
folder=dir,
folder=rel_dir.as_posix(),
target=data_dir,
osf_id=source_info['osf_project'],
zenodo_id=source_info['zenodo_id'],
desc=f'Melting curve data: {dir}',
desc=f'Melting curve data: {rel_dir}',
)

# Create canonical _P-T copies from Zenodo legacy names (solidus.dat -> solidus_P-T.dat).
# Keep originals so md5sum checks don't trigger unnecessary re-downloads.
# ------------------------------------------------------------------
# Legacy compatibility:
# - if download contains solidus.dat / liquidus.dat, treat them as P-T
# and create canonical *_P-T.dat copies
# ------------------------------------------------------------------
for stem in ('solidus', 'liquidus'):
legacy = folder_dir / f'{stem}.dat'
canonical = folder_dir / f'{stem}_P-T.dat'
Expand Down
Loading
Loading