Skip to content

Commit b4077b1

Browse files
author
William Wolf
committed
Clarify version updates and clean up headers.
1 parent 9dce546 commit b4077b1

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

mesa_script/README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
MesaScript
22
==========
33

4-
###MESA Requirement!
4+
### MESA Requirement!
55
In its current state, MesaScript requires MESA rev. 5596 or above. This is due
66
to a sensitivity to where the `'.inc'` files are stored on earlier versions. If
77
there is demand for MesaScript for earlier revisions, I will look into making
8-
it backward compatible.
8+
it backward compatible. It has been updated to work in the `git` era (beyond
9+
version 15140), including conditionally adding the `&kap` and `&eos` namelists
10+
if they are present. It does not currently support `astero` inlists out of the
11+
box.
912

10-
###The Short Short Version
13+
### The Short Short Version
1114
To get up and running fast, skip to installation, then try and use the included
1215
sample file, `sample.rb` (via running `ruby sample.rb` in the command line). The
1316
comments in `sample.rb` should get you started, especially if you have at least
1417
a little Ruby know-how.
15-
###What is MesaScript?
18+
### What is MesaScript?
1619
Lightweight, Ruby-based language that provides a powerful way to make inlists
1720
for MESA projects. Really, MesaScript is a DSL (domain-specific language) built
1821
on top of Ruby, so Ruby code "just works" inside MesaScript (if you're familiar
@@ -43,7 +46,7 @@ are pretty wide open. You could easily make a script that starts with a given
4346
set of parameters, run MESA star, then use the output of that run to dictate a
4447
new inlist and run, creating a chain (maybe a MESA root find of sorts).
4548

46-
###Installation
49+
### Installation
4750
MesaScript is now available as a gem! Assuming you have the `gem` command up
4851
and running (you probably do, but if not, check out
4952
[RubyGems](https://rubygems.org) to get it up and running). Simply run
@@ -91,7 +94,7 @@ work. The `mesa_script.rb` file generates all the necessary data it needs from
9194
the MESA source on the fly (this also makes it nearly MESA version
9295
independent).
9396

94-
###Basic Usage
97+
### Basic Usage
9598
The `mesa_script.rb` file defines just one class, Inlist, which we'll interact
9699
with primarily through one class method, `make_inlist`. Just put the following
97100
in a file to make a blank inlist:
@@ -113,14 +116,14 @@ by the way). Then to actually generate the inlist, enter
113116
MesaScript, and you did so using fewer lines than it would have taken to
114117
actually make that inlist on your own (technically)!
115118

116-
###Entering Inlist Commands
119+
### Entering Inlist Commands
117120
Making blank inlists is boring, so now let's cover how you actually make useful
118121
inlists. For mesa inlists, there are really only two types of declarations:
119122
those for scalars and those for array. Let's talk about scalars first, since
120123
they are far more common. Then we'll get to the more complicated array
121124
assignments.
122125

123-
####Scalar Assignments
126+
#### Scalar Assignments
124127
As an example, let's say we want to set the initial mass of our star to 2.0
125128
solar masses. The inlist command for this is `initial_mass`. In a regular
126129
inlist file, we would need to put this in the proper namelist, `&controls` as
@@ -143,7 +146,7 @@ called `initial_mass`. (For the person curious as to why I didn't program this
143146
functionality in, google something like "instance_eval setter method" to
144147
discover what took me too long to figure out.)
145148

146-
####Array Assignments
149+
#### Array Assignments
147150
As an example, let's say we want to set a lower limit on a certain central
148151
abundance as a stopping condition. Then we would, at the minimum, need to set
149152
the inlist command `xa_central_lower_limit_species(1) = 'h1'`, for example. In MesaScript, there are three ways to do this:
@@ -160,7 +163,7 @@ work:
160163
I tried to program this functionality in, and the kind people at
161164
[StackOverflow](http://stackoverflow.com/questions/21036873/how-do-i-write-a-method-to-edit-an-array-hash-using-parentheses-instead-of-squar/21044781?noredirect=1#21044781) kindly but firmly convinced me it was utterly impossible to to with Ruby without writing a parser of my own. Just stick to the bracket syntax or the less natural parentheses/space notations.
162165

163-
####Other Details
166+
#### Other Details
164167
That's really all you need to know to start making inlists with MesaScript,
165168
though I should remind you, especially if you aren't familiar with Ruby, about
166169
the basic types of entries you might use. Most inlist commands are one of the
@@ -218,10 +221,10 @@ inlist commands so you don't forget to change a particular command when you
218221
move on to a different run (like forgetting to change a `LOG_dir`, which I've
219222
done a few too many times and thus overwritten some data).
220223

221-
###Deeper and Deeper...
224+
### Deeper and Deeper...
222225
Are you still reading this? Well, you must want to do more.
223226

224-
###Using Custom Namelists
227+
### Using Custom Namelists
225228
You can also make MesaScript know about additional namelists (or forget about
226229
the standard three). After requiring the `mesa_script` file, you can change the
227230
namelists it cares about via the following commands (obviously subbing out any
@@ -252,7 +255,7 @@ That *should* set things up to work with custom namelists, so long as the
252255
`.inc` and `.defaults` files are formatted more or less the same as the "stock"
253256
ones.
254257

255-
###Accessing Current Values and Displaying Default Values
258+
### Accessing Current Values and Displaying Default Values
256259
Perhaps you want to display a default value in your inlist, but not actually
257260
change it. Well, most of the assignment methods mentioned earlier
258261
are also getter methods. I haven't mentioned how these methods actually work, so I'll do so now since you're still reading this manifesto.
@@ -297,5 +300,5 @@ Note that these array methods, as indicated, point to hashes (not arrays) of
297300
values. So `xa_central_lower_limit_species[1] = 'h1'` would return
298301
`{1 => 'h1'}`.
299302

300-
##Further Work
303+
## Further Work
301304
I warmly welcome bug reports, feature suggestions, and most all, pull requests!

0 commit comments

Comments
 (0)