Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outgassing handled by CALLIOPE and other minor additions #176

Merged
merged 19 commits into from
Sep 10, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
python-version: ['3.10', '3.12']

env:
FWL_DATA: /home/runner/work/fwl_data
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ JANUS
agni
Agni
AGNI
calliope
Calliope
CALLIOPE

# misc
######
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ repos:
types_or: [python, pyi]
# - id: ruff-format
# types_or: [python, pyi]

exclude: 'examples/.*'
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
],
"python.analysis.exclude": [
"**/__pycache__", "petsc", ".git", "SPIDER"
]
],
"julia.environmentPath": "${workspaceFolder}/AGNI"
}
7 changes: 7 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ You will need to setup Python (>=3.10) on your system. This can be done via brew
pip install -e JANUS/.
```

- CALLIOPE outgassing model

```console
git clone [email protected]:FormingWorlds/CALLIOPE
pip install -e CALLIOPE/.
```

9. Setup PROTEUS coupled framework

- Get the remaining Python dependencies
Expand Down
2 changes: 1 addition & 1 deletion examples/dummy/init_coupler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ P_top = 1.0e-6 # bar, Pressure at TOA
##### PROTEUS settings

iter_max = 9000
log_level = 'DEBUG'
log_level = 'INFO'

# Output subdirectory name (relative to output folder)
dir_output = 'dummy'
Expand Down
Binary file modified examples/dummy/plot_elements.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dummy/plot_escape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/dummy/plot_fluxes_global.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/dummy/plot_global_lin.png
Copy link
Member

@lsoucasse lsoucasse Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All plots in examples/dummy look the same. Could you confirm they are different?
Same comment for examples/earth_demo pdf files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They probably are indeed the same as before, since this PR doesn't change any of the physics involved in running the simulations. The only changes related to that are ensuring that PROTEUS doesn't try to plot the atmosphere fluxes and structure when using the dummy model.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did re-run the examples to make sure that they were generated with a recent version of the code, although this would be better solved by #165

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum... the csv output displays small differences. So I guess it is fine to upload the new plots.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does - that's interesting. The differences are quite small, but I think this is something we should keep in mind, especially as we get closer to setting up proper tests for PROTEUS.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/dummy/plot_global_log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/dummy/plot_interior.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/dummy/plot_interior_cmesh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/dummy/plot_observables.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/dummy/plot_sflux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,136 changes: 625 additions & 4,511 deletions examples/dummy/proteus_00.log

Large diffs are not rendered by default.

400 changes: 200 additions & 200 deletions examples/dummy/runtime_helpfile.csv

Large diffs are not rendered by default.

Binary file modified examples/earth_demo/plot_atmosphere.pdf
Binary file not shown.
Binary file added examples/earth_demo/plot_emission.pdf
Binary file not shown.
Binary file modified examples/earth_demo/plot_fluxes_atmosphere.pdf
Binary file not shown.
Binary file modified examples/earth_demo/plot_fluxes_global.pdf
Binary file not shown.
Binary file modified examples/earth_demo/plot_global_lin.pdf
Binary file not shown.
Binary file modified examples/earth_demo/plot_global_log.pdf
Binary file not shown.
Binary file modified examples/earth_demo/plot_interior.pdf
Binary file not shown.
Binary file modified examples/earth_demo/plot_interior_cmesh.pdf
Binary file not shown.
Binary file modified examples/earth_demo/plot_observables.pdf
Binary file not shown.
Binary file modified examples/earth_demo/plot_sflux.pdf
Binary file not shown.
Binary file modified examples/earth_demo/plot_stacked.pdf
Binary file not shown.
3,658 changes: 1,876 additions & 1,782 deletions examples/earth_demo/proteus_00.log

Large diffs are not rendered by default.

178 changes: 89 additions & 89 deletions examples/earth_demo/runtime_helpfile.csv

Large diffs are not rendered by default.

170 changes: 170 additions & 0 deletions examples/hd63433d/init_coupler.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
########## PROTEUS configuration file

##### Star configuration

star_model = 1 # Evolution model to use for star (0: Spada, 1: Baraffe)
star_mass = 0.99 # M_sun, mass of star
star_radius_modern = 0.912 # R_sun, radius of star (TODAY)
star_temperature_modern = 5640.0 # K, temperature of star (TODAY)
star_luminosity_modern = 0.753 # L_sun, luminosity of star (TODAY) used for Baraffe model
star_age_modern = 4.14e8 # yr, age of star (TODAY)
star_rot_pctle = 50.0
star_spectrum = 'stellar_spectra/Named/sun.txt' # Stellar spectrum file at 1 AU (TODAY)

##### Planet configuration
mean_distance = 0.0503 # AU, star-planet distance
mass = 1.0 # M_earth
radius = 1.073 # R_earth

zenith_angle = 54.74 # Tidally locked [Hamano+15, acos(1/sqrt(3)) ]
asf_scalefactor = 0.25 # absorbed solar flux scale factor = 1/4
albedo_s = 0.2 # surface albedo
albedo_pl = 0.0 # Bond albedo (scattering)

P_top = 1.0e-5 # bar, Pressure at TOA

##### PROTEUS settings

iter_max = 9000
log_level = 'DEBUG'

# Output subdirectory name (relative to output folder)
dir_output = 'hd63433d'

# Choose times
time_star = 50.0e6 # yr, time since star formation
time_target = 4.567e+9 # yr, target time for MO evolution

# SOCRATES spectral file to use (relative to FWL_DATA folder)
spectral_file = 'spectral_files/Dayspring/256/Dayspring.sf'

# Stellar heating toggle, 0: disabled | 1: enabled
stellar_heating = 1

# Time-stepping stuff
plot_iterfreq = 1 # Plotting frequency, 0: wait until completion | n: every n iterations
plot_format = 'png' # Plotting image file format
sspec_dt_update = 3e6 # Time intervals at which to re-calculate the stellar spectrum
sinst_dt_update = 1e2 # Time intervals at which to re-calculate the instellation
dt_maximum = 1e7 # Maximum time-step
dt_minimum = 3e2 # Minimum time-step
dt_method = 1 # Time-stepping method, 0: proportional | 1: adaptive | 2: maximum
dt_propconst = 52.0 # Proportionality constant for dt_method=0
dt_atol = 0.02 # Step size atol
dt_rtol = 0.07 # Step size rtol
dt_initial = 1e3 # Inital step size

# Flux convergence scheme and tolerances for surface equilibration
shallow_ocean_layer = 0 # 0: off | 1: on
F_atm_bc = 0 # Boundary condition choice for F_atm, 0: TOA | 1: Surface
skin_d = 0.01 # m
skin_k = 2.0 # W m-1 K-1
prevent_warming = 1 # Require that the planet only cool down over time, 0: disabled | 1: enabled

# Break at solidification?
solid_stop = 1
phi_crit = 0.005 # melt fraction

# Break at steady state?
steady_stop = 1
steady_flux = 0.8 # Maximum absolute value of F_atm allowed for convergence
steady_dprel = 3.0e-9 # Percentage change in melt fraction over time (dp/p)/dt*100

# Break at small flux?
emit_stop = 1 # Enable this break condition
F_crit = 0.1 # Model will terminate when |F_atm| < F_crit

# Atmospheric escape
escape_model = 0 # Escape model to be used, 0: None | 1: ZEPHYRUS | 2: Dummy
escape_stop = 3e-4 # Terminate when atm mass drops below this fraction of its initial mass
escape_dummy_rate = 0.0 # Bulk escape rate for dummy escape model [kg s-1]


# Method for solving for T(p) profile
atmosphere_model = 1 # Atmosphere model to be used, 0: JANUS | 1: AGNI
atmosphere_surf_state = 2 # Atmosphere bottom edge boundary condition, 0: free | 1: fixed at T_surf | 2: conductive skin

# Number of levels
atmosphere_nlev = 40

# Temperature limits throughout atmosphere [K]
min_temperature = 0.5
max_temperature = 5000.0

# Clouds
water_cloud = 0 # enable water cloud radiative effects? (1: yes, 0: no)
alpha_cloud = 0.0 # condensate retention fraction (1 -> fully retained)

# Tropopause type, 0: none | 1: skin temperature | 2: dynamic
tropopause = 1

# Rayleigh scattering, 0: Disabled | 1: Enabled
rayleigh = 1

# Atmospheric chemistry, 0: Disabled | 1: Equilibrium | 2: Kinetics
atmosphere_chemistry = 0

##### SPIDER-specific settings

interior_nlev = 290
grain_size = 0.1

# Mixing length parameterization: 1: variable | 2: constant
mixing_length = 2

# Standard tolerance for solvers
solver_tolerance = 1.0e-10

# Maximum absolute surface temperature change [K]
tsurf_poststep_change = 20.0

# Maximum fractional surface temperature change [fraction]
tsurf_poststep_change_frac = 0.01

# Fractional core radius
planet_coresize = 0.55

# Initial entropy conditions for interior
ic_adiabat_entropy = 3200.0
ic_dsdr = -4.698e-06

# Atmosphere heat flux start guess, adjusted during runtime [W/m^2]
F_atm = 1e5

# Oxygen fugacity offset relative to the IW buffer (log10 units)
fO2_shift_IW = 0

# Enable solving for initial partial pressures (0: off | 1: on)
solvevol_use_params = 1

# Parameters used to solve for initial partial pressures (when solvepp_use_params = 1)
Phi_global = 1.0 # Mantle melt fraction initial guess
CH_ratio = 1.0 # C/H ratio
hydrogen_earth_oceans = 8.0 # Hydrogen inventory in units of equivalent Earth oceans
nitrogen_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass
sulfur_ppmw = 300.0 # Sulfur inventory in ppmw relative to mass of melt

# Prescribed injected partial pressures [bar]
H2O_included = 1
H2O_initial_bar = 0.0

CO2_included = 1
CO2_initial_bar = 0.0

N2_included = 1
N2_initial_bar = 0.0

S2_included = 1
S2_initial_bar = 0.0

SO2_included = 1
SO2_initial_bar = 0.0

H2_included = 1
H2_initial_bar = 0.0

CH4_included = 1
CH4_initial_bar = 0.0

CO_included = 1
CO_initial_bar = 0.0
Binary file added examples/hd63433d/plot_atmosphere.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_emission.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_fluxes_atmosphere.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_fluxes_global.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_global_lin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_global_log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_interior.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_interior_cmesh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_observables.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_sflux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_sflux_cross.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_stacked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/hd63433d/plot_vmr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading