Skip to content

Commit 876824e

Browse files
committed
Merge remote-tracking branch 'origin' into EbF/update_massive_star_test_suites
2 parents 4517eef + d08dbbb commit 876824e

File tree

17 files changed

+1011
-139
lines changed

17 files changed

+1011
-139
lines changed

astero/defaults/astero_search.defaults

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
! + ``Rcz``
5050

5151
! where ``M_H``, ``surface_Z_div_X``, ``surface_He`` and ``Rcz``
52-
! are now implemented in the standard ``run_star_extras.f90`.
52+
! are now implemented in the standard ``run_star_extras.f90``.
5353
! The other options fall back to the history columns.
5454

5555
! To implement your own constraints, create the appropriate case
@@ -85,6 +85,8 @@
8585
! constraint_sigma(:)
8686
! ~~~~~~~~~~~~~~~~~~~
8787

88+
! ::
89+
8890
constraint_name(:) = '' ! change this to whatever you want
8991
constraint_target(:) = 0
9092
constraint_sigma(:) = 0
@@ -102,7 +104,7 @@
102104
! Z_div_X_solar
103105
! ~~~~~~~~~~~~~
104106
! Convenience parameter leftover from the old interface that
105-
! can be used when calculating things relative to solar metallicity.
107+
! can be used when calculating things relative to solar metallicity. ::
106108

107109
Z_div_X_solar = 0.02293d0
108110

@@ -130,7 +132,7 @@
130132

131133
! dt_for_smaller_steps_before_age_target
132134
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133-
! This should be much smaller than ``age_sigma``.
135+
! This should be much smaller than ``age_sigma``. ::
134136

135137
dt_for_smaller_steps_before_age_target = 0.0065d8 ! 1/10 age_sigma
136138

@@ -570,6 +572,7 @@
570572
! parameters in the ``set_param`` subroutine in
571573
! ``run_star_extras.f90``, or rely on the default
572574
! implementation, which provides the legacy options
575+
573576
! * ``initial_mass``
574577
! * ``initial_Y``
575578
! * ``initial_FeH``
@@ -587,7 +590,7 @@
587590
! ~~~~~~~~~~
588591
! If ``.true.``, that parameter will be varied by the search.
589592
! If ``.false.``, that parameter will be fixed at the first value
590-
! (see ``first_param``).
593+
! (see ``first_param``). ::
591594

592595
vary_param(:) = .false.
593596

@@ -621,7 +624,7 @@
621624
! ~~~~
622625
! Legacy controls from the old interface, which is available with
623626
! the default ``run_star_extras.f90`` by using the parameter names
624-
! ``initial_Y`` and ``initial_FeH`.
627+
! ``initial_Y`` and ``initial_FeH``.
625628

626629
! If ``Y_depends_on_Z = .false.``, ``Y`` is a parameter like any other and you should set
627630
! ``vary_Y``, ``first_Y``, ``min_Y`` and ``max_Y`` (and ``delta_Y`` for a grid).
@@ -941,7 +944,7 @@
941944
! ~~~~~~~~~~~~~~~~~~~~~~~~~
942945

943946
! Formats for writing floats (reals), integers and characters
944-
! (strings) to the results file.
947+
! (strings) to the results file. ::
945948

946949
astero_results_dbl_format = '(1pes26.16)'
947950
astero_results_int_format = '(i26)'
@@ -1166,16 +1169,16 @@
11661169
! The GYRE controls are read from the ``gyre_input_file``.
11671170
! Rich offers the following comments on setting them:
11681171

1169-
! > I suggest setting freq_min to 0.9*MINVAL(l0_obs),
1170-
! > and freq_max to 1.1*MAXVAL(l0_obs)
1171-
! > (similarly for the other l values).
1172+
! I suggest setting freq_min to 0.9*MINVAL(l0_obs),
1173+
! and freq_max to 1.1*MAXVAL(l0_obs)
1174+
! (similarly for the other l values).
11721175

1173-
! > freq_units should be 'UHZ',
1174-
! > and set grid_type to 'LINEAR'.
1176+
! freq_units should be 'UHZ',
1177+
! and set grid_type to 'LINEAR'.
11751178

1176-
! > For n_freq, I suggest either setting it to 10*(freq_max - freq_min)/dfreq,
1177-
! > where dfreq is the estimated frequency spacing; or, set it to 10*nl0.
1178-
! > The factor 10 is arbitrary, but seems to be a good safety factor.
1179+
! For n_freq, I suggest either setting it to 10*(freq_max - freq_min)/dfreq,
1180+
! where dfreq is the estimated frequency spacing; or, set it to 10*nl0.
1181+
! The factor 10 is arbitrary, but seems to be a good safety factor.
11791182

11801183
! gyre_input_file
11811184
! ~~~~~~~~~~~~~~~

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# Defining the exact version will make sure things don't break
33
sphinx==5.3.0
44
sphinx_rtd_theme==1.1.1
5-
readthedocs-sphinx-search==0.1.1
5+
readthedocs-sphinx-search==0.3.2
66

docs/source/changelog.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ produced GYRE-format files that are backward-compatible with older
7777
GYRE releases. (If using GSM-format files, set to 110 instead for
7878
backward compatibility).
7979

80+
White Dwarf O/Ne Phase Separation
81+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82+
83+
Phase separation for crystallizing white dwarfs now supports options
84+
for either C/O or O/Ne phase diagrams. You can select the appropriate
85+
option with the ``phase_separation_option`` in the ``&controls`` inlist
86+
section (see documentation at :ref:`reference/controls:phase_separation_option`).
87+
The phase diagram for O/Ne separation comes from
88+
`Blouin & Daligault (2021b) <https://ui.adsabs.harvard.edu/abs/2021ApJ...919...87B/abstract>`_.
89+
8090
Massive Star test_suite Updates
8191
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8292
The ``12Msun_pre_ms_to_core_collapse``, ``20Msun_pre_ms_to_core_collapse``, and ``zams_to_cc_80``
@@ -99,6 +109,10 @@ starting models has been recalculated with a more stringent stopping condition,
99109
and now all pre-computed ZAMS models have a central hydrogen mass fraction very
100110
near 0.697.
101111

112+
The ``fixed_Teff``, ``fixed_Tsurf``, ``fixed_Psurf``, and ``fixed_Psurf_and_Tsurf``
113+
atmosphere options have been reimplemented, although we caution users that their
114+
implementation might conflict with mlt_option = ``TDC``.
115+
102116
Changes in r23.05.1
103117
===================
104118

docs/source/developing/collaboration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ MESA (e.g., contribute a hook/routine, make a pull request).
2727

2828
*MESA Developers (MD)*: These are individuals committed to improving
2929
MESA and its infrastructure (e.g., the MESA Test Hub). Instructions on how to become
30-
a developer are found :doc:`here <developing/new_developers>`.
30+
a developer are found :doc:`here <new_developers>`.
3131

3232
Responsibilities
3333
of developers include:
@@ -92,7 +92,7 @@ fulfill their responsibilities, they must inform the MD.
9292
Removal from MD, MTC, and MAC can be for inactivity,
9393
harm to the Project, or simply opting out.
9494

95-
Onboarding to the MD is described :doc:`here <developing/new_developers>`.
95+
Onboarding to the MD is described :doc:`here <new_developers>`.
9696

9797
Instrument Paper Principles
9898
===========================

docs/source/installation.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ uses export to set variables):
108108
export MESASDK_ROOT=/Applications/mesasdk
109109
source $MESASDK_ROOT/bin/mesasdk_init.sh
110110
111+
# add shmesa (the MESA command line tool) to your PATH
112+
export PATH=$PATH:$MESA_DIR/scripts/shmesa
113+
111114
112115
If your machine uses csh as its shell, use ``setenv`` instead of ``export``.
113116

docs/source/news/2016-02-03-r8118.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ post <https://lists.mesastar.org/pipermail/mesa-users/2016-February/006205.html>
1212
to learn more.
1313

1414
- Almost all extras routines in run_star_extras and run_binary_extras
15-
are now implemented as hooks, in a similar way to all other_\*
15+
are now implemented as hooks, in a similar way to all ``other_\*``
1616
routines. If you use a custom run_star_extras, you need to slightly
1717
modify it for it to be compatible with this and future versions.
1818

docs/source/news/2017-09-01-three-updates.rst

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,27 @@ This week has seen three new/updated projects announced on mesa-users.
88
announces <https://lists.mesastar.org/pipermail/mesa-users/2017-August/007853.html>`__
99
`MESA-Docker <https://github.com/evbauer/MESA-Docker>`__:
1010

11-
::
12-
13-
It’s a Docker container with MESA already installed, and it should
11+
*It’s a Docker container with MESA already installed, and it should
1412
work with any OS that supports Docker, including Windows 10. This
1513
should serve as a useful tool for those who are ready to invest
1614
some extra effort to step beyond the limited options of MESA-Web,
1715
but not yet comfortable configuring their environment for full
18-
installation.
16+
installation.*
1917

2018
`Rob Farmer
2119
announces <https://lists.mesastar.org/pipermail/mesa-users/2017-August/007856.html>`__
2220
`pyMesa <https://github.com/rjfarmer/pyMesa>`__:
2321

24-
::
25-
26-
This is a set of low level python bindings for MESA to allow easy
22+
*This is a set of low level python bindings for MESA to allow easy
2723
access to the individual MESA modules. This is aimed for those
2824
people who want to quickly get a result from a MESA module and
2925
don’t want to worry about getting fortran code compiled and
30-
working.
26+
working.*
3127

3228
`Carl Fields
3329
announces <https://lists.mesastar.org/pipermail/mesa-users/2017-September/007864.html>`__
3430
updates to `MESA-Web <http://mesa-web.asu.edu/>`__:
3531

36-
::
37-
38-
1. Users can now choose to upload a custom reaction rate.
39-
2. More mixing parameters available for calculations.
40-
3. Jobs now run for 4hrs or until iron core collapse.
32+
1. *Users can now choose to upload a custom reaction rate.*
33+
2. *More mixing parameters available for calculations.*
34+
3. *Jobs now run for 4hrs or until iron core collapse.*

docs/source/summer_schools.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
MESA Summer Schools
2-
=================
2+
===================
33

44
***
55
MESA Summer School Programs -- this page under construction!
66
***
77

88
History of the MESA Summer School Program
9-
--------------------
9+
-----------------------------------------
1010

1111
The MESA Summer Schools have traditionally been held in Santa Barbara, California, until 2022. The 2023 MESA Summer School program, branded as MESA@Konkoly, was held in Budapest, Hungary. As of 2023, MESA Summer Schools can be run anywhere in the world. The involvement of the MESA developers is encouraged, and we are happy to help.
1212

1313

1414
How to run a MESA Summer School
15-
--------------------
15+
-------------------------------
1616

1717
Preparing a good program takes about a year. Historically, the program has taken place in the middle of August. Assuming this timing, preparations for next year's program should begin in September.
1818

1919

2020
1 year + out (September/October)
21-
--------------------
21+
--------------------------------
2222

2323
- Book a venue
2424
- Choose your organizational team
2525

2626

2727
9 months out (November)
28-
--------------------
28+
-----------------------
2929

3030
- Contact lecturers. Try to invite people with a diverse set of research areas and consider focusing on topics that have not been covered in past programs (see previous summer school pages and agendas for this information)
31-
- Contact TAs.
31+
- Contact TAs.

scripts/shmesa/README.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
**shmesa**: a set of bash utilities providing convenience functions for MESA
2+
3+
To install, simply add `PATH=$PATH:$MESA_DIR/scripts/shmesa` to your `~/.bashrc` and start a new terminal.
4+
5+
To use, simply call: `shmesa`
6+
7+
```bash
8+
> shmesa
9+
_ __ __ _____ ____ _
10+
___| |__ | \/ | ____/ ___| / \
11+
/ __| '_ \| |\/| | _| \___ \ / _ \
12+
\__ \ | | | | | | |___ ___) / ___ \
13+
|___/_| |_|_| |_|_____|____/_/ \_\
14+
15+
Usage: shmesa [work|change|defaults|cp|grep|extras|zip|help] [arguments]
16+
17+
Subcommands:
18+
work copy the work directory to the current location
19+
change change a parameter in the given inlist
20+
defaults copy the history/profile defaults to the current location
21+
cp copy a MESA directory without copying LOGS, photos, etc.
22+
grep search the MESA source code for a given string
23+
extras fill in the full run_star_extras.f90 template
24+
zip prepare a MESA directory for sharing
25+
help display this helpful message
26+
-h get additional details about any of the above
27+
```
28+
29+
Want more details about any of the subprograms? Just run any of them with `-h`, for example
30+
```bash
31+
> shmesa cp -h
32+
Usage: shmesa cp source_dir target_dir
33+
Copies a MESA working directory but without copying LOGS, photos, or .mesa_temp_cache
34+
```
35+
36+
### Some example usage
37+
You can use this for example to make a grid of models, and e.g. include the output `delta_nu` and `nu_max` in `LOGS` with
38+
```bash
39+
### Make a grid in M and Z in a few lines of bash
40+
41+
# copy over a new work directory
42+
shmesa work "grid_dir"
43+
cd grid_dir
44+
./mk
45+
46+
# output asteroseismic quantities in `LOGS/history.data`
47+
shmesa defaults delta_nu nu_max
48+
49+
# loop through values of M and Z and run MESA
50+
for M in 1.0 1.5 2.0; do
51+
for Z in 0.01 0.02 0.03; do
52+
shmesa change inlist_project \
53+
initial_mass $M \
54+
Zbase $Z \
55+
initial_z $Z
56+
./star inlist_project
57+
mv LOGS "M='$M'_'Z='$Z'"
58+
done
59+
done
60+
61+
```
62+
63+
64+
### Tests
65+
There is functionality for testing all the subprograms:
66+
67+
```bash
68+
> shmesa test
69+
>> TESTING SHMESA <<
70+
71+
>>> test: shmesa work
72+
SHMESA> DEBUG: Calling work with arguments: shmesa_test_work
73+
gfortran -Wno-uninitialized -fno-range-check -fmax-errors=7 -fprotect-parens -fno-sign-zero ...
74+
<<< success
75+
76+
77+
>>> test: shmesa change
78+
SHMESA> DEBUG: Calling change with arguments: inlist_project pgstar_flag .false.
79+
SHMESA> DEBUG: SHMESA> BACKING UP: inlist_project inlist_project.bak
80+
SHMESA> DEBUG: Calling change with arguments: inlist_project initial_mass 1.2 Z 0.01 Zbase 0.01
81+
SHMESA> DEBUG: SHMESA> BACKING UP: inlist_project inlist_project.bak
82+
<<< success
83+
84+
...
85+
86+
>>> test: shmesa defaults
87+
SHMESA> DEBUG: Calling defaults with arguments: nu_max delta_nu
88+
SHMESA> DEBUG: Calling defaults with arguments: logM
89+
SHMESA> DEBUG: SHMESA> BACKING UP: profile_columns.list
90+
SHMESA> DEBUG: SHMESA> BACKING UP: history_columns.list
91+
<<< success
92+
93+
all done!
94+
```
95+
96+
### Development
97+
There's instructions inside the code for adding a new bash subprogram to this driver:
98+
```bash
99+
### DEVELOPMENT USE
100+
### TEMPLATE FOR NEW SHMESA FUNCTIONS
101+
shmesa_template () {
102+
if shmesa_check_h_flag "$@"; then
103+
echo "Usage: mesa funcname arg [optional arg]"
104+
echo "put discription here"
105+
return 0
106+
fi
107+
108+
UNTESTED # comment this out when done (crashes the program to avoid problems)
109+
110+
# parse required variables
111+
local example_var=5
112+
if [[ ! -z $1 ]]; then # check if it's set
113+
example_var=$1
114+
#else # uncomment if you want this to be a required variable
115+
# echo "Error: "
116+
# return 1
117+
fi
118+
#shift # and then copy this block to parse the next one, for example
119+
120+
# afterwards, update:
121+
# 1. shmesa_test
122+
# 2. shmesa_help
123+
# 3. parser at the end of this file
124+
}
125+
```

0 commit comments

Comments
 (0)