Skip to content

Commit

Permalink
Merge pull request #297 from FormingWorlds/hn/terminate
Browse files Browse the repository at this point in the history
Update termination criteria
  • Loading branch information
nichollsh authored Nov 28, 2024
2 parents c424ed8 + ea47959 commit 03c7329
Show file tree
Hide file tree
Showing 12 changed files with 216 additions and 217 deletions.
8 changes: 1 addition & 7 deletions input/aragog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
# required number of iterations
[params.stop.iters]
enabled = true
minimum = 3
minimum = 5
maximum = 9000

# required time constraints
Expand All @@ -73,12 +73,6 @@ author = "Harrison Nicholls, Tim Lichtenberg"
atol = 0.2 # absolute tolerance [W m-2]
rtol = 1e-3 # relative tolerance

# steady state
[params.stop.steady]
enabled = false
F_crit = 0.8 # Maximum absolute value of F_atm allowed for convergence
dprel = 1.0e-9 # Percentage change in melt fraction over time (dp/p)/dt*100

[params.stop.escape]
enabled = true
mass_frac = 3e-4 # Stop when atm_mass < this frac of initial mass
Expand Down
8 changes: 1 addition & 7 deletions input/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
# required number of iterations
[params.stop.iters]
enabled = true
minimum = 3
minimum = 5
maximum = 9000

# required time constraints
Expand All @@ -73,12 +73,6 @@ author = "Harrison Nicholls, Tim Lichtenberg"
atol = 0.2 # absolute tolerance [W m-2]
rtol = 1e-3 # relative tolerance

# steady state
[params.stop.steady]
enabled = false
F_crit = 0.8 # Maximum absolute value of F_atm allowed for convergence
dprel = 1.0e-9 # Percentage change in melt fraction over time (dp/p)/dt*100

[params.stop.escape]
enabled = true
mass_frac = 3e-4 # Stop when atm_mass < this frac of initial mass
Expand Down
8 changes: 1 addition & 7 deletions input/hd63433d.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
# required number of iterations
[params.stop.iters]
enabled = true
minimum = 3
minimum = 5
maximum = 9000

# required time constraints
Expand All @@ -73,12 +73,6 @@ author = "Harrison Nicholls, Tim Lichtenberg"
atol = 0.1 # absolute tolerance [W m-2]
rtol = 1e-3 # relative tolerance

# steady state
[params.stop.steady]
enabled = false
F_crit = 1.8 # Maximum absolute value of F_atm allowed for convergence
dprel = 3.0e-10 # Percentage change in melt fraction over time (dp/p)/dt*100

[params.stop.escape]
enabled = true
mass_frac = 3e-4 # Stop when atm_mass < this frac of initial mass
Expand Down
8 changes: 1 addition & 7 deletions input/k218b.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
# required number of iterations
[params.stop.iters]
enabled = true
minimum = 3
minimum = 5
maximum = 9000

# required time constraints
Expand All @@ -73,12 +73,6 @@ author = "Harrison Nicholls, Tim Lichtenberg"
atol = 0.1 # absolute tolerance [W m-2]
rtol = 1e-3 # relative tolerance

# steady state
[params.stop.steady]
enabled = false
F_crit = 1.8 # Maximum absolute value of F_atm allowed for convergence
dprel = 3.0e-10 # Percentage change in melt fraction over time (dp/p)/dt*100

[params.stop.escape]
enabled = false
mass_frac = 3e-4 # Stop when atm_mass < this frac of initial mass
Expand Down
16 changes: 5 additions & 11 deletions input/l9859d.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[params.out]
path = "l9859d"
logging = "INFO"
plot_mod = 5 # Plotting frequency, 0: wait until completion | n: every n iterations
plot_mod = 10 # Plotting frequency, 0: wait until completion | n: every n iterations
plot_fmt = "png" # Plotting image file format, "png" or "pdf" recommended

# time-stepping
Expand All @@ -53,14 +53,14 @@ author = "Harrison Nicholls, Tim Lichtenberg"
# required number of iterations
[params.stop.iters]
enabled = true
minimum = 3
minimum = 5
maximum = 9000

# required time constraints
[params.stop.time]
enabled = true
minimum = 1.0e3 # yr, model will certainly run to t > minimum
maximum = 4.567e+9 # yr, model will terminate when t > maximum
maximum = 1e+9 # yr, model will terminate when t > maximum

# solidification
[params.stop.solid]
Expand All @@ -71,13 +71,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[params.stop.radeqm]
enabled = true
atol = 1e-2 # absolute tolerance [W m-2]
rtol = 1e-2 # relative tolerance

# steady state
[params.stop.steady]
enabled = false
F_crit = 1.8 # Maximum absolute value of F_atm allowed for convergence
dprel = 3.0e-10 # Percentage change in melt fraction over time (dp/p)/dt*100
rtol = 2e-2 # relative tolerance

[params.stop.escape]
enabled = true
Expand Down Expand Up @@ -140,7 +134,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"

[atmos_clim.agni]
p_top = 1.0e-4 # bar, top of atmosphere grid pressure
spectral_group = "Dayspring" # which gas opacities to include
spectral_group = "Honeyside" # which gas opacities to include
spectral_bands = "256" # how many spectral bands?
num_levels = 42 # Number of atmospheric grid levels
chemistry = "eq" # "none" | "eq"
Expand Down
8 changes: 1 addition & 7 deletions input/trappist1c.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
# required number of iterations
[params.stop.iters]
enabled = true
minimum = 3
minimum = 5
maximum = 9000

# required time constraints
Expand All @@ -73,12 +73,6 @@ author = "Harrison Nicholls, Tim Lichtenberg"
atol = 0.1 # absolute tolerance [W m-2]
rtol = 1e-3 # relative tolerance

# steady state
[params.stop.steady]
enabled = false
F_crit = 1.8 # Maximum absolute value of F_atm allowed for convergence
dprel = 3.0e-10 # Percentage change in melt fraction over time (dp/p)/dt*100

[params.stop.escape]
enabled = true
mass_frac = 3e-4 # Stop when atm_mass < this frac of initial mass
Expand Down
21 changes: 0 additions & 21 deletions src/proteus/config/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,13 @@ class StopParams:
Parameters for solidification criteria.
radeqm: StopRadeqm
Parameters for radiative equilibrium criteria.
steady: StopSteady
Parameters for steady state criteria.
escape: StopEscape
Parameters for escape criteria.
"""
iters: StopIters
time: StopTime
solid: StopSolid
radeqm: StopRadeqm
steady: StopSteady
escape: StopEscape


Expand Down Expand Up @@ -210,24 +207,6 @@ class StopRadeqm:
rtol: float = field(validator=ge(0))


@define
class StopSteady:
"""Parameters for steady state stopping criteria.
Attributes
----------
enabled: bool
Enable criteria if True
F_crit: float
Necessary (not sufficient) condition on maximum absolute net outgoing flux [W m-2].
dprel: float
Necessary (not sufficient) condition maximum change in melt fraction over time `(dp/p)/dt*100` [yr-1].
"""
enabled: bool
F_crit: float = field(validator=gt(0))
dprel: float = field(validator=gt(0))


@define
class StopEscape:
"""Parameters for escape stopping criteria.
Expand Down
Loading

0 comments on commit 03c7329

Please sign in to comment.