Skip to content

Commit 1ddee4f

Browse files
authored
Rename limit in controls to upper_limit if there's already a corresponding lower_limit (#519)
1 parent 34ffaae commit 1ddee4f

File tree

13 files changed

+87
-98
lines changed

13 files changed

+87
-98
lines changed

docs/source/changelog.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,32 @@ Changes in main
1313
Backwards-incompatible changes
1414
------------------------------
1515

16+
Renamed controls for upper limits
17+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18+
19+
The following controls in ``&controls`` for upper limits on
20+
`when to stop <reference/controls.html#when-to-stop>`_ have
21+
been renamed:
22+
23+
+------------------------------+------------------------------------+
24+
+ Old + New +
25+
+==============================+====================================+
26+
+ + +
27+
+ ``log_center_density_limit`` + ``log_center_density_upper_limit`` +
28+
+ + +
29+
+ ``log_center_temp_limit`` + ``log_center_temp_upper_limit`` +
30+
+ + +
31+
+ ``center_entropy_limit`` + ``center_entropy_upper_limit`` +
32+
+ + +
33+
+ ``max_entropy_limit`` + ``max_entropy_upper_limit`` +
34+
+ + +
35+
+------------------------------+------------------------------------+
36+
37+
You can substitute the new names for the old ones using the command
38+
line tool ``sed`` with, e.g. ::
39+
40+
$ sed 's/log_center_density_limit/log_center_density_upper_limit' -i <inlist_filename>
41+
1642
Extra inlist controls are now arrays
1743
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1844

star/defaults/controls.defaults

Lines changed: 14 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,43 +1056,29 @@
10561056
eta_center_limit = 1d99
10571057

10581058

1059-
! log_center_density_limit
1059+
! log_center_density_upper_limit
10601060
! ~~~~~~~~~~~~~~~~~~~~~~~~
1061-
1062-
! Stop when log10 of the center density exceeds this limit.
1063-
1064-
! ::
1065-
1066-
log_center_density_limit = 12d0
1067-
1068-
10691061
! log_center_density_lower_limit
10701062
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10711063

1072-
! Stop when log10 of the center density is below this limit.
1064+
! Stop when log10 of the center density is above/below the upper/lower limit.
10731065

10741066
! ::
10751067

1068+
log_center_density_upper_limit = 12d0
10761069
log_center_density_lower_limit = -1d99
10771070

10781071

1079-
! log_center_temp_limit
1072+
! log_center_temp_upper_limit
10801073
! ~~~~~~~~~~~~~~~~~~~~~
1081-
1082-
! Stop when log10 of the center temperature exceeds this limit.
1083-
1084-
! ::
1085-
1086-
log_center_temp_limit = 11d0
1087-
1088-
10891074
! log_center_temp_lower_limit
10901075
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
10911076

1092-
! Stop when log10 of the center temperature is below this limit.
1077+
! Stop when log10 of the center temperature is above/below the upper/lower limit.
10931078

10941079
! ::
10951080

1081+
log_center_temp_upper_limit = 11d0
10961082
log_center_temp_lower_limit = -1d99
10971083

10981084

@@ -1112,65 +1098,42 @@
11121098

11131099
! log_max_temp_upper_limit
11141100
! ~~~~~~~~~~~~~~~~~~~~~~~~
1115-
1116-
! stop when log10 of the maximum temperature rises above this limit.
1117-
1118-
! ::
1119-
1120-
log_max_temp_upper_limit = 99
1121-
1122-
11231101
! log_max_temp_lower_limit
11241102
! ~~~~~~~~~~~~~~~~~~~~~~~~
11251103

1126-
! stop when log10 of the maximum temperature drops below this limit.
1104+
! stop when log10 of the maximum temperature is above/below the upper/lower limit.
11271105

11281106
! ::
11291107

1108+
log_max_temp_upper_limit = 99
11301109
log_max_temp_lower_limit = -99
11311110

11321111

1133-
! center_entropy_limit
1112+
! center_entropy_upper_limit
11341113
! ~~~~~~~~~~~~~~~~~~~~
1135-
1136-
! stop when the center entropy exceeds this limit.
1137-
! in kerg per baryon
1138-
1139-
! ::
1140-
1141-
center_entropy_limit = 1d99
1142-
1143-
11441114
! center_entropy_lower_limit
11451115
! ~~~~~~~~~~~~~~~~~~~~~~~~~~
11461116

1147-
! stop when the center entropy is below this limit.
1117+
! stop when the center entropy is above/below the upper/lower limit.
11481118
! in kerg per baryon
11491119

11501120
! ::
11511121

1122+
center_entropy_upper_limit = 1d99
11521123
center_entropy_lower_limit = -1d99
11531124

11541125

1155-
! max_entropy_limit
1126+
! max_entropy_upper_limit
11561127
! ~~~~~~~~~~~~~~~~~
1157-
1158-
! stop when the max entropy exceeds this limit.
1159-
! in kerg per baryon
1160-
1161-
! ::
1162-
1163-
max_entropy_limit = 1d99
1164-
1165-
11661128
! max_entropy_lower_limit
11671129
! ~~~~~~~~~~~~~~~~~~~~~~~
11681130

1169-
! stop when the max entropy is below this limit.
1131+
! stop when the max entropy is above/below the upper/lower limit.
11701132
! in kerg per baryon
11711133

11721134
! ::
11731135

1136+
max_entropy_upper_limit = 1d99
11741137
max_entropy_lower_limit = -1d99
11751138

11761139

star/private/ctrls_io.f90

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ module ctrls_io
5151
max_model_number, relax_max_number_retries, max_number_retries, max_age, max_age_in_seconds, max_age_in_days, &
5252
num_adjusted_dt_steps_before_max_age, dt_years_for_steps_before_max_age, max_abs_rel_run_E_err, &
5353
reduction_factor_for_max_timestep, when_to_stop_rtol, when_to_stop_atol, &
54-
gamma_center_limit, eta_center_limit, log_center_temp_limit, log_max_temp_upper_limit, &
55-
log_max_temp_lower_limit , log_center_temp_lower_limit, log_center_density_limit, &
56-
log_center_density_lower_limit, center_entropy_limit, center_entropy_lower_limit, &
57-
max_entropy_limit, max_entropy_lower_limit, min_timestep_limit, non_fe_core_rebound_limit, &
54+
gamma_center_limit, eta_center_limit, log_center_temp_upper_limit, log_max_temp_upper_limit, &
55+
log_max_temp_lower_limit , log_center_temp_lower_limit, log_center_density_upper_limit, &
56+
log_center_density_lower_limit, center_entropy_upper_limit, center_entropy_lower_limit, &
57+
max_entropy_upper_limit, max_entropy_lower_limit, min_timestep_limit, non_fe_core_rebound_limit, &
5858
fe_core_infall_limit, center_Ye_lower_limit, center_R_lower_limit, non_fe_core_infall_limit, &
5959
fe_core_infall_mass, non_fe_core_infall_mass, &
6060
v_div_csound_surf_limit, v_div_csound_max_limit, Lnuc_div_L_upper_limit, Lnuc_div_L_lower_limit,&
@@ -780,17 +780,17 @@ subroutine store_controls(s, ierr)
780780
s% when_to_stop_atol = when_to_stop_atol
781781
s% gamma_center_limit = gamma_center_limit
782782
s% eta_center_limit = eta_center_limit
783-
s% log_center_temp_limit = log_center_temp_limit
783+
s% log_center_temp_upper_limit = log_center_temp_upper_limit
784784
s% log_max_temp_upper_limit = log_max_temp_upper_limit
785785
s% log_max_temp_lower_limit = log_max_temp_lower_limit
786786
s% log_center_temp_lower_limit = log_center_temp_lower_limit
787-
s% log_center_density_limit = log_center_density_limit
787+
s% log_center_density_upper_limit = log_center_density_upper_limit
788788
s% log_center_density_lower_limit = log_center_density_lower_limit
789789
s% min_timestep_limit = min_timestep_limit
790790

791-
s% center_entropy_limit = center_entropy_limit
791+
s% center_entropy_upper_limit = center_entropy_upper_limit
792792
s% center_entropy_lower_limit = center_entropy_lower_limit
793-
s% max_entropy_limit = max_entropy_limit
793+
s% max_entropy_upper_limit = max_entropy_upper_limit
794794
s% max_entropy_lower_limit = max_entropy_lower_limit
795795

796796
s% fe_core_infall_limit = fe_core_infall_limit
@@ -2455,17 +2455,17 @@ subroutine set_controls_for_writing(s, ierr)
24552455
when_to_stop_atol = s% when_to_stop_atol
24562456
gamma_center_limit = s% gamma_center_limit
24572457
eta_center_limit = s% eta_center_limit
2458-
log_center_temp_limit = s% log_center_temp_limit
2458+
log_center_temp_upper_limit = s% log_center_temp_upper_limit
24592459
log_max_temp_upper_limit = s% log_max_temp_upper_limit
24602460
log_max_temp_lower_limit = s% log_max_temp_lower_limit
24612461
log_center_temp_lower_limit = s% log_center_temp_lower_limit
2462-
log_center_density_limit = s% log_center_density_limit
2462+
log_center_density_upper_limit = s% log_center_density_upper_limit
24632463
log_center_density_lower_limit = s% log_center_density_lower_limit
24642464
min_timestep_limit = s% min_timestep_limit
24652465

2466-
center_entropy_limit = s% center_entropy_limit
2466+
center_entropy_upper_limit = s% center_entropy_upper_limit
24672467
center_entropy_lower_limit = s% center_entropy_lower_limit
2468-
max_entropy_limit = s% max_entropy_limit
2468+
max_entropy_upper_limit = s% max_entropy_upper_limit
24692469
max_entropy_lower_limit = s% max_entropy_lower_limit
24702470

24712471
fe_core_infall_limit = s% fe_core_infall_limit

star/private/do_one_utils.f90

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -828,27 +828,27 @@ integer function do_check_limits(id)
828828
call compare_to_target('center_degeneracy >= eta_center_limit', &
829829
s% center_degeneracy, s% eta_center_limit, t_eta_center_limit)
830830

831-
else if (s% log_center_temperature >= s% log_center_temp_limit) then
832-
call compare_to_target('log_center_temperature >= log_center_temp_limit', &
833-
center_value(s, s% lnT)/ln10, s% log_center_temp_limit, t_log_center_temp_limit)
831+
else if (s% log_center_temperature >= s% log_center_temp_upper_limit) then
832+
call compare_to_target('log_center_temperature >= log_center_temp_upper_limit', &
833+
center_value(s, s% lnT)/ln10, s% log_center_temp_upper_limit, t_log_center_temp_upper_limit)
834834

835835
else if (s% log_center_temperature <= s% log_center_temp_lower_limit) then
836836
call compare_to_target('log_center_temperature <= log_center_temp_lower_limit', &
837837
center_value(s, s% lnT)/ln10, s% log_center_temp_lower_limit, &
838838
t_log_center_temp_lower_limit)
839839

840-
else if (s% max_entropy >= s% max_entropy_limit) then
841-
call compare_to_target('max_entropy >= max_entropy_limit', &
842-
s% max_entropy, s% max_entropy_limit, t_max_entropy_limit)
840+
else if (s% max_entropy >= s% max_entropy_upper_limit) then
841+
call compare_to_target('max_entropy >= max_entropy_upper_limit', &
842+
s% max_entropy, s% max_entropy_upper_limit, t_max_entropy_upper_limit)
843843

844844
else if (s% max_entropy <= s% max_entropy_lower_limit) then
845845
call compare_to_target('max_entropy <= max_entropy_lower_limit', &
846846
s% max_entropy, s% max_entropy_lower_limit, &
847847
t_max_entropy_lower_limit)
848848

849-
else if (s% center_entropy >= s% center_entropy_limit) then
850-
call compare_to_target('center_entropy >= center_entropy_limit', &
851-
s% center_entropy, s% center_entropy_limit, t_center_entropy_limit)
849+
else if (s% center_entropy >= s% center_entropy_upper_limit) then
850+
call compare_to_target('center_entropy >= center_entropy_upper_limit', &
851+
s% center_entropy, s% center_entropy_upper_limit, t_center_entropy_upper_limit)
852852

853853
else if (s% center_entropy <= s% center_entropy_lower_limit) then
854854
call compare_to_target('center_entropy <= center_entropy_lower_limit', &
@@ -860,9 +860,9 @@ integer function do_check_limits(id)
860860
center_value(s, s% lnd)/ln10, s% log_center_density_lower_limit, &
861861
t_log_center_density_lower_limit)
862862

863-
else if (s% log_center_density >= s% log_center_density_limit) then
864-
call compare_to_target('log_center_density >= log_center_density_limit', &
865-
center_value(s, s% lnd)/ln10, s% log_center_density_limit, t_log_center_density_limit)
863+
else if (s% log_center_density >= s% log_center_density_upper_limit) then
864+
call compare_to_target('log_center_density >= log_center_density_upper_limit', &
865+
center_value(s, s% lnd)/ln10, s% log_center_density_upper_limit, t_log_center_density_upper_limit)
866866

867867
else if (center_gamma > s% gamma_center_limit) then
868868
call compare_to_target('center_gamma > gamma_center_limit', &

star/private/star_private_def.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ subroutine star_private_def_init
9696
termination_code_str(t_peak_burn_vconv_div_cs_limit) = 'peak_burn_vconv_div_cs_limit'
9797
termination_code_str(t_max_model_number) = 'max_model_number'
9898
termination_code_str(t_eta_center_limit) = 'eta_center_limit'
99-
termination_code_str(t_log_center_temp_limit) = 'log_center_temp_limit'
99+
termination_code_str(t_log_center_temp_upper_limit) = 'log_center_temp_upper_limit'
100100
termination_code_str(t_log_center_temp_lower_limit) = 'log_center_temp_lower_limit'
101-
termination_code_str(t_center_entropy_limit) = 'center_entropy_limit'
101+
termination_code_str(t_center_entropy_upper_limit) = 'center_entropy_upper_limit'
102102
termination_code_str(t_center_entropy_lower_limit) = 'center_entropy_lower_limit'
103-
termination_code_str(t_max_entropy_limit) = 'max_entropy_limit'
103+
termination_code_str(t_max_entropy_upper_limit) = 'max_entropy_upper_limit'
104104
termination_code_str(t_max_entropy_lower_limit) = 'max_entropy_lower_limit'
105-
termination_code_str(t_log_center_density_limit) = 'log_center_density_limit'
105+
termination_code_str(t_log_center_density_upper_limit) = 'log_center_density_upper_limit'
106106
termination_code_str(t_log_center_density_lower_limit) = 'log_center_density_lower_limit'
107107
termination_code_str(t_gamma_center_limit) = 'gamma_center_limit'
108108
termination_code_str(t_log_max_temp_upper_limit) = 'log_max_temp_upper_limit'

star/test_suite/carbon_kh/inlist_carbon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
use_simple_es_for_kap = .true.
5555

5656
! when to stop
57-
log_center_density_limit = 1
57+
log_center_density_upper_limit = 1
5858

5959
! turn off nuclear reactions
6060
eps_nuc_factor = 0

star/test_suite/carbon_kh/inlist_carbon_kh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
use_simple_es_for_kap = .true.
6060

6161
! when to stop
62-
log_center_density_limit = 8.5
62+
log_center_density_upper_limit = 8.5
6363
when_to_stop_atol = 1d-3
6464
when_to_stop_rtol = 0
6565

star/test_suite/carbon_kh/inlist_pms

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
use_simple_es_for_kap = .true.
4343

4444
! when to stop
45-
log_center_density_limit = -1.5
45+
log_center_density_upper_limit = -1.5
4646

4747
! turn off nuclear reactions
4848
eps_nuc_factor = 0

star/test_suite/custom_rates/inlist_NCO_flash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
save_model_when_terminate = .true.
1010
save_model_filename = 'final.mod'
11-
required_termination_code_string = 'log_center_temp_limit'
11+
required_termination_code_string = 'log_center_temp_upper_limit'
1212

1313
! Nuclear Reactions
1414

@@ -62,7 +62,7 @@
6262
! limit max_model_number as part of test_suite
6363
max_model_number = 600
6464

65-
log_center_temp_limit = 7.8
65+
log_center_temp_upper_limit = 7.8
6666

6767
! Accretion Controls
6868
accrete_same_as_surface = .false.

star/test_suite/custom_rates/inlist_NCO_hashimoto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
max_age = 44d7
5555

5656
! Should not reach this until next inlist
57-
log_center_temp_limit = 7.8
57+
log_center_temp_upper_limit = 7.8
5858

5959
! Accretion Controls
6060
accrete_same_as_surface = .false.

0 commit comments

Comments
 (0)