From 4402a77aa9abd74177af13b4bea984d0dc08e9f4 Mon Sep 17 00:00:00 2001
From: Robert Izzard <r.izzard@surrey.ac.uk>
Date: Thu, 14 Nov 2019 13:55:52 +0100
Subject: [PATCH] update docs for meson/ninja

build for distribution of 2.1.4
---
 binary_c-config                |   11 +
 doc/binary_c2.html             | 8957 --------------------------------
 doc/binary_c2.lyx              |   57 +-
 doc/binary_c2.pdf              |  Bin 963550 -> 963756 bytes
 src/binary_c_parameters.h      |    2 +-
 src/nucsyn/nucsyn_parameters.h |   12 +-
 6 files changed, 63 insertions(+), 8976 deletions(-)
 delete mode 100644 doc/binary_c2.html

diff --git a/binary_c-config b/binary_c-config
index 034315b66..f48dd0c19 100755
--- a/binary_c-config
+++ b/binary_c-config
@@ -19,15 +19,22 @@
 #
 ############################################################
 
+
+# find the directory from which the script was called
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+# hence the executable
 BIN="$DIR/binary_c"
 
+# if it's not executable, fail
 if [[ ! -x "$BIN" ]];then
     echo -e "\e[91m"
     echo "Looked for binary_c at $BIN but could not find an executable there :( Have you built binary_c? Is this config script located in the binary_c directory?"
     echo -e "\e[39m"
     exit
 fi
+
+# defaults
 VER="$BIN version "
 DEFAULTS="$BIN list_args"
 GREP="grep"
@@ -71,11 +78,13 @@ Note: this script requires standard tools like grep, sed, tr, ldd
 EOHELP
 )
 
+# check for an argument : if none is given, show help text
 if [[ -z $1 ]]; then 
     echo "$HELP"
     exit
 fi
 
+# check first argument : do what it says
 while (( $# )); do
     key="$1"
     
@@ -201,3 +210,5 @@ while (( $# )); do
     esac
 done
                      
+# we're done, exit
+
diff --git a/doc/binary_c2.html b/doc/binary_c2.html
deleted file mode 100644
index 2e8b3d870..000000000
--- a/doc/binary_c2.html
+++ /dev/null
@@ -1,8957 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta name="GENERATOR" content="LyX 2.3.3" />
-<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>LyX Document</title>
-<style type='text/css'>
-/* LyX Provided Styles */
-mstyle.mathbox { font-style: normal; }
-div.bibtexentry { margin-left: 2em; text-indent: -2em; }
-span.bibtexlabel:before{ content: "["; }
-span.bibtexlabel:after{ content: "] "; }
-
-/* Layout-provided Styles */
-dfn.lyxnoun {
-  font-variant: small-caps;
-}
-div.standard {
-	margin-bottom: 2ex;
-}
-div.plain_layout {
-text-align: left;
-
-}
-h2.section {
-font-weight: bold;
-font-size: x-large;
-margin-top: 1.3ex;
-margin-bottom: 0.7ex;
-text-align: left;
-
-}
-h3.subsection {
-font-weight: bold;
-font-size: large;
-margin-top: 0.9ex;
-margin-bottom: 0.5ex;
-text-align: left;
-
-}
-ul.itemize {
-margin-top: 0.7ex;
-margin-bottom: 0.7ex;
-margin-left: 3ex;
-text-align: left;
-
-}
-blockquote.quotation {
-margin-top: 0.5ex;
-margin-bottom: 0.5ex;
-margin-left: 3ex;
-margin-right: 3ex;
-text-align: left;
-
-}
-dl.description dt { font-weight: bold; }
-h4.subsubsection {
-font-weight: bold;
-font-size: medium;
-margin-top: 0.7ex;
-margin-bottom: 0.4ex;
-text-align: left;
-
-}
-ol.enumerate {
-margin-top: 0.7ex;
-margin-bottom: 0.7ex;
-margin-left: 3ex;
-text-align: left;
-
-}
-ol.lyxlist {
-	list-style-type: none;
-}
-li.labeling_item {
-	text-indent: 0em
-	margin-left: 5em;
-}
-span.lyxlist {
-	margin-right: 1em;
-}
-h4.subsubsection_ {
-font-weight: bold;
-font-size: medium;
-margin-top: 0.7ex;
-margin-bottom: 0.4ex;
-text-align: left;
-
-}
-div.Frameless { margin: 1em; }
-div.toc {
-  margin: 2em 0em;
-  border-style: solid;
-  border-width: 2px 0px;
-  padding: 1em 0em;
-}
-h2.tochead { font-size: x-large; font-weight: bold; }
-div.lyxtoc-0 {
-  margin: 2em 0em 0em 0em;
-  font-size: xx-large;
-  font-weight: bold;
-}
-div.lyxtoc-1 {
-  margin: 1em 0em 0em 0em;
-  font-size: x-large;
-  font-weight: bold;
-}
-div.lyxtoc-2 {
-  margin: 0em 0.1em 0em 1em;
-  font-size: large;
-  font-weight: normal;
-}
-div.lyxtoc-3 { margin: 0em 0.1em 0em 0.5em; font-size: medium; }
-div.lyxtoc-4 { margin: 0em 0.1em 0em 0.5em; }
-div.lyxtoc-5 { margin: 0em 0.1em 0em 0.5em; }
-div.lyxtoc-6 { margin: 0em 0.1em 0em 0.5em; }
-a.tocentry {
-  text-decoration: none;
-  color: black;
-}
-a.tocentry:visited { color: black; }
-span.flex_url {
-font-family: monospace;
-}
- 
-	span.flex_file {
-	  font-style: italic; 
-	} 
- 
-	span.flex_os {
-	  font-style: italic; 
-	} 
-div.float-listings {
-	border: 2px solid black;
-	padding: 1ex;
-	margin: 1ex;
-}
-div.listings-caption {
-	text-align: center;
-	border: 2px solid black;
-	padding: 1ex;
-	margin: 1ex;
-	}
- 
-	span.flex_scriptinglanguage {
-	  font-style: italic; 
-	} 
- 
-	span.flex_software {
-	  font-style: italic; 
-	} 
- 
-	span.flex_envvar {
-	  font-family: monospace; 
-	} 
- 
-	span.flex_args {
-	  font-family: monospace; 
-	} 
- 
-	span.flex_command {
-	  font-family: monospace; 
-	} 
- 
-	span.flex_perlscript {
-	  font-style: italic; 
-	} 
- 
-	span.flex_bashscript {
-	  font-style: italic; 
-	} 
-div.Boxed {
-	border: solid thick black;
-	padding: 0.5ex;
-}
-span.foot_label {
-	vertical-align: super;
-	font-size: smaller;
-	font-weight: bold;
-	text-decoration: underline;
-}
-div.foot {
-	display: inline;
-	font-size: small;
-	font-weight: medium;
-	font-family: serif;
-	font-variant: normal;
-	font-style: normal;
-}
-div.foot_inner { display: none; }
-div.foot:hover div.foot_inner {
-	display: block;
-	border: 1px double black;
-	margin: 0em 1em;
-	padding: 1em;
-}
- 
-	span.flex_programminglanguage {
-	  font-style: italic; 
-	} 
- 
-	span.flex_cflags {
-	  font-family: monospace; 
-	} 
- 
-	span.flex_perlmodule {
-	  font-family: monospace; 
-	} 
- 
-	span.flex_cmacro {
-	  font-family: monospace; 
-	} 
- 
-	span.flex_perlcode {
-	  font-family: monospace; 
-	} 
- 
-	span.flex_cvar {
-	  font-family: monospace; 
-	} 
-div.float {
-	border: 2px solid black;
-	text-align: center;
-}
-div.float-caption {
-	text-align: center;
-	border: 2px solid black;
-	padding: 1ex;
-	margin: 1ex;
-}
- 
-	span.flex_cfunction {
-	  font-family: monospace; 
-	} 
- 
-	span.flex_sourcefile {
-	  font-style: italic; 
-	} 
- 
-	span.flex_cstruct {
-	  font-family: monospace; 
-	} 
- 
-	span.flex_headerfile {
-	  font-style: italic; 
-	} 
- 
-	span.flex_fortranfunction {
-	  font-family: monospace; 
-	} 
-
-
-</style>
-<link rel="stylesheet" href="css/alabaster_binary_c.css" type="text/css" />
-
-<link rel="stylesheet" href="css/pygments.css" type="text/css" />
-
-<link rel="stylesheet" href="css/theme.css" type="text/css" />
-
-</head>
-<body dir="auto">
-<div class="document">
-<div class="documentwrapper">
-<div class="bodywrapper">
-<div class="body" role="main">
-
-
-<div class="standard" style='text-align: center;' id='magicparlabel-2'><img style='width:55%;' src='images/1.png' alt='image: 7_tmp_binary_c_lyx_images_1.png' />
-</div>
-
-<div class="standard" id='magicparlabel-3'><div class='Frameless'><div class="plain_layout" style='text-align: center;' id='magicparlabel-7'><b>An introduction to the <i>binary_c</i> framework: software to make populations of single and binary stars on your computer(s).
-<br />
-
-
-<br />
-
-Version 2.1.4
-<br />
-
-
-<br />
-
-Warning: <em><i>binary_c</i></em> is always under development, so details are likely to change.</b></div>
-</div></div>
-
-<div class="standard" id='magicparlabel-8'><br />
-</div>
-
-
-<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
-<div class="sphinxsidebarwrapper"><img width="200px" src="images/logo.png"><div id='toc'><h2 class='tochead section'>Table of Contents</h2>
-
-
-<div class='lyxtoc-1'><div class='lyxtoc-2'><a href='#magicparlabel-10' class='tocentry'>1 Disclaimer and Licence </a></div></div>
-
-
-<div class='lyxtoc-3'><a href='#magicparlabel-12' class='tocentry'>1.1 Disclaimer</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-22' class='tocentry'>1.2 Licence</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-28' class='tocentry'>1.3 Mailing lists</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-33' class='tocentry'>1.4 Conventions</a>
-</div>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-72' class='tocentry'>2 Quick start guide</a>
-
-
-<div class='lyxtoc-3'><a href='#magicparlabel-74' class='tocentry'>2.1 Download and build <i>binary_c</i></a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-306' class='tocentry'>2.2 Running a single- or binary-star system</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-339' class='tocentry'>2.3 Running a grid of stars with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mstyle mathvariant='normal'>
-    <mstyle mathvariant='italic'>
-     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
-     </mrow>
-    </mstyle>
-   </mstyle><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math></a>
-</div>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-494' class='tocentry'>3 Introduction</a>
-
-
-<div class='lyxtoc-3'><a href='#magicparlabel-535' class='tocentry'>3.1 Binary_c: tools for stellar evolution and population synthesis</a>
-</div>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-545' class='tocentry'>4 Installation</a>
-
-
-<div class='lyxtoc-3'><a href='#magicparlabel-548' class='tocentry'>4.1 Quick start</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-568' class='tocentry'>4.2 Getting <i>binary_c</i></a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-675' class='tocentry'>4.3 System Requirements</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-868' class='tocentry'>4.4 Configuring and building <i>binary_c</i></a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-1218' class='tocentry'>4.5 Testing <i>binary_c</i></a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-1261' class='tocentry'>4.6 Directory structure</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-1304' class='tocentry'>4.7 Building binary_grid2: the population synthesis module</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-1791' class='tocentry'>4.8 <em><i>binary_grid2</i></em> backends</a>
-</div>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-2051' class='tocentry'>5 Evolving single and binary stars</a>
-
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2054' class='tocentry'>5.1 Running</a>
-</div>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-2205' class='tocentry'>6 Making populations of stars with <i>binary_grid2</i></a>
-
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2225' class='tocentry'>6.1 Introduction</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2248' class='tocentry'>6.2 Aims: what the grid does and why</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2250' class='tocentry'>6.3 Grid dimensions</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2263' class='tocentry'>6.4 What to do with the grid</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2272' class='tocentry'>6.5 Grid setup (in theory)</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2293' class='tocentry'>6.6 Data parsing</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2305' class='tocentry'>6.7 Running grids of stars</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2446' class='tocentry'>6.8 Important Subroutines in your grid script</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2481' class='tocentry'>6.9 Your <em>grid script </em>and coupling your population synthesis to <em><i>binary_c</i>/nucsyn</em></a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2743' class='tocentry'>6.10 Save your data – or process on the fly?</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2774' class='tocentry'>6.11 Flexigrid</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2796' class='tocentry'>6.12 Setup in your grid script</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2896' class='tocentry'>6.13 3D grid example</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2952' class='tocentry'>6.14 Viewing The (Automatically Generated) Gridcode </a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-2980' class='tocentry'>6.15 Error handling</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-3004' class='tocentry'>6.16 Flexigrid variable options</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-3051' class='tocentry'>6.17 Flexigrid loop structure</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-3111' class='tocentry'>6.18 <i>binary_grid</i> with <em>HTCondor</em></a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-3540' class='tocentry'>6.19 Binary_grid with <em>slurm</em></a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-3669' class='tocentry'>6.20 Initial distributions (IMF etc.) </a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-3690' class='tocentry'>6.21 Grid spacings</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-3700' class='tocentry'>6.22 The <span class='math'>\binarygrid</span>
- thread model</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-3861' class='tocentry'>6.23 Debugging, benchmarking and advanced topics</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-4063' class='tocentry'>6.24 Future Plans</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-4067' class='tocentry'>6.25 Cookbook</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-4278' class='tocentry'>6.26 FAQ</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-4382' class='tocentry'>6.27 Multi-core scaling</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-4390' class='tocentry'>6.28 Testing Setup</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-4440' class='tocentry'>6.29 Results</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-4497' class='tocentry'>6.30 Conclusions</a>
-</div>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-4582' class='tocentry'>7 <em><i>binary_c</i> </em>API</a>
-
-
-<div class='lyxtoc-3'><a href='#magicparlabel-4586' class='tocentry'>7.1 Naming conventions</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-4706' class='tocentry'>7.2 Using the API</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-4939' class='tocentry'>7.3 Standard functions</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-5186' class='tocentry'>7.4 Extension functions</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-5236' class='tocentry'>7.5 API Examples</a>
-</div>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-5456' class='tocentry'>8 Code description and internals</a>
-
-
-<div class='lyxtoc-3'><a href='#magicparlabel-5459' class='tocentry'>8.1 History</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-5521' class='tocentry'>8.2 How the <em><i>binary_c</i></em> code works</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-5529' class='tocentry'>8.3 Memory management in <span class='math'>binary_c</i></span>
-</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-5902' class='tocentry'>8.4 Output</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-5982' class='tocentry'>8.5 Debugging <span class='math'>binary_c</i></span>
-</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-6275' class='tocentry'>8.6 Events</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-6530' class='tocentry'>8.7 Timestepping</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-6609' class='tocentry'>8.8 Code layout, header files, flow</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-7011' class='tocentry'>8.9 nucsyn</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-7350' class='tocentry'>8.10 Coding style</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-7412' class='tocentry'>8.11 Control scripts</a>
-</div>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-7432' class='tocentry'>9 Advanced Configuration</a>
-
-
-<div class='lyxtoc-3'><a href='#magicparlabel-7451' class='tocentry'>9.1 Meson configuation</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-7469' class='tocentry'>9.2 <i>binary_c</i>-config</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-7562' class='tocentry'>9.3 Makefile -D&hellip;</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-7592' class='tocentry'>9.4 binary_c_code_options.h</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-7631' class='tocentry'>9.5 binary_c_parameters.h</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-7795' class='tocentry'>9.6 nucsyn/nucsyn_parameters.h</a>
-</div>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-7889' class='tocentry'>10 <em><i>binary_c</i> </em>software development cycle</a>
-
-
-<div class='lyxtoc-3'><a href='#magicparlabel-7893' class='tocentry'>10.1 The git revolution</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-7916' class='tocentry'>10.2 The master(trunk)–branch model</a>
-</div>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-8001' class='tocentry'>11 Cookbook</a>
-
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8002' class='tocentry'>11.1 How to log output</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8016' class='tocentry'>11.2 How to find which source files contain a string</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8040' class='tocentry'>11.3 How to build with debugging output</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8074' class='tocentry'>11.4 How to check for NaNs (not a numbers)</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8096' class='tocentry'>11.5 How to exit <em><i>binary_c</i></em></a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8119' class='tocentry'>11.6 How to debug segfaults</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8160' class='tocentry'>11.7 How to debug memory leaks</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8199' class='tocentry'>11.8 How to show the arguments that <em>tbse</em> would use, but do not evolve a star</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8205' class='tocentry'>11.9 How to run a star which has the arguments in a file</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8211' class='tocentry'>11.10 How to use profile guided optimization (PGO)</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8236' class='tocentry'>11.11 How to get help</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8251' class='tocentry'>11.12 How to add a parameter</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8270' class='tocentry'>11.13 How to build on a Mac</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8272' class='tocentry'>11.14 How to build as a shared library</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8278' class='tocentry'>11.15 How to calculate stellar yields or population statistics</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8324' class='tocentry'>11.16 <em>bash</em> autocompletion of <i>binary_c</i> arguments</a>
-</div>
-
-<div class='lyxtoc-3'><a href='#magicparlabel-8354' class='tocentry'>11.17 How to find the <em>git</em> revision and <em>git</em> URL</a>
-</div>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-8390' class='tocentry'>12 Changelog</a>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-8418' class='tocentry'>13 Acknowledgements</a>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-8425' class='tocentry'>A Grid options (<em>grid_options</em> hash)</a>
-</div>
-
-<div class='lyxtoc-2'><a href='#magicparlabel-8482' class='tocentry'>B Binary_c/nucsyn options (<em>bse_options</em> hash)</a>
-</div>
-</div>
-</div>
-
-<h2 class="section" id='magicparlabel-10'><span class="section_label">1</span> Disclaimer and Licence </h2>
-<div class="standard" id='magicparlabel-11'><div id="sec_Disclaimer_and_Licence"></div>
-Please read this section before continuing. </div>
-<h3 class="subsection" id='magicparlabel-12'><span class="subsection_label">1.1</span> Disclaimer</h3>
-<div class="standard" id='magicparlabel-13'><div id="subsec_Disclaimer"></div>
-Robert Izzard (henceforth RGI) is <em>not responsible</em> for anything you do with this code, for the results, quality of code or results, etc.&nbsp;it is up to you to make sure you get things right! You can check every line of source code if you like. While RGI has done his best to make sure everything that follows (and in his papers) is correct <b>there are certainly bugs and omissions</b>. Please, if you find one, can you let him know, preferably through the gitlab bug reporting interface <a href="https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>/issues">https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>/issues</a> or by email.
-<b></b></div>
-<h3 class="subsection" id='magicparlabel-22'><span class="subsection_label">1.2</span> Licence</h3>
-<div class="standard" id='magicparlabel-23'><div id="subsec_Licence"></div>
-Please read the <span class="flex_file">LICENCE</span> file provided in the <em><i>binary_c</i></em> directory tree.</div>
-<h3 class="subsection" id='magicparlabel-28'><span class="subsection_label">1.3</span> Mailing lists</h3>
-<div class="standard" id='magicparlabel-29'><div id="subsec_mailing_lists"></div>
-There are two mailing lists for <i>binary_c</i>, both on Google's &ldquo;groups&rdquo; service</div>
-
-<ul class="itemize" id='magicparlabel-30'><li class="itemize_item">The announcements list
-<br />
-
-<a href=" https://groups.google.com/group/<i>binary_c</i>-nucsyn-announce"> https://groups.google.com/group/<i>binary_c</i>-nucsyn-announce</a>
-<br />
-
-This contains major announcements such as significant upgrades to <i>binary_c</i> (or the supporting software)</li>
-<li class="itemize_item">The development list
-<br />
-
-<a href="https://groups.google.com/group/<i>binary_c</i>-nucsyn-devel">https://groups.google.com/group/<i>binary_c</i>-nucsyn-devel</a>
-<br />
-
-This is more of a discussion list outlining specific changes to physics and technical development of the code(s). </li>
-<li class="itemize_item">Facebook page at
-<br />
-
-<a href="https://www.facebook.com/groups/149489915089142/?fref=ts">https://www.facebook.com/groups/149489915089142/?fref=ts</a></li>
-</ul>
-<h3 class="subsection" id='magicparlabel-33'><span class="subsection_label">1.4</span> Conventions</h3>
-<div class="standard" id='magicparlabel-34'>It is assumed you are using a <em>bash</em> shell and are familiar with the <span class="flex_os">Linux</span>/<span class="flex_os">Unix</span> command line. Instructions which should be executed in a <em>bash</em> shells are preceded by <span style='font-family:monospace;font-size: 18px;'>$</span> symbols, which <em>you should not</em> <em>type</em>!, like this<br />
-<pre class\s*='listings bash'>$ cd $HOME
-$ ls</pre><br />
-bash <em>scripts</em> look like this</div>
-
-<div class="standard" id='magicparlabel-48'><br />
-<pre class ='listings'># this is a bash script
-export BINARY_C=$HOME/progs/stars/<i>binary_c</i>
-cd $BINARY_C
-./<i>binary_c</i> version</pre><br />
-while <em>C</em> code looks like this</div>
-
-<div class="standard" id='magicparlabel-56'><br />
-<pre class ='listings'>int x;
-x++;</pre><br />
-and <span class="flex_scriptinglanguage">Perl</span> code looks like this <br />
-<pre class ='listings Perl'>my $y;
-$y++;</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-71'><br />
-</div>
-<h2 class="section" id='magicparlabel-72'><span class="section_label">2</span> Quick start guide</h2>
-<div class="standard" id='magicparlabel-73'>This section is a quick guide to getting <i>binary_c</i> and <i>binary_grid</i> to work. Please start reading at Section&nbsp;<a href="#sec_Introduction">3</a> if you want the full manual with complete installation instructions in Section&nbsp;<a href="#subsec_Getting_binary_c">4.2</a>.</div>
-<h3 class="subsection" id='magicparlabel-74'><span class="subsection_label">2.1</span> Download and build <i>binary_c</i></h3>
-<div class="standard" id='magicparlabel-75'>In the following, I assume you have internet access. I also assume you are building for a generic 64-bit CPU on Linux, and have software like <span class="flex_software">gcc</span>, <span class="flex_software">Perl5</span>, <span class="flex_software">Python3</span>, <span class="flex_software">wget</span> and other standard build tools installed. I assume your temporary directory is <span class="flex_file">/tmp</span> and you use a shell like <span class="flex_software">bash</span>. Installed libraries will be put in <span class="flex_file">$HOME/lib</span> (with associated files in <span class="flex_file">$HOME/include</span> etc.) so they are private to the user, rather than in system locations. <i>binary_c</i> will be installed in <span class="flex_file">$HOME/progs/stars/<i>binary_c</i></span> and other software will be downloaded and built in <span class="flex_file">$HOME/git</span>.</div>
-
-<ul class="itemize" id='magicparlabel-116'><li class="itemize_item">First, you need access to the git server. Please try to log in with a <em>gmail</em> account at gitlab.eps.surrey.ac.uk and when it blocks you, email Rob (<a href="r.izzard@surrey.ac.uk">r.izzard@surrey.ac.uk</a>) to ask for access. You will then be granted access.</li>
-<li class="itemize_item">(Do this once) Add to your <span class="flex_file">.bashrc</span> or equivalent shell profile<br />
-<pre class ='listings'>export BINARY_C=$HOME/progs/stars/<i>binary_c</i></pre><br />
-and<em> <b>restart your shell</b> </em>so that the environment variable <span class="flex_envvar">BINARY_C</span> is defined.</li>
-<li class="itemize_item">(Do this once) Set up <span class="flex_envvar">LIBRARY_PATH</span> and <span class="flex_envvar">LD_LIBRARY_PATH</span> in <span class="flex_file">.bashrc</span> unless it already points to <span class="flex_file">$HOME/lib</span>. Add the following to <span class="flex_file">.bashrc</span><br />
-<pre class ='listings'>export LD_LIBRARY_PATH=$HOME/lib
-export LIBRARY_PATH=$HOME/lib
-</pre><br />
-and <em><b>restart your shell</b></em>.</li>
-<li class="itemize_item">If you can, install <span class="flex_software">libbsd</span> – this is a system package so requires root access. You will require the <em>development</em> version which contains the various header files, this is usually called <span class="flex_software">libbsd-dev</span> (or similar). <span class="flex_software">libbsd</span> is not required for <i>binary_c</i> but is useful and speeds up the code.</li>
-<li class="itemize_item">If you can, install RGI's custom <em>GSL</em> which has a few small fixes to make it behave better. At present, the latest release is 2.5. <br />
-<pre class ='listings'>export PREFIX=$HOME
-cd $HOME/git
-git clone gitlab@gitlab.eps.surrey.ac.uk:ri0005/GSL-RGI.git
-cd GSL-RGI/2.5
-./configure
-make 
-make install</pre><br />
-</li>
-<li class="itemize_item">If you can, install <span class="flex_software">librinterpolate</span>. <br />
-<pre class ='listings'>export PREFIX=$HOME
-export CFLAGS=&rdquo;-O3 -mtune=generic&rdquo;
-mkdir $HOME/lib $HOME/git
-cd $HOME/git
-git clone gitlab@gitlab.eps.surrey.ac.uk:ri0005/librinterpolate.git
-cd $HOME/git/librinterpolate/src
-make 
-make install</pre><br />
-</li>
-<li class="itemize_item">If you can, install <span class="flex_software">libmemoize</span>. <br />
-<pre class ='listings'>export PREFIX=$HOME
-export CFLAGS=&rdquo;-O3 -mtune=generic&rdquo;
-mkdir $HOME/lib $HOME/git
-cd $HOME/git
-git clone gitlab@gitlab.eps.surrey.ac.uk:ri0005/libmemoize.git
-cd $HOME/git/librinterpolate/src
-make 
-make install</pre><br />
-</li>
-<li class="itemize_item">Clone the <em>master</em> branch of <i>binary_c</i>.<br />
-<pre class ='listings'>export ARCHFLAGS=" -mtune=generic "
-export CC=gcc
-mkdir -p $HOME/progs/stars/
-cd $HOME/progs/stars
-git clone gitlab@gitlab.eps.surrey.ac.uk:ri0005/<i>binary_c</i>.git</pre><br />
-</li>
-<li class="itemize_item">Change to the <i>binary_c</i> directory, configure and build both <i>binary_c</i> and its shared library. Note: if builddir already exists, you need to add <br />
-<pre class ='listings'>--reconfigure</pre><br />
- to the <span class="flex_software">Meson</span> command. <br />
-<pre class ='listings'>cd $BINARY_C
-meson builddir --buildtype release
-cd builddir
-ninja  
-ninja <i>libbinary_c.so</i>
-ninja libbinary_c_symlink 
-cd ..</pre><br />
-</li>
-<li class="itemize_item">Install <span class="flex_software">perlbrew</span> which is your own, custom <span class="flex_software">Perl</span>. <br />
-<pre class ='listings'>export NTHREADS=`cat /proc/cpuinfo |grep cpu\ famil|wc -l`
-export LATEST_PERL=`perlbrew available | grep &ldquo;^[[:space:]]\+perl&rdquo; | head -1`
-wget --no-check-certificate -O - http://install.perlbrew.pl | bash
-perlbrew -v install perl-5.31.5 --thread --multi --64bitall --notest -Dusethreads -Duselargefiles -Dcccdlflags=-fPIC -Dpager=/usr/bin/sensible-pager -Doptimize="-O3 mtune=generic" -Duseshrplib -j $NTHREADS</pre><br />
-If you have problems with <span class="flex_software">wget</span>, try removing the <span class="flex_args">–no-check-certificate</span>. 
-<br />
-
-<span class="flex_software">Perl</span> will, on completion of the build (which takes a little while), tell you to append some expressions to your shell profile (e.g.&nbsp;<span class="flex_file">.bashrc</span>). Do this, and then <em><b>restart your shell</b></em>.</li>
-<li class="itemize_item">Switch to using the new <span class="flex_software">Perl</span>, and install <span class="flex_software">cpanminus</span> (which is the command <span class="flex_command">cpanm</span>)<br />
-<pre class ='listings'>perlbrew switch $LATEST_PERL
-perlbrew install-cpanm </pre><br />
-</li>
-<li class="itemize_item">Install <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mstyle mathvariant='normal'>
-    <mstyle mathvariant='italic'>
-     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
-     </mrow>
-    </mstyle>
-   </mstyle><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math><br />
-<pre class ='listings'>cd $BINARY_C
-cd src/perl
-./install_modules.pl</pre><br />
-you may well need to run the <span class="flex_software">install_modules.pl</span> script repeatedly to satisfy dependencies, or if there is a failure check the error message and install the module manually using the <span class="flex_software">cpanm</span> command.</li>
-</ul>
-<h3 class="subsection" id='magicparlabel-306'><span class="subsection_label">2.2</span> Running a single- or binary-star system</h3>
-<div class="standard" id='magicparlabel-307'>Go to the <span class="flex_envvar">$BINARY_C</span> directory and open the file <span class="flex_file">tbse</span> (where <em>tbse</em> means &ldquo;test binary-star evolution&rdquo;). </div>
-
-<ul class="itemize" id='magicparlabel-316'><li class="itemize_item">In this file you can set every physical parameter of <i>binary_c</i>, for example the masses and orbital parameters<br />
-<pre class ='listings'># stellar masses (solar units)
-M1=6
-M2=0.9
-
-# orbit: 
-# If the period (days) is given, use it. 
-# If the period is zero, use the separation (in Rsun) to calculate the period.
-# (this requires that the masses are already set)
-ORBITAL_PERIOD=0.0
-ORBITAL_SEPARATION=3000.0
-
-# Orbital eccentricity should be in the range 0.0-1.0.
-ECCENTRICITY=0.0</pre><br />
-</li>
-<li class="itemize_item">You can also override physics by running tbse with subsequent command-line arguments, e.g., to run the default star with a metallicity of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0.004</mn>
- </mrow></mstyle></math>:<br />
-<pre class ='listings'>tbse metallicity 0.004</pre><br />
-</li>
-<li class="itemize_item">Do not run many stars this way, use <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mstyle mathvariant='normal'>
-    <mstyle mathvariant='italic'>
-     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
-     </mrow>
-    </mstyle>
-   </mstyle><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math></li>
-</ul>
-<h3 class="subsection" id='magicparlabel-339'><span class="subsection_label">2.3</span> Running a grid of stars with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mstyle mathvariant='normal'>
-    <mstyle mathvariant='italic'>
-     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
-     </mrow>
-    </mstyle>
-   </mstyle><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math></h3>
-
-<ul class="itemize" id='magicparlabel-340'><li class="itemize_item">Open the file $BINARY_C/src/perl/scripts2/template.pl</li>
-<li class="itemize_item">This is an example of how to run <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mstyle mathvariant='normal'>
-    <mstyle mathvariant='italic'>
-     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
-     </mrow>
-    </mstyle>
-   </mstyle><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math> to extract data from a grid of stars. You set up a grid of stars as a $population object, and then call that to set up the physics and run the grid. </li>
-<li class="itemize_item">To make a new population which evolves to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>15000</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>M</mi><mi>y</mi><mi>r</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> with metallicity <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>Z</mi><mo>=</mo><mn>0.02</mn>
-  </mrow>
- </mrow></mstyle></math>, use <span class="flex_perlscript"><i>binary_grid2</i>-&gt;new()</span> to make a population object<br />
-<pre class ='listings'># make a new stellar population
-my $population = <i>binary_grid2</i>-&gt;new(
-    # options can be given now ... 
-    metallicity =&gt; 0.02, # mass fraction of "metals"
-    max_evolution_time =&gt; 15000, # Myr 
-    );</pre><br />
-</li>
-<li class="itemize_item">To set parameters of an existing population, call<span class="flex_perlscript">$population-&gt;set()</span><br />
-<pre class ='listings'>$population-&gt;set(
-    vb=&gt;1, # turn on verbose logging (can be 0,1,2...)
-    return_array_refs=&gt;1, # quicker data parsing mode
-    log_args=&gt;1,
-    sort_args=&gt;1,
-    save_args=&gt;1,
-    log_args_dir=&gt;'/tmp',
-    C_auto_logging =&gt; {
-        'MY_STELLAR_DATA' =&gt;
-            [
-             'model.time',
-             'star[0].mass',
-             'model.probability',
-             'model.dt'
-            ]
-    },
-    );</pre><br />
-</li>
-<li class="itemize_item">To set up the grid, with is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>N</mi>
- </mrow></mstyle></math>-dimensional, just call <span class="flex_perlscript">add_grid_variable()</span> for each dimension, for example to set up primary masses in a logarithmic grid between <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0.1</mn>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>50</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> distributed according to Kroupa's 2001 initial mass function.<br />
-<pre class ='listings'>    $population-&gt;add_grid_variable
-        (
-        'name'       =&gt; 'lnm1', 
-        'longname'   =&gt;'Primary mass', 
-        'range'      =&gt;[log(0.1),log(50)],
-        'resolution' =&gt; 100,
-        'spacingfunc'=&gt;"const(log($mmin),log($mmax),$resolution-&gt;{m1})",
-        'precode'    =&gt;'$m1=exp($lnm1);',
-        'probdist'   =&gt;'Kroupa2001($m1)*$m1',
-        'dphasevol'  =&gt;'$dlnm1',
-        );</pre><br />
-</li>
-<li class="itemize_item">To analyse the data output from <i>binary_c</i> and do something useful with it, set up a <span class="flex_perlscript">parse_data()</span> function. In this case, we save to the results hash stored in <span class="flex_perlscript">$results</span>. Each thread contains part of the results, and all the results are automatically combined at the end of the population run. <br />
-<pre class ='listings'># link population to custom data parser function
-$population-&gt;set(
-    parse_bse_function_pointer =&gt; \&amp;main::parse_data
-    );
-
-sub parse_data
-{
-    my ($population, $results) = @_;
-
-    while(1)
-    {
-        # subsequent calls to tbse_line contain
-        # (references to) arrays of data 
-        my $la = $population-&gt;tbse_line();
-        
-        # first element is the "header" line
-        my $header = shift @$la;
-
-        # break out of the look if this is 'fin'
-        last if ($header eq 'fin');
-
-        if($header eq 'MY_STELLAR_DATA')
-        {
-            # matched MY_STELLAR_DATA header
-            my $time = $la-&gt;[0];
-            my $mass = $la-&gt;[1];
-            my $probability = $la-&gt;[2];
-            my $timestep = $la-&gt;[3];
-
-            # bin mass to nearest 1.0 Msun
-            $mass = $population-&gt;rebin($mass, 1.0);
-
-            # add up the initial mass function
-            if($time == 0.0)
-            {
-                $results-&gt;{initial_mass_function}-&gt;{$mass} += $probability;
-            }
-            
-            # add up the mass distribution
-            $results-&gt;{mass_distribution}-&gt;{$mass} += $probability * $timestep; 
-        }
-    }
-}</pre><br />
-</li>
-<li class="itemize_item">To run the population, call <span class="flex_perlscript">evolve()</span><br />
-<pre class ='listings'># evolution the stellar population (this takes some time)
-$population-&gt;evolve();</pre><br />
-</li>
-<li class="itemize_item">To output information, loop through the <span class="flex_perlscript">$results</span> hash. In this case we output to the screen both the initial mass function (with lines headed by <em>IMF</em>) and time-dependent mass function (lines headed by <em>MASS</em>). Naturally, you should save this data to a file if you want to further process it.<br />
-<pre class ='listings'>sub output
-{
-    my ($population) = @_;
-
-    # $results is a hash reference containing
-    # the results that were added up in parse_data()
-    my $results = $population-&gt;results;
-
-    # output the initial mass function
-    foreach my $mass (sort {$a&lt;=&gt;$b} keys %{$results-&gt;{initial_mass_function}})
-    {
-        printf "IMF %g %g\n",$mass,$results-&gt;{initial_mass_function}-&gt;{$mass};
-    }
-
-    # output the mass distribution
-    foreach my $mass (sort {$a&lt;=&gt;$b} keys %{$results-&gt;{mass_distribution}})
-    {
-        printf "MASS %g %g\n",$mass,$results-&gt;{mass_distribution}-&gt;{$mass};
-    }
-}
-</pre><br />
-</li>
-</ul>
-<h2 class="section" id='magicparlabel-494'><span class="section_label">3</span> Introduction</h2>
-<div class="standard" id='magicparlabel-495'><div id="sec_Introduction"></div>
-From <a href='#LyXCite-Izzard_et_al_2003c_Monash'><span class="bib-abbrvciteauthor">Izzard and Tout</span></a> (<span class="bib-year">2003</span>):</div>
-
-<blockquote class="quotation" id='magicparlabel-496'><div class="quotation_item">For many years the study of stellar yields and galactic chemical evolution (GCE) has gone on assuming, mainly for simplicity, that stars are isolated objects (one exception being <a href='#LyXCite-2002NewA____7___55D'><span class="bib-abbrvciteauthor">De Donder and Vanbeveren</span>, <span class="bib-year">2002</span></a>). Reality bites deeply into this picture with the observation that most stars are in multiple systems and that many of these systems are interacting. The state of the art in binary star nucleosynthesis is focused on explosive events such as type Ia supernovae and classical novae but other binary star processes contribute to pollution of the interstellar medium. Mass-transfer by Roche-lobe overflow (RLOF) occurs particularly when the stellar radius is growing rapidly and so commonly when one star is on the asymptotic giant branch (AGB).</div>
-</blockquote>
-<div class="standard" id='magicparlabel-497'>A recent review of binary stars can be found in <a href='#LyXCite-2017PASA___34____1D'><span class="bib-abbrvciteauthor">De Marco and Izzard</span></a> (<span class="bib-year">2017</span>).</div>
-
-<div class="standard" id='magicparlabel-498'>To investigate the effect of a companion on stellar nucleosynthesis the <em><i>binary_c</i></em> code was developed. The <em><i>binary_c</i></em> code currently uses the <em>SSE/BSE</em> package at its core to provide most of the stellar evolution modeling, with nucleosynthesis in parallel based on various algorithms, to explore the large parameter spaces associated with binary stars in reasonable periods of time. Binaries are important for nucleosynthesis because of two main effects:</div>
-
-<ul class="itemize" id='magicparlabel-499'><li class="itemize_item">The presence of a companion affects evolution by mass loss and gain. Good examples are Roche-lobe overflow caused by interaction between a giant branch or asymptotic giant branch (GB/AGB) star and a main-sequence (MS) star. Truncation of the GB/AGB phase may prevent dredge-up events and hence reduce the amount of nuclear processing material undergoes prior to expulsion to the ISM. Common envelopes generally result and while the detailed physics is unclear it is likely that mass is ejected to the ISM from some of these stars.</li>
-<li class="itemize_item">Novae, type Ia supernoave, X-ray bursts, stellar mergers (including neutron-star/black-hole mergers), etc. occur in binaries, as do many tidal disruption events. These may eject material or lead to extra nuclear burning.</li>
-</ul>
-<div class="standard" id='magicparlabel-501'>The physics of binary evolution is not all that well understood and, at the same time, suffers all the uncertainties of single-star evolution. Some effects which must be considered are:</div>
-
-<ul class="itemize" id='magicparlabel-502'><li class="itemize_item">Duplicity: is the star single or binary or perhaps even triple or quadruple?</li>
-<li class="itemize_item">Metallicity and, less importantly, initial abundance mix. The initial abundance mix depends on the galactic evolution history and even the solar mixture is somewhat uncertain.</li>
-<li class="itemize_item">Initial distributions: What is the IMF? What is the initial distribution for primary mass, secondary mass, separation/period and eccentricity in binary stars?</li>
-<li class="itemize_item">Abundance changes at dredge-ups. These changes can depend on the input physics, especially in the case of third dredge-up. Calibration to observations is necessary in this case and leads to the introduction of free parameters to increase the amount of dredge-up. There is also great uncertainty with regard to the s-process isotopes, in particular the size of the C13 pocket during third dredge-up. </li>
-<li class="itemize_item">Wind loss rates. Mass loss due to stellar winds is a very dodgy affair - most prescriptions in current use are quite phenomenological and have little regard for actual physics. With this in mind it is important to test a range of prescriptions.</li>
-<li class="itemize_item">Common envelope parameters - the parameters <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi> &lambda; </mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>C</mi><mi>E</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi> &alpha; </mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>C</mi><mi>E</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> parameterise our ignorance of this complex process, mainly because the mechanism for driving off the stellar envelope is unclear (magnetic fields? friction? ionization? who knows!). This problem is very much open (<a href='#LyXCite-2012IAUS__283___95I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2012</span></a>; <a href='#LyXCite-2013A_ARv__21___59I'><span class="bib-abbrvciteauthor">Ivanova et al.</span>, <span class="bib-year">2013</span></a>).</li>
-<li class="itemize_item">Eddington limit : should this be imposed during accretion processes?</li>
-<li class="itemize_item">HBB temperature : somewhat uncertain is the amount of HBB, this can be varied in the model</li>
-<li class="itemize_item">Black hole formation : what is the mass of a black hole forming from a given mass progenitor? </li>
-<li class="itemize_item">Supernova kicks : is there a kick at SN formation? What is the magnitude/distribution of this kick? Pulsar peculiar velocities give us an idea but are not necessarily the answer to the question.</li>
-<li class="itemize_item">Binary induced wind loss (Companion Reinforced Attrition Process - CRAP) - see Chris Tout's PhD. Does the presence of a binary companion increase wind loss rates? What about circularization? (Barium stars are eccentric and have short periods – current theory, and this code, cannot make these stars!)</li>
-<li class="itemize_item">Time evolution of the yields. Even if the integrated yield up to (say) 15Gyr from a population of stars is similar when comparing binary and single stars, the time evolution probably is not. For example, nitrogen peaks far more quickly in single than in binary stars because massive (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>M</mi><mo>&gt;</mo><mn>4</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>) TPAGB stars in binaries overflow their Roche lobes prior to HBB so C12 cannot be converted into N14.</li>
-<li class="itemize_item">Numerical resolution - requires careful consideration!</li>
-</ul>
-<div class="standard" id='magicparlabel-515'><i>binary_c</i> is the trade name for the <i>C</i>-version of the <em>B</em>inary <em>S</em>tar <em>E</em>volution (<em>BSE</em>) code of <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>) with added <em>nucleo</em>synthesis. The nucleosynthesis algorithm runs (mostly) in parallel to the nucleosynthesis code and includes the following (see <a href='#LyXCite-2006A_A___460__565I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2006</span><span class="bib-modifier">b</span></a>; <a href='#LyXCite-2009A_A___508_1359I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2009</span></a>; <a href='#LyXCite-2018MNRAS_473_2984I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2018</span></a> and many subsequent papers):</div>
-
-<ul class="itemize" id='magicparlabel-516'><li class="itemize_item">First and second dredge-up fitted to the detailed nucleosynthesis models of <a href='#LyXCite-Parameterising_3DUP_Karakas_Lattanzio_Pols'><span class="bib-abbrvciteauthor">Karakas et al.</span></a> (<span class="bib-year">2002</span>). </li>
-<li class="itemize_item">A new synthetic model of TPAGB stars (<a href='#LyXCite-Izzard_et_al_2003b_AGBs'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2004</span></a>) in collaboration with Amanda Karakas, Chris Tout and Onno Pols based on the Karakas et al. models. The effects of third dredge-up, the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>s</mi>
- </mrow></mstyle></math>-process, hot-bottom burning (CNO, NeNa and MgAl) and mass loss are included.</li>
-<li class="itemize_item">Phenomenological fits to massive and Wolf-Rayet star surface abundances (elemental H, He, CNO, Ne) based on the models of Lynnette Dray (<a href='#LyXCite-2003MNRAS_338__973D'><span class="bib-abbrvciteauthor">Dray et al.</span>, <span class="bib-year">2003</span></a>). These were recently complemented by tables from Richard Stancliffe which include all the <em>isotopes</em> up to iron (Stancliffe, private communication, see also <a href='#LyXCite-2006astro_ph_12390I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2006</span><span class="bib-modifier">a</span></a>).</li>
-<li class="itemize_item">Supernovae: types Ia, II and Ib/c with yields fitted to published models (<a href='#LyXCite-1986ApJ___301__601W'><span class="bib-abbrvciteauthor">Woosley et al.</span>, <span class="bib-year">1986</span></a>; <a href='#LyXCite-1995ApJ___452___62L'><span class="bib-abbrvciteauthor">Livne and Arnett</span>, <span class="bib-year">1995</span></a>; <a href='#LyXCite-1995ApJS__101__181W'><span class="bib-abbrvciteauthor">Woosley and Weaver</span>, <span class="bib-year">1995</span></a>; <a href='#LyXCite-1999ApJS__125__439I'><span class="bib-abbrvciteauthor">Iwamoto et al.</span>, <span class="bib-year">1999</span></a>; <a href='#LyXCite-2004ApJ___608__405C'><span class="bib-abbrvciteauthor">Chieffi and Limongi</span>, <span class="bib-year">2004</span></a>).</li>
-<li class="itemize_item">Nova yields fitted to <a href='#LyXCite-1998ApJ___494__680J'><span class="bib-abbrvciteauthor">José  and Hernanz</span></a> (<span class="bib-year">1998</span>). </li>
-<li class="itemize_item"><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>r</mi>
- </mrow></mstyle></math>-process &ldquo;yields&rdquo; (I say this in the loosest possible sense!) from Arlandini et al 1999 and Simmerer 2004.</li>
-<li class="itemize_item">Roche-Lobe Overflow and (possible) accretion onto the companion, common-envelope loss contribution to yields.</li>
-<li class="itemize_item">Mass loss due to winds and mass gain from a companion.</li>
-<li class="itemize_item">Colliding winds.</li>
-<li class="itemize_item">Accretion is treated with a two-layer model and thermohaline mixing.</li>
-<li class="itemize_item">Mergers.</li>
-<li class="itemize_item">SN stripping of companions.</li>
-</ul>
-<div class="standard" id='magicparlabel-528'>What does the <i>binary_c</i> code not do?</div>
-
-<ul class="itemize" id='magicparlabel-529'><li class="itemize_item">Diffusion - nobody plans to work on this! </li>
-<li class="itemize_item">"Extra mixing" - dubious although might be the cause of J-stars. </li>
-<li class="itemize_item">Common envelope nucleosynthesis - thought not to be important, but you never know. </li>
-<li class="itemize_item">(Pre-)MS burning of the interior of the star - this means that if a MS star is stripped the increase in C13/N14 due to CNO cycling is not taken into account. However, if the star makes it to 1st dredge up then this is taken into account. Note there is <em>experimental</em> code which can deal with this.</li>
-<li class="itemize_item">WD surface layers - these are very complicated!</li>
-<li class="itemize_item">Probably some other things too.</li>
-</ul>
-<h3 class="subsection" id='magicparlabel-535'><span class="subsection_label">3.1</span> Binary_c: tools for stellar evolution and population synthesis</h3>
-<div class="standard" id='magicparlabel-536'>The <i>binary_c</i> software framework consists of a number of tools, in particular:</div>
-
-<dl class='description' id='magicparlabel-537'><dt class="description_label"><i>binary_c</i></dt>
-<dd class="description_item"> The <i>binary_c</i> code itself. This is the core code, written in <em>C</em>, which contains the stellar evolution and nucleosynthesis algorithms.</dd>
-<dt class="description_label"><i>libbinary_c</i></dt>
-<dd class="description_item"> The shared library based on <i>binary_c</i> which should be accessed through the <i>binary_c</i> API functions. This works with other languages such as <em>Python</em> and <em>FORTRAN</em>.</dd>
-<dt class="description_label"><i>binary_grid</i></dt>
-<dd class="description_item"> A suite of software to run many stars in a stellar population. This is written in <span class="flex_scriptinglanguage">Perl</span> because when I started there was no <em>Python</em>. Sorry! But before you say &ldquo;oh but Perl is not <i><a href="https://www.python.org/">Python</a></i>&rdquo; – true, but it's a damned powerful language. You only need it to run the populations: after that, you can process the resulting data however you like (even in Excel if you want – but please don't!).</dd>
-</dl>
-<div class="standard" id='magicparlabel-544'><br />
-</div>
-<h2 class="section" id='magicparlabel-545'><span class="section_label">4</span> Installation</h2>
-<div class="standard" id='magicparlabel-546'>The following is an installation guide for installing <i>binary_c</i> and some of its support tools. If you know how to run code, and want to run <i>binary_c</i> as quickly as possible, just go for the quick start guide. If you want to get <i>binary_c</i>, either as source code, a virtual machine or Docker image, see section&nbsp;<a href="#subsec_Getting_binary_c">4.2</a>. Technical system requirements are discussed in section&nbsp;<a href="#subsec_system_requirements">4.3</a>. Building <i>binary_c</i> is describe in section&nbsp;<a href="#subsec_Building">4.4</a>.</div>
-
-<div class="standard" id='magicparlabel-547'>The <i>binary_grid</i> software is described in section&nbsp;<a href="#subsec_installing_binary_grid">4.7.3</a>.</div>
-<h3 class="subsection" id='magicparlabel-548'><span class="subsection_label">4.1</span> Quick start</h3>
-
-<ul class="itemize" id='magicparlabel-549'><li class="itemize_item">From the git repository check out <i>binary_c</i> and change to its directory</li>
-<li class="itemize_item">Run one binary system with the <span class="flex_bashscript">tbse</span> (test binary star evolution) script:<br />
-<pre class\s*='listings bash'>$ meson builddir --buildtype release
-$ cd builddir
-$ ninja
-$ cd ..
-$ tbse</pre><br />
-</li>
-<li class="itemize_item">Change <span class="flex_bashscript">tbse</span> to suit.</li>
-</ul>
-<h3 class="subsection" id='magicparlabel-568'><span class="subsection_label">4.2</span> Getting <i>binary_c</i><div id="subsec_Getting_binary_c"></div>
-</h3>
-<div class="standard" id='magicparlabel-569'>You can either get the <i>binary_c</i> source code, and build it yourself, or use the prebuilt <span class="flex_software">Docker</span><em> </em>image.</div>
-
-<h4 class="subsubsection" id='magicparlabel-576'><span class="subsubsection_label">4.2.1</span> Getting the source code</h4>
-<div class="standard" id='magicparlabel-577'>At present, <em>the <span class='math'>binary_c</i></span>
-</em> source code is accessed through the Faculty of Engineering and Physics (FEPS) of the University of Surrey's <em>git </em>server at <a href="https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>">https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i></a>. Access requires permission which is done on a user-by-user basis and currently only works easily if you have a Gmail account. If you don't, we can probably arrange something. </div>
-
-<div class="standard" id='magicparlabel-578'>In order to obtain an account, you need to do the following, in order</div>
-
-<ol class="enumerate" id='magicparlabel-579'><li class="enumerate_item">Try to log in at <a href="https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>">https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i></a> using your Gmail account by clicking on the <img style='width:1.2em;' src='images/2.png' alt='image: 8_tmp_binary_c_lyx_images_9.png' />
-. You will be told <em>your account is locked!</em> This poorly-worded message means you have to&hellip;</li>
-<li class="enumerate_item">Email me at r.izzard@surrey.ac.uk and tell me your account is &ldquo;locked&rdquo;. I will then email IT support, who will unlock your account.</li>
-<li class="enumerate_item">IT support should then tell me your account is unlocked so I should then be able to tell you. However, IT support have been known to unlock accounts and <em>not </em>let me know, so please keep trying. If you find you <em>can </em>access the gitlab server (i.e.&nbsp;you can log in) but get a &ldquo;404 The page could not be found or you don't have permission to view it&rdquo; error when trying to view <a href="https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>">https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i></a>, then I can probably fix the problem. But you have to tell me, so keep trying to log in :)</li>
-<li class="enumerate_item">This may take some time: please do hot hold your breath, <em>it is most unwise.</em></li>
-<li class="enumerate_item">Once you have confirmation from me (or before, if you are impatient) go back to the website, please click on the <img style='width:1.2em;' src='images/3.png' alt='image: 9_tmp_binary_c_lyx_images_10.png' />
- to sign in, and grab the code. If everything works, great! If not, I may have to talk with IT support, yet again.</li>
-</ol>
-<div class="standard" style='text-align: center;' id='magicparlabel-584'><div class='Boxed' style='width: 75%; '><div class="plain_layout" id='magicparlabel-588'>If you do not know me, it would really help me – and those who fund <em><span class='math'>binary_c</i></span>
-</em> – if you could include in your email to me a little about you and why you want to download and use <span class='math'>binary_c</i></span>
-.
-<br />
-
-
-<br />
-
-Please also let me know if you publish a paper which uses results derived from <em><span class='math'>binary_c</i></span>
-</em>.</div>
-</div></div>
-<h4 class="subsubsection" id='magicparlabel-589'><span class="subsubsection_label">4.2.2</span> Getting the Docker image</h4>
-<div class="standard" id='magicparlabel-590'>You can access <em><span class='math'>binary_c</i></span>
-</em> through <em>docker</em><div class="foot"><span class="foot_label">1</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-594'><a href="https://www.docker.com/">https://www.docker.com/</a></div>
-</div></div>.</div>
-
-<ol class="enumerate" id='magicparlabel-595'><li class="enumerate_item">I assume you have installed and signed in to <em>docker</em>. I cannot provide support for <em>Docker</em>!</li>
-<li class="enumerate_item">The newest <em><span class='math'>binary_c</i></span>
-</em> container is <b><span style='font-family:monospace;font-size: 18px;'>robizzard/<i>binary_c</i>:master2.0pre32
-<br />
-
-</span></b><span style='font-family:monospace;font-size: 18px;'>Public URL at Docker: <a href="https://hub.docker.com/r/robizzard/<i>binary_c</i>">https://hub.docker.com/r/robizzard/<i>binary_c</i></a></span></li>
-<li class="enumerate_item">Pull the &ldquo;latest&rdquo; version with<br />
-<pre class\s*='listings bash'>$ docker pull robizzard/<i>binary_c</i></pre><br />
-or a specific version (in this case 2.0pre32 master branch) with<br />
-<pre class\s*='listings bash'>$ docker pull robizzard/<i>binary_c</i>:master2.0pre32</pre><br />
-</li>
-<li class="enumerate_item">When you run Docker it inherits your stack settings, which may be too small for <i>binary_c</i> to run. Use <br />
-<pre class\s*='listings bash'>$ --ulimit stack:-1</pre><br />
- in your startup command to avoid this.</li>
-<li class="enumerate_item">Run it with a command like<br />
-<pre class\s*='listings bash'>$ docker run --ulimit stack=-1 -it robizzard/<i>binary_c</i>:latest /bin/bash --login</pre><br />
-this loads a bash shell in the directory of <span class='math'>binary_c</i></span>
-.</li>
-<li class="enumerate_item">Further information can be found in the file <span style='font-family:monospace;font-size: 18px;'>/home/<i>binary_c</i>/progs/stars/<i>binary_c</i>/doc/README.docker</span></li>
-<li class="enumerate_item">The following bash script allows you to run an X11-enabled terminal with <em><span class='math'>binary_c</i></span>
-</em> and <em><span class='math'>\binarygrid</span>
-</em> prebuilt, you have to do nothing more than run them. You can download the script from
-<br />
-
- <a href="http://personal.ph.surrey.ac.uk/~ri0005/code/scripts/<i>binary_c</i>/run_docker.sh">http://personal.ph.surrey.ac.uk/~ri0005/code/scripts/<i>binary_c</i>/run_docker.sh</a><br />
-<pre class ='listings'>#!/bin/bash
-
-############################################################
-# run <i>binary_c</i> using docker on Linux/Unix
-############################################################
-
-############################################################
-# we create a volume in binary_c_persistent : this
-# is a persistent file space that is stored even when
-# <i>binary_c</i> stops
-############################################################
-docker volume create binary_c_volume &gt;/dev/null
-
-############################################################
-# Allow connections to our X display
-############################################################
-XAUTH=$(mktemp)
-xauth nlist $DISPLAY |  sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
-chmod 755 $XAUTH
-
-############################################################
-# run a bash login shell in the container : 
-# this leaves us in an X-connected shell.
-#
-# Note the chown/chgrp to make the persistent directory
-# writable by the user "<i>binary_c</i>"
-############################################################
-docker run \
-       --name=<i>binary_c</i> \
-       -it \
-       --rm \
-       -e DISPLAY=$DISPLAY \
-       --ipc=host \
-       --net=host \
-       --mount source=binary_c_volume,target=/home/<i>binary_c</i>/binary_c_persistent \
-       -v /tmp/.X11-unix \
-       -v $XAUTH \
-       -v $HOME/.Xauthority:/home/<i>binary_c</i>/.Xauthority \
-       robizzard/<i>binary_c</i>:master2.0pre32 \
-       /bin/bash -c "sudo chown <i>binary_c</i> binary_c_persistent ; sudo chgrp <i>binary_c</i> binary_c_persistent; cat /home/<i>binary_c</i>/progs/stars/<i>binary_c</i>/doc/README.docker; bash --login"
-
-
-
-# to clean the BINARY_C volume run:
-# docker volume rm binary_c_volume
-
-# clean up XAUTH
-rm $XAUTH
-
-</pre><br />
-</li>
-</ol>
-
-<h3 class="subsection" id='magicparlabel-675'><span class="subsection_label">4.3</span> System Requirements</h3>
-<div class="standard" id='magicparlabel-676'><div id="subsec_system_requirements"></div>
-In the following I assume you are using a <span class="flex_os">Linux</span>-type system (e.g&nbsp;running an distribution like <span class="flex_os">Ubuntu</span>). If you are not, I highly recommend using a virtual machine (e.g.&nbsp;<span class="flex_software">Virtualbox</span>) to run <span class="flex_os">Linux</span> on your system. <span class="flex_os">MacOS</span> and <span class="flex_os">Windows</span> have a quite different build structure compared to <span class="flex_os">Linux</span>, and while the code itself should work I have no Mac on which to test it. You can also run the <em><span class="flex_software">Docker</span></em> directly on <span class="flex_os">MacOS</span>.</div>
-
-<div class="standard" id='magicparlabel-713'>To build <i>binary_c</i> from source, the following software is required on your system:</div>
-
-<ul class="itemize" id='magicparlabel-714'><li class="itemize_item">A <em><span class="flex_programminglanguage"><em>C</em></span></em> compiler e.g.&nbsp;one of,
-<br />
-
-
-
-<ul class="itemize" id='magicparlabel-719'><li class="itemize_item"><span class="flex_software">gcc</span> (the <em>GNU</em> compiler <a href="http://gcc.gnu.org/">http://gcc.gnu.org/</a>) this comes as standard on most <span class="flex_os">Linux</span> and <span class="flex_os">MacOS</span> systems and is easily installed on others, and is free software.</li>
-<li class="itemize_item"><span class="flex_software">clang</span> (<em>C</em> compiler for <span class="flex_software">LLVM</span> <a href="http://clang.llvm.org/">http://clang.llvm.org/</a>) is also free, and may be faster than <span class="flex_software">gcc</span><em>.</em></li>
-<li class="itemize_item"><span class="flex_software">icc</span> (Intel compiler <a href="http://software.intel.com/en-us/articles/intel-compilers/">http://software.intel.com/en-us/articles/intel-compilers/</a>) this costs money but it is probably faster than <span class="flex_software">gcc</span>.</li>
-</ul>
-<div class="standard" id='magicparlabel-754'>Your system should include such a compiler unless you're using <span class="flex_os">Windows</span>. <em>Binary_c</em> has been tested on <span class="flex_os">Linux</span> and various <span class="flex_os">Solaris</span> machines. Note that (for an unknown reason!) it does not run (but does compile) on older versions of <span class="flex_os">MacOS</span>. If you can fix this problem please let me know! Also, there has been trouble with <span class="flex_software">gcc</span><em> </em>on Xeon machines. This is not my fault, please use <span class="flex_software">icc</span> or perhaps a newer <em><span class="flex_software">gcc</span></em>.<div class="foot"><span class="foot_label">2</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-786'>This information may be out of date! Please test the build and let me know.</div>
-</div></div></div>
-</li><li class="itemize_item"><span class="flex_scriptinglanguage">Python</span>, <span class="flex_software">meson</span> and <span class="flex_software">ninja</span>. You can install these tools on your system. You should make sure you have <span class="flex_software">meson</span> V0.52.0 or later. If you have <span class="flex_scriptinglanguage">Python3</span> installed, you can update <span class="flex_software">meson</span> with <br />
-<pre class ='listings'>pip3 install meson</pre><br />
-which should get you the latest version.</li>
-<li class="itemize_item"><span class="flex_scriptinglanguage">Perl</span>  - this is required for the <em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mstyle mathvariant='normal'>
-    <mstyle mathvariant='italic'>
-     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
-     </mrow>
-    </mstyle>
-   </mstyle><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math></em> software. <span class="flex_scriptinglanguage">Perl</span> is usually installed on your system, or you can download <span class="flex_scriptinglanguage">Perl</span> at <a href="www.perl.com">www.perl.com</a>, but I recommend <span class="flex_software">Perlbrew</span> instead. Please try to use a version of <span class="flex_scriptinglanguage">Perl</span>  that is 5.16 or later: 5.31.5 is currently the latest version and works just fine.
-<em><br />
-
-NOTE: </em><span class="flex_software">Perlbrew</span> and <span class="flex_software">cpanm</span> are <em>essential </em>if you want to use <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mstyle mathvariant='normal'>
-    <mstyle mathvariant='italic'>
-     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
-     </mrow>
-    </mstyle>
-   </mstyle><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item">You will want to use <em>git</em> to get<em> <i>binary_c</i></em>, see the document <em>getting_binary_c&nbsp;</em>.</li>
-<li class="itemize_item">If you plan to modify <em><i>binary_c</i> </em>you probably want a debugger of some sort. <span class="flex_software">Valgrind</span> is the tool of choice although you can also use <span class="flex_software">gdb</span>.</li>
-</ul>
-<div class="standard" id='magicparlabel-855'>By using <em><i>binary_c</i></em> and <em><i>binary_grid</i></em> you are part of a community. You are therefore jointly responsible for helping with the never-ending process of improvement and bug fixing.<em> Binary_c</em> (and its  <span class="flex_scriptinglanguage">Perl</span>  modules, such as <em><i>binary_grid</i></em>) is stored on a<em> </em><span class="flex_software">git</span> server. Please read the <span class="flex_file">LICENCE</span> file before use.</div>
-<h3 class="subsection" id='magicparlabel-868'><span class="subsection_label">4.4</span> Configuring and building <i>binary_c</i></h3>
-<div class="standard" id='magicparlabel-869'><div id="subsec_Building"></div>
-</div>
-<h4 class="subsubsection" id='magicparlabel-870'><span class="subsubsection_label">4.4.1</span> From <em>git</em></h4>
-<div class="standard" id='magicparlabel-871'>Assuming you have checked out your branch, a release or the trunk, from the <em>git</em> repository (see Sec.&nbsp;<a href="#subsec_Getting_binary_c">4.2</a>), go to that directory (which will be called the <span class="flex_file"><i>binary_c</i></span> directory below) and skip to <a href="#subsec_Configuration">4.4.3</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-876'><span class="subsubsection_label">4.4.2</span> From a <em>zip</em> file or tarball</h4>
-<div class="standard" id='magicparlabel-877'>If have been given a file <span class="flex_software">zip</span> file <span class="flex_file"><i>binary_c</i>.zip</span><span style='font-family:monospace;font-size: 18px;'>,</span> or a tarball e.g.&nbsp;<span class="flex_file"><i>binary_c</i>.tar.gz</span> or <span class="flex_file"><i>binary_c</i>.tar.bz2</span>, you should copy it to a directory (hereafter <span class="flex_file"><i>binary_c</i></span>, usually I put everything in <span class="flex_file"><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mo> &sim; </mo>
- </mrow></mstyle></math>/progs/stars/<i>binary_c</i></span> where <span class="flex_file"><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mo> &sim; </mo>
- </mrow></mstyle></math></span> is your home directory – if you put it there then all the scripts will work) and <span class="flex_software">unzip</span> it with one of the following commands (depending on the type of file you were given):</div>
-
-<div class="standard" id='magicparlabel-910'><b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ unzip <i>binary_c</i>.zip 
-$ tar -xvf <i>binary_c</i>.tar.gz
-$ tar -xvf <i>binary_c</i>.tar.bz2</pre><br />
-</span></b></div>
-
-<div class="standard" id='magicparlabel-917'>which will <span class="flex_software">unzip</span> the files in the appropriate places.</div>
-<h4 class="subsubsection" id='magicparlabel-922'><span class="subsubsection_label">4.4.3</span> Building with Meson<div id="subsec_Configuration"></div>
-</h4>
-<div class="standard" id='magicparlabel-923'>Now, from the <span class="flex_file"><i>binary_c</i></span> directory, you need to use <span class="flex_software">Meson</span> to make<div class="foot"><span class="foot_label">3</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-935'>Consider installing also <span class="flex_software">ccache</span> and bash auto-completion for <span class="flex_software">Meson</span> <a href="https://github.com/ninja-build/ninja/blob/master/misc/bash-completion">https://github.com/ninja-build/ninja/blob/master/misc/bash-completion</a></div>
-</div></div> a build directory, e.g.,<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ meson builddir --buildtype release</pre><br />
-</span></b>and now you should go to that directory to build the code using <span class="flex_software">ninja,</span></div>
-
-<div class="standard" id='magicparlabel-956'><b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ cd builddir
-$ ninja</pre><br />
-</span></b>The code will now build, assuming everything worked ok. If it does <em>not</em> work then please try to fix it (using, e.g. <em>Google</em>) before running to me with complaints. It works fine on <span class="flex_os">Linux</span> and will revert to <span class="flex_software">gcc</span> as the default compiler if something goes wrong. </div>
-
-<div class="standard" id='magicparlabel-970'>You can change the <span class="flex_args">buildtype</span> to debug if you want to build for testing (this is the default if you do not include any <span class="flex_args">buildtype</span>) – see <a href="https://mesonbuild.com/Running-Meson.html">https://mesonbuild.com/Running-Meson.html</a> for details.</div>
-
-<div class="standard" id='magicparlabel-983'>The executable is called <span class="flex_file"><i>binary_c</i></span>. To run a star go back to the main <i>binary_c</i> directory and run tbse, e.g.,<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ cd ..
-$ tbse</pre><br />
-</span></b></div>
-
-<div class="standard" id='magicparlabel-993'>Note: <span class="flex_file"><i>binary_c</i></span> is built as a single, possibly <em>large</em> (many MB) executable. The reason for this is the ease of use when transferring the executable from one machine to another (e.g.&nbsp;for use with distributed computing). It is possible to build a shared library instead (see below) and future <i>binary_c</i> versions will probably use environment variables to point to data directories.</div>
-<h4 class="subsubsection" id='magicparlabel-998'><span class="subsubsection_label">4.4.4</span> Cleaning the build tree</h4>
-<div class="standard" id='magicparlabel-999'>You can clean the build directory with<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ cd builddir
-$ ninja clean</pre><br />
-</span></b>This does not clean the data objects, which are built only once. If you want to clean these as well (equivalent to a <br />
-<pre class\s*='listings bash'>$ make cleanall</pre><br />
- of old) you should run,<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ ./meson/clean_data_objects.sh</pre><br />
-</span></b>from within the <i>binary_c</i> main directory.</div>
-<h4 class="subsubsection" id='magicparlabel-1013'><span class="subsubsection_label">4.4.5</span> Building the shared library <i>libbinary_c</i></h4>
-<div class="standard" id='magicparlabel-1014'>To build the shared library, go back into the builddir and run,</div>
-
-<div class="standard" id='magicparlabel-1015'><br />
-<pre class\s*='listings bash'>$ cd builddir
-$ ninja <i>libbinary_c.so</i>
-$ ninja libbinary_c_symlink</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-1022'>This makes the <span class="flex_file"><i>libbinary_c.so</i></span> shared library which can be used, for example, by the <span class="flex_programminglanguage">C</span> backend to <i>binary_grid</i><em>2</em>, or to access <i>binary_c</i> through its <em>API</em> functions. The <span class="flex_args">libbinary_c_symlink</span> build sets up a symbolic link in the <i>binary_c</i> <span class="flex_file">src</span> directory which allows <i>binary_grid</i><em>2 </em>to function.</div>
-<h4 class="subsubsection" id='magicparlabel-1039'><span class="subsubsection_label">4.4.6</span> Building <i>binary_c</i> and <i>libbinary_c</i>, and installing them for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mstyle mathvariant='normal'>
-    <mstyle mathvariant='italic'>
-     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
-     </mrow>
-    </mstyle>
-   </mstyle><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math></h4>
-<div class="standard" id='magicparlabel-1040'>You can build and install both <i>binary_c</i> and <i>libbinary_c</i> in locations which are compatible with legacy builds and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mstyle mathvariant='normal'>
-    <mstyle mathvariant='italic'>
-     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
-     </mrow>
-    </mstyle>
-   </mstyle><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math> with one command:</div>
-
-<div class="standard" id='magicparlabel-1041'><br />
-<pre class\s*='listings bash'>$ cd builddir
-$ ninja binary_c_install_legacy</pre><br />
-This puts a copy of the <span class="flex_file"><i>binary_c</i></span> executable in the root <i>binary_c</i> directory, and copies the shared library file <span class="flex_file"><i>libbinary_c.so</i></span> to the <span class="flex_file">src</span> directory, i.e.&nbsp;the locations <i>binary_grid2</i> expects.</div>
-
-<div class="standard" id='magicparlabel-1059'>After doing the above, you can remove the <span class="flex_file">builddir</span> completely.</div>
-<h4 class="subsubsection" id='magicparlabel-1064'><span class="subsubsection_label">4.4.7</span> Alternative compiler</h4>
-<div class="standard" id='magicparlabel-1065'>You can build with another compiler, e.g.<em>&nbsp;<span class="flex_software">clang</span></em>, by setting the <span class="flex_envvar">CC</span> environment variable. If you have not yet made a builddir, do the following.</div>
-
-<div class="standard" id='magicparlabel-1074'><br />
-<pre class\s*='listings bash'>$ export CC=clang
-$ meson builddir --buildtype release
-$ cd builddir
-$ ninja</pre><br />
-</div>
-<h4 class="subsubsection" id='magicparlabel-1082'><span class="subsubsection_label">4.4.8</span> Existing builddir</h4>
-<div class="standard" id='magicparlabel-1083'>If you already have a <span class="flex_file">builddir</span>, instead of deleting it, do the following,<br />
-<pre class\s*='listings bash'>$ export CC=clang
-$ cd builddir
-$ meson --reconfigure --buildtype release
-$ ninja</pre><br />
-</div>
-<h4 class="subsubsection" id='magicparlabel-1095'><span class="subsubsection_label">4.4.9</span> Debugging build</h4>
-<div class="standard" id='magicparlabel-1096'>To enable full debugging, run, from within <span class="flex_file">builddir</span>,<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ meson builddir --buildtype debug
-$ ninja</pre><br />
-</span></b>or just <b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ meson builddir
-$ cd builddir
-$ ninja</pre><br />
-</span></b>because <span class="flex_args">debug</span> is the default <span class="flex_args">buildtype</span>. You require debugging to use <span class="flex_software">gdb</span>, <span class="flex_software">valgrind</span>, etc.&nbsp;as well as <span class="flex_software">libbacktrace</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-1132'><span class="subsubsection_label">4.4.10</span> Accurate floating point build</h4>
-<div class="standard" id='magicparlabel-1133'>Binary_c generally does not require perfect floating-point accuracy and uses <span class="flex_cflags">-ffast-math</span> for extra speed, but you can turn on <span class="flex_software">gcc</span>'s various flags to improve accuracy with <b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ meson builddir -Daccurate=true</pre><br />
-</span></b></div>
-<h4 class="subsubsection" id='magicparlabel-1146'><span class="subsubsection_label">4.4.11</span> Generic build, e.g.&nbsp;for <em>HTCondor</em></h4>
-<div class="standard" id='magicparlabel-1147'>You may wish to build a generic version of <i>binary_c</i> which is not tied to the CPU architecture or operating system on which you are building, e.g.&nbsp;if your <i>binary_c</i> is required for use on the many machines of an <span class="flex_software">HTCondor</span><em> </em>or <span class="flex_software">Slurm</span> grid. Try <b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ meson builddir -Dgeneric=true</pre><br />
-</span></b></div>
-<h4 class="subsubsection" id='magicparlabel-1160'><span class="subsubsection_label">4.4.12</span> Libraries for <i>binary_c</i></h4>
-<div class="standard" id='magicparlabel-1161'><i>binary_c</i> uses <a href="https://gitlab.eps.surrey.ac.uk/ri0005/libmemoize">libmemoize</a> and <a href="https://gitlab.eps.surrey.ac.uk/ri0005/librinterpolate">librinterpolate</a>, written by RGI, and RGI's customized <i>GNU</i> Scientific Library (at <a href="https://gitlab.eps.surrey.ac.uk/ri0005/GSL-RGI">this link</a>). These should really just be installed locally, but there are internal versions inside <i>binary_c</i> just in case you cannot install them, and a standard system <span class="flex_software">GSL</span> should work.</div>
-
-<div class="standard" id='magicparlabel-1166'>You should make sure <span class="flex_software">Meson</span> knows about the locations of your libraries. Usually it is sufficient to set their locations (i.e.&nbsp;the directories in which they reside) in the environment variables <span class="flex_envvar">LIBRARY_PATH</span> (for compilation) and <span class="flex_envvar">LD_LIBRARY_PATH</span> (at runtime). For example, to point to the directories <span class="flex_file">$HOME/lib</span> and <span class="flex_file">$HOME/otherlibs</span>, using <span class="flex_software">bash</span>, <b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ export LIBRARY_PATH=$HOME/lib:$HOME/otherlibs
-$ export LD_LIBRARY_PATH=$HOME/lib:$HOME/otherlibs</pre><br />
-</span></b></div>
-<h4 class="subsubsection" id='magicparlabel-1196'><span class="subsubsection_label">4.4.13</span> Extra libraries</h4>
-<div class="standard" id='magicparlabel-1197'>A number of external libraries can be used, particularly during debugging. These include <span class="flex_software">libiberty</span>, <span class="flex_software">libbfd</span> (part of <span class="flex_software">gcc</span>) and <em><span class="flex_software">libbacktrace</span></em>. The latter is particularly useful, and I recommend installing it if you want to do any serious debugging. You can download <span class="flex_software">libbacktrace</span> from <a href="https://github.com/ianlancetaylor/libbacktrace">https://github.com/ianlancetaylor/libbacktrace</a>.</div>
-<h3 class="subsection" id='magicparlabel-1218'><span class="subsection_label">4.5</span> Testing <i>binary_c</i></h3>
-<div class="standard" id='magicparlabel-1219'>Run the <span class="flex_scriptinglanguage">bash</span> script to &ldquo;test binary star evolution&rdquo; which is located in the main <i>binary_c</i> directory, called,</div>
-
-<div class="standard" id='magicparlabel-1224'><br />
-<pre class\s*='listings bash'>$ tbse</pre><br />
-You should see some output. 
-<br />
-
-Note: You may have to symbolically link the executable to make this work. You can do this manually by going into the builddir and running<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ ninja binary_c_symlink</pre><br />
-</span></b></div>
-<h4 class="subsubsection" id='magicparlabel-1233'><span class="subsubsection_label">4.5.1</span> tbse commands<div id="subsec_tbse_commands"></div>
-</h4>
-<div class="standard" id='magicparlabel-1234'><span class="flex_bashscript">tbse</span><em> </em>can take extra arguments, which are often passed to <em><i>binary_c</i></em> directly or are directives to perform special tasks.</div>
-
-<dl class='description' id='magicparlabel-1239'><dt class="description_label">tbse&nbsp;echo</dt>
-<dd class="description_item"> This outputs (to <em>stdout</em>) the arguments that would have been sent to <em><i>binary_c</i></em>.</dd>
-<dt class="description_label">tbse_echolines</dt>
-<dd class="description_item"> As <em>tbse echo</em> but in a single line of output. Newlines are converted to <span style='font-family:monospace;font-size: 18px;'>\n</span>.</dd>
-<dt class="description_label">tbse&nbsp;args</dt>
-<dd class="description_item"> Ignores settings in the <em>tbse </em>file and runs only with the extra arguments given on the command line.</dd>
-<dt class="description_label">tbse&nbsp;arglines</dt>
-<dd class="description_item"> As <em>tbse args</em> but in a single line of output. Newlines are converted to <span style='font-family:monospace;font-size: 18px;'>\n</span>.</dd>
-<dt class="description_label">tbse&nbsp;debug</dt>
-<dd class="description_item"> This runs <em><i>binary_c</i> </em>with the gdb debugger</dd>
-<dt class="description_label">tbse&nbsp;valgrind</dt>
-<dd class="description_item"> This runs <em><i>binary_c</i></em> through <em>Valgrind</em>'s <em>memcheck</em> tool to detect memory leaks.</dd>
-<dt class="description_label">tbse&nbsp;valgrind_args</dt>
-<dd class="description_item"> This shows the command-line arguments that are passed to <em>Valgrind</em> and then exits.</dd>
-<dt class="description_label">tbse&nbsp;massif</dt>
-<dd class="description_item"> This runs <em><i>binary_c</i></em> through <em>Valgrind</em>'s <em>massif</em> heap checker.</dd>
-<dt class="description_label">tbse&nbsp;callgrind</dt>
-<dd class="description_item"> This runs <i>binary_c</i> through <em>Valgrind</em>'s <em>callgrind </em>tool.</dd>
-<dt class="description_label">tbse&nbsp;cachegrind</dt>
-<dd class="description_item"> This runs <em><i>binary_c</i></em> through <em>Valgrind</em>'s <em>cachegrind</em> tool.</dd>
-<dt class="description_label">tbse&nbsp;ptrcheck</dt>
-<dd class="description_item"> This runs<em> <i>binary_c</i></em> through <em>Valgrind</em>'s <em>ptrcheck</em> tool.</dd>
-<dt class="description_label">tbse&nbsp;sgcheck</dt>
-<dd class="description_item"> This runs<em> <i>binary_c</i></em> through <em>Valgrind</em>'s <em>sgcheck</em> tool.</dd>
-<dt class="description_label">tbse&nbsp;drd</dt>
-<dd class="description_item"> This runs<em> <i>binary_c</i></em> through <em>Valgrind</em>'s <em>drd</em> tool.</dd>
-<dt class="description_label">tbse&nbsp;gprof</dt>
-<dd class="description_item"> This runs <em><i>binary_c</i></em> through <em>gprof</em>, the <em>GNU</em> profiler.</dd>
-<dt class="description_label">tbse&nbsp;gprof_lines</dt>
-<dd class="description_item"> This runs <em><i>binary_c</i></em> through <em>gprof</em>, the <em>GNU</em> profiler, doing line-by-line accounting.</dd>
-<dt class="description_label">tbse&nbsp;gprof_with_stdout</dt>
-<dd class="description_item"> This runs <em><i>binary_c</i></em> through <em>gprof</em>, the <em>GNU</em> profiler, showing <em>stdout</em>.</dd>
-<dt class="description_label">tbse&nbsp;pgo</dt>
-<dd class="description_item"> Profile guided optimization. This builds <em><i>binary_c</i></em> once, runs a number of systems, then rebuilds with extra optimization based on the profile generated by the runs. This works for <em>GCC</em> and probably also <em>clang</em>.</dd>
-<dt class="description_label">tbse&nbsp;bug</dt>
-<dd class="description_item"> This runs <em><i>binary_c</i></em> and outputs information which is suitable for reporting a bug to Rob.</dd>
-<dt class="description_label">tbse&nbsp;multicore</dt>
-<dd class="description_item"> This runs <em><i>binary_c</i></em> on many CPU cores at once. Exits immediately on failure, so this is useful for testing e.g. Monte carlo kicks. </dd>
-<dt class="description_label">tbse&nbsp;multicore_valgrind</dt>
-<dd class="description_item"> As <em>tbse_multicore</em> but using <em>Valgrind</em>. </dd>
-<dt class="description_label">tbse&nbsp;&lt;filename&gt;</dt>
-<dd class="description_item"> This runs the set of arguments specified in the file given by <em>filename</em>.</dd>
-<dt class="description_label">tbse&nbsp;clip</dt>
-<dd class="description_item"> Runs <i>binary_c</i> and saves the output to the clipboard (requires <em>xclip</em>).</dd>
-</dl>
-<h3 class="subsection" id='magicparlabel-1261'><span class="subsection_label">4.6</span> Directory structure</h3>
-
-<ul class="itemize" id='magicparlabel-1262'><li class="itemize_item">The <span class="flex_file">src</span> directory, which holds all the <span style='font-family:monospace;font-size: 18px;'>.c</span> files</li>
-<li class="itemize_item"><span class="flex_file">src/doc</span> contains documentation</li>
-<li class="itemize_item"><span class="flex_file">src/perl</span> contains the <span class="flex_scriptinglanguage">Perl</span>  scripts e.g.<span style='font-family:monospace;font-size: 18px;'>&nbsp;</span><span class="flex_file">grid.pl</span><span style='font-family:monospace;font-size: 18px;'> </span>as well as latest <em><i>binary_grid</i></em> and helper modules, as well as some useful scripts. Please see the installation guide for help on installing these components.</li>
-<li class="itemize_item"><span class="flex_file">unit_tests</span> contains some test components (likely to be updated in later versions)</li>
-<li class="itemize_item"><span class="flex_file">builddir</span> contains the <span class="flex_software">Meson</span>/<span class="flex_software">Ninja</span> build information. You can delete this at any time, but you will have to rebuild everything from scratch.</li>
-</ul>
-<div class="standard" id='magicparlabel-1303'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-1304'><span class="subsection_label">4.7</span> Building binary_grid2: the population synthesis module</h3>
-<div class="standard" id='magicparlabel-1305'>This section describes in some detail the installation of <em><i>binary_grid2</i></em>. Note that sometimes you will require the latest version of pieces of software, in particular <span class="flex_scriptinglanguage">Perl</span> which should be at least version 5.16. I show you how to do this <em>without</em> requiring root permissions on your machine. Should you require packages to be installed that require root permission, you can always set up <em><i>binary_c</i></em> and <em><i>binary_grid</i></em> on a <em>virtual machine</em> which runs as a guest on your operating system, I do this with <span class="flex_software">Virtualbox</span> (<a href="https://www.virtualbox.org/">https://www.virtualbox.org/</a>). This would be my advice if you are running on a non-standard operating system, e.g.<em>&nbsp;</em><span class="flex_os">Windows</span>. You will have the root password for your virtual machine, so there are never permissions problems.</div>
-
-<div class="standard" id='magicparlabel-1318'>You will need some basic tools installed to make everything work: <span class="flex_scriptinglanguage">bash</span>, <span class="flex_software">subversion</span>, <span class="flex_scriptinglanguage">Perl</span>, <span class="flex_software">gmake</span>, <span class="flex_software">wget</span>, <span class="flex_software">gcc</span>. These are available on all good operating systems, and come by default – or after a simple install – with most flavours of <span class="flex_os">Linux</span>/<span class="flex_os">Unix</span> and <span class="flex_os">MacOS</span>.</div>
-
-<div class="standard" id='magicparlabel-1355'>Some <span class="flex_scriptinglanguage">Perl</span><em> </em>modules also require some other system libraries and development files. It is difficult to know exactly what these would be for every operating system. You may have to use a web search to find out, but that's fine because you are smart!</div>
-<h4 class="subsubsection" id='magicparlabel-1360'><span class="subsubsection_label">4.7.1</span> Get the latest <span class="flex_scriptinglanguage">Perl</span>  with<em> perlbrew</em></h4>
-<div class="standard" id='magicparlabel-1365'>I highly recommend that you install the latest version of <span class="flex_scriptinglanguage">Perl</span><em> </em>using <span class="flex_software">perlbrew</span> and install modules using <span class="flex_software">cpanm</span><em>.</em> I describe how to do this below, but also please see <a href="http://perlbrew.pl/">http://perlbrew.pl/</a> and <a href="http://perlbrew.pl/Perlbrew-and-Friends.html ">http://perlbrew.pl/Perlbrew-and-Friends.html </a>for further instructions and documentation.</div>
-<h4 class="subsubsection" id='magicparlabel-1378'><span class="subsubsection_label">4.7.2</span> Installing <em><i>binary_c</i></em></h4>
-<div class="standard" id='magicparlabel-1379'>Please see Sec.&nbsp;<a href="#subsec_Building">4.4</a> above for details about how to install <i>binary_c</i>. </div>
-<h4 class="subsubsection" id='magicparlabel-1380'><span class="subsubsection_label">4.7.3</span> Installing <em><i>binary_grid2</i></em></h4>
-<div class="standard" id='magicparlabel-1381'><div id="subsec_installing_binary_grid"></div>
-</div>
-
-<div class="standard" id='magicparlabel-1382'><em><i>binary_grid2</i></em> is written in <span class="flex_scriptinglanguage"><span class="flex_scriptinglanguage">Perl</span> </span> (<a href="http://www.perl.org/">http://www.perl.org/</a>) which is available on almost every modern operating system, although to my knowledge <em><i>binary_grid2</i></em> has never been tested on anything other than <span class="flex_os">Linux</span> (<a href="http://www.linux.org/">http://www.linux.org/</a>), <span class="flex_os">Solaris</span> and <span class="flex_os">MacOS</span>.</div>
-
-<div class="standard" id='magicparlabel-1403'>The newest <em><i>binary_grid2</i></em> uses features from the latest <span class="flex_scriptinglanguage">Perl</span>  (5.16 or above, currently testing on 5.29.8) so you'll need a recent <span class="flex_scriptinglanguage">Perl</span>  to be installed. Unfortunately most versions of <span class="flex_os">Linux</span> run an older <span class="flex_scriptinglanguage">Perl</span>  without support for many of the required features. You will also need to have the latest versions of a number of <span class="flex_scriptinglanguage">Perl</span>  modules which come from either from the online resource <em>CPAN</em><div class="foot"><span class="foot_label">4</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-1427'><em>Comprehensive Perl Archive Network</em></div>
-</div></div> (<a href="http://www.cpan.org/">http://www.cpan.org/</a>) or as part of the <em><i>binary_c</i></em> package.</div>
-
-<div class="standard" id='magicparlabel-1428'>My recommendation is to use <em><b>perlbrew</b> </em>to make your own <span class="flex_scriptinglanguage">Perl</span>  and <span class="flex_software">cpanminus</span> (the command is <span class="flex_software">cpanm</span>) to install the modules.</div>
-
-<div class="standard" id='magicparlabel-1441'>You can find <span class="flex_software">perlbrew</span> at <a href="http://perlbrew.pl/">http://perlbrew.pl/</a> : please follow the instructions on that page to install the latest <span class="flex_scriptinglanguage">Perl</span>  on your system if you do not trust my instructions below. Typically do the following, but remember you <em>must</em> install <span class="flex_software">perlbrew</span> with <span class="flex_cflags">-Dusethreads</span> otherwise <span class="flex_scriptinglanguage">Perl</span>  will not use threads and you will lose the multi-CPU features of <em><i>binary_grid</i></em>2. Please note that I assume you are using the <span class="flex_software">bash</span> shell.</div>
-
-<ol class="enumerate" id='magicparlabel-1466'><li class="enumerate_item"><br />
-<pre class\s*='listings bash'>$ wget --no-check-certificate -O - http://install.perlbrew.pl | bash</pre><br />
- or <br />
-<pre class\s*='listings bash'>$ curl -kL http://install.perlbrew.pl | bash</pre><br />
-If you have problems with <span class="flex_software">wget</span>, try removing the <span class="flex_args">--no-check-certificate</span>.</li>
-<li class="enumerate_item">Run <span class="flex_software">perlbrew</span><span style='font-family:monospace;font-size: 18px;'> available</span> to find a list of available versions, you should choose the newest, e.g.&nbsp;<span class="flex_file">perl-5.29.8</span>, and then run the following command to install <span class="flex_scriptinglanguage">Perl</span> : <br />
-<pre class\s*='listings bash'>$ perlbrew -v install perl-5.29.8 --thread --multi --64bitall --notest -Dusethreads -Duselargefiles -Duseshrplib -Dcccdlflags=-fPIC -Dpager=/usr/bin/sensible-pager -Doptimize="-O3 -march=x86-64 -mtune=generic" -Duseshrplib -j 8 </pre><br />
-You can use <span class="flex_cflags">-march=native -mtune=native</span> if you are quite sure you will not use this version of <span class="flex_scriptinglanguage">Perl</span> , or its modules, on a machine with a different architecture. If you are building for use with an <span class="flex_software">HTCondor</span> grid or on a shared (e.g.&nbsp;<em><span class="flex_software">NFS</span></em>) filesystem which is used on many different machines, I highly recommend using the <span class="flex_args">generic</span> option.
-<br />
-
-Note that the final <em>8</em> should be replaced by the number of CPUs you wish to use for the build (it is an option passed to <em>make</em>). Note also that <span class="flex_cflags">-Duseshrplib</span> may no longer be required. I have recently added <span class="flex_cflags">–thread-multi –64bitall</span> so if you have trouble, please remove these and try again. <div class="foot"><span class="foot_label">5</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-1531'>In <span class="flex_scriptinglanguage">Perl</span>  5.27.5 there is a (known) bug in the test routines which may (or may not) stop your installation. For this reason the <span class="flex_cflags">--notest</span> flag if set. Remove this if you want testing back (also, it is slow).</div>
-</div></div>The installation process can take a long time, go and have lunch&hellip; then:</li>
-<li class="enumerate_item">Do what <span class="flex_software">perlbrew</span> suggests with your <span class="flex_file">.bashrc</span> (or whatever shell initialization script you use) to fix the <span class="flex_envvar">PERLBREW_PATH</span>.</li>
-<li class="enumerate_item">Restart your shell (e.g.&nbsp;close your terminal and open a new one, or just run <span class="flex_scriptinglanguage">bash</span> again) to update your environment and <span class="flex_envvar">$PATH</span>.</li>
-<li class="enumerate_item">Check you're using the correct <span class="flex_scriptinglanguage">Perl</span>  with <br />
-<pre class\s*='listings bash'>$ perl -v</pre><br />
- This should say something like
-<br />
-
-<br />
-<pre class ='listings'>This is perl 5, version 29, subversion 8 (v5.29.8) built for x86_64-linux-thread-multi</pre><br />
-Check that the <span class="flex_args">-thread-</span> is there – without threads, <em><i>binary_grid2</i></em> multi-CPU options will not function.
-<br />
-
-
-<br />
-
-If you have a previous version of <span class="flex_scriptinglanguage">Perl</span>  installed by <span class="flex_software">perlbrew</span>, you will have to do something like
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ perlbrew switch perl-5.29.8</pre><br />
-</li>
-<li class="enumerate_item">If the installation was successful, but you see an older <span class="flex_scriptinglanguage">Perl</span> , check that your <span class="flex_envvar">$PATH</span> variable points to the new <span class="flex_scriptinglanguage">Perl</span> , and check that <span class="flex_envvar">$PERLBREW_PATH</span> exists.</li>
-<li class="enumerate_item">Install <span class="flex_software">cpanminus</span> by running
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ perlbrew install-cpanm </pre><br />
-</li>
-</ol>
-<div class="standard" id='magicparlabel-1617'>Now you have the latest <span class="flex_scriptinglanguage">Perl</span>  and <span class="flex_software">cpanm</span> installed, you can start to install the modules needed for <em><i>binary_grid</i></em>2. (Un?)fortunately, there are many of them, so I have made a script to do it for you</div>
-
-<ol class="enumerate" id='magicparlabel-1626'><li class="enumerate_item">From the <span class="flex_file"><i>binary_c</i></span> directory, go to <span class="flex_file">src/perl</span> with <br />
-<pre class\s*='listings bash'>$ cd src/perl</pre><br />
-</li>
-<li class="enumerate_item">Run the install script which uses <span class="flex_software">cpanminus</span> to install the modules
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ ./install_modules.pl</pre><br />
-</li>
-<li class="enumerate_item">Wait. Watch the output flow past your eyes. Note that you can <em>also</em> install the modules yourself from their tarballs in <span class="flex_file">src/perl/modules_targz</span>, e.g.,<br />
-<pre class\s*='listings bash'>$ cd src/perl/modules_targz
-$ cpanm ./&lt;modname&gt;.tar.gz</pre><br />
-but please note the <span class="flex_args">./</span> in the filename is <em>required</em>.</li>
-<li class="enumerate_item">In case of errors, try installing the module with verbose logging switched on
-<b><span style='font-family:monospace;font-size: 18px;'><br />
-
-</span></b><br />
-<pre class\s*='listings bash'>$ cpanm -v ./&lt;modname&gt;.tar.gz</pre><br />
-</li>
-<li class="enumerate_item">Check the output. If there is a failure, it should say. You will have to fix it by looking at the output to see where it went wrong. The most common cause of failure is that you need some kind of development (<em>-dev</em> or <em>-devel</em>) packages to be installed on your system, e.g. through <em><span class="flex_software">apt</span></em>, <span class="flex_software">yum</span> or <span class="flex_software">synaptic</span> or the system package manager. This may require root permission.
-<br />
-
-If all else fails, you can ask RGI for help, but he's not a sysadmin!</li>
-<li class="enumerate_item">Your installed modules are usually in (for <span class="flex_scriptinglanguage">Perl</span>  5.29.8) <span class="flex_file">$HOME/perl5/perlbrew/perls/5.29.8/lib/site_perl/5.29.8</span>
-<br />
-
-You should not have to set the <span class="flex_envvar">PERL5LIB</span> environment variable when installing with a modern <span class="flex_software">cpanminus</span>.
-<br />
-
-If you <em>do</em> have trouble, try <br />
-<pre class\s*='listings bash'>$ export PERL5LIB=$HOME/perl5/perlbrew/perls/5.29.8/lib/site_perl/5.29.8</pre><br />
- (or similar).</li>
-</ol>
-<div class="standard" id='magicparlabel-1701'>Now you should have everything installed and be able to run a <em><i>binary_grid</i></em> script.</div>
-<h4 class="subsubsection" id='magicparlabel-1702'><span class="subsubsection_label">4.7.4</span> Troubleshooting <em><span class="flex_scriptinglanguage"><em>Perl</em></span></em></h4>
-
-<dl class='description' id='magicparlabel-1707'><dt class="description_label">Module&nbsp;not&nbsp;found</dt>
-<dd class="description_item"> Check the <span class="flex_envvar">PERL5LIB</span> environment variable. When it is empty, <span class="flex_software">cpanm</span>/<span class="flex_software">perlbrew</span> should find your modules automatically, <em>if</em> they are installed correctly by <span class="flex_software">cpanm</span> (in the <span class="flex_file">site_perl</span> directory, see above). You can try installing modules again with <br />
-<pre class\s*='listings bash'>$ cpanm --force --reinstall</pre><br />
- to force a reinstallation, and with <span class="flex_args">-v</span> for extra logging.</dd>
-<dt class="description_label">Module&nbsp;fails&nbsp;to&nbsp;build</dt>
-<dd class="description_item"> Try<br />
-<pre class\s*='listings bash'>$ cpanm --notests</pre><br />
-to not run all tests. Sometimes these fail for spurious reasons, e.g. in the case of <em><i>binary_grid</i></em> because there are<em> no tests,</em> but<em> </em>the module still functions.</dd>
-<dt class="description_label">Perlbrew&nbsp;build&nbsp;flags</dt>
-<dd class="description_item"> I would recommend at least 
-<br />
-
-<span class="flex_cflags">-Dusethreads -Duselargefiles -Doptimize="-O3 -march=native -mtune=native"</span>
-<span style='font-family:monospace;font-size: 18px;'><br />
-
-</span>although you may wish to use <span class="flex_cflags">-O2</span> if you feel mathematical precision is key to your application (I have never noticed a problem with the above).
-<br />
-
-I also recommend <span class="flex_cflags">-Dcccdlflags=-fPIC</span><span style='font-family:monospace;font-size: 18px;'> </span>so that module code is position independent and <span style='font-family:monospace;font-size: 18px;'>-Duseshrplib</span> so that the appropriate threading library is used. (These flags are passed to the <em>C</em> compiler that builds <span class="flex_scriptinglanguage">Perl</span> .)</dd>
-<dt class="description_label">Rebuild&nbsp;modules&nbsp;for&nbsp;new&nbsp;<span class="flex_scriptinglanguage">Perl</span></dt>
-<dd class="description_item">  Let's say you had an old <span class="flex_scriptinglanguage">Perl</span><em> </em>built with <span class="flex_scriptinglanguage">perlbrew</span>, have installed a shiny new <span class="flex_scriptinglanguage">Perl</span> version with <span class="flex_software">perlbrew</span>, and now you want to rebuild all your existing modules. Try this after the install, but before switching to the new <span class="flex_scriptinglanguage">Perl</span>, replacing <span style='font-family:monospace;font-size: 18px;'>5.xx.yy</span> with the new <span class="flex_scriptinglanguage">Perl</span> version:
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ perlbrew list-modules | perlbrew exec --with 5.xx.yy cpanm</pre><br />
-</dd>
-</dl>
-<h3 class="subsection" id='magicparlabel-1791'><span class="subsection_label">4.8</span> <em><i>binary_grid2</i></em> backends<div id="subsec_binary_grid2_backends"></div>
-</h3>
-<div class="standard" id='magicparlabel-1792'>The &ldquo;backend&rdquo; of <em><i>binary_c</i></em> is a set of interface code between <em><i>binary_c</i></em> and <i>binary_grid</i><em>2</em>. To understand what a backend is, please see <a href="https://en.wikipedia.org/wiki/Front_and_back_ends">https://en.wikipedia.org/wiki/Front_and_back_ends</a>. There are two backends – <span class="flex_scriptinglanguage">Perl</span>  and <span class="flex_programminglanguage">C</span> – corresponding to the two different ways <em><i>binary_c</i></em> can talk to <i>binary_grid</i>. You should always use the <span class="flex_programminglanguage">C</span> backend if at all possible: it is faster and has more features, and the <span class="flex_scriptinglanguage">Perl</span>  backend will be deprecated at some point.</div>
-<h4 class="subsubsection" id='magicparlabel-1809'><span class="subsubsection_label">4.8.1</span> <span class="flex_programminglanguage">C</span> backend</h4>
-<div class="standard" id='magicparlabel-1814'>New to <em><i>binary_grid2</i></em> is the<em> </em><span class="flex_programminglanguage">C</span> backend. This features simpler code and uses <em><i>binary_c</i></em>'s <em>API</em> to access data directly, hence it is a lot faster than the <span class="flex_scriptinglanguage">Perl</span>  backend, and scales better on multi-core architectures. The down side is that installation is more difficult, especially if you have multiple projects.</div>
-
-<div class="standard" id='magicparlabel-1823'>If you see errors like:</div>
-
-<div class="standard" id='magicparlabel-1824'><b><br />
-<pre class ='listings'>perl: symbol lookup error: /.../perl5/perlbrew/perls/perl-5.29.8/lib/site_perl/5.29.8/x86_64-linux-thread-multi/auto/<i>binary_grid</i>/C/C.so: undefined symbol: new_system</pre><br />
-</b>then you have failed to build the shared library as is required when using the <span class="flex_programminglanguage">C</span> backend.
-<br />
-
-To make the <span class="flex_programminglanguage">C</span> backend work, you have to <em>first</em> build <span class="flex_file"><i>libbinary_c.so</i></span> and <em>then</em> install <em><i>binary_grid2</i></em>. In summary:</div>
-
-<ol class="enumerate" id='magicparlabel-1841'><li class="enumerate_item">Build <em><i>binary_c</i></em> as normal <br />
-<pre class\s*='listings bash'>$ make</pre><br />
-</li>
-<li class="enumerate_item">Make the shared library, <em><i>libbinary_c.so</i></em> <br />
-<pre class\s*='listings bash'>$ make <i>libbinary_c.so</i></pre><br />
-</li>
-<li class="enumerate_item">Install <em><i>binary_grid2</i> </em>using <em>cpanm </em><br />
-<pre class\s*='listings bash'>$ ./install_modules.pl Histogram <i>binary_grid</i></pre><br />
-</li>
-</ol>
-<div class="standard" id='magicparlabel-1856'>Because this module is written partly in <span class="flex_programminglanguage">C</span> and partly in <span class="flex_scriptinglanguage">Perl</span> , everything has to work perfectly or it will crash (usually with a segmentation fault). The shared library file <span class="flex_file"><i>libbinary_c.so</i></span><em> </em>must match with <em><i>binary_grid2</i></em> <b>at compile time</b>, and if you change anything in <em><i>binary_c</i></em> you probably have to follow the above instructions to reinstall the <span class="flex_programminglanguage">C</span> backend. </div>
-
-<div class="standard" id='magicparlabel-1873'>You can change the name of the shared library by setting the environment variable <span style='font-family:monospace;font-size: 18px;'>BINARY_GRID2_LIB</span> to the name of the library, and pointing <span class="flex_envvar">BINARY_C</span> to your <em><i>binary_c</i></em> tree. Then rebuild, e.g., assuming you already have a <span class="flex_file">builddir</span>,</div>
-
-<div class="standard" id='magicparlabel-1882'><br />
-<pre class\s*='listings bash'>$ export BINARY_GRID2_LIB=binary_c_custom
-$ export BINARY_C=$HOME/<i>binary_c</i>
-$ cd builddir
-$ meson --reconfigure -Dlibname=binary_c_custom
-$ ninja libbinary_c_custom.so
-$ 
-$ # ... change directory to where you have <i>binary_grid2</i>.tar.gz ... 
-$ 
-$ cpanm <i>binary_grid2</i>.tar.gz</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-1895'>The <em><i>binary_grid2</i></em> module respects the <span class="flex_envvar">BINARY_GRID2_LIB</span> environment variable. </div>
-
-<div class="standard" id='magicparlabel-1900'>I do not yet know how to have custom <span class="flex_programminglanguage">C</span> backend modules with different shared libraries. It is quite possible that you could use the <span class="flex_envvar">PERL_INLINE_DIRECTORY</span> environment variable to have multiple builds, and point to the appropriate one. Please read <a href="http://search.cpan.org/~ingy/Inline-0.44/Inline.pod">http://search.cpan.org/~ingy/Inline-0.44/Inline.pod</a> especially the section <em>The Inline DIRECTORY</em> for instructions on how it is best to set up production code for multiple projects. Let RGI know if it works, so better instructions can be put in here.</div>
-
-<div class="standard" id='magicparlabel-1909'>There are a number of environment variables which can be set when installing <em><i>binary_grid2</i></em>'s <em>C</em> backend:</div>
-
-<dl class='description' id='magicparlabel-1910'><dt class="description_label">BINARY_C</dt>
-<dd class="description_item"> The directory in which your <i>binary_c</i> source tree lives. From this, the <span class="flex_file">src</span> directory is at <span class="flex_file"><span class="flex_envvar">$BINARY_C</span>/src</span></dd>
-<dt class="description_label">BINARY_GRID2_LIB</dt>
-<dd class="description_item"> The name of the shared library. Usually this is <em>'<i>binary_c</i></em>'.</dd>
-<dt class="description_label">BINARY_GRID2_CC</dt>
-<dd class="description_item"> The name of the compiler used to build the <span class="flex_programminglanguage">C</span> backend. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">9.2</a>).</dd>
-<dt class="description_label">BINARY_GRID2_LD</dt>
-<dd class="description_item"> The name of the linker used to build the <span class="flex_programminglanguage">C</span> backend. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">9.2</a>).</dd>
-<dt class="description_label">BINARY_GRID2_INC</dt>
-<dd class="description_item"> Include flags for the build. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">9.2</a>).</dd>
-<dt class="description_label">BINARY_GRID2_EXTRAINC</dt>
-<dd class="description_item"> Include flags to be postfixed to the <em>inc</em> flags set above.</dd>
-<dt class="description_label">BINARY_GRID2_LIBS</dt>
-<dd class="description_item"> Library flags. Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">9.2</a>).</dd>
-<dt class="description_label">BINARY_GRID2_EXTRALIBS</dt>
-<dd class="description_item"> Library flags appended to the <em>libs</em> flags set above.</dd>
-<dt class="description_label">BINARY_GRID2_CCFLAGS</dt>
-<dd class="description_item"> Compiler flags.<span style='font-family:monospace;font-size: 18px;'> </span>Set by <span class="flex_bashscript"><i>binary_c</i>-config</span> by default (section&nbsp;<a href="#subsec_binary_c_config">9.2</a>).</dd>
-<dt class="description_label">BINARY_GRID2_EXTRACCFLAGS</dt>
-<dd class="description_item"> <i>C</i> compiler flags postfixed to the <em>ccflags </em>set above.</dd>
-<dt class="description_label">BINARY_GRID2_DEBUG</dt>
-<dd class="description_item"> If non-zero, is used at the debugging flag when building the <span class="flex_perlmodule">binary_grid::C</span> backend.</dd>
-</dl>
-<h4 class="subsubsection" id='magicparlabel-1965'><span class="subsubsection_label">4.8.2</span> The <i>C</i> backend with multiple versions of <em><i>binary_c</i></em></h4>
-<div class="standard" id='magicparlabel-1966'>You may well have several branches, each of which uses a different <em><i>binary_c</i></em> setup (e.g. one with <span class="flex_cmacro">NUCSYN</span>, one without). However, using <span class="flex_software">cpanm</span> the <span class="flex_perlmodule">binary_grid::C</span> module is installed only <em>once</em> and cannot possibly thus work with all your branches. (The reason is that in each branch the various structures used by <em><i>binary_c</i></em> will be of different sizes in memory, so trying to access them from an incompatible version will likely give you a segmentation fault.)</div>
-
-<div class="standard" id='magicparlabel-1979'>There is a solution. Make two directories containing your <em><i>binary_c</i></em> trees. You can either check out new copies of your git branches, or use &ldquo;git archive&rdquo; to copy a tree. In each tree, build a local copy of the <em><i>binary_grid</i></em> modules using <span class="flex_scriptinglanguage">Perl</span>'s <span class="flex_perlmodule">local::lib</span> and use this when calling your <span class="flex_scriptinglanguage">Perl</span>  grid script.</div>
-
-<div class="standard" id='magicparlabel-1992'>Note: it is important to set <span class="flex_envvar">BINARY_C</span> prior to the rebuild, this points to your <i>binary_c</i> directory (as checked out using <em>git</em>), because the <i>binary_grid</i> module looks in these locations for source code (which is different from tree to tree). So, from within the tree directory, run the following:</div>
-
-<div class="standard" id='magicparlabel-1997'><br />
-<pre class\s*='listings bash'>$ export BINARY_C=&rdquo;path_to_tree&rdquo; # you have to set this to the git checkout directory
-$ PERL_LIBDIR=&rdquo;path_to_binary_grid_perl_module&rdquo; # you have to set this
-$ 
-$ # make a Perl module build directory specific to this tree
-$ PERL_MODDIR=&rdquo;$BINARY_C/src/perl_local_lib&rdquo;
-$ mkdir -p $PERL_MODDIR
-$ 
-$ # install <i>binary_grid</i>. Note, we install from a clean directory
-$ mkdir -p build
-$ cd build
-$ cpanm --local-lib $PERL_MODDIR --reinstall $PERL_MODDIR
-$ cd ..
-$ rmdir build
-$ 
-$ # run your grid
-$ perl -Mlocal::lib=$PER_MODDIR your_grid_script.pl ...
-$ </pre><br />
-</div>
-<h4 class="subsubsection" id='magicparlabel-2018'><span class="subsubsection_label">4.8.3</span> Perl backend</h4>
-<div class="standard" id='magicparlabel-2019'><b>Warning: the <span class="flex_scriptinglanguage">Perl</span>  backend will soon be deprecated.</b></div>
-
-<div class="standard" id='magicparlabel-2024'>In <em><i>binary_grid</i> </em>version 1, the only backend available was the <span class="flex_scriptinglanguage">Perl</span>  backend which communicates with <em><i>binary_c</i></em> via a set of <span class="flex_os">Unix</span> pipes. This is portable and flexible, and hence for many years was the default. It does not, however, scale very well in multi-CPU architectures (mostly because of the bandwidth required for the pipes). In <em><i>binary_grid2</i></em> a pure  <span class="flex_scriptinglanguage">Perl</span>  module is also provided, both for backwards compatibility and because the code is well tested and stable. The  <span class="flex_scriptinglanguage">Perl</span>  backend is installed by default with <em><i>binary_grid2</i> </em>although the <span class="flex_programminglanguage">C</span><em> </em>backend will replace it eventually.</div>
-
-<div class="standard" id='magicparlabel-2045'>It is a simple matter of changing the <span class="flex_perlcode">prog</span> grid variable if you want to use a different version of <em><i>binary_c</i></em> with each grid script.</div>
-
-<div class="standard" id='magicparlabel-2050'><br />
-</div>
-<h2 class="section" id='magicparlabel-2051'><span class="section_label">5</span> Evolving single and binary stars</h2>
-<div class="standard" id='magicparlabel-2052'><div id="sec_Simple_Use"></div>
-This section describes how to run <em><i>binary_c</i></em> on one stellar system, be it single or binary. The web home of <i>binary_c</i> is <a href="http://personal.ph.surrey.ac.uk/~ri0005/<i>binary_c</i>.html">http://personal.ph.surrey.ac.uk/~ri0005/<i>binary_c</i>.html</a>. The online binary-star simulator is at <a href="http://personal.ph.surrey.ac.uk/~ri0005/cgi-bin/binary5.cgi">http://personal.ph.surrey.ac.uk/~ri0005/cgi-bin/binary5.cgi</a>. If these should move, you can use your favourite web-search engine to locate the code.</div>
-
-<div class="standard" id='magicparlabel-2053'>You should consider joining the mailing lists (see Sec.&nbsp;<a href="#subsec_mailing_lists">1.3</a>).</div>
-<h3 class="subsection" id='magicparlabel-2054'><span class="subsection_label">5.1</span> Running</h3>
-<div class="standard" id='magicparlabel-2055'><div id="subsec_Running"></div>
-</div>
-
-<div class="standard" id='magicparlabel-2056'>A <span class="flex_scriptinglanguage">bash</span> script called <span class="flex_file">tbse</span> is provided to run one single or binary star system. Run it with
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ ./tbse</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-2069'>from the <em><i>binary_c</i></em> directory (you can omit the <span class="flex_file">.</span> if it is in your <span class="flex_envvar">PATH</span>). The script sets a number of <span class="flex_scriptinglanguage">bash</span> variables (in capital letters) which are then passed to <i>binary_c</i>. In general, the capitalized <span class="flex_scriptinglanguage">bash</span><em> </em>variable corresponds to the same variable in <i>binary_c</i> in lower case. For example,</div>
-
-<div class="standard" id='magicparlabel-2086'><br />
-<pre class ='listings'># Initial primary mass
-M1=6
-# Initial secondary mass
-M2=3
-# Initial orbital period (days) 
-ORBITAL_PERIOD=100
-# Initial eccentricity
-ECCENTRICITY=0.2
-# (Initial) Metallicity
-METALLICITY=0.02
-# Maximum evolution time (MYr)
-MAX_EVOLUTION_TIME=16000</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-2102'>Many parameters are not just simple numbers, they are choices of algorithms. You can replace the numerical algorithm number, as usually defined by a macro in a header file, with the macro itself. For example, the following two are equivalent because the macro <span class="flex_cmacro">MAGNETIC_BRAKING_ALGORITHM_HURLEY_2002</span> is defined to be <span class="flex_cvar">0</span>,<br />
-<pre class ='listings'>MAGNETIC_BRAKING_ALGORITHM=0
-MAGNETIC_BRAKING_ALGORITHM=MAGNETIC_BRAKING_ALGORITHM_HURLEY_2002</pre><br />
-similarly, you can use <span class="flex_cmacro">True</span> and <span class="flex_cmacro">False</span> (or <span class="flex_cmacro">t</span>, <span class="flex_cmacro">T</span>, <span class="flex_cmacro">true</span>, etc.) to represent <span class="flex_cvar">1</span> and <span class="flex_cvar">0</span> respectively,<br />
-<pre class ='listings'>PRE_MAIN_SEQUENCE=True
-PRE_MAIN_SEQUENCE_FIT_LOBES=False</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-2149'>A simple output log is sent to the file defined in <span class="flex_cmacro">LOG_FILENAME</span> which is <span class="flex_file">/tmp/c_log2.dat</span> by default. What gets output to the screen depends on what options you select (see section <a href="#subsec_Advanced_Configuration">9</a>).</div>
-
-<div class="standard" id='magicparlabel-2158'>Run <br />
-<pre class\s*='listings bash'>$ tbse help</pre><br />
-to obtain general help for <span class="flex_file">tbse</span> or read Section&nbsp;<a href="#subsec_tbse_commands">4.5.1</a> to see more options.</div>
-
-<div class="standard" id='magicparlabel-2167'>Use<br />
-<pre class\s*='listings bash'>$ ./<i>binary_c</i> help </pre><br />
-for general <i>binary_c</i> help, or <br />
-<pre class\s*='listings bash'>$ ./<i>binary_c</i> help &lt;string&gt;</pre><br />
-to get help on the contents of string, for example let's say you want to know which options are available for the <span class="flex_cvar">magnetic_braking_algorithm</span> preference:<br />
-<pre class ='listings'>./<i>binary_c</i> help magnetic_braking_algorithm
-<i>binary_c</i> help for variable : magnetic_braking_algorithm &lt;Integer&gt;
-
-Algorithm for the magnetic braking angular momentum loss rate. 0 = Hurley et al. 2002, 1 = Andronov, Pinnsonneault and Sills 2003, 2 = Barnes and Kim 2010 
-
-Available macros:
-
-MAGNETIC_BRAKING_ALGORITHM_HURLEY_2002 = 0
-MAGNETIC_BRAKING_ALGORITHM_ANDRONOV_2003 = 1
-MAGNETIC_BRAKING_ALGORITHM_BARNES_2010 = 2
-MAGNETIC_BRAKING_ALGORITHM_RAPPAPORT_1983 = 3
-</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-2195'>Do <em>not</em> use <span class="flex_file">tbse</span> to run many stars in a stellar population! This is amazingly inefficient: you'll waste a huge amount of time just loading <span class="flex_scriptinglanguage">bash</span> and saving your data.</div>
-
-<div class="standard" id='magicparlabel-2204'><br />
-</div>
-<h2 class="section" id='magicparlabel-2205'><span class="section_label">6</span> Making populations of stars with <i>binary_grid2</i></h2>
-<div class="standard" id='magicparlabel-2206'><div id="subsec_Running_a_grid"></div>
-You <em>could</em> run many stars by directly calling <em><i>binary_c</i></em> with the appropriate arguments or making many <span class="flex_file">tbse</span><em> </em>scripts. This is <em><b>very</b></em> <em><b>inefficient</b></em>. Instead, <em><i>binary_c</i></em> can be controlled by a <span class="flex_scriptinglanguage">Perl</span>  script, e.g.&nbsp;<span class="flex_file">grid.pl</span>, which uses a library of functions in the <em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mstyle mathvariant='normal'>
-    <mstyle mathvariant='italic'>
-     <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>_<mi>g</mi><mi>r</mi><mi>i</mi><mi>d</mi>
-     </mrow>
-    </mstyle>
-   </mstyle><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math></em> <span class="flex_scriptinglanguage">Perl</span>  module to run the stars on a grid for you.</div>
-
-<h3 class="subsection" id='magicparlabel-2225'><span class="subsection_label">6.1</span> Introduction</h3>
-<div class="standard" id='magicparlabel-2226'>The <em><span class='math'>\binarygrid</span>
-</em> software has been developed over the last ten years or so by Robert Izzard with help from many people around the world. It is designed to work with the <em><span class='math'>binary_c</i></span>
-</em> stellar evolution code, based on <em>BSE</em> of <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>), but should work with any suitably prepared stellar evolution code. In 2011 and 2012, the old <em><span class='math'>\binarygrid</span>
-</em> code was replaced with the <em>flexigrid</em> – this document is the guide to the <em>flexigrid</em> version of software. In 2016 a new <em><span class='math'>\binarygrid</span>
-2</em> was forked and made object-oriented, with new backends (in <span class="flex_programminglanguage">C</span> and <span class="flex_scriptinglanguage">Perl</span>) to access the <span class='math'>binary_c</i></span>
- code. In the future, only the (faster, simpler) <span class="flex_programminglanguage">C</span> backend will be supported. In the following, <em><span class='math'>\binarygrid</span>
- </em>implies <em><span class='math'>\binarygrid</span>
-2</em>, although there may be parts of the documentation which require an update to the newer version (please let RGI know if you find an example).</div>
-<h3 class="subsection" id='magicparlabel-2248'><span class="subsection_label">6.2</span> Aims: what the grid does and why</h3>
-<div class="standard" id='magicparlabel-2249'><div id="sec_aims"></div>
-Binary population synthesis is a glorified form of accountancy, without the huge pay but with of course much more fun! It involves modelling perhaps millions of binary stars in a population to pick out those few that contribute to the population of scientific interest. The rate of formation, or number of these stars, or some other property of them can then be examined in a <em>quantitative</em> and <em>statistical</em> manner. This manual explains how the <em><span class='math'>\binarygrid</span>
- </em>module – part of the <em><span class='math'>binary_c</i></span>
-</em> code package – can be used to model populations of single and binary stars. This guide is <em>only</em> concerned with the details of running grids of models, not about the details of the models themselves.</div>
-<h3 class="subsection" id='magicparlabel-2250'><span class="subsection_label">6.3</span> Grid dimensions<div id="subsec_Grid_dimensions"></div>
-</h3>
-<div class="standard" id='magicparlabel-2251'>There are many parameters which can be set before running a stellar model. The most important, for single stars, are the stellar mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math> and metallicity <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>Z</mi>
- </mrow></mstyle></math>. It is common to set the metallicity <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>Z</mi>
- </mrow></mstyle></math> to be constant and vary the initial stellar mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math>. In everything that follows I will assume you are working at a constant metallicity <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>Z</mi>
- </mrow></mstyle></math>. </div>
-
-<div class="standard" id='magicparlabel-2252'>The situation is more complicated in binaries because instead of just <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math> there are two stellar masses <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, the separation <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math> (or, equivalently, the period <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>P</mi>
- </mrow></mstyle></math>) and perhaps the eccentricity <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>e</mi>
- </mrow></mstyle></math>. To run a population of binary stars then requires a grid of models in four dimensions. Often the eccentricity is ignored because close binaries – which are the ones in which you may be interested – tend to circularise rapidly. This reduces the problem to three dimensions.</div>
-
-<div class="standard" id='magicparlabel-2253'>The number of stars on each side of the grid, i.e. the <em>resolution</em> <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>n</mi>
- </mrow></mstyle></math>, roughly determines the total runtime of your simulation. In single stars this is just <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Delta; </mo><mi>t</mi><mo> &times; </mo><mi>n</mi>
-  </mrow>
- </mrow></mstyle></math>, where one model takes a time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Delta; </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> to run. In the case of binaries on a three-dimensional grid, this increases to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Delta; </mo><mi>t</mi><mo> &times; </mo>
-   <msup>
-    <mrow><mi>n</mi>
-    </mrow>
-    <mrow><mn>3</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math> (see Fig.&nbsp;<a href="#fig_grid_size">1</a>). In a typical population <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>n</mi><mo> &sim; </mo><mn>100</mn>
-  </mrow>
- </mrow></mstyle></math> so the total runtime increases by a factor of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>10</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msup><mo>=</mo><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>4</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math>. This ignores the increase in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Delta; </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> for binaries which is unavoidable because there are two stars under consideration as well as smaller timesteps during mass transfer. It is for this reason that the <em><i>binary_c</i>/nucsyn</em> code (and its BSE ancestor) must be – and is – fast. It can run a population of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>6</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math> binaries in less than <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>24</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>C</mi><mi>P</mi><mi>U</mi><mspace width="6px" /><mi>h</mi><mi>o</mi><mi>u</mi><mi>r</mi><mi>s</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>. </div>
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-2257'><img style='width:45%;' src='images/4.png' alt='image: 10_tmp_binary_c_lyx_images_2.png' />
-<img style='width:45%;' src='images/5.png' alt='image: 11_tmp_binary_c_lyx_images_3.png' />
-</div>
-
-<div class="plain_layout" id='magicparlabel-2258'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 1:  <div id="fig_grid_size"></div>
-The relative size of the single- and binary-star grids. In single stars only one mass is required, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, while in binaries the two masses <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and separation are needed. For a grid resolution of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>n</mi><mo>=</mo><mn>100</mn>
-  </mrow>
- </mrow></mstyle></math>, the runtime for the single stars (left cuboid) is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>100</mn><mo> &times; </mo><mo> &Delta; </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math>, where <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Delta; </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> is the runtime for one stellar system. In binaries (right cuboid) this increases to at least <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>6</mn>
-    </mrow>
-   </msup><mo> &times; </mo><mo> &Delta; </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> because of the extra grid dimensions. In addition, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Delta; </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> will be longer for binaries because of the short timesteps required during some phases of mass transfer, the fact that there are two stars to follow in the evolution/nucleosynthesis algorithms and extra overhead from logging and parsing output from both stars. Typically, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Delta; </mo><mi>t</mi><mo> &sim; </mo><mn>0.1</mn><mspace width="6px" />
-   <mstyle class='mathbox'>s
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> on a <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>3</mn><mspace width="6px" />
-   <mstyle class='mathbox'>
-    <mrow>Ghz
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> PC.</span></div>
-</div>
-
-<h3 class="subsection" id='magicparlabel-2263'><span class="subsection_label">6.4</span> What to do with the grid<div id="subsec_What_to_do"></div>
-</h3>
-<div class="standard" id='magicparlabel-2264'>What do we do once the grid of stars is set up? In most cases this involves adding up some statistics related to each star on the grid. There are two approaches which are commonly used, constant star formation and a starburst. The one that suits you depends on what you are trying to calculate and to which observations you hope to compare.</div>
-<h4 class="subsubsection" id='magicparlabel-2265'><span class="subsubsection_label">6.4.1</span> Constant star formation rate</h4>
-<div class="standard" id='magicparlabel-2266'>In this case the formation rate or (perhaps <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math>-weighted) probabilities for each star corresponding to those in which you are interested are simply added up. This is why I say it is like accountancy! Because the rate of star formation is assumed to be <em>constant</em> the evolution time of the stellar evolution is irrelevant. A hybrid scheme can also be used, you might only consider stars older than a given age (e.g. for halo stars).</div>
-<h4 class="subsubsection" id='magicparlabel-2267'><span class="subsubsection_label">6.4.2</span> Starburst</h4>
-<div class="standard" id='magicparlabel-2268'>All stars form at time zero and you add up the (probably <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math>-weighted) number of stars in which you are interested which form or exist in each time bin. A good example is the delay-time distribution of type Ia supernovae.
-<br />
-
-</div>
-
-<div class="standard" id='magicparlabel-2269'>The statistic you wish to add up is usually output from <em><span class='math'>binary_c</i></span>
-. </em>Your &ldquo;grid script&rdquo; runs each star in your population, takes the output of <em><span class='math'>binary_c</i></span>
-</em> and adds up the statistic. You can generate single numbers, histograms or arbitrarily complicated statistical constructs for comparison with observations. You can choose whether to do the calculations on the fly or save the progenitor information for later data processing.</div>
-
-<div class="standard" id='magicparlabel-2270'>The grid script can be used on multi-CPU machines and handles the administrative issues regarding parallel processing.</div>
-
-<div class="standard" id='magicparlabel-2271'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-2272'><span class="subsection_label">6.5</span> Grid setup (in theory)</h3>
-<div class="standard" id='magicparlabel-2273'><div id="sec_grid_setup_theory"></div>
-This section presents the <em>theory</em> behind the setup of a grid in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math>, for single stars, or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math> for binary stars. In general a <em>logarithmic</em> spacing is chosen for the mass grid because the important relevant physical processes are &ldquo;more different&rdquo; for the mass range <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn><mo>-</mo><mn>10</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> than between <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>10</mn><mo>-</mo><mn>100</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>. This is rather subjective but you can chose the bounds of your grid to reflect the stars in which your interest lies.</div>
-
-<div class="standard" id='magicparlabel-2274'>Each star in the grid represents a <em>phase volume</em>. This means that a star of mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math> represents stars which, in reality, have masses <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>M</mi><mo>-</mo><mi> &delta; </mi><mi>M</mi><mo>/</mo><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math> to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>M</mi><mo>+</mo><mi> &delta; </mi><mi>M</mi><mo>/</mo><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math>, where <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>M</mi>
-  </mrow>
- </mrow></mstyle></math> is the grid spacing. In an ideal world <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>M</mi>
-  </mrow>
- </mrow></mstyle></math> would be very small, so our simulations match reality as closely as possible. However, this is not usually possible if the grid is to run in a reasonable amount of time (before funding runs out). The usual way around this is to 1) be clever and/or 2) use a brute-force approach where the resolution is increased (in this case <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>M</mi>
-  </mrow>
- </mrow></mstyle></math> decreased) until your &ldquo;answer&rdquo; converges.</div>
-
-<div class="standard" id='magicparlabel-2275'>One concept which must be grasped is that the bounds of the <em>grid</em> are not necessarily the bounds of the <em>initial distributions</em> you will be using (e.g. the initial mass function, IMF). This is a critical point which can lead to confusion, it is best explained with an example. Say you wish to calculate the ratio of type II to type Ib/c supernovae. You would do this by adding up the number of stars that explode as type IIs and divide by the number of stars that explode as type Ib/cs. You <em>could</em> do this with a grid from <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0.1</mn>
- </mrow></mstyle></math> to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>100</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> and, given enough stars, you would come up with the correct answer. This is easy for single stars, because <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>4</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math> single stars are easily run on a modern PC. However, in binaries this is difficult, because even with only <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>100</mn>
- </mrow></mstyle></math> stars in the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math> dimensions, there would be <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>8</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math> stars in your simulation and the runtime would be huge. You can, however, be smarter and reduce the grid bounds and resolution. You know in advance that at solar metallicity (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>Z</mi><mo>=</mo><mn>0.02</mn>
-  </mrow>
- </mrow></mstyle></math>) type II and Ib/c supernovae occur in <em>single stars</em> with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>M</mi><mo> &gsim; </mo><mn>8</mn>
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>. If you choose <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> to run between (say) <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>4</mn>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>100</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> you know you will record the supernovae from mass transfer (as <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msub><mo> &le; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>1</mn>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> so the minimum mass of merged stars is the required <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>8</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>) as well as all the others at higher masses. So, you will get the <em>same answer</em> from a grid between <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>4</mn>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>100</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> as with a grid between <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0.1</mn>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>100</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>. Note that the <em>grid</em> has changed, but the result has not. This is because the initial distributions have fixed bounds independent of the grid bounds. See Section&nbsp;<a href="#sec_initial_dists">6.20</a> for more details on initial distributions. </div>
-
-<div class="standard" id='magicparlabel-2276'>This process requires some knowledge in advance, which you may not have. In that case, run a low resolution grid, find suitable grid bounds and then repeat at higher resolution until you are happy. The downside to the process is that you may well miss small parts of the parameter space which contain interesting systems. In practice this is often a compromise worth making and, if in doubt, test your model runs at low resolution but then crank the resolution to the maximum you think is possible for the final model run.</div>
-
-<div class="standard" id='magicparlabel-2277'>Another advantage of choosing the grid bounds is that sub-grids can be run on different computers or CPU cores and the results combined. This is discussed further in Section&nbsp;<a href="#sec_The_Thread_Model">6.22</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-2278'><span class="subsubsection_label">6.5.1</span> Phase Volume</h4>
-<div class="standard" id='magicparlabel-2279'><div id="subsec_phase_volume"></div>
-Given a chosen set of these distributions a logarithmic grid is set up in one-dimensional <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math> space for single stars or in 3D <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>–<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>–<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math> space for binary stars. The grid is split into <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>n</mi>
- </mrow></mstyle></math> stars per dimension such that each star represents the centre of a logarithmic grid-cell of size <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>V</mi>
-  </mrow>
- </mrow></mstyle></math> where </div>
-
-<div class="standard" id='magicparlabel-2280'><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mtable>
-  <mtr>
-   <mtd>
-    <mrow><mi> &delta; </mi><mi>V</mi><mo>=</mo><mo form='prefix' fence='true' stretchy='true' symmetric='true' lspace='thinmathspace'>{</mo>
-     <mtable>
-      <mtr>
-       <mtd>
-        <mrow><mi> &delta; </mi><mo> ln </mo><mi>M</mi>
-        </mrow>
-       </mtd>
-       <mtd>
-        <mstyle mathvariant='normal'>
-         <mrow><mi>s</mi><mi>i</mi><mi>n</mi><mi>g</mi><mi>l</mi><mi>e</mi>&nbsp;<mi>s</mi><mi>t</mi><mi>a</mi><mi>r</mi><mi>s</mi>
-         </mrow>
-        </mstyle>
-       </mtd>
-      </mtr>
-      <mtr>
-       <mtd>
-        <mrow><mi> &delta; </mi><mo> ln </mo>
-         <msub subscriptshift="0.2ex">
-          <mrow><mi>M</mi>
-          </mrow>
-          <mrow><mn>1</mn>
-          </mrow>
-         </msub><mspace width="6px" /><mi> &delta; </mi><mo> ln </mo>
-         <msub subscriptshift="0.2ex">
-          <mrow><mi>M</mi>
-          </mrow>
-          <mrow><mn>2</mn>
-          </mrow>
-         </msub><mspace width="6px" /><mi> &delta; </mi><mo> ln </mo><mi>a</mi>
-        </mrow>
-       </mtd>
-       <mtd>
-        <mstyle mathvariant='normal'>
-         <mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>r</mi><mi>y</mi>&nbsp;<mi>s</mi><mi>t</mi><mi>a</mi><mi>r</mi><mi>s</mi>
-         </mrow>
-        </mstyle>
-       </mtd>
-      </mtr>
-     </mtable><mo form='postfix' fence='true' stretchy='true' symmetric='true' lspace='thinmathspace'>.</mo>
-    </mrow>
-   </mtd>
-   <mtd>(1)
-   </mtd>
-  </mtr>
- </mtable></mstyle></math>and<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mtable>
-  <mtr>
-   <mtd>
-    <mrow><mi> &delta; </mi><mo> ln </mo><mi>x</mi><mo>=</mo>
-     <mfrac>
-      <mrow>
-       <mrow><mo> ln </mo>
-        <msub subscriptshift="0.2ex">
-         <mrow><mi>x</mi>
-         </mrow>
-         <mrow>
-          <mstyle mathvariant='normal'>
-           <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-           </mrow>
-          </mstyle>
-         </mrow>
-        </msub><mo>-</mo><mo> ln </mo>
-        <msub subscriptshift="0.2ex">
-         <mrow><mi>x</mi>
-         </mrow>
-         <mrow>
-          <mstyle mathvariant='normal'>
-           <mrow><mi>m</mi><mi>i</mi><mi>n</mi>
-           </mrow>
-          </mstyle>
-         </mrow>
-        </msub>
-       </mrow>
-      </mrow>
-      <mrow><mi>n</mi>
-      </mrow>
-     </mfrac><mspace width="6px" /><mo>,</mo>
-    </mrow>
-   </mtd>
-   <mtd>(2)
-   </mtd>
-  </mtr>
- </mtable></mstyle></math>where <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math> represents <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>i</mi><mi>n</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> are the grid limits. The total number of stars is denoted by <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>N</mi>
- </mrow></mstyle></math> such that <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>N</mi><mo>=</mo><mi>n</mi>
-  </mrow>
- </mrow></mstyle></math> for single stars and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>N</mi><mo>=</mo>
-   <msup>
-    <mrow><mi>n</mi>
-    </mrow>
-    <mrow><mn>3</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math> for binary stars.</div>
-
-<div class="standard" id='magicparlabel-2281'>The probability of existence of star <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>i</mi>
- </mrow></mstyle></math> is given by</div>
-
-<div class="standard" id='magicparlabel-2282'><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mtable>
-  <mtr>
-   <mtd>
-    <mrow><mi> &delta; </mi>
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>p</mi>
-      </mrow>
-      <mrow><mi>i</mi>
-      </mrow>
-     </msub><mo>=</mo><mo> &Psi; </mo><mi> &delta; </mi>
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>V</mi>
-      </mrow>
-      <mrow><mi>i</mi>
-      </mrow>
-     </msub><mo>=</mo><mo> &Psi; </mo><mi> &delta; </mi><mi>V</mi><mspace width="6px" /><mo>,</mo>
-    </mrow>
-   </mtd>
-   <mtd>(3)
-   </mtd>
-  </mtr>
- </mtable></mstyle></math>because <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>V</mi>
-  </mrow>
- </mrow></mstyle></math> is a constant. The function <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mo> &Psi; </mo>
- </mrow></mstyle></math> is discussed in Section&nbsp;<a href="#sec_initial_dists">6.20</a>. </div>
-
-<div class="standard" id='magicparlabel-2283'>The probability, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>p</mi>
-    </mrow>
-    <mrow><mi>i</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>, is sometimes the quantity you wish to add up, although commonly you want <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>p</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'><mi>i</mi>
-     </mstyle>
-    </mrow>
-   </msub><mo> &times; </mo><mi> &delta; </mi><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> where <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> is the time spent in the phase of interest. This is usually the case when comparing the number of stars which go through a particular phase of evolution because the <em>time </em>in the phase of evolution is as important as the <em>probability</em> of the star existing in the first place.<em> </em>However, for <em>event rates</em> (e.g. supernovae) the time involved is zero, they are instantaneous events on a stellar evolution timescale, so you have to sum up the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>p</mi>
-    </mrow>
-    <mrow><mi>i</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>. You have to be careful to calculate the appropriate statistics for comparison with the observations.</div>
-<h4 class="subsubsection" id='magicparlabel-2284'><span class="subsubsection_label">6.5.2</span> Grid loops</h4>
-<div class="standard" id='magicparlabel-2285'><div id="subsec_grid_loops"></div>
-In binary systems, the secondary mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> typically depends on the primary mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, and the separation, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math>, or period <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>P</mi>
- </mrow></mstyle></math>, may depend on both. This means that usually the grid must be constructed in a series of nested loops:</div>
-
-<div class="standard" id='magicparlabel-2286'><div id="eq_grid_loops"></div>
-<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mtable>
-  <mtr>
-   <mtd>
-    <mrow>
-     <msubsup>
-      <mrow>
-       <mstyle displaystyle='true' scriptlevel='0'><mo> &sum; </mo>
-       </mstyle>
-      </mrow>
-      <mrow>
-       <mrow>
-        <msub subscriptshift="0.2ex">
-         <mrow><mi>M</mi>
-         </mrow>
-         <mrow><mn>1</mn>
-         </mrow>
-        </msub><mo>=</mo>
-        <msub subscriptshift="0.2ex">
-         <mrow><mi>M</mi>
-         </mrow>
-         <mrow>
-          <mstyle mathvariant='normal'>
-           <mrow><mn>1</mn><mo>,</mo><mi>m</mi><mi>i</mi><mi>n</mi>
-           </mrow>
-          </mstyle>
-         </mrow>
-        </msub>
-       </mrow>
-      </mrow>
-      <mrow>
-       <msub subscriptshift="0.2ex">
-        <mrow><mi>M</mi>
-        </mrow>
-        <mrow>
-         <mrow><mn>1</mn><mo>,</mo>
-          <mstyle mathvariant='normal'>
-           <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-           </mrow>
-          </mstyle>
-         </mrow>
-        </mrow>
-       </msub>
-      </mrow>
-     </msubsup><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-     <mrow>
-      <msubsup>
-       <mrow><mo> &sum; </mo>
-       </mrow>
-       <mrow>
-        <mrow>
-         <msub subscriptshift="0.2ex">
-          <mrow><mi>M</mi>
-          </mrow>
-          <mrow><mn>2</mn>
-          </mrow>
-         </msub><mo>=</mo>
-         <msub subscriptshift="0.2ex">
-          <mrow><mi>M</mi>
-          </mrow>
-          <mrow><mn>2</mn>
-          </mrow>
-         </msub>
-        </mrow>
-       </mrow>
-       <mrow>
-        <msub subscriptshift="0.2ex">
-         <mrow><mi>M</mi>
-         </mrow>
-         <mrow>
-          <mrow><mn>2</mn>
-           <mstyle mathvariant='normal'>
-            <mrow><mo>,</mo><mi>m</mi><mi>a</mi><mi>x</mi>
-            </mrow>
-           </mstyle>
-          </mrow>
-         </mrow>
-        </msub>
-       </mrow>
-      </msubsup><mo form='prefix' fence='true' stretchy='true' symmetric='true'>{</mo>
-
-      <mrow>
-       <msubsup>
-        <mrow><mo> &sum; </mo>
-        </mrow>
-        <mrow>
-         <mrow><mi>a</mi><mo>=</mo>
-          <msub subscriptshift="0.2ex">
-           <mrow><mi>a</mi>
-           </mrow>
-           <mrow>
-            <mstyle mathvariant='normal'>
-             <mrow><mi>m</mi><mi>i</mi><mi>n</mi>
-             </mrow>
-            </mstyle>
-           </mrow>
-          </msub>
-         </mrow>
-        </mrow>
-        <mrow>
-         <msub subscriptshift="0.2ex">
-          <mrow><mi>a</mi>
-          </mrow>
-          <mrow>
-           <mstyle mathvariant='normal'>
-            <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-            </mrow>
-           </mstyle>
-          </mrow>
-         </msub>
-        </mrow>
-       </msubsup><mo form='prefix' fence='true' stretchy='true' symmetric='true'>[</mo>
-
-       <mi>&hellip;
-       </mi>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>]</mo>
-
-      </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>}</mo>
-
-     </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-<mspace width="6px" /><mn>.</mn>
-    </mrow>
-   </mtd>
-   <mtd>(4)
-   </mtd>
-  </mtr>
- </mtable></mstyle></math>In the most grids, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> depends on <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> through the mass-ratio, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>q</mi><mo>=</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msub><mo>/</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>1</mn>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>, distribution. The default mass-ratio distribution is flat in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>q</mi>
- </mrow></mstyle></math> (see Section&nbsp;<a href="#sec_initial_dists">6.20</a>), with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>0.1</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub><mo> &le; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msub><mo> &le; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>1</mn>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>. The period or separation distribution may also depend on <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>.</div>
-<h4 class="subsubsection" id='magicparlabel-2287'><span class="subsubsection_label">6.5.3</span> Resolution</h4>
-<div class="standard" id='magicparlabel-2288'><div id="subsec_resolution"></div>
-The choice of grid resolution depends very much on the problem you wish to address and what you are trying to calculate. As a general rule, assuming you are modelling stars from <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>m</mi><mi>i</mi><mi>n</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo>=</mo><mn>0.1</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo>=</mo><mn>100</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> you probably want at least <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>100</mn>
- </mrow></mstyle></math> stars in the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math> (or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>) dimension. </div>
-
-<div class="standard" id='magicparlabel-2289'>However, before rushing off to run millions of stars, run some low-resolution test models and gradually increase the number of stars. The best way to determine the required resolution is simply the brute force method: keep increasing the resolution until your answers converge.</div>
-
-<div class="standard" id='magicparlabel-2290'>You can roughly estimate the <em>statistical </em>error by counting the number of stars that satisfy your criterion (say <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>k</mi>
- </mrow></mstyle></math> stars) and then use Poisson statistics (i.e. the error on a value <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math> is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>x</mi><mo>/</mo>
-   <msqrt><mi>k</mi>
-   </msqrt>
-  </mrow>
- </mrow></mstyle></math>). <b>Be warned that this is <em>not</em> the error due to the use of a grid.</b> If your data calculation binning is <em>over</em>-resolved you may see problems with artefacts and aliasing. These may or may not affect your results. If in doubt, increase the resolution until the problem goes away (if it goes away!). In some cases this may not be possible because your computer is not fast enough. You could always buy a time machine&hellip; but then you wouldn't be doing astrophysics!</div>
-
-<div class="standard" id='magicparlabel-2291'>Overall resolution is often not your only concern: perhaps you want more stars in a certain region of the parameter space. Well, with the flexigrid and its spacing_functions module you can define your own grid spacing function which as flexible as you like (see Sections&nbsp;<a href="#sec_flexigrid">6.11</a> and <a href="#sec_The_spacing_functions_module">6.21</a>). </div>
-
-<div class="standard" id='magicparlabel-2292'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-2293'><span class="subsection_label">6.6</span> Data parsing</h3>
-<div class="standard" id='magicparlabel-2294'><div id="sec_data_parsing"></div>
- Before you actually run your own population synthesis grid you have to think about what you want to discover from your stellar models. A few standard cases are outlined here. It is vital to decide what you want in advance, because often data analysis takes up a large chunk of CPU time when evolving a population. While <em><span class='math'>\binarygrid</span>
-2</em> is a great advance over earlier versions of <span class='math'>\binarygrid</span>
- in this regard, it is still good to be <em>efficient</em>.</div>
-
-<div class="standard" id='magicparlabel-2295'>This section describes the theory, the practical aspects of combining<em> <span class='math'>binary_c</i></span>
- </em>with your grid script are described in the following, e.g. Section&nbsp;<a href="#sec_grid_pl">6.9</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-2296'><span class="subsubsection_label">6.6.1</span> Rates of things</h4>
-<div class="standard" id='magicparlabel-2297'><div id="subsec_rates_of_things"></div>
-The simplest thing to calculate is the rate of formation of some type of star, or alternatively the rate of stellar death (e.g. the supernova rate), merger rate, etc. These are <em>events </em>which have no duration so the important thing to log is the <em>time at which the event happened</em>,<em> <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>t</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math></em>, and <em>the probability of existence of the stellar system, </em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>.</div>
-
-<div class="standard" id='magicparlabel-2298'>You will probably want to count the number of systems that explode in a given time bin, i.e. between time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>t</mi>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>t</mi><mo>+</mo><mo> &Delta; </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math>, where <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Delta; </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> is the time bin width (<em>not</em> the <span class='math'>binary_c</i></span>
- timestep! see also section&nbsp;<a href="#subsec_Timestepping">8.7</a>). The formation rate is the product of the star formation rate <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>S</mi>
- </mrow></mstyle></math> and the summed probability of the stars that do whatever it is that is interesting in time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>t</mi>
- </mrow></mstyle></math> to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>t</mi><mo>+</mo><mo> &Delta; </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &sum; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>p</mi>
-    </mrow>
-    <mrow><mi>i</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>. You have to somehow calculate <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>S</mi>
- </mrow></mstyle></math> (see e.g. <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span>, <span class="bib-year">2002</span></a> for a simple prescription). You would be better comparing the relative rates of two types of event, in which case <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>S</mi>
- </mrow></mstyle></math> (and its associated uncertainty) cancels out.</div>
-
-<div class="standard" id='magicparlabel-2299'>This is all correct for a starburst at time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>t</mi><mo>=</mo><mn>0</mn>
-  </mrow>
- </mrow></mstyle></math>. If you want to use a more realistic star formation history with varying metallicity you have to convolve the results of many starbursts. You can do this manually (and it is easy if, say, the metallicity and other physics is not a function of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>t</mi>
- </mrow></mstyle></math>) or use a pre-existing code such as RGI's Galactic Chemical Evolution (<em>GCE</em>) code. The latter has the advantage that it already exists and is well tested. You will, however, have to ask RGI about it because it is not (yet) a part of the standard<em> <span class='math'>binary_c</i></span>
- </em>distribution. </div>
-<h4 class="subsubsection" id='magicparlabel-2300'><span class="subsubsection_label">6.6.2</span> Numbers of things</h4>
-<div class="standard" id='magicparlabel-2301'><div id="subsec_numbers_of_things"></div>
-</div>
-
-<div class="standard" id='magicparlabel-2302'>Alternatively, perhaps you wish to calculate the number of stars of a certain type e.g. the number of carbon stars or the number of K-type stars. In this case you have to count both the probability of the existence of the star <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and the time the star spends in the evolutionary phase of interest. If we assume <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>S</mi><mo>=</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math> (i.e. constant star formation) you should then count <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &sum; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>p</mi>
-    </mrow>
-    <mrow><mi>i</mi>
-    </mrow>
-   </msub><mspace width="6px" /><mi> &delta; </mi><mi>t</mi><mspace width="6px" />
-   <mover>
-    <mrow><mi> &delta; </mi>
-    </mrow><mo stretchy="true">&OverBar;</mo>
-   </mover>
-  </mrow>
- </mrow></mstyle></math> where <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mover>
-    <mrow><mi> &delta; </mi>
-    </mrow><mo stretchy="true">&OverBar;</mo>
-   </mover><mo>=</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math> if the star is interesting to you, but zero otherwise.</div>
-
-<div class="standard" id='magicparlabel-2303'>As in the previous example, if <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>S</mi>
- </mrow></mstyle></math> is not simply a constant things get tricky. But usually a constant star formation rate is &ldquo;good enough&rdquo; for e.g. Galactic stellar population studies of anything but the youngest stars. In other cases a starburst is more appropriate and you will have to factor in a check on the time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>t</mi>
- </mrow></mstyle></math> into <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mover>
-   <mrow><mi> &delta; </mi>
-   </mrow><mo stretchy="true">&OverBar;</mo>
-  </mover>
- </mrow></mstyle></math> to match the present-day age of the population. </div>
-
-<div class="standard" id='magicparlabel-2304'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-2305'><span class="subsection_label">6.7</span> Running grids of stars</h3>
-<div class="standard" id='magicparlabel-2306'><div id="sec_grid_setup_practice"></div>
-You run a grid of stars using a combination of the <em><i>binary_grid2</i></em> module and a chosen backend (see Section&nbsp;<a href="#subsec_binary_grid2_backends">4.8</a>).</div>
-
-<dl class='description' id='magicparlabel-2307'><dt class="description_label"><i>binary_grid2</i></dt>
-<dd class="description_item"> is the code which sets out the parameter space, and defines the (object oriented) interface to your stellar population. </dd>
-<dt class="description_label">the&nbsp;backend</dt>
-<dd class="description_item"> is the code that connects your <span class='math'>\binarygrid</span>
-2 stellar population to the stellar evolution code (usually<em> <span class='math'>binary_c</i></span>
-</em>). As of V2.00 there is a <span class="flex_programminglanguage">C</span> and a <span class="flex_scriptinglanguage">Perl</span> backend. Please use the <span class="flex_programminglanguage">C</span> backend, the <span class="flex_scriptinglanguage">Perl</span> backend is for backwards compatibility reasons and testing only, and the <span class="flex_programminglanguage">C</span> version is <em>much</em> more efficient.</dd>
-</dl>
-<div class="standard" id='magicparlabel-2329'>For details on how the grid is set up, and how it is multithreaded, please see Section&nbsp;<a href="#sec_flexigrid">6.11</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-2330'><span class="subsubsection_label">6.7.1</span> Your <em>grid script</em></h4>
-<div class="standard" id='magicparlabel-2331'>You load the<em> <span class='math'>\binarygrid</span>
-2 </em>module from your <em>grid</em> <em>script</em> (see Sec.&nbsp;<a href="#sec_grid_pl">6.9</a> for full details). This is a<em> </em><span class="flex_scriptinglanguage">Perl</span> script which contains the definition of both your population synthesis grid and your input physics. Do not make this yourself: instead, use the template script in the <span class="flex_file">src/perl/scripts2</span> directory of the<em> <span class='math'>binary_c</i></span>
- </em>tree and modify appropriately (Sec.&nbsp;<a href="#sec_grid_pl">6.9</a>). The most appropriate starting place is the script <span class="flex_file">src/perl/scripts2/template.pl</span> which is a basic grid that can be adapted.</div>
-<h4 class="subsubsection" id='magicparlabel-2344'><span class="subsubsection_label">6.7.2</span> The <em><i>binary_grid2</i></em> Module</h4>
-<div class="standard" id='magicparlabel-2345'><div id="subsec_the_binary_grid_perl_module"></div>
-</div>
-
-<div class="standard" id='magicparlabel-2346'>The <em><span class='math'>\binarygrid</span>
-2</em> module contains all the code to set up, manage and run your stellar grid(s). The internal workings should be (almost) transparent to you, the user, and the process is as automated as possible. You still have to do something, of course, and – most importantly – decide on input physics.</div>
-<h4 class="subsubsection" id='magicparlabel-2347'><span class="subsubsection_label">6.7.3</span> <span class='math'>\binarygrid</span>
-2 objects</h4>
-<div class="standard" id='magicparlabel-2348'>You should make <span class='math'>\binarygrid</span>
-2 objects, each of which is one of your stellar populations. You can have multiple populations in the same grid (they are independent) but usually you just want one. Make a new one with code like the following:</div>
-
-<div class="standard" id='magicparlabel-2349'><br />
-<pre class ='listings Perl'># number of computational threads to launch
-my $nthreads = rob_misc::ncpus();
-
-# make a new stellar population
-my $population = <i>binary_grid2</i>-&gt;new( 
-    metallicity =&gt; 0.02, # mass fraction of "metals"
-    max_evolution_time =&gt; 15000, # Myr 
-    nthreads=&gt;$nthreads, # number of threads
-    );
-</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-2363'>You can now access the object, <span class="flex_perlcode">$population</span>, through the various methods of the <span class='math'>\binarygrid</span>
-2 module.</div>
-<h4 class="subsubsection" id='magicparlabel-2368'><span class="subsubsection_label">6.7.4</span> Variables</h4>
-<div class="standard" id='magicparlabel-2369'>You can set variables:</div>
-
-<ul class="itemize" id='magicparlabel-2370'><li class="itemize_item">When defining the object, as shown above.</li>
-<li class="itemize_item">With calls the <span style='font-family:monospace;font-size: 18px;'>set</span> method, e.g.,<br />
-<pre class ='listings Perl'>$population-&gt;set(
-    vb=&gt;1, # turn on verbose logging (can be 0,1,2...)
-    return_array_refs=&gt;1, # quicker data parsing mode
-    );</pre><br />
-</li>
-<li class="itemize_item">By setting the internal variables of the object directly, e.g.,<br />
-<pre class ='listings Perl'>$population-&gt;{_grid_options}-&gt;{nthreads} = 2;
-$population-&gt;{_bse_options}-&gt;{metallicity} = 0.004;</pre><br />
-This method is <b>not recommended unless you know exactly what you are doing.</b></li>
-<li class="itemize_item">Calls to object methods which are <em>undefined</em> are passed to the <span class="flex_perlcode">AUTOLOAD</span> method which issues a warning. This usually indicates a typo or mistake on your part.</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-2390'><span class="subsubsection_label">6.7.5</span> Important Subroutines in <em><i>binary_grid</i></em></h4>
-<div class="standard" id='magicparlabel-2391'><div id="subsec_subs_in_binary_grid"></div>
-A few <span class='math'>\binarygrid</span>
-2 methods are used often</div>
-
-<dl class='description' id='magicparlabel-2392'><dt class="description_label">parse&nbsp;args</dt>
-<dd class="description_item"> This scans the command line arguments to your script and sets any variables thus defined as <span class="flex_perlcode">&lt;variable&gt;=&lt;value&gt;</span> pairs.</dd>
-<dt class="description_label">set</dt>
-<dd class="description_item"> Sets a list of variables in <span class="flex_perlcode">&lt;variable&gt; =&gt; &lt;value&gt;</span> pairs.</dd>
-<dt class="description_label">evolve</dt>
-<dd class="description_item"> Evolves the stellar population.</dd>
-<dt class="description_label">add_grid_variable</dt>
-<dd class="description_item"> Adds a variable to the population grid.</dd>
-<dt class="description_label">tbse_line</dt>
-<dd class="description_item"> Returns a line or array of data from your stellar evolution code which can be used to extract data about the state of a stellar system (as defined in your stellar evolution code, e.g. with <em><i>binary_c</i></em> this would be a <span class="flex_cmacro">Printf</span> statement in <span class="flex_cfunction">log_every_timestep()</span>.
-<br />
-
-By default the grid variable <span class="flex_perlcode">return_array_refs</span> is <span class="flex_perlcode">0</span>, and <span class="flex_perlcode">tbse_line()</span> returns strings containing a line of data. You must then split the string to an array and process this, or run it through a number of regular expressions to get the data out in a useful form.
-<br />
-
-If the grid variable <span class="flex_perlcode">return_array_refs</span><em> </em>is set to <span class="flex_perlcode">1</span>, then <span class="flex_perlcode">tbse_line()</span> returns a reference to an array of data. The splitting from a data line to a data array is done in the backend. The split assumes the data is single-space-separated data. Note that with the <span class="flex_programminglanguage">C</span> backend, this is done in <span class="flex_programminglanguage">C</span> so is very fast compared to Perl's split.</dd>
-<dt class="description_label">results</dt>
-<dd class="description_item"> Returns (a reference to) the hash containing the results of the evolution. At the end of the evolution of your population you can acquire statistics through this hash reference.</dd>
-</dl>
-<h3 class="subsection" id='magicparlabel-2446'><span class="subsection_label">6.8</span> Important Subroutines in your grid script</h3>
-<div class="standard" id='magicparlabel-2447'><div id="subsec_subs_in_your_script"></div>
-</div>
-<h4 class="subsubsection" id='magicparlabel-2448'><span class="subsubsection_label">6.8.1</span> <em>parse_data </em>(required)</h4>
-<div class="standard" id='magicparlabel-2449'>You have to write a function to parse the data which comes from your <span class='math'>\binarygrid</span>
-2 object and return when there is no more data. 
-<br />
-
-You must set a pointer to this function as follows:<br />
-<pre class ='listings Perl'>$population-&gt;set(
-    parse_bse_function_pointer =&gt; \&amp;main::parse_data
-    );</pre><br />
-(naturally you can rename the function if you so choose).
-<br />
-
-An example function is the following.
-<br />
-
-<br />
-<pre class ='listings Perl'>sub parse_data
-{
-    my ($population, $results) = @_;
-
-    while(1)
-    {
-        # subsequent calls to tbse_line contain
-        # (references to) arrays of data 
-        my $la = $population-&gt;tbse_line();
-        
-        # first element is the "header" line
-        my $header = shift @$la;
-
-        # break out of the look if this is 'fin'
-        last if ($header eq 'fin');
-
-        # process data here based on the value of $header
-	    # . . .
-    }
-}
-</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-2480'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-2481'><span class="subsection_label">6.9</span> Your <em>grid script </em>and coupling your population synthesis to <em><i>binary_c</i>/nucsyn</em></h3>
-<div class="standard" id='magicparlabel-2482'><div id="sec_grid_pl"></div>
-This describes what you should do in your grid script in order to make the <em>flexigrid </em>work. Learn about the <em>flexigrid</em> in Section&nbsp;<a href="#sec_flexigrid">6.11</a>.
-<br />
-
-
-<br />
-
-Before you start: you should copy the <span class="flex_perlscript">grid-flexigrid.pl</span> script in the <span class="flex_file">src/perl/scripts</span> directory to a script of your own naming (usually <span class="flex_perlscript">grid-xxx.pl</span> where you choose a suitable label to replace <span class="flex_perlscript">xxx</span>). Work on your copy, not the original!
-<br />
-
-
-<br />
-
-</div>
-<h4 class="subsubsection" id='magicparlabel-2499'><span class="subsubsection_label">6.9.1</span> Logging in <em><i>binary_c</i></em></h4>
-<div class="standard" id='magicparlabel-2500'><div id="subsec_logging_in_binary_c"></div>
-</div>
-
-<div class="standard" id='magicparlabel-2501'>When <em><span class='math'>binary_c</i></span>
-</em> is run for one star with the <span class="flex_bashscript">tbse</span> script the output is dumped to the screen (known in <span class="flex_os">UNIX</span> as <span class="flex_cvar">stdout</span>). A standard build of <em><span class='math'>binary_c</i></span>
-</em> outputs very little information because it does not know what you wish to know (this is a <em>known unknown</em>). Every line that is output is expensive in terms of CPU time, and CPU time is critical when running millions of stars. This means you have to think carefully about what you will output from <em><span class='math'>binary_c</i></span>
-</em> and when. Too much information slows things down, too little is useless – you have to decide.</div>
-
-<div class="standard" id='magicparlabel-2514'>You may want to choose whether to output one line of information every <em><span class='math'>binary_c</i></span>
-</em> timestep. This should be done either in your grid script by setting <span class="flex_perlscript">C_auto_logging</span> or <span class="flex_perlcode">C_logging_code</span> or manually in the <span class="flex_sourcefile">src/logging/log_every_timestep.c</span> subroutine which is called every timestep.</div>
-
-<ul class="itemize" id='magicparlabel-2527'><li class="itemize_item"><em><b>C_auto_logging</b></em> This is the recommended route to logging when coupling <span class='math'>binary_c</i></span>
- to <span class='math'>\binarygrid</span>
- but only works for simple variables that are inside stardata. In your grid script, do something like the following to set <span class="flex_perlscript">C_auto_logging</span>. This is a hash of headers (in this case MY_STELLAR_DATA) which correspond to lines of output from <span class='math'>binary_c</i></span>
- which are then prefixed with the header. Following this is a set of numerical data items, in the case below time, mass of star 0 (the primary star), the system probability and the timestep. All the items are assumed to be floating point variables, and are processed with the <span class="flex_cvar">%g</span> format statement so that (small) integers are output as integers.<br />
-<pre class ='listings'>$population-&gt;set(
-     C_auto_logging =&gt; {
-        'MY_STELLAR_DATA' =&gt;
-            [
-             'model.time',
-             'star[0].mass',
-             'model.probability',
-             'model.dt'
-            ]
-    }
-};</pre><br />
-</li>
-<li class="itemize_item"><em><b>C_logging_code</b></em> You can enter more complicated code to be evaluated each timestep by using the <span class="flex_perlcode">C_logging_code</span> variable. The following code does the same as the above <span class="flex_perlcode">C_auto_logging</span> example.<br />
-<pre class ='listings'>$population-&gt;set(
-    C_logging_code =&gt; '
-             Printf("MY_STELLAR_DATA %g %g %g %g\n",
-                 stardata-&gt;model.time,
-                 stardata-&gt;star[0].mass,
-                 stardata-&gt;model.probability,
-                 stardata-&gt;model.dt);
-                       '
-);</pre><br />
-</li>
-<li class="itemize_item">In <span class="flex_cfunction">log_every_timestep</span> you can enter code that is evaluated every timestep, just as above. However, unlike the above, any updates to this code <em>must</em> be recompiled with a call to <span class="flex_command">make <i>libbinary_c.so</i></span> and the <span class='math'>\binarygrid</span>
- module reinstalled.<br />
-<pre class ='listings'>           Printf("MY_STELLAR_DATA %g %g %g %g\n",
-                 stardata-&gt;model.time,
-                 stardata-&gt;star[0].mass,
-                 stardata-&gt;model.probability,
-                 stardata-&gt;model.dt);
-</pre><br />
-</li>
-</ul>
-<div class="standard" id='magicparlabel-2589'>The string <span class="flex_cmacro">MY_STELLAR_DATA</span> is critical: this is the <em>header</em> that is recognised by your <span class="flex_perlscript">parse_data</span> function as <span class="flex_perlcode">$header</span> and on the basis of which your <span class="flex_perlcode">parse_data</span> function decides how to act and save data for later statistical analysis, output, plotting, etc.</div>
-
-<div class="standard" id='magicparlabel-2606'>You should have a think (and consult Section&nbsp;<a href="#sec_data_parsing">6.6</a>) to determine whether you want to output either the probability (<span class="flex_cvar">stardata-&gt;model.probability</span>) or both the probability and timestep<div class="foot"><span class="foot_label">6</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-2614'>Do not use stardata-&gt;model.dt or stardata-&gt;model.dtm: use the local variable dt.</div>
-</div></div> (<span class="flex_cvar">dt</span> in years, or <span class="flex_cvar">dtm</span> in megayears). Often it is the number of stars in a particular phase that you want to count, in which case you want to add up the product: <span class="flex_cvar">stardata-&gt; model.probability*dt</span>, which is set up for you as the local variable <span class="flex_cvar">dtp</span>. If you are counting the rate of an event, e.g.&nbsp;supernovae, then the probability alone is more likely to be what you want.</div>
-<h4 class="subsubsection" id='magicparlabel-2631'><span class="subsubsection_label">6.9.2</span> Adding things up</h4>
-<div class="standard" id='magicparlabel-2632'><div id="subsec_adding_things_up"></div>
-The <span class="flex_perlcode">$h</span> hash pointer in <span class="flex_perlscript">parse_data</span> is where you should put data which you later want to analyse. You should scan for the appropriate header, e.g.<span style='font-family:monospace;font-size: 18px;'>&nbsp;</span><span class="flex_cvar">MY_STELLAR_DATA</span>, and then act on the rest of the data. An example <span style='font-family:monospace;font-size: 18px;'>parse_data</span> function corresponding to the above <span style='font-family:monospace;font-size: 18px;'>Printf</span> statement is (assuming <span class="flex_perlcode">return_array_refs</span> is set to <span class="flex_perlcode">1</span>)<br />
-<pre class ='listings Perl'>sub parse_data
-{
-   my ($population, $results) = @_;
-
-   while(1)
-   {
-        # subsequent calls to tbse_line contain
-        # (references to) arrays of data
-        my $la = $population-&gt;tbse_line();
-        
-        # first element is the "header" line
-        my $header = shift @$la;
-
-        # break out of the look if this is 'fin'
-        last if ($header eq 'fin');
- 	
-        if($header eq 'MY_STELLAR_DATA')
-        {
-            # matched MY_STELLAR_DATA header
-            #
-            #
-            my $time = $la-&gt;[0];
-            my $probability = $la-&gt;[1];
-            my $timestep = $la-&gt;[2];
- 	       my $mass = $la-&gt;[3];
- 	       my $stellar_type = $la-&gt;[4];
-
-            # bin mass to nearest 1.0 Msun
-            $mass = binary_grid2::rebin($mass, 1.0);
-
-            # add up the mass distribution in a histogram
-            $results-&gt;{mass_distribution}-&gt;{$mass} += $probability * $timestep; 
-        }
-    }
-}</pre><br />
-</div>
-<h4 class="subsubsection" id='magicparlabel-2691'><span class="subsubsection_label">6.9.3</span> Joining the results</h4>
-<div class="standard" id='magicparlabel-2692'>The <span class="flex_perlcode">$results</span> hash pointer in <span class="flex_perlcode">parse_data</span> is unique to its thread: it does not contain your final result, just the part of it corresponding to the population of stars which ran on that thread. You have to add up the results by joining the various threads at the end of the run. In practice this is done automatically by <span class='math'>\binarygrid</span>
-2 in combination with some <span class="flex_scriptinglanguage">Perl</span> wizardry. You can, however, override this yourself by writing your own join function, which should be set in the following manner:
-<br />
-
-<br />
-<pre class ='listings Perl'>$binary_grid::grid_options{'threads_join_function_pointer'}=\&amp;join_thread;</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-2709'><b>Beware that joining large hashes may require a lot of RAM. </b>If you are running <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>N</mi>
- </mrow></mstyle></math> threads which each uses <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math> MB of memory, you will need <em>at least</em> <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-   <mrow><mi>N</mi><mo>+</mo><mn>1</mn>
-   </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-<mi>M</mi>
-  </mrow>
- </mrow></mstyle></math> MB to join the data (probably a bit more). If you have trouble, say on a cluster, you might consider saving the results hash from each thread to a file, then joining the results on another machine. When running on <span class="flex_software">condor</span> or <span class="flex_software">slurm</span>, this is done automatically if you postpone the join.</div>
-<h4 class="subsubsection" id='magicparlabel-2718'><span class="subsubsection_label">6.9.4</span> Outputting the results</h4>
-<div class="standard" id='magicparlabel-2719'>At the end of the grid script you should output the results, usually by writing an <em>output</em> subroutine and calling it. An example is the following which outputs to <span class="flex_cvar">stdout</span>, but you could of course open files and save your output to them.</div>
-
-<div class="standard" id='magicparlabel-2724'><br />
-<pre class ='listings Perl'>sub output
-{
-    my $population = shift;
-
-    # $results is a hash reference containing
-    # the results that were added up in parse_data()
-    my $results = $population-&gt;results;
-
-    # output the mass distribution
-    foreach my $mass (sort {$a&lt;=&gt;$b} keys %{$results-&gt;{mass_distribution}})
-    {
-        printf "%g %g\n",$mass,$results-&gt;{mass_distribution}-&gt;{$mass};
-    }
-}
-</pre><br />
-</div>
-<h3 class="subsection" id='magicparlabel-2743'><span class="subsection_label">6.10</span> Save your data – or process on the fly?</h3>
-<div class="standard" id='magicparlabel-2744'>Before running a grid you have to make the big decision: do you save your data or process it all on the fly? Above I have shown you the latter, and there is good reason to teach this first and use this method preferably. That said, there are advantages and disadvantages to both, as described below.</div>
-<h4 class="subsubsection" id='magicparlabel-2745'><span class="subsubsection_label">6.10.1</span> Saving data </h4>
-<div class="standard" id='magicparlabel-2746'><div id="subsec_saving_data"></div>
-In this case you run a grid and tag the initial parameters of each system of interest (i.e. the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>V</mi><mo>=</mo><mi> &delta; </mi><mo> ln </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>1</mn>
-    </mrow>
-   </msub><mspace width="6px" /><mi> &delta; </mi><mo> ln </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msub><mspace width="6px" /><mi> &delta; </mi><mi>a</mi>
-  </mrow>
- </mrow></mstyle></math>). <em>You save these initial parameters into a large datafile </em>(possibly in a binary format)<em>.</em> The big advantage of this technique is that you can rerun the saved grid <em>from the datafile, </em>possibly<em> </em>without running <em><span class='math'>binary_c</i></span>
-</em> again, and with a different initial distribution function (e.g. initial mass function) or very slightly different physics (on the assumption that changing the physics will not change the systems which were saved). </div>
-
-<div class="standard" id='magicparlabel-2747'>You could save, as well as the initial parameters of the systems, the time spent in the phase of interest, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Delta; </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math>. Each time the grid is rerun you would then calculate the probability <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> for each system again, hence you know <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>p</mi>
-    </mrow>
-    <mrow><mi>i</mi>
-    </mrow>
-   </msub><mo> &Delta; </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> which is your required &ldquo;number of stars&rdquo;. You can either </div>
-
-<ol class="enumerate" id='magicparlabel-2748'><li class="enumerate_item">Change <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and recalculate your statistics. This does <em>not </em>require the running of <em><span class='math'>binary_c</i></span>
-</em> and is the fast option.</li>
-<li class="enumerate_item">Change <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and some physics, which requires rerunning of <span class='math'>binary_c</i></span>
-. This is slower, but still faster than running the full grid.</li>
-</ol>
-<div class="standard" id='magicparlabel-2750'>Saving the progenitor data set is a very useful way of saving time after an initial high-resolution grid run.</div>
-
-<div class="standard" id='magicparlabel-2751'>You may want to consider converting your saved data from <span class="flex_software">ASCII</span> to binary format, particularly if you will be processing it repeatedly. This can save a lot of time, but it renders your data very difficult to read, and it is hard to make such code truly backwards compatible. If someone comes to look at your results in ten years' time, will you remember exactly what is going on? Sacrificing clarity for speed is not necessarily a good thing.</div>
-<h4 class="subsubsection" id='magicparlabel-2756'><span class="subsubsection_label">6.10.2</span> On the fly data processing</h4>
-<div class="standard" id='magicparlabel-2757'><div id="subsec_on_the_fly"></div>
-</div>
-
-<div class="standard" id='magicparlabel-2758'>If you do not want to recalculate your answer with different initial functions, you might be better off calculating the results you require &ldquo;on the fly&rdquo;. This means you do your data processing <em>in your grid script</em>. The main advantages to this are speed and data storage. For example, if you have <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>6</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math>&nbsp;stars in your grid, that is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>6</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math>&nbsp;lines of data – this might be a lot of data.</div>
-
-<div class="standard" id='magicparlabel-2759'>In some cases you <em>must</em> do this. If you are looking at data which is time dependent then you will have <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>6</mn>
-    </mrow>
-   </msup><mo> &times; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>N</mi>
-    </mrow>
-    <mrow><mi>t</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>&nbsp;lines of data, where <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>N</mi>
-   </mrow>
-   <mrow><mi>t</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> is the number of timesteps during which your system is of interest. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>N</mi>
-   </mrow>
-   <mrow><mi>t</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> may be many hundreds for a given system, hence the total number of lines of data is of the order of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>8</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math> and the data storage requirements become quite ridiculous. For example, a typical line of data has about 200 characters, so <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>200</mn><mo> &times; </mo><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>8</mn>
-    </mrow>
-   </msup><mo>=</mo><mn>2</mn><mo> &times; </mo><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>10</mn>
-    </mrow>
-   </msup><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>b</mi><mi>y</mi><mi>t</mi><mi>e</mi><mi>s</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> of data, or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>20</mn><mspace width="6px" />
-   <mstyle class='mathbox'>
-    <mrow>GB
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>. The time it takes to process all this data may be longer than the time to <em>rerun</em> <em><span class='math'>binary_c</i></span>
- </em>for each system, especially if your data storage is non-local (e.g.&nbsp;on an <em>NFS</em> (network) partition). </div>
-
-<div class="standard" id='magicparlabel-2760'>You can save some space by outputting data every, say, Myr, but this may not be the time resolution you require to catch systems of interest.</div>
-
-<div class="standard" id='magicparlabel-2761'>You can increase the speed of your run by using the <span class="flex_programminglanguage">C</span> backend and setting <span class="flex_perlcode">return_array_refs</span> to <span class="flex_perlcode">1</span>.<br />
-</div>
-<h3 class="subsection" id='magicparlabel-2774'><span class="subsection_label">6.11</span> Flexigrid</h3>
-<div class="standard" id='magicparlabel-2775'><div id="sec_flexigrid"></div>
-As of summer 2011, the &ldquo;flexi<em>grid</em>&rdquo; was developed. This is an attempt to replace much of the old, rigid grid framework with a new, dynamic and flexible API. The key concepts are the following:</div>
-
-<ul class="itemize" id='magicparlabel-2776'><li class="itemize_item">When a <em>flexigrid</em> is run, it sets up <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>n</mi>
- </mrow></mstyle></math> concurrently running <em>threads</em>. Each of these is fed with stars until the population is complete. Because of this, <em>flexigrid</em> is designed specifically to work on the latest multi-core CPUs on shared-memory machines (which are the typical PCs of the early 21st century). It scales quite well if you use the <span class="flex_programminglanguage">C</span> backend, less well with the <em>Perl</em> backend on more than a few CPUs.</li>
-<li class="itemize_item"><em>Flexigrid</em> sets up its <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>1</mn>
-    </mrow>
-   </msub><mo>-</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msub><mo>-</mo><mi>a</mi>
-  </mrow>
- </mrow></mstyle></math> (or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>P</mi>
- </mrow></mstyle></math>) etc. grid <em>dynamically</em>. It does this by writing the grid code itself and then compiling it with <span class="flex_scriptinglanguage">Perl</span>'s <em>eval</em> command. This means it is truly flexible, you can add or remove <em>any variable you like</em> to the grid with an <em>arbitrary spacing </em>and do not have to write any new code in the <em><span class='math'>\binarygrid</span>
-2</em> module!</li>
-<li class="itemize_item">Probabilities are calculated more efficiently and flexibly by the <span class="flex_perlmodule">distribution_functions</span> module.</li>
-<li class="itemize_item">Grid spacings are calculated with the <span class="flex_perlmodule">spacing_functions</span> module.</li>
-</ul>
-<h3 class="subsection" id='magicparlabel-2796'><span class="subsection_label">6.12</span> Setup in your grid script</h3>
-<div class="standard" id='magicparlabel-2797'><div id="subsec_setup_grid_script"></div>
-</div>
-
-<div class="standard" id='magicparlabel-2798'>You need to do a few things to define the variables which describe your grid. </div>
-<h4 class="subsubsection" id='magicparlabel-2799'><span class="subsubsection_label">6.12.1</span> Grid variables: 1D example</h4>
-<div class="standard" id='magicparlabel-2800'>Setting up which variables you use is best defined by example. Let's start with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> which you will always require. First, define the grid resolution as <span class="flex_perlcode">$n<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mo> &times; </mo>
- </mrow></mstyle></math>$n<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mo> &times; </mo>
- </mrow></mstyle></math>$n</span> (here <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>10</mn><mo> &times; </mo><mn>10</mn><mo> &times; </mo><mn>10</mn>
-  </mrow>
- </mrow></mstyle></math>)<span style='font-family:monospace;font-size: 18px;'> </span>with <span class="flex_perlcode">$n=10;</span>
-<br />
-
-Next, use your <em><span class='math'>\binarygrid</span>
-2</em> object's <span class="flex_perlcode">add_grid_variable()</span> method to define the new variable.
-<br />
-
-</div>
-
-<div class="standard" id='magicparlabel-2813'><br />
-<pre class ='listings Perl'>  # Mass 1
-  my $mmin=0.1;
-  my $mmax=80.0;
-  my $n=10;
-  $population-&gt;{_grid_options}{binary} = 0;
-  $population-&gt;add_grid_variable
-        (
-        'name'       =&gt; 'lnm1', 
-        'longname'   =&gt;'Primary mass', 
-        'range'      =&gt;[log($mmin),log($mmax)],
-        'resolution' =&gt; $n,
-        'spacingfunc'=&gt;"const(log($mmin),log($mmax),$n)",
-        'precode'    =&gt;'$m1=exp($lnm1);',
-        'probdist'   =&gt;'Kroupa2001($m1)*$m1',
-        'dphasevol'  =&gt;'$dlnm1',
-        );</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-2833'>What does this mean?</div>
-
-<ol class='lyxlist' id='magicparlabel-2834'><li class="labeling_item"><span class='lyxlist'>name&nbsp;string</span>
- This is the variable name. It should be parsable in <span class="flex_scriptinglanguage">Perl</span>, e.g. in the above case it is expanded to <span class="flex_perlcode">$lnm1</span> in the gridcode.</li>
-<li class="labeling_item"><span class='lyxlist'>longname&nbsp;string</span>
- This is a long (human-readable) name used in logging. It should contain no spaces (use underscores).</li>
-<li class="labeling_item"><span class='lyxlist'>range&nbsp;[min,&nbsp;max]</span>
- This defines the range of the grid, from <em>min</em> to <em>max.</em> In the above case from <span class="flex_perlcode">log(0.1)</span> to <span class="flex_perlcode">log(80.0)</span>. (We are using a grid in <em>log</em> <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>.) Note that this is sent as an <em>anonymous array</em> of the form<span style='font-family:monospace;font-size: 18px;'> [<em>min</em>,<em>max</em>]</span> (remember the square brackets!).</li>
-<li class="labeling_item"><span class='lyxlist'>resolution&nbsp;n</span>
-<em> </em>This is the grid resolution, given above by <span class="flex_perlcode">$n</span>.</li>
-<li class="labeling_item"><span class='lyxlist'>spacingfunc&nbsp;func</span>
-<em> </em>This defines the spacing function which should be in the <em>spacing_functions</em> Perl module. In the above example the spacing is constant between <span class="flex_perlcode">log(0.1)</span> and <span class="flex_perlcode">log(80.0)</span> with <span class="flex_perlcode">$n</span> steps.</li>
-<li class="labeling_item"><span class='lyxlist'>preloopcode&nbsp;code</span>
-<em> </em>This is code executed before the loop is set up. None is required in this case.</li>
-<li class="labeling_item"><span class='lyxlist'>precode&nbsp;code</span>
-<em> </em>This is code executed before the next grid variable is embedded. In our case we have to specify <span class="flex_perlcode">$m1</span>, i.e.&nbsp;calculate <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>1</mn>
-    </mrow>
-   </msub><mo>=</mo><mo> exp </mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-   <mrow><mo> ln </mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>[</mo>
-
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>M</mi>
-     </mrow>
-     <mrow><mn>1</mn>
-     </mrow>
-    </msub>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>]</mo>
-
-   </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-  </mrow>
- </mrow></mstyle></math>, because we have only calculated <span class="flex_perlcode">$lnm1</span>.</li>
-<li class="labeling_item"><span class='lyxlist'>postcode&nbsp;code</span>
-<em> </em>This is code executed after the next part of the grid is set up. None is required in this case.</li>
-<li class="labeling_item"><span class='lyxlist'>probdist&nbsp;func</span>
-<em> </em>This is a probability distribution function as given in the <em>distribution_functions</em> Perl module. In the above we use the <span class="flex_perlcode">ktg93</span> ((<a href='#LyXCite-KTG1993MNRAS_262_545K'><span class="bib-fullciteauthor">Kroupa, Tout, and Gilmore</span>, <span class="bib-year">1993</span></a>) initial mass function (IMF). </li>
-<li class="labeling_item"><span class='lyxlist'>dphasevol&nbsp;expression</span>
-<em> </em>This defines the contribution to the phase volume of each stellar system from this variable. In general this is just <span class="flex_perlcode">$dlnm1</span> (i.e.&nbsp;should be <span class="flex_perlcode">$dname</span>) but you can set it to whatever you like. </li>
-</ol>
-<h3 class="subsection" id='magicparlabel-2896'><span class="subsection_label">6.13</span> 3D grid example</h3>
-<div class="standard" id='magicparlabel-2897'><div id="subsec_3d_grid_example"></div>
-</div>
-
-<div class="standard" id='magicparlabel-2898'>The next step is to set up the further grid variables. Usually these are <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math>, as defined in the code below.</div>
-
-<div class="standard" id='magicparlabel-2899'><br />
-<pre class ='listings Perl'>    my $resolution = {
-        m1 =&gt; 10,
-        q =&gt; 10,
-        P =&gt; 10
-    };      
-    $population-&gt;{_grid_options}{binary} = 1;
-    
-    $population-&gt;add_grid_variable
-        (
-        'name'       =&gt; 'lnm1', 
-        'longname'   =&gt;'Primary mass', 
-        'range'      =&gt;[log($mmin),log($mmax)],
-        'resolution' =&gt; $resolution-&gt;{m1},
-        'spacingfunc'=&gt;"const(log($mmin),log($mmax),$resolution-&gt;{m1})",
-        'precode'    =&gt;'$m1=exp($lnm1);',
-        'probdist'   =&gt;'Kroupa2001($m1)*$m1',
-        'dphasevol'  =&gt;'$dlnm1',
-        );
-    # q=M1/M2 distribution flat in q between 0.1/M1 and 1.0
-    $population-&gt;add_grid_variable
-        (
-        'condition'  =&gt;'$self-&gt;{_grid_options}{binary}==1',
-        'name'       =&gt;'q',
-        'longname'   =&gt;'Mass ratio',
-        'range'      =&gt;['0.1/$m1',1.0],
-         'resolution'=&gt;$resolution-&gt;{q},
-        'spacingfunc'=&gt;"const(0.1/\$m1,1.0,$resolution-&gt;{q})",
-        'probdist'   =&gt;"flatsections\(\$q,\[
-\{min=&gt;0.1/\$m1,max=&gt;0.8,height=&gt;1.0\},
-\{min=&gt;0.8,max=&gt;1.0,height=&gt;1.0\},
-\]\)",
-        precode     =&gt;'$m2=$q*$m1;',
-        dphasevol   =&gt;'$dq',
-        );
-     # orbital period Duquennoy and Mayor 1991 distribution
-     $population-&gt;add_grid_variable
-         (
-          'name'       =&gt;'logper',
-          'longname'   =&gt;'log(Orbital_Period)',
-          'range'      =&gt;[-2.0,12.0],
-          'resolution' =&gt;$resolution-&gt;{P},
-          'spacingfunc'=&gt;"const(-1.0,10.0,$resolution-&gt;{P})",
-          'precode'=&gt;"\$per = 10.0 ** \$logper;
-my \$eccentricity = 0.0;
-\$sep=calc_sep_from_period(\$m1,\$m2,\$per) if(defined \$m1 &amp;&amp; defined \$m2);
-",
-          'probdist'=&gt;"gaussian(\$logper,4.8,2.3,-2.0,12.0)",
-          'dphasevol'=&gt;'$dln10per'
-         );</pre><br />
-</div>
-<h3 class="subsection" id='magicparlabel-2952'><span class="subsection_label">6.14</span> Viewing The (Automatically Generated) Gridcode </h3>
-<div class="standard" id='magicparlabel-2953'><div id="subsec_viewing_the_gridcode"></div>
-</div>
-
-<div class="standard" id='magicparlabel-2954'>When you evolve your <span class='math'>\binarygrid</span>
-2 object, the<span style='font-family:monospace;font-size: 18px;'> </span><span class="flex_perlcode">flexigrid</span> is run. First the grid code is generated, then this processed by <span class="flex_scriptinglanguage">Perl</span>'s <span class="flex_perlcode">eval()</span>.</div>
-
-<div class="standard" id='magicparlabel-2967'>You can find the grid code in the file <span class="flex_file">/tmp/gridcode</span> where <span class="flex_file">/tmp</span> can be changed, e.g.&nbsp;with,<br />
-<pre class ='listings Perl'>$population-&gt;set(tmp=&gt;&rdquo;/directory/of/your/choice&rdquo;);</pre><br />
-</div>
-<h3 class="subsection" id='magicparlabel-2980'><span class="subsection_label">6.15</span> Error handling</h3>
-<div class="standard" id='magicparlabel-2981'><div id="subsec_flexigrid_error_handling"></div>
-</div>
-
-<div class="standard" id='magicparlabel-2982'>Things do go wrong. Usually when this happens, the threads will be shut down and your grid script will exit, telling you as much as it can about the error. </div>
-
-<div class="standard" id='magicparlabel-2983'>When running with the <span class="flex_programminglanguage">C</span> backend, the grid will crash. If you have built <span class="flex_file"><i>libbinary_c.so</i></span> with debugging (e.g.&nbsp;<span class="flex_command">configure debug</span>) you should see a stack trace so that you can debug the crash. With the <span class="flex_scriptinglanguage">Perl</span> backend this is more difficult, but you should see an error message. Beware that if the <span class="flex_scriptinglanguage">Perl</span> backend crashes at the wrong place, there may be zombie processes hanging around, or worse: processes that eat your CPU time. Please check for these when testing your code! </div>
-<h3 class="subsection" id='magicparlabel-3004'><span class="subsection_label">6.16</span> Flexigrid variable options</h3>
-<div class="standard" id='magicparlabel-3005'><div id="subsec_flexigrid_variable_options"></div>
-</div>
-
-<div class="standard" id='magicparlabel-3006'><b>FIXME! This is out of date.</b></div>
-
-<div class="standard" id='magicparlabel-3007'>Note that any <em>code</em> is executed in the context of the flexigrid <span class="flex_perlcode">eval</span> call, so you should prepend calls to subroutines with <span class="flex_perlmodule">main::</span> or <span class="flex_perlmodule">module_name::</span> or, if they are part of <span class='math'>\binarygrid</span>
-2, <span class="flex_perlcode">$self</span> to access them through the <span class='math'>\binarygrid</span>
-2 object.</div>
-
-<ol class='lyxlist' id='magicparlabel-3024'><li class="labeling_item"><span class='lyxlist'>condition&nbsp;code</span>
- The loop is executed only if <em>condition</em> is true. </li>
-<li class="labeling_item"><span class='lyxlist'>dphasevol&nbsp;expression</span>
-<em> </em>This defines the contribution to the phase volume from this variable.</li>
-<li class="labeling_item"><span class='lyxlist'>gridtype&nbsp;string</span>
-<em> </em>Most grid variables are of type &ldquo;grid&rdquo; which implies cell-centred variables. However, you can also specify &ldquo;edge&rdquo; to keep the variable on the cell edge instead. </li>
-<li class="labeling_item"><span class='lyxlist'>longname&nbsp;string</span>
- This is a long (human-readable) name used in logging. It should contain no spaces (use underscores).</li>
-<li class="labeling_item"><span class='lyxlist'>name&nbsp;string</span>
- This is the variable name. (It is best that it contains no special characters, just a-z, A-Z, 0-9 or _, but is converted internally into a hash key, so in theory it could be any string.)</li>
-<li class="labeling_item"><span class='lyxlist'>noprobdist&nbsp;n</span>
-<em> </em>If this is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1</mn>
- </mrow></mstyle></math> then no probability is calculated. Useful for changing, e.g., the duplicity (see Recipe&nbsp;<a href="#Recipe_Single_and_binary_stars">6.25.4</a>).</li>
-<li class="labeling_item"><span class='lyxlist'>preloopcode&nbsp;code</span>
-<em> </em>This is code executed before the loop is set up.</li>
-<li class="labeling_item"><span class='lyxlist'>precode&nbsp;code</span>
-<em> </em>This is code executed before the next part of the grid is set up. </li>
-<li class="labeling_item"><span class='lyxlist'>postcode&nbsp;code</span>
-<em> </em>This is code executed after the next part of the grid is set up. (In our case there is no <em>postcode</em>).</li>
-<li class="labeling_item"><span class='lyxlist'>postloopcode&nbsp;code</span>
-<em> </em>This is code executed after the loop and before the beginning of the next loop.</li>
-<li class="labeling_item"><span class='lyxlist'>probdist&nbsp;func</span>
-<em> </em>This is a probability distribution function as given in the <span class="flex_perlmodule">distribution_functions</span> Perl module. </li>
-<li class="labeling_item"><span class='lyxlist'>range&nbsp;min&nbsp;max</span>
- This defines the range of the grid variable, from <em>min</em> to <em>max.</em> </li>
-<li class="labeling_item"><span class='lyxlist'>resolution&nbsp;(n|code)</span>
-<em> </em>This is the grid variable resolution, which is <span class="flex_perlcode">eval</span>ed in the gridcode context, so it can be a function or a constant. Mostly this is used for logging to estimate when the grid is finished.</li>
-<li class="labeling_item"><span class='lyxlist'>spacingfunc&nbsp;func</span>
-<em> </em>This defines the spacing function which should be in the <span class="flex_perlmodule">spacing_functions</span> Perl module. </li>
-</ol>
-<div class="standard" id='magicparlabel-3050'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-3051'><span class="subsection_label">6.17</span> Flexigrid loop structure</h3>
-<div class="standard" id='magicparlabel-3052'><div id="subsec_flexigrid_loop_structure"></div>
-</div>
-
-<div class="standard" id='magicparlabel-3053'>Each loop is logically structured as follows:</div>
-
-<ul class="itemize" id='magicparlabel-3054'><li class="itemize_item">setup <span class="flex_perlcode">%fvar</span> (min, max, initial grid spacing <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &delta; </mi>
- </mrow></mstyle></math> from the <em>spacing_functions, </em>type=<em>grid</em> or <em>edge</em>)</li>
-<li class="itemize_item">calculate the resolution (with an <span class="flex_perlcode">eval</span><em> </em>call)</li>
-<li class="itemize_item">execute <span class="flex_perlcode">preloopcode</span></li>
-<li class="itemize_item">check condition code</li>
-<li class="itemize_item"><span class="flex_perlcode">{</span> (start the loop) </li>
-<li class="itemize_item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;execute <span class="flex_perlcode">precode</span></li>
-<li class="itemize_item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;calculate this loop's contribution to the phase space and probability (using the <span class="flex_perlmodule">distribution_functions</span>)</li>
-<li class="itemize_item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update the counter</li>
-<li class="itemize_item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move loop variable on by <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo>/</mo><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math> (if it is is a grid variable)</li>
-<li class="itemize_item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="flex_perlcode">&lt;next loop&gt;</span> (or push commands onto the thread queue)</li>
-<li class="itemize_item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;execute <span class="flex_perlcode">postcode</span></li>
-<li class="itemize_item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move loop variable on by <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo>/</mo><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math> (if it is is a grid variable) or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &delta; </mi>
- </mrow></mstyle></math> (if it is an edge variable)</li>
-<li class="itemize_item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update grid spacing <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &delta; </mi>
- </mrow></mstyle></math> (using the <span class="flex_perlmodule">spacing_functions</span><em>)</em></li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>}</span> (close the loop)</li>
-<li class="itemize_item">execute <span class="flex_perlcode">postloopcode</span></li>
-</ul>
-<div class="standard" id='magicparlabel-3109'>Only the innermost loop contains the calls to push commands onto the thread queue.</div>
-
-<div class="standard" id='magicparlabel-3110'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-3111'><span class="subsection_label">6.18</span> <i>binary_grid</i> with <em>HTCondor<div id="sec_Working_with_HTCondor"></div>
-</em></h3>
-<div class="standard" id='magicparlabel-3112'>The <span class="flex_software">HTCondor</span> system allows you to distribute your computing of stellar populations over many PCs and hence greatly increase your available computing power. In the following we define the following terms:</div>
-
-<dl class='description' id='magicparlabel-3117'><dt class="description_label">Launching</dt>
-<dd class="description_item"> jobs means sending a grid of stars to be run on a remote PC by submitting an <span class="flex_software">HTCondor</span> script.</dd>
-<dt class="description_label">Joining</dt>
-<dd class="description_item"> jobs means taking all the data that you have generated on remote PCs and making your final dataset. By default, <em><span class='math'>\binarygrid</span>
-</em> tries to join the data when all the jobs have finished. However, this places a considerable load on the machine in question (often far greater, especially in terms of memory, than running a single job). You may want to load a local machine, or one which has faster access to the data store (e.g.&nbsp;if it is an <em>NFS </em>mountpoint). Use the <span class="flex_perlcode">condor_postpone_join</span><span style='font-family:monospace;font-size: 18px;'> </span>variable to postpone the join in this manner (see below).</dd>
-</dl>
-
-<ul class="itemize" id='magicparlabel-3127'><li class="itemize_item">You need to decide how many condor jobs to run (<span class="flex_perlcode">condor_njobs</span>). This is a tradeoff between how many <em>HTCondor</em> slots you have available (probably this is the number of cores you have available on your PCs), how much disk space you want to take up, and how long you would like to wait in the joining process (which scales linearly with the number of jobs). In general, joining is fast compared to running large stellar populations, so the joining is irrelevant. Thus, you want to set this to the number of slots available, unless there is some limit set by your administrator, or you are short of disk space (the amount of disk space you require is linear in the number of slots you use).</li>
-<li class="itemize_item">You will need to set a <span class="flex_perlcode">condor_dir</span> directory which stores the <span class="flex_software">HTCondor</span> scripts, logs, <span class="flex_cvar">stdout</span>, <span class="flex_cvar">stderr</span>, status and the data which is to be joined. This directory must be accessible to <em>all the compute nodes </em>(e.g.&nbsp;mounted as an <em>NFS</em> partition).</li>
-<li class="itemize_item">The data that is to be joined is stored in your <span class="flex_perlcode">condor_dir</span> directory. There are <span class="flex_perlcode">condor_njobs</span> of these files, one for each job. Together they contain your raw population data (prior to <span style='font-family:monospace;font-size: 18px;'>output()</span> being called).</li>
-<li class="itemize_item">The generated scripts are actually called from wrapper scripts (appended with <span class="flex_file">.wrap</span>) which catch errors. See below for more details.</li>
-</ul>
-
-<dl class='description' id='magicparlabel-3163'><dt class="description_label">Binary_c</dt>
-<dd class="description_item"> You should configure <span class='math'>binary_c</i></span>
- to use generic flags by running,<br />
-<pre class\s*='listings bash'>$ ./configure generic</pre><br />
- or by setting <span class="flex_envvar">ARCHFLAGS</span> prior to the build, e.g.,
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ export ARCHFLAGS="-mtune=generic -march=generic"</pre><br />
-You will need to completely rebuild <span class='math'>binary_c</i></span>
- and <span class='math'>libbinary_c</i></span>
-.so on the <span class="flex_software">HTCondor</span> submission machine after setting <span class="flex_envvar">ARCHFLAGS</span> and (perhaps) each time you change <span class='math'>binary_c</i></span>
-. If you do not, you will suffer from (seemingly random) segmentation faults.</dd>
-</dl>
-<div class="standard" id='magicparlabel-3184'>Other parameters include:</div>
-
-<dl class='description' id='magicparlabel-3185'><dt class="description_label">condor_memory</dt>
-<dd class="description_item"> The amount of RAM allocated to your run. Since each job uses only one CPU at a time, this is generally small (less than 1GB) however there may be occasions where you require more.</dd>
-<dt class="description_label">condor_universe</dt>
-<dd class="description_item"> This must be <span class="flex_args">vanilla</span>. I have not tried to compile all the required tools using <span class="flex_software">HTCondor</span>'s compiler.</dd>
-<dt class="description_label">condor_postpone_join</dt>
-<dd class="description_item"> If this is <em>false</em> (<span class="flex_perlcode">0</span>) then upon completion of the final job the join of all the data, and the subsequent call to <span class="flex_perlcode">output()</span>, is done automatically. If <em>true</em> (<span class="flex_perlcode">1</span>) then this join is postponed until the command in the <span class="flex_file">condor_dir/scripts/joincmd</span> file is run. This is very useful if, for example, the join requires a lot of RAM and the <span class="flex_software">HTCondor</span> nodes lack this RAM. The join can then be performed on an appropriate machine, elsewhere. This is also useful if a lot of data is to be joined: the join can be performed on a machine which has fast access to the appropriate data store. </dd>
-<dt class="description_label">condor_join_machine</dt>
-<dd class="description_item"> If not <span class="flex_perlcode">undef</span>, this is the machine on which the join is to be performed. Automated access (e.g.&nbsp;<span class="flex_command">ssh</span> via public key) to this machine is assumed.</dd>
-<dt class="description_label">condor_join_pwd</dt>
-<dd class="description_item"> If not <span class="flex_perlcode">undef</span>, this is the directory in which the join is to be done (otherwise the working directory is used).</dd>
-<dt class="description_label">condor_command</dt>
-<dd class="description_item"> This is either an empty string on the first run of the script, in which case the various scripts are set up and launched, or <span style='font-family:monospace;font-size: 18px;'>join</span> to automatically join the datafiles (this is usually what you want to do). You should only use this by including a <span class="flex_perlcode">condor_command=join</span> argument to your script to join all the data once it has finished.
-<br />
-
-Other, less common, options are <span class="flex_perlcode">join_datafiles</span> to use a specified list of datafiles rather than the list automatically generated, or <span class="flex_perlcode">run_flexigrid</span> to run a grid of stars (this is done automatically by each of the <span class="flex_software">HTCondor</span> submit scripts). </dd>
-<dt class="description_label">condor_resubmit_submitted</dt>
-<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">6.18.4</a>.</dd>
-<dt class="description_label">condor_resubmit_running</dt>
-<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">6.18.4</a>.</dd>
-<dt class="description_label">condor_resubmit_crashed</dt>
-<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">6.18.4</a>.</dd>
-<dt class="description_label">condor_resubmit_finished</dt>
-<dd class="description_item"> Please see section&nbsp;<a href="#subsec_Rerunning_your_jobs">6.18.4</a>.</dd>
-</dl>
-<h4 class="subsubsection" id='magicparlabel-3251'><span class="subsubsection_label">6.18.1</span> Modifying your grid script for HTCondor<div id="subsec_Modifying_your_grid"></div>
-</h4>
-<div class="standard" id='magicparlabel-3252'>You need to:</div>
-
-<ol class="enumerate" id='magicparlabel-3253'><li class="enumerate_item">load in the <span class="flex_perlmodule">binary_grid::condor</span> module</li>
-<li class="enumerate_item">set some parameters and </li>
-<li class="enumerate_item">modify the call to your <span style='font-family:monospace;font-size: 18px;'>output</span> function. </li>
-</ol>
-<div class="standard" id='magicparlabel-3260'>The following is a basic example.</div>
-
-<div class="standard" id='magicparlabel-3261'><br />
-<pre class ='listings Perl'>#!/usr/bin/env perl
-use strict; # recommended
-use 5.16.0; # recommended
-use binary_grid2; # required
-use binary_grid::C; # backend : <i>C</i> or Perl
-use binary_grid::condor; # add condor support
-
-...
-# make and set up your population object here as usual
-...
-
-# set up condor
-$population-&gt;set(
-    condor=&gt;1, # use condor
-    condor_njobs=&gt;4, # run 4 jobs
-    condor_dir=&gt;'/home/rgi/data/condor_control',# working directory for scripts etc.
-    condor_streams=&gt;0, # if 1 stream to stdout/stderr (warning: lots of network bandwidth!)
-    condor_memory=&gt;1024, # RAM (MB) per job
-    condor_universe=&gt;'vanilla', # always vanilla
-    condor_postpone_join=&gt;1, # if 1 do not join on condor, join elsewhere
-    condor_join_machine=&gt;undef,
-    condor_join_pwd=&gt;undef,
-
-    # resubmission options
-    condor_resubmit_submitted=&gt;0,
-    condor_resubmit_running=&gt;0,
-    condor_resubmit_crashed=&gt;0,
-    condor_resubmit_finished=&gt;0,
-    );
-
-# evolution the stellar population (this takes some time) 
-$population-&gt;evolve();
-
-...
-
-# output results
-output($population) if($population-&gt;output_allowed());
-
-...
-# the rest of the script remains unchanged
-</pre><br />
-</div>
-<h4 class="subsubsection" id='magicparlabel-3306'><span class="subsubsection_label">6.18.2</span> Launching your jobs<div id="subsec_Launching_your_jobs"></div>
-</h4>
-<div class="standard" id='magicparlabel-3307'>Once your grid script is modified, you just have to run it on a PC which is allowed to submit jobs using <span class="flex_perlcode">condor_submit</span>. </div>
-
-<div class="standard" id='magicparlabel-3312'>If you want the script to sometimes run condor (e.g.&nbsp;if you are on the condor submit machine), and sometimes not (e.g.&nbsp;you are on your personal PC or laptop), set <span class="flex_args">condor=&gt;0</span> in the above example, and run with <span class="flex_args">condor=1</span> as an argument <em>only </em>on the condor submit machine.</div>
-
-<div class="standard" id='magicparlabel-3321'><br />
-<pre class\s*='listings bash'>$ mygridscript.pl condor=1</pre><br />
-</div>
-<h4 class="subsubsection_" id='magicparlabel-3326'>Job IDs<div id="subsec_Job_IDs"></div>
-</h4>
-<div class="standard" id='magicparlabel-3327'>Each job is given an ID string, <span style='font-family:monospace;font-size: 18px;'>x.y</span>, where <span style='font-family:monospace;font-size: 18px;'>x</span> is a counter which ranges from <span style='font-family:monospace;font-size: 18px;'>0</span> to <span style='font-family:monospace;font-size: 18px;'>y-1</span>, where <span style='font-family:monospace;font-size: 18px;'>y</span> is the number of jobs to be launched (<span class="flex_args">condor_njobs</span>). The files in the various subdirectories that control your jobs are named <span style='font-family:monospace;font-size: 18px;'>x.y</span>. </div>
-
-<div class="standard" id='magicparlabel-3332'>Please note: <b>if you change </b><span class="flex_perlcode">condor_njobs</span><b> or </b><span class="flex_perlcode">condor_dir</span><b> then you are also changing your job IDs. If you make changes to these variables and then try to join your data after postponing the join, things will break.</b> Please see Section&nbsp;<a href="#subsec_Joining_your_jobs">6.18.5</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-3341'><span class="subsubsection_label">6.18.3</span> Status of your jobs<div id="subsec_Status_of_your_jobs"></div>
-</h4>
-
-<ul class="itemize" id='magicparlabel-3342'><li class="itemize_item">You can use the <span class="flex_command">condor_q</span> command and its various options to enquire about the status of your jobs.</li>
-<li class="itemize_item">You can also use the <span class="flex_file">condor_dir/status</span> files which are used by <span class='math'>\binarygrid</span>
- to monitor the status of your jobs. These have the values:</li>
-</ul>
-
-<dl class='description' id='magicparlabel-3352'><dt class="description_label">submitted</dt>
-<dd class="description_item"> The job is submitted and will (hopefully) soon be run.</dd>
-<dt class="description_label">running</dt>
-<dd class="description_item"> The job is currently running (and a crash has not been detected).</dd>
-<dt class="description_label">finished</dt>
-<dd class="description_item"> The job has finished and the data is ready to be joined.</dd>
-<dt class="description_label">crash&nbsp;n</dt>
-<dd class="description_item"> The job crashed with exit code <em>n.</em></dd>
-</dl>
-<h4 class="subsubsection" id='magicparlabel-3356'><span class="subsubsection_label">6.18.4</span> Rerunning your jobs<div id="subsec_Rerunning_your_jobs"></div>
-</h4>
-<div class="standard" id='magicparlabel-3357'>Sometimes you would like to rerun your jobs, especially if some of them fail to run and you later fix the bug. Four variables allow you to restart a job, depending on its current status.</div>
-
-<dl class='description' id='magicparlabel-3358'><dt class="description_label">condor_resubmit_submitted</dt>
-<dd class="description_item"> If this is <span style='font-family:monospace;font-size: 18px;'>1</span> and a job status is <span style='font-family:monospace;font-size: 18px;'>submitted</span>, it is resubmitted. </dd>
-<dt class="description_label">condor_resubmit_running</dt>
-<dd class="description_item"> If this is <span style='font-family:monospace;font-size: 18px;'>1</span> and a job status is <span style='font-family:monospace;font-size: 18px;'>running</span>, it is resubmitted.</dd>
-<dt class="description_label">condor_resubmit_crashed</dt>
-<dd class="description_item"> If this is <span style='font-family:monospace;font-size: 18px;'>1</span> and a job status is <span style='font-family:monospace;font-size: 18px;'>crashed</span>, it is resubmitted.</dd>
-<dt class="description_label">condor_resubmit_finished</dt>
-<dd class="description_item"> If this is <span style='font-family:monospace;font-size: 18px;'>1</span> and a job status is <span style='font-family:monospace;font-size: 18px;'>finished</span>, it is resubmitted.</dd>
-</dl>
-<div class="standard" id='magicparlabel-3362'>By default, all the <span class="flex_perlcode">condor_resubmit_*</span> variables are <span style='font-family:monospace;font-size: 18px;'>0</span>, so jobs that have already been started are not resubmitted.</div>
-<h4 class="subsubsection" id='magicparlabel-3367'><span class="subsubsection_label">6.18.5</span> Joining your jobs<div id="subsec_Joining_your_jobs"></div>
-</h4>
-<div class="standard" id='magicparlabel-3368'>If you postponed the join of your jobs with <span class="flex_perlcode">condor_postpone_join</span> set to <span class="flex_perlcode">1</span>, you have to join them in order to finish your population calculations. You can either:</div>
-
-<ul class="itemize" id='magicparlabel-3377'><li class="itemize_item">Rerun your script with <span class="flex_args">condor_command=join</span> appended to the command line. This automatically locates the list of files require, joins them and calls <span class="flex_perlcode">output()</span>. This is the simplest, and recommended, way to do it.</li>
-<li class="itemize_item">Locate the <span class="flex_file">condor_dir/scripts/joincmd</span> file and run the command in it to join the data and call <span class="flex_perlcode">output()</span>.</li>
-</ul>
-<div class="standard" id='magicparlabel-3395'>You <b>must not change</b> <span class="flex_perlcode">condor_njobs</span><b> or <span style='font-family:monospace;font-size: 18px;'>condor_dir </span>prior to joining your jobs</b>. This is because these variables are used to construct job IDs. See section&nbsp;<a href="#subsec_Job_IDs">6.18.2</a> for more details.</div>
-<h4 class="subsubsection" id='magicparlabel-3400'><span class="subsubsection_label">6.18.6</span> Debugging <em>HTCondor</em> jobs<div id="subsec_Debugging_HTCondor_jobs"></div>
-</h4>
-<div class="standard" id='magicparlabel-3401'>All the <span class="flex_software">HTCondor</span> logs, <span class="flex_cvar">stdout</span> and <span class="flex_cvar">stderr</span> from your jobs are stored in the <span class="flex_file">condor_dir</span>. I cannot guide you on how <span class="flex_software">HTCondor</span> works or what its error codes mean, I suggest you look at their website for these instructions. However, you can check the log files to see whether a job that has stopped has crashed (as opposed to having been <em>evicted</em>). </div>
-
-<div class="standard" id='magicparlabel-3422'>When a job crashes and the crash has been caught by<em> </em><span class='math'>\binarygrid</span>
-'s wrapper script (this is usually the case), its status file contains crashed <em>n</em> where <em>n</em> is the crashed exit code from <span class='math'>binary_c</i></span>
-.</div>
-<h4 class="subsubsection" id='magicparlabel-3423'><span class="subsubsection_label">6.18.7</span> &ldquo;Random&rdquo; segmentation faults (segfaults)</h4>
-<div class="standard" id='magicparlabel-3424'>Sometimes you may find that the grid does not start. This looks like a random segmentation fault (such faults are almost never random). The most common cause is that your <span class='math'>\binarygrid</span>
- <span class="flex_scriptinglanguage">Perl</span> module must be reinstalled after you recompile <span class="flex_file"><i>libbinary_c.so</i></span>.</div>
-
-<ul class="itemize" id='magicparlabel-3433'><li class="itemize_item">Recompile <span style='font-family:monospace;font-size: 18px;'><span class='math'>libbinary_c</i></span>
-:
-<br />
-
-</span><br />
-<pre class\s*='listings bash'>$ ./configure; make cleanall; make; make <i>libbinary_c.so</i></pre><br />
-</li>
-<li class="itemize_item">Reinstall th<em>e <span class='math'>\binarygrid</span>
- </em>module
-<span style='font-family:monospace;font-size: 18px;'><br />
-
-</span><br />
-<pre class\s*='listings bash'>$ cpanm <i>binary_grid</i> --force -v</pre><br />
-</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-3443'><span class="subsubsection_label">6.18.8</span> <span style='font-family:monospace;font-size: 18px;'>SIGILL</span> – Error code 4</h4>
-<div class="standard" id='magicparlabel-3444'>If you find &ldquo;Error code 4&rdquo;, a <span class="flex_cvar">SIGILL</span>, is occurring, then you have a problem because it turns out that your build of either <span class='math'>libbinary_c</i></span>, <em><span class='math'>binary_c</i></span>
-</em> or <span class="flex_scriptinglanguage">Perl</span> (and its modules) is incompatible with the architecture on one of your slots. This problem can overcome by:</div>
-
-<ul class="itemize" id='magicparlabel-3453'><li class="itemize_item">Setting the <span class="flex_envvar">ARCHFLAGS</span> environment variable, e.g.
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ export ARCHFLAGS=" -mtune=generic -march=x86-64 "</pre><br />
-then run <br />
-<pre class\s*='listings bash'>$ ./configure; make cleanall; make; make <i>libbinary_c.so</i></pre><br />
- to rebuild <span class='math'>binary_c</i></span>
-.</li>
-<li class="itemize_item">Replacing the <span class="flex_args">mtune</span> and <span class="flex_args">march</span> flags in your <span class="flex_software">Perlbrew</span> build with the above &ldquo;generic&rdquo; flags. To do this:
-
-<ul class="itemize" id='magicparlabel-3479'><li class="itemize_item">Move (or remove) your <span class="flex_file">perlbrew</span><em> </em>and <span class="flex_file">perl5</span><em> </em>directories. </li>
-<li class="itemize_item">Reinstall <span class="flex_scriptinglanguage">Perl</span> and <em><b>all</b></em> its modules. </li>
-<li class="itemize_item">If in doubt, check that the <span class="flex_perlmodule">binary_grid::C</span> module has the generic flags set rather than anything else. (If you are reading this documentation, then your version is fixed.)</li>
-</ul>
-</li></ul>
-<div class="standard" id='magicparlabel-3498'>Note that using the above flags slows <span class='math'>binary_c</i></span>
- but hopefully not by too much.</div>
-<h4 class="subsubsection" id='magicparlabel-3499'><span class="subsubsection_label">6.18.9</span> Timeouts</h4>
-<div class="standard" id='magicparlabel-3500'><em><span class='math'>binary_c</i></span>
- </em>automatically stops if <span class="flex_cmacro">TIMEOUT_SECONDS</span> (defined in <em><span class="flex_file">code_options.h</span></em>) have passed without a call to the <span class="flex_cfunction">reset_timeout()</span> function. This may happen if the host machine locks up for some reason, or if the network fails to write a file. There is not much I can do about this, but you could always set <span class="flex_cmacro">TIMEOUT_SECONDS</span> to <span class="flex_cmacro">0</span>, or comment out <span class="flex_cvar">CATCH_SIGVTALRM</span>. You will have to rebuild <span class='math'>libbinary_c</i></span>
-/<span class='math'>binary_c</i></span>
- if you do this.</div>
-<h4 class="subsubsection_" id='magicparlabel-3525'>Checkpointing<div id="subsec_Checkpointing"></div>
-</h4>
-<div class="standard" id='magicparlabel-3526'>At one point there was an option to stop and start <span class='math'>\binarygrid</span>, however this has not been used in a long time. Because your jobs are running in the <em>vanilla</em> universe, they cannot be checkpointed by <span class="flex_software">HTCondor</span>. This might be considered a disadvantage, and annoying because checkpointing is one of the big features of <span class="flex_software">HTCondor</span>. However, I would disagree with this assessment. Your jobs will, if split onto enough PCs, not (each) take long to run. This means that should the <span class="flex_software">HTCondor</span> grid go down (e.g.&nbsp;there is a power cut) you can simply restart when it is up and your runtime will be delayed only by as long as one script takes to run (typically an hour or two if you have not too many stars in your population and you have plenty of compute machines). This is probably less time than your power cut. It is simply not worth my while programming in more features to deal with such a situation when the solution is so cheap.</div>
-
-<div class="standard" id='magicparlabel-3539'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-3540'><span class="subsection_label">6.19</span> Binary_grid with <em>slurm<div id="sec_Working_with_slurm"></div>
-</em></h3>
-<div class="standard" id='magicparlabel-3541'><span class="flex_software">Slurm</span> is a distributed computing system similar to <span class="flex_software">HTCondor</span>. <em><span class='math'>\binarygrid</span>
-</em>2 has a dedicated <span class="flex_software">slurm</span> module which you can load simply with:<br />
-<pre class ='listings Perl'>use binary_grid2; 
-use binary_grid::C; 
-use binary_grid::slurm;</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-3560'>After setting up your population as usual, just insert some <em><span class="flex_software">slurm</span></em>-specific parameters<br />
-<pre class ='listings Perl'># set up slurm
-$population-&gt;set(
-    slurm=&gt;1, # use slurm if 1
-    slurm_njobs=&gt;40, # number of jobs
-    slurm_dir=&gt;'/users/ri0005/data/slurm', # working directory for scripts etc.
-    slurm_memory=&gt;256, # RAM (MB) per job
-	slurm_time=&gt;0,
-    slurm_postpone_join=&gt;0, # if 1 do not join on slurm, join elsewhere
-    slurm_partition=&gt;'all', # MUST be defined
-    slurm_jobname=&gt;'<i>binary_grid</i>', # not required but useful
-	slurm_use_all_node_CPUs=&gt;1,
-    slurm_control_CPUs=&gt;0,
-    );</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-3581'>Hopefully the options are obvious, but you will need to set them all.</div>
-
-<ul class="itemize" id='magicparlabel-3582'><li class="itemize_item">The <span class="flex_perlcode">slurm_dir</span> is a space that needs to be writable by all the nodes of your <span class="flex_software">slurm</span> setup. The <em>partition</em> is a queue name which you will have to find out from your local <span class="flex_software">slurm</span> setup (e.g. with <span class="flex_command">sinfo</span> or <em><span class="flex_command">squeue</span></em>). The <em>jobname</em> should be set to something sensible so you can identify your jobs.</li>
-<li class="itemize_item"><span class="flex_perlcode">slurm_time</span> is the maximum time your job has to run (<span class="flex_perlcode">0</span> means infinite).</li>
-<li class="itemize_item"><span class="flex_perlcode">slurm_use_all_node_CPUs</span> should be set to <span class="flex_perlcode">1</span> if you are running the default setup where each <span class="flex_software">slurm</span> job gets a single node and all its CPUs.</li>
-<li class="itemize_item"><span class="flex_perlcode">slurm_control_CPUs</span> is the number of CPUs belonging to the control script, i.e. if you set this to <span class="flex_perlcode">1</span> then one of the CPUs is <em>not</em> given to calculations but rather to the <span class="flex_scriptinglanguage">Perl</span> grid. It is safe to leave this at zero.</li>
-</ul>
-<div class="standard" id='magicparlabel-3638'>One big advantage of <span class="flex_software">slurm</span> compared to <span class="flex_software">HTCondor</span> is that <span class="flex_software">slurm</span> has array jobs which make it easy to set up a grid of models (the details are handled internally by the <span class="flex_software">slurm</span> module and all CPUs are used by default). </div>
-
-<div class="standard" id='magicparlabel-3655'>Please note that the <span class="flex_software">slurm</span> module has only been tested with <span class="flex_perlmodule"><i>binary_grid2</i></span> and <span class="flex_perlmodule">binary_grid::C</span>.</div>
-
-<div class="standard" id='magicparlabel-3668'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-3669'><span class="subsection_label">6.20</span> Initial distributions (IMF etc.) </h3>
-<div class="standard" id='magicparlabel-3670'><div id="sec_initial_dists"></div>
-The initial distributions of stellar masses, mass ratios, separations and periods are handled by the <span class="flex_perlmodule">distribution_functions</span> <span class="flex_scriptinglanguage">Perl</span> module. The general idea is that given a set of stellar parameters <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math> (or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>P</mi>
- </mrow></mstyle></math>) and phase volume <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo> ln </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>1</mn>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo> ln </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo> ln </mo><mi>a</mi>
-  </mrow>
- </mrow></mstyle></math> (or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo> ln </mo><mi>P</mi>
-  </mrow>
- </mrow></mstyle></math>) the probability of existence of star <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>i</mi>
- </mrow></mstyle></math> is calculated from </div>
-
-<div class="standard" id='magicparlabel-3679'><div id="eq_prob_eq"></div>
-<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mtable>
-  <mtr>
-   <mtd>
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>p</mi>
-     </mrow>
-     <mrow><mi>i</mi>
-     </mrow>
-    </msub>
-   </mtd>
-   <mtd><mo>=</mo>
-   </mtd>
-   <mtd>
-    <mrow><mo> &Psi; </mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mn>1</mn>
-      </mrow>
-     </msub>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-<mo> &Phi; </mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mn>2</mn>
-      </mrow>
-     </msub>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-<mi> &chi; </mi><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-<mi>a</mi>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-<mspace width="6px" /><mi> &delta; </mi><mo> ln </mo>
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mn>1</mn>
-      </mrow>
-     </msub><mspace width="6px" /><mi> &delta; </mi><mo> ln </mo>
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mn>2</mn>
-      </mrow>
-     </msub><mspace width="6px" /><mi> &delta; </mi><mo> ln </mo><mi>a</mi>
-    </mrow>
-   </mtd>
-   <mtd>
-   </mtd>
-  </mtr>
-  <mtr>
-   <mtd><mrow/>
-   </mtd>
-   <mtd><mo>=</mo>
-   </mtd>
-   <mtd>
-    <mrow><mo> &Psi; </mo><mo> &Phi; </mo><mi> &chi; </mi><mi> &delta; </mi><mo> ln </mo><mi>V</mi>
-    </mrow>
-   </mtd>
-   <mtd>(5)
-   </mtd>
-  </mtr>
- </mtable></mstyle></math>where <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo> ln </mo><mi>V</mi>
-  </mrow>
- </mrow></mstyle></math> is the 'phasevol' (as stored in the progenitor hash, see Section&nbsp;<a href="#sec_grid_options">A</a>). The functions <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mo> &Psi; </mo>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mo> &Phi; </mo>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &chi; </mi>
- </mrow></mstyle></math> are not necessarily independent (e.g. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Phi; </mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msub>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-  </mrow>
- </mrow></mstyle></math> may actually be <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Phi; </mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-   <mrow><mi>q</mi><mo>=</mo>
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>M</mi>
-     </mrow>
-     <mrow><mn>2</mn>
-     </mrow>
-    </msub><mo>/</mo>
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>M</mi>
-     </mrow>
-     <mrow><mn>1</mn>
-     </mrow>
-    </msub>
-   </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-  </mrow>
- </mrow></mstyle></math> in which case it depends on <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>) but the assumption we make is that <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> is separable. Note that <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &sum; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>p</mi>
-    </mrow>
-    <mrow><mi>i</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> must add to one, i.e. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mrow><mo> &int; </mo>
-   </mrow>
-   <mrow><mi>p</mi><mspace width="6px" />
-   </mrow><mo> &InvisibleTimes; </mo>
-   <mrow><mo> &DifferentialD; </mo><mi>V</mi>
-   </mrow><mo>=</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math>. In general, each of the distributions must also satisfy <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mrow><mo> &int; </mo>
-   </mrow>
-   <mrow><mo> &Psi; </mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>M</mi>
-     </mrow>
-     <mrow><mn>1</mn>
-     </mrow>
-    </msub>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-   </mrow><mo> &InvisibleTimes; </mo>
-   <mrow><mo> &DifferentialD; </mo>
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>M</mi>
-     </mrow>
-     <mrow><mn>1</mn>
-     </mrow>
-    </msub>
-   </mrow><mo>=</mo>
-   <mrow><mo> &int; </mo>
-   </mrow>
-   <mrow><mo> &Psi; </mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>M</mi>
-     </mrow>
-     <mrow><mn>2</mn>
-     </mrow>
-    </msub>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-   </mrow><mo> &InvisibleTimes; </mo>
-   <mrow><mo> &DifferentialD; </mo>
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>M</mi>
-     </mrow>
-     <mrow><mn>2</mn>
-     </mrow>
-    </msub>
-   </mrow><mo>=</mo>
-   <mrow><mo> &int; </mo>
-   </mrow>
-   <mrow><mi> &chi; </mi><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-<mi>a</mi>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-   </mrow><mo> &InvisibleTimes; </mo>
-   <mrow><mo> &DifferentialD; </mo><mi>a</mi>
-   </mrow><mo>=</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math> where the integrals are from <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo>-</mo><mi> &infin; </mi>
-  </mrow>
- </mrow></mstyle></math> to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo>+</mo><mi> &infin; </mi>
-  </mrow>
- </mrow></mstyle></math>.</div>
-
-<div class="standard" id='magicparlabel-3680'>There are many forms for each initial distributions and they depend on which authors you believe and/or which stars you are looking at (e.g. low- or high-mass stars). There is no one true answer – yet!</div>
-<h4 class="subsubsection" id='magicparlabel-3681'><span class="subsubsection_label">6.20.1</span> Predefined functions in the distribution_functions module</h4>
-<div class="standard" id='magicparlabel-3682'><div id="subsec_distribution_functions_predefined_functions"></div>
-</div>
-
-<dl class='description' id='magicparlabel-3683'><dt class="description_label">const(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>b</mi>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math>)</dt>
-<dd class="description_item"> Returns a constant distribution function between <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>y</mi>
- </mrow></mstyle></math> i.e. returns <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn><mo>/</mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-   <mrow><mi>b</mi><mo>-</mo><mi>a</mi>
-   </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-  </mrow>
- </mrow></mstyle></math>. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math> is optional, if given then a result is returned only if <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>a</mi><mo> &ge; </mo><mi>x</mi><mo> &ge; </mo><mi>b</mi>
-  </mrow>
- </mrow></mstyle></math>, otherwise zero. (This is useful for specifying a flat-<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>q</mi>
- </mrow></mstyle></math> distribution for the secondary mass or a flat-<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> ln </mo><mi>a</mi>
-  </mrow>
- </mrow></mstyle></math> separation distribution.)</dd>
-<dt class="description_label">powerlaw(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>b</mi>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>k</mi>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math>)</dt>
-<dd class="description_item"> A power-law distribution in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math> between <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>b</mi>
- </mrow></mstyle></math> with slope <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>k</mi>
- </mrow></mstyle></math>, zero if out of range.</dd>
-<dt class="description_label">three_part_power_law(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow><mn>0</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow><mn>3</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>,$consts)</dt>
-<dd class="description_item"> A three-part power-law distrubition between <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow><mn>0</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, with slopes <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> between <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mrow><mi>i</mi><mo>-</mo><mn>1</mn>
-    </mrow>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>i</mi><mo>=</mo><mn>1</mn><mo>,</mo><mn>2</mn><mo>,</mo><mn>3</mn>
-  </mrow>
- </mrow></mstyle></math>), zero otherwise. </dd>
-<dt class="description_label">ktg93(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math>)</dt>
-<dd class="description_item"> A wrapper function to use the <a href='#LyXCite-KTG1993MNRAS_262_545K'><span class="bib-abbrvciteauthor">Kroupa et al.</span></a> (<span class="bib-year">1993</span>) initial mass function for mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math>. All the constants are set up for you, you just have to specify the mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math>. </dd>
-<dt class="description_label">Kroupa2001(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math>)</dt>
-<dd class="description_item"> A wrapper function to use the <a href='#LyXCite-2001MNRAS_322__231K'><span class="bib-abbrvciteauthor">Kroupa</span></a> (<span class="bib-year">2001</span>) mass function, similar in design to <em>ktg93</em> above.</dd>
-<dt class="description_label">gaussian(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &mu; </mi>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &sigma; </mi>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>i</mi><mi>n</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>)</dt>
-<dd class="description_item"> A Gaussian distribution, mean <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &mu; </mi>
- </mrow></mstyle></math>, variance <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &sigma; </mi><mo>,</mo>
-  </mrow>
- </mrow></mstyle></math> between <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>i</mi><mi>n</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> evaluated at <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math>.</dd>
-</dl>
-<div class="standard" id='magicparlabel-3689'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-3690'><span class="subsection_label">6.21</span> Grid spacings</h3>
-<div class="standard" id='magicparlabel-3691'><div id="sec_The_spacing_functions_module"></div>
-The <span class="flex_perlmodule">spacing_functions</span><em> </em>module is used to set up the grid spacings. At the moment there are only a few functions, but you can add your own of course.</div>
-
-<dl class='description' id='magicparlabel-3696'><dt class="description_label">const(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>i</mi><mi>n</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>,<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>n</mi>
- </mrow></mstyle></math>)</dt>
-<dd class="description_item"> Constant spacing between <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>i</mi><mi>n</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>x</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>n</mi>
- </mrow></mstyle></math> steps, i.e. spacing <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>d</mi><mi>x</mi><mo>=</mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-   <mrow>
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>x</mi>
-     </mrow>
-     <mrow>
-      <mstyle mathvariant='normal'>
-       <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-       </mrow>
-      </mstyle>
-     </mrow>
-    </msub><mo>-</mo>
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>x</mi>
-     </mrow>
-     <mrow>
-      <mstyle mathvariant='normal'>
-       <mrow><mi>m</mi><mi>i</mi><mi>n</mi>
-       </mrow>
-      </mstyle>
-     </mrow>
-    </msub>
-   </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-<mo>/</mo><mi>n</mi>
-  </mrow>
- </mrow></mstyle></math>.</dd>
-<dt class="description_label">number(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math>)</dt>
-<dd class="description_item"> Simply returns <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math>, i.e. spacing <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>d</mi><mi>x</mi><mo>=</mo><mi>x</mi>
-  </mrow>
- </mrow></mstyle></math>.</dd>
-<dt class="description_label">const_dt</dt>
-<dd class="description_item"> This is a special distribution which chooses primary masses <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> such that the stellar lifetime between two stars <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mi> &delta; </mi><mi>t</mi><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>1</mn>
-    </mrow>
-   </msub>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-  </mrow>
- </mrow></mstyle></math> is constant. This is very useful for making grids to calculate e.g. yields as a function of time for a large number of timesteps. Note that in this case, such a distribution is <em>far</em> more efficient than, say, fixed in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> log </mo><mi>M</mi>
-  </mrow>
- </mrow></mstyle></math>. This distribution also has options to increase the resolution for low- and high-mass stars, as well as around the helium-flash mass, and can work in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mo> log </mo>
-    </mrow>
-    <mrow><mn>10</mn>
-    </mrow>
-   </msub><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> instead of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>t</mi>
- </mrow></mstyle></math>. See Sec.&nbsp;<a href="#Recipe_time_resolved_mass_grid">6.25.3</a> for an example of its use.</dd>
-</dl>
-<div class="standard" id='magicparlabel-3699'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-3700'><span class="subsection_label">6.22</span> The <span class='math'>\binarygrid</span>
- thread model</h3>
-<div class="standard" id='magicparlabel-3701'><div id="sec_The_Thread_Model"></div>
-CPUs used to be simple devices that did one job at a time. No more: every CPU these days has multiple <em>cores</em> which can run simultaneously while sharing system resources (e.g. RAM, disk). <span class='math'>\binarygrid</span>
- takes advantage of this by splitting the workload of running stars over a parameter space into multiple <em>threads</em> which run concurrently, thus speeding up execution of the grid.</div>
-
-<div class="standard" id='magicparlabel-3702'>Note: you should <em>not</em> call <span class="flex_perlcode">flexigrid</span> directly with <span class='math'>\binarygrid</span>
-2: instead call <br />
-<pre class ='listings'>$population-&gt;evolve();</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-3711'>When you call <span class="flex_perlcode">$population-&gt;evolve()</span> it sends a single argument to <span class="flex_perlcode">flexigrid()</span>: the number of child threads. Let's say you launch <span class="flex_perlcode">flexigrid(4);</span><em> </em>then the parent thread launches four children which are managed in a thread queue (using <span class="flex_scriptinglanguage">Perl</span>'s <span class="flex_perlmodule">Thread::Queue</span> module). Each star you want to run is placed in the queue and the threads pull them off one by one until the parameter space is complete.</div>
-<h4 class="subsubsection" id='magicparlabel-3732'><span class="subsubsection_label">6.22.1</span> Thread resources</h4>
-<div class="standard" id='magicparlabel-3733'><div id="subsec_thread_resources"></div>
-Each thread stores its results in a <em>hash table </em>(marked by <span class="flex_perlcode">%</span> in <em>Perl</em>, see 
-<br />
-
-<a href="http://en.wikipedia.org/wiki/Hash_function#Hash_tables">http://en.wikipedia.org/wiki/Hash_function#Hash_tables</a> and 
-<br />
-
-<a href="http://www.perltutorial.org/perl-hash.aspx">http://www.perltutorial.org/perl-hash.aspx</a>, if you know about <span class="flex_scriptinglanguage">Python</span><em> </em>dictionaries, these are pretty much the same). This is like an array, which is probably familiar to you from other programming languages e.g. <em>C</em>, <em>C++</em> and <em>FORTRAN</em>, but instead of using numbers (e.g. 0, 1, 2&hellip;) as indices, it uses <em>keys</em> instead which can be any scalar, i.e. strings or numbers. Hashes can be nested, e.g. as hashes of hashes or hashes of arrays or arrays of hashes etc. This concept is very powerful because it allows you to store the results of your population synthesis in a <em>single hash table.</em> Because hashes can be nested, a single table can store <em>everything</em> you can throw at it. </div>
-
-<div class="standard" id='magicparlabel-3742'>Each thread has its own hash, usually accessed (e.g. in <em><span class="flex_perlcode">parse_bse</span></em>) through the variable
-<br />
-
- <span class="flex_perlcode">$population-&gt;results</span> where <span class="flex_perlcode">$population</span> is your <em><span class='math'>\binarygrid</span>
-2</em> object (this is actually a <em>reference</em> to a hash, similar to a <span class="flex_programminglanguage">C</span> pointer). Usually it is easiest to take a copy in <span class="flex_perlcode">$h</span>, e.g. with <br />
-<pre class ='listings Perl'>$h=$population-&gt;results();</pre><br />
- into which you put your data in <span style='font-family:monospace;font-size: 18px;'>$h</span> and it is propagated where it is required.</div>
-
-<div class="standard" id='magicparlabel-3767'>When the threads finish they are <em>joined</em> together – in this process, the thread's<em> </em>results hash is added to a global hash which ends up in your <span class="flex_perlcode">$population</span> object. The mechanism to do this is automatically included in <span class='math'>\binarygrid</span>, you do not usually have to do anything yourself. At the end of the grid, the<em> </em><span class="flex_perlcode">$population-&gt;results</span> hash contains the sum of the population synthesis over all the stars you have run.</div>
-
-<div class="standard" id='magicparlabel-3776'>Beware that the default hash join function <em>only </em>knows how to add up scalars, arrays and hashes. It cannot know how to add a hash to an array. I cannot think of a case where this would be a problem unless you make your results hash structure depend on thread number. I cannot think of a reason why you would do this.</div>
-<h4 class="subsubsection" id='magicparlabel-3777'><span class="subsubsection_label">6.22.2</span> CPU load and thread number</h4>
-<div class="standard" id='magicparlabel-3778'><div id="subsec_CPU_load"></div>
-</div>
-
-<dl class='description' id='magicparlabel-3779'><dt class="description_label">C&nbsp;backend</dt>
-<dd class="description_item"> Using the <em>C</em> backend, the number of threads scales well with CPU usage and runtime, tested up to 8 threads (or 16 with hyperthreading, which obviously isn't really a valid test given how dodgy hyperthreading is). <b>It is highly recommended to use the <i>C</i> backend for greatly increased performance.</b></dd>
-<dt class="description_label">Perl&nbsp;backend</dt>
-<dd class="description_item"> It is not obviously clear how many threads you should launch even if you know the number of CPUs in your system. If your <span class='math'>binary_c</i></span>
- process does a lot of work and outputs very little, then <span class='math'>\binarygrid</span>
-will not have much processing to do and you may as well launch as many threads as you have CPUs. However, if <em><span class='math'>binary_c</i></span>
-</em> outputs a lot of data (e.g. at every timestep) then <span class='math'>\binarygrid</span>
- will have to work hard to keep up and you may need as much (or more!) CPU for<em> </em><span class='math'>\binarygrid</span>
- as <span class='math'>binary_c</i></span>
-. Remember that each Perl<em> <span class='math'>\binarygrid</span>
- </em>thread launches its own <span class='math'>binary_c</i></span>, so if you have <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>N</mi>
- </mrow></mstyle></math> CPUs, you might want <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>N</mi><mo>/</mo><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math> threads for the fastest possible grid.</dd>
-</dl>
-<div class="standard" id='magicparlabel-3781'>The best option is to experiment with a limited (low-resolution) parameter space and gradually increase the number of stars while changing the number of threads. This is, in any case, good practice for debugging your newly programmed code. When debugging, use <em>only one thread.</em></div>
-<h4 class="subsubsection" id='magicparlabel-3782'><span class="subsubsection_label">6.22.3</span> Memory usage</h4>
-<div class="standard" id='magicparlabel-3783'><div id="subsec_memory_usage"></div>
-Each thread stores its data in its own hash, so the more threads you have the more memory you will use. If you are not saving much data, this will not bother you, but obviously if you save a lot of high-resolution data you may start to use a lot of RAM. </div>
-
-<div class="standard" id='magicparlabel-3784'>You should bin your hash keys to save RAM: consider this example. If you save the luminosity at each timestep, you will end up with hashes with keys (e.g.) 1.0, 1.0001, 1.0002, 1.0003 etc. Very quickly – in seconds! – you will have more data than you or your RAM can handle. Instead, bin your data and use logarithms when you can. Binary_grid has a bin_data function for this, e.g.&nbsp;<br />
-<pre class ='listings Perl'>$logL=bin_data(log10($L),0.1);</pre><br />
- bins the logarithm of <span style='font-family:monospace;font-size: 18px;'>$L</span> (e.g. the luminosity) to the nearest <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>0.1</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>d</mi><mi>e</mi><mi>x</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>. </div>
-
-<div class="standard" id='magicparlabel-3789'>Remember that if each thread uses <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>N</mi>
- </mrow></mstyle></math> megabytes of RAM and you have <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>n</mi>
- </mrow></mstyle></math> threads, the maximum RAM use is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &sim; </mo><mn>2</mn><mi>n</mi><mi>N</mi>
-  </mrow>
- </mrow></mstyle></math> because, when the data is joined, the master thread contains a copy of all the data as well. While <span class='math'>\binarygrid</span>
- tries very hard to use as little memory as possible, such that the total memory use is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo>&lt;</mo><mn>2</mn><mi>n</mi><mi>N</mi>
-  </mrow>
- </mrow></mstyle></math>, your grid may fail at the thread join step if there is not sufficient RAM. In the case of an <span class="flex_software">HTCondor</span> or <span class="flex_software">slurm</span> grid, your data files are preserved and you can simply rerun the final grid join step on a machine with more memory.</div>
-<h4 class="subsubsection" id='magicparlabel-3798'><span class="subsubsection_label">6.22.4</span> <span style='font-family:monospace;font-size: 18px;'>threadinfo</span> variables</h4>
-<div class="standard" id='magicparlabel-3799'><div id="subsec_thread_variables"></div>
-Each thread sets its own copy of the<span style='font-family:monospace;font-size: 18px;'> </span><span class="flex_perlcode">_threadinfo</span> hash inside the<em> <span class='math'>\binarygrid2</span>
- </em>object, containing information relevant only to the thread. Most of this is used internally but you have access to it (do not change it unless you know what you are doing!).</div>
-
-<ol class='lyxlist' id='magicparlabel-3804'><li class="labeling_item"><span class='lyxlist'>evcode_pid</span>
- <span class='math'>binary_c</i></span>
- process id associated with this thread (only for <span class="flex_scriptinglanguage">Perl</span><em> </em>backend)</li>
-<li class="labeling_item"><span class='lyxlist'>cmd</span>
- Internal thread command number (used to label various stop conditions)</li>
-<li class="labeling_item"><span class='lyxlist'>h</span>
- Reference to the data hash filled by this thread (<span class="flex_perlcode">$h</span> in <span class="flex_perlcode">parse_data</span>)</li>
-<li class="labeling_item"><span class='lyxlist'>lastargs</span>
- The last argument string which was fed to <span class='math'>binary_c</i></span>
-</li>
-<li class="labeling_item"><span class='lyxlist'>runtime</span>
- The total runtime of the thread (including Perl) </li>
-<li class="labeling_item"><span class='lyxlist'>runcount</span>
- The number of stars run by this thread</li>
-<li class="labeling_item"><span class='lyxlist'>state</span>
- Thread state variable: <span class="flex_perlcode">0</span>=finished, <span class="flex_perlcode">1</span>=running </li>
-<li class="labeling_item"><span class='lyxlist'>thread_number</span>
-<em> </em>The unique thread number (starts at zero)</li>
-<li class="labeling_item"><span class='lyxlist'>thread_queue</span>
- The thread queue object (see the <em>CPAN</em> module <em><span class="flex_perlmodule">Thread::Queue</span></em>)</li>
-<li class="labeling_item"><span class='lyxlist'>tstart</span>
- Start time of the thread (from <span class="flex_perlcode">[gettimeofday]</span>)</li>
-<li class="labeling_item"><span class='lyxlist'>tvb_fp</span>
- File (pointer) to which output is sent if the grid option <span class="flex_perlcode">tvb</span> is true</li>
-<li class="labeling_item"><span class='lyxlist'>tvb_repeat</span>
- Thread logging control variable (prevents repeated lines) </li>
-<li class="labeling_item"><span class='lyxlist'>tvb_last</span>
- The previous thread log line</li>
-<li class="labeling_item"><span class='lyxlist'>tvb_lasttime</span>
-<em> </em>The time of the previous output to the thread log</li>
-<li class="labeling_item"><span class='lyxlist'>thread_prev_alive</span>
- Thread timer (from <span class="flex_perlcode">time()</span>): this is the time the thread last registered as being alive</li>
-<li class="labeling_item"><span class='lyxlist'>thread_prev_complaint</span>
- Thread timer (from <span class="flex_perlcode">time()</span>): this is the time the thread last registered a complaint about taking too long</li>
-</ol>
-<div class="standard" id='magicparlabel-3860'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-3861'><span class="subsection_label">6.23</span> Debugging, benchmarking and advanced topics</h3>
-<div class="standard" id='magicparlabel-3862'><div id="sec_debugging"></div>
-This section provides a summary of debugging options and suggestions for ways to fix your code (or<em> <span class='math'>\binarygrid</span>
-</em>!). </div>
-<h4 class="subsubsection" id='magicparlabel-3863'><span class="subsubsection_label">6.23.1</span> Debugging options</h4>
-<div class="standard" id='magicparlabel-3864'>The following <span class='math'>\binarygrid</span>
-2 object variables affect debugging:</div>
-
-<ul class="itemize" id='magicparlabel-3865'><li class="itemize_item"><span class="flex_perlcode">vb</span>
-<br />
-
-See Section&nbsp;<a href="#subsec_Verbosity">6.23.2</a> below.</li>
-<li class="itemize_item"><span class="flex_perlcode">tvb</span><span style='font-family:monospace;font-size: 18px;'> </span>controls individual thread logging.</li>
-<li class="itemize_item"><span class="flex_perlcode">log_args</span> will output the arguments sent to<em> <span class='math'>binary_c</i></span>
- </em>in files in 
-<span style='font-family:monospace;font-size: 18px;'><br />
-
-</span><span class="flex_file">/tmp/<i>binary_c</i>.thread_$n.lastargs</span> where <span class="flex_perlcode">$n</span> is the thread number. </li>
-<li class="itemize_item"><span class="flex_perlcode">args</span> stores a single string with the raw arguments that were passed into <span class='math'>binary_c</i></span>
-. This is useful if you want to do some debugging in the <span class="flex_perlcode">parse_bse()</span> function (which has access to this variable). Within a thread, this data is also accessible in <span class="flex_perlcode">$threadinfo{lastargs}</span>.</li>
-<li class="itemize_item"><span class="flex_perlcode">progenitor</span> stores the progenitor information in a single string, in the following order: duplicity, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>P</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>e</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>Z</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>P</mi>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo> ln </mo><mi>V</mi>
-  </mrow>
- </mrow></mstyle></math> (the '<span class="flex_perlcode">logphasevol</span>'=<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo> ln </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>1</mn>
-    </mrow>
-   </msub><mi> &delta; </mi><mo> ln </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msub><mi> &delta; </mi><mi>a</mi>
-  </mrow>
- </mrow></mstyle></math>). If the star is a single star (when <span class="flex_perlcode">binary==0</span>) then <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>P</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>e</mi>
- </mrow></mstyle></math> are omitted and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo> ln </mo><mi>V</mi><mo>=</mo><mi> &delta; </mi><mo> ln </mo><mi>M</mi>
-  </mrow>
- </mrow></mstyle></math>. This data is accessible from <span class="flex_perlcode">parse_data</span>.</li>
-<li class="itemize_item"><span class="flex_perlcode">progenitor_hash</span> contains the same information as the progenitor string (above) in a more accessible form: the hash <em>keys</em> are binarity, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>P</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>e</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>Z</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>P</mi>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo> ln </mo><mi>V</mi>
-  </mrow>
- </mrow></mstyle></math>, and the values contain the appropriate data. Again, this is accessible from <span class="flex_perlcode">parse_bse</span>. </li>
-<li class="itemize_item">Use the <span class="flex_perlcode">timeout</span> feature if your code is freezing. This is <em>not</em> the same as fixing your problem, but you may be able to stop the code from using all your CPU when it freezes! (Note that this uses <span class="flex_os">Unix</span> signals to test for timeouts: it may not work e.g.&nbsp;with the <span class="flex_software">HTCondor</span>/<span class="flex_software">slurm</span> queueing system).</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-3944'><span class="subsubsection_label">6.23.2</span> Verbosity<div id="subsec_Verbosity"></div>
-</h4>
-<div class="standard" id='magicparlabel-3945'><span style='font-family:monospace;font-size: 18px;'>vb</span> controls the amount of grid output to the screen, usually lines showing the number of stars evolved, the total number in the grid, the current time, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>P</mi>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>Z</mi>
- </mrow></mstyle></math>, the probability, the total grid probability, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>%
- </mrow></mstyle></math> grid completion, estimated time until arrival (finish) i.e. <em>ETA</em>, <em>tpr</em> (time per run), <em>ETF</em> (estimated time at which it will finish) and memory usage. If set to 1 it shows output every second or every <span style='font-family:monospace;font-size: 18px;'>nmod</span> models. </div>
-
-<div class="standard" id='magicparlabel-3946'>If <span style='font-family:monospace;font-size: 18px;'>vb</span> is set to <span style='font-family:monospace;font-size: 18px;'>2</span> then more output, showing the arguments sent to <span class='math'>binary_c</i></span>, will be dumped onto the screen for each model. This is only useful for small grids, for large grids it will overwhelm you. It is possible to set <span style='font-family:monospace;font-size: 18px;'>vb=3</span> for even more output.
-<br />
-
-Note that as of <em><span class='math'>\binarygrid</span>
-</em> 0.18 it is impossible to set <span style='font-family:monospace;font-size: 18px;'>vb</span> from inside your script if you are using the two-stage bootstrapping (which you really should, see Section&nbsp;<a href="#subsec_Two_stage_bootstrapping">6.23.4</a> below): it <em>must</em> be sent on the command line that runs your script.</div>
-
-<div class="standard" id='magicparlabel-3947'>Inside <span class="flex_perlmodule"><i>binary_grid2</i>.pm</span> are many <span class="flex_perlcode">vbout(<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>n</mi>
- </mrow></mstyle></math>,&hellip;);</span> statements. These control the verbose output from<em> <span class='math'>\binarygrid</span>
-2</em>, such that the statement is output to the screen <em>only if </em><span style='font-family:monospace;font-size: 18px;'>vb</span><em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &ge; </mo><mi>n</mi>
-  </mrow>
- </mrow></mstyle></math></em>. If you want to insert new verbose statements, please use this format!</div>
-<h4 class="subsubsection" id='magicparlabel-3956'><span class="subsubsection_label">6.23.3</span> Benchmarking with subroutine timers<div id="subsec_Subroutine_timers"></div>
-</h4>
-<div class="standard" id='magicparlabel-3957'><b>Warning:timers have not been tested with <i>binary_grid2</i></b></div>
-
-<div class="standard" id='magicparlabel-3958'>If your grid is running slowly, you can use subroutine timers by first setting:</div>
-
-<div class="standard" id='magicparlabel-3959'><br />
-<pre class ='listings Perl'>$population-&gt;timers=1;</pre><br />
-<span style='font-family:monospace;font-size: 18px;'> </span>and then make a list of subroutines you would like to time:</div>
-
-<div class="standard" id='magicparlabel-3964'><br />
-<pre class ='listings Perl'>$population-&gt;timer_subroutines=['main::parse_bse','binary_out','print_binary_in'];</pre><br />
-Note that a default subroutine list is used (see <span class="flex_file"><i>binary_grid2</i>.pm</span>) which includes most of the subroutines in <span class='math'>\binarygrid</span>
-. To see the results of the subroutine timing, put a call to</div>
-
-<div class="standard" id='magicparlabel-3973'><br />
-<pre class ='listings Perl'>output_binary_grid_timers();</pre><br />
-in your script before it exits.</div>
-
-<div class="standard" id='magicparlabel-3978'>There is considerable overhead in activating subroutine timers, so your grid will run possibly up to twice as slow as normal. Timers should <em>not</em> be used for production code, but are very useful if you want to know what is slowing you down.</div>
-
-<div class="standard" id='magicparlabel-3979'>Note that some subroutines are designed to sit and wait for something to happen (e.g. <em>binary_out</em>) and these will therefore use up a lot of time. This is normal: I have gone to great length to make these functions as fast as possible (while keeping debugging and code-crash checking) – if you can make them faster, great, but this will be difficult if you want stability and error-checking.</div>
-<h4 class="subsubsection" id='magicparlabel-3980'><span class="subsubsection_label">6.23.4</span> Two-stage bootstrapping<div id="subsec_Two_stage_bootstrapping"></div>
-</h4>
-<div class="standard" id='magicparlabel-3981'><b>Warning: bootstrapping is no longer of much concern in <em><i>binary_grid2</i></em>, even though it still works for some of the module code. The backend modules are <em>not </em>bootstrapped because it is simply impossible to do so.</b></div>
-
-<div class="standard" id='magicparlabel-3982'>As of version 0.18 of <span class='math'>\binarygrid</span>
- and hence inherited in <span class='math'>\binarygrid</span>
-2, the <span class='math'>\binarygrid</span>
-2 module is loaded using a two-stage bootstrap technique. The aim of this is to reduce the overhead of using verbose debugging statements (and the like) in the <em><span class='math'>\binarygrid</span>
- </em>code by removing unnecessary code at runtime <em>prior to compilation</em>. Perl is a superb language for doing this by means of its <span class="flex_perlcode">eval</span> command. Roughly, when you load <span class="flex_file"><i>binary_grid2</i>.pm</span> the following happens:</div>
-
-<ol class="enumerate" id='magicparlabel-3991'><li class="enumerate_item">The module loads a few basic subroutines, including <span class="flex_perlcode">parse_args</span> to check the command line arguments, especially to look for a <span class="flex_args">vb=n</span> switch that controls verbosity.</li>
-<li class="enumerate_item">The variable <span class="flex_perlcode">$binary_grid_code</span> is set up: this contains most of the module code. This is then filtered to remove <span class="flex_perlcode">vbout()</span> and <span class="flex_perlcode">verbose_output()</span> statements that would never output anything, based on your choice of the <span class="flex_perlcode">vb</span> <span class="flex_perlcode">grid_option</span> (as given in the arguments to your script). Note that the useless code is <em>completely removed</em> rather than left to always do nothing.</li>
-<li class="enumerate_item">The <span class="flex_perlcode">$binary_grid_code</span> is <span class="flex_perlcode">eval</span>d, i.e. compiled at runtime.</li>
-</ol>
-<div class="standard" id='magicparlabel-4030'>This <em>bootstrapping</em> eliminates the overhead of calls to the vbout subroutine, and its check of the <span style='font-family:monospace;font-size: 18px;'>vb</span> variable. You may think this overhead is small, but it really is not. The reason is that the arguments to a <span class="flex_software">Perl</span> subroutine are evaluated <em>prior </em>to the call. This often makes sense, but if the arguments are (say) long lists that need joining, this takes valuable CPU time – and for nothing!</div>
-
-<div class="standard" id='magicparlabel-4035'>Benchmarking tests with subroutine timers (see Section&nbsp;<a href="#subsec_Subroutine_timers">6.23.3</a>) show a considerable saving by using this technique, sometimes up to a factor of two in runtime. Bootstrapping is set to be on by default, but can be disabled by setting
-<br />
-
-<br />
-<pre class ='listings Perl'>$binary_grid::grid_options{binary_grid_code_filtering}=0;</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-4040'>If you have problems, e.g. the <span class="flex_perlcode">eval()</span><em> </em>step fails, you should be able to spot this at module installation time (e.g.<em> </em><span class="flex_software">cpanm</span> will fail). Alternatively, you can set
-<br />
-
-<span class="flex_perlcode">$binary_grid::grid_options{pre_filter_file}</span> and
-<br />
-
- <span class="flex_perlcode">$binary_grid::grid_options{post_filter_file}</span> to dump the contents of <span class="flex_perlcode">$binary_grid_code</span> to files, which you can then diff to determine what went wrong. </div>
-
-<div class="standard" id='magicparlabel-4061'>Note that, if you use the bootstrapping – which you really should! – you <em>must</em> set <span style='font-family:monospace;font-size: 18px;'>vb</span> in the arguments to your script. Any later settings (e.g. setting the variable manually inside your script) will be ignored.</div>
-
-<div class="standard" id='magicparlabel-4062'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-4063'><span class="subsection_label">6.24</span> Future Plans</h3>
-<div class="standard" id='magicparlabel-4064'><div id="sec_future_plans"></div>
-</div>
-
-<ul class="itemize" id='magicparlabel-4065'><li class="itemize_item">A graphical frontend would be good! Please write one for me.</li>
-</ul>
-<div class="standard" id='magicparlabel-4066'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-4067'><span class="subsection_label">6.25</span> Cookbook</h3>
-<div class="standard" id='magicparlabel-4068'><div id="sec_Cookbook"></div>
-This section contains some examples of how to use <i>binary_grid</i>, so refers to old code (which I have updated where I can). I will fill this in for<b> <span class='math'>\binarygrid2</span>
- </b>at some point.</div>
-<h4 class="subsubsection" id='magicparlabel-4069'><span class="subsubsection_label">6.25.1</span> Star Formation History</h4>
-<div class="standard" id='magicparlabel-4070'><div id="Recipe_SFR"></div>
-You may not want to use a constant star formation rate (SFR). If you can live with all your models having the same input physics (i.e. metallicity, etc.) you can easily fold in a star formation history (SFH).</div>
-
-<ol class="enumerate" id='magicparlabel-4071'><li class="enumerate_item">Make sure you know the <em>time</em> at each output of <span class='math'>binary_c</i></span>, let's call this <span style='font-family:monospace;font-size: 18px;'>$t</span>.</li>
-<li class="enumerate_item">You also need <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>d</mi><mi>t</mi><mo> &times; </mo><mi>p</mi>
-  </mrow>
- </mrow></mstyle></math>, i.e. <span class="flex_perlcode">$dtp</span>, at each timestep.</li>
-<li class="enumerate_item">Weight <span class="flex_perlcode">$dtp</span> by a SFR function:<span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings Perl'>$dtp *= SFR($binary_grid::bse_options{'max_evolution_time'}-$t);</pre><br />
-</span></li>
-</ol>
-<div class="standard" id='magicparlabel-4086'>You have to write the SFR function yourself, e.g.,</div>
-
-<div class="standard" id='magicparlabel-4087'><br />
-<pre class ='listings Perl'>sub SFR
-{
-	# SFR as a function of Galactic age in Myr
-	my $t=$_[0]; # Galactic age
-	return 1.0; # const SFR
-	return $t&lt;1.0e3 ? 1.0 : 0.0; # const for the first Gyr
-	return exp(-$t/10e3); # exponential dropoff over 10Gyr
-}</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-4099'>How does this work? What you're passing into the SFR function is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>t</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo>-</mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math>, which is effectively the time at which the star was born, assuming everything begin <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>t</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>m</mi><mi>a</mi><mi>x</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> ago.</div>
-
-<div class="standard" id='magicparlabel-4100'>This does not describe the overall normalization, e.g. if you want <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>N</mi>
- </mrow></mstyle></math> stars in total. You have to add up the statistic appropriate to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>N</mi>
- </mrow></mstyle></math> (i.e. the number of stars seen <em>now</em>) and apply this to your results.</div>
-<h4 class="subsubsection" id='magicparlabel-4101'><span class="subsubsection_label">6.25.2</span> Aliasing</h4>
-<div class="standard" id='magicparlabel-4102'><div id="Recipe_aliasing"></div>
-You output your histogram but it's all spiky and noisy! What's wrong? The simple answer is that you don't have enough stars on your grid for the bin width of your histogram. (See e.g. 
-<br />
-
-<a href="http://en.wikipedia.org/wiki/Nyquist-Shannon_sampling_theorem">http://en.wikipedia.org/wiki/Nyquist-Shannon_sampling_theorem</a>) Solutions are:</div>
-
-<ol class="enumerate" id='magicparlabel-4103'><li class="enumerate_item">More stars</li>
-<li class="enumerate_item">Wider bins</li>
-</ol>
-<div class="standard" id='magicparlabel-4105'>Now, I hear you cry that your old Monte Carlo code gives a lovely smooth histogram. Yes, for the same number of stars, it might. But it might also give you worse spikes. With a MC code you can never guarantee resolution, and in the limit of a large number of stars the result is the same. At least with a grid-based solution you can <em>see</em> the spikes so you <em>know </em>the limit of your resolution. With an MC code you're just playing dice (see the FAQ <a href="#FAQ_why_not_MC_">6.26.1</a>).</div>
-
-<div class="standard" id='magicparlabel-4106'>Usually I just run with more stars. See also Recipe&nbsp;<a href="#Recipe_SFR">6.25.1</a> above.</div>
-<h4 class="subsubsection" id='magicparlabel-4107'><span class="subsubsection_label">6.25.3</span> Time-resolved mass grid</h4>
-<div class="standard" id='magicparlabel-4108'><div id="Recipe_time_resolved_mass_grid"></div>
-Some problems require a more carefully spaced grid than the simple <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> ln </mo><mi>M</mi>
-  </mrow>
- </mrow></mstyle></math> grid. A good example is the calculation of stellar yields. The yield sets are generally required to give yields out to a time of many <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mstyle mathvariant='normal'>
-   <mrow><mi>G</mi><mi>y</mi><mi>r</mi>
-   </mrow>
-  </mstyle>
- </mrow></mstyle></math> and with a time resolution of, say, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>10</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>M</mi><mi>y</mi><mi>r</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>. At early times this is not a problem, but at late times the stellar lifetime scales with the mass as <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>t</mi><mo> &sim; </mo>
-   <msup>
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>3</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math> (roughly) so in order to have good time resolution we require <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>M</mi><mo> &sim; </mo><mi> &delta; </mi><mi>t</mi><mo>/</mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-   <mrow><mn>3</mn>
-    <msup>
-     <mrow><mi>M</mi>
-     </mrow>
-     <mrow><mn>2</mn>
-     </mrow>
-    </msup>
-   </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-<mo> &sim; </mo>
-   <msup>
-    <mrow><mi>t</mi>
-    </mrow>
-    <mrow>
-     <mrow><mo>-</mo><mn>2</mn><mo>/</mo><mn>3</mn>
-     </mrow>
-    </mrow>
-   </msup><mi> &delta; </mi><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> which is rather small at late times when <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>t</mi>
- </mrow></mstyle></math> is large. </div>
-
-<div class="standard" id='magicparlabel-4109'>We could just set a normal log-mass grid and have a very large resolution. A smarter alternative is to set up the grid to <em>enforce </em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>M</mi><mo>=</mo><mi>f</mi><mo> &times; </mo><mi> &delta; </mi><mi>t</mi><mo>/</mo><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-   <mrow><mn>3</mn>
-    <msup>
-     <mrow><mi>M</mi>
-     </mrow>
-     <mrow><mn>2</mn>
-     </mrow>
-    </msup>
-   </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-  </mrow>
- </mrow></mstyle></math> as our grid spacing (with a factor <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>f</mi><mo>&lt;</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math> which ensures over-resolution to avoid gridding artifacts). Implementations of this, and a fixed <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo> ln </mo><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math> grid, are available in <em><i>binary_grid</i></em> via the <em>spacing_functions </em>module.</div>
-
-<div class="standard" id='magicparlabel-4110'>In the HRD project with Peter Anders, I use the following:</div>
-
-<div class="standard" id='magicparlabel-4111'><br />
-<pre class ='listings Perl'># Mass 1
-$binary_grid::grid_options{'flexigrid'}{'grid variable '.$nvar++}=
-{
-	'name'=&gt; 'lnm1', 
-	'longname'=&gt;'Primary mass', 
-	'range'=&gt;["log(0.1)","log(80)"], 
-	# const_dt spacing function options
-	'preloopcode'=&gt;"
-	my \$const_dt_opts=\{
-	max_evolution_time=&gt;20000,
-	stellar_lifetime_table_nm=&gt;100,
-	nthreads=&gt;1,
-	thread_sleep=&gt;1,
-	mmin=&gt;0.1,
-	mmax=&gt;80.0,
-	time_adaptive_mass_grid_log10_time=&gt;1,
-	time_adaptive_mass_grid_log10_step=&gt;0.05,
-	time_adaptive_mass_grid_step=&gt;100,
-	extra_flash_resolution=&gt;0,
-	time_adaptive_mass_grid_nlow_mass_stars=&gt;10,
-	debugging_output_directory=&gt;undef,#'/tmp/adaptive_mass_grid',
-	max_delta_m=&gt;2.0,
-	savegrid=&gt;undef,
-	vb=&gt;0,
-\};
-	spacing_functions::const_dt(\$const_dt_opts,'reset');",
-	# use const_dt function
-	'spacingfunc'=&gt;"const_dt(\$const_dt_opts,'next')",
-	# and its resolution
-	'resolution'=&gt;"spacing_functions::const_dt(\$const_dt_opts,'resolution');",
-	'precode'=&gt;'$m1=exp($lnm1); $eccentricity=0.0;',
-	'probdist'=&gt;"Kroupa2001(\$m1)*\$m1",
-	'dphasevol'=&gt;'$dlnm1',
-};</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-4149'>The key line is <span class="flex_perlcode">time_adaptive_mass_grid_log10_step=&gt;0.05</span> which specifies that I want (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mo> log </mo>
-   </mrow>
-   <mrow><mn>10</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>) time resolved to every <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>0.05</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>d</mi><mi>e</mi><mi>x</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>. Note how I set up the <span class="flex_perlcode">$const_dt_opts</span> anonymous hash of options and then send it via the spacing function with the option '<span class="flex_perlcode">reset</span>'. This sets up a list of masses which are just returned for each call to <span class="flex_perlcode">const_dt()</span> with the '<span class="flex_perlcode">next</span>' parameter. Calling <span class="flex_perlcode">const_dt()</span> with the '<span class="flex_perlcode">resolution</span>' parameter just returns the number of masses in the list, which is trivially the resolution.</div>
-<h4 class="subsubsection" id='magicparlabel-4178'><span class="subsubsection_label">6.25.4</span> Single and binary stars combined</h4>
-<div class="standard" id='magicparlabel-4179'><div id="Recipe_Single_and_binary_stars"></div>
-You can set up a grid containing both single and binary stars quite easily. The following code defines a grid variable &ldquo;<em>duplicity</em>&rdquo; which is either <span class="flex_perlcode">0</span> or <span class="flex_perlcode">1</span>, and sets the <span class="flex_perlcode">grid_option</span> &ldquo;binary&rdquo; appropriately. Deeper nested grid variables can then depend on the duplicity and choose, through the <em>condition </em>variable, whether to execute grids over <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and beyond.</div>
-
-<div class="standard" id='magicparlabel-4192'><br />
-<pre class ='listings Perl'># duplicity
-$binary_grid::grid_options{'flexigrid'}{'grid variable '.$nvar++}=
-{
-	'name'=&gt;'duplicity',
-	'longname'=&gt;'Duplicity',
-	'range'=&gt;[0,1],
-	'resolution'=&gt;1,
-	'spacingfunc'=&gt;'number(1.0)',
-	'precode'=&gt;'$binary_grid::grid_options{binary}=$duplicity;',
-	'gridtype'=&gt;'edge',
-	'noprobdist'=&gt;1,
-};</pre><br />
-</div>
-<h4 class="subsubsection" id='magicparlabel-4208'><span class="subsubsection_label">6.25.5</span> Snapshots: I want to stop a grid and restart later</h4>
-<div class="standard" id='magicparlabel-4209'><div id="subsec_snapshotting"></div>
-The ability to stop and restart the grid is called <em>snapshotting</em>. Note that while this currently works, it assumes that you:</div>
-
-<ol class="enumerate" id='magicparlabel-4210'><li class="enumerate_item">Use the identical grid script to restart</li>
-<li class="enumerate_item">Do not change any of your installation (<span class='math'>binary_c</i></span>, <span class='math'>\binarygrid</span>
-&nbsp;etc.) between stopping and restarting, </li>
-</ol>
-<div class="standard" id='magicparlabel-4212'>thus snapshotting is quite limited in its functionality but it might save your data when your computer is about to die.</div>
-<h4 class="subsubsection" id='magicparlabel-4213'><span class="subsubsection_label">6.25.6</span> Suspending the grid</h4>
-<div class="standard" id='magicparlabel-4214'><em><span class='math'>\binarygrid</span>
-</em> looks in files, defined in <span class="flex_perlcode">$binary_grid::grid_options{'suspend_files'}=[&hellip;]</span>, and if one exists, it executes its snapshot code. To make one exist, use the <span class="flex_scriptinglanguage">Unix</span> command <span class="flex_command">touch</span><em> </em>e.g. </div>
-
-<div class="standard" id='magicparlabel-4227'><br />
-<pre class ='listings'>touch /tmp/force_binary_c_suspend</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-4232'>This joins all the current threads and saves their data in one file so you can restart it later. It may take some time to join all the threads, so please be patient. By default, <i>binary_grid</i> looks at the files <span class="flex_file">/tmp/force_binary_c_suspend</span> and <span class="flex_perlcode">./force_binary_c_suspend</span> (although you can add your own with <span class="flex_perlcode">push(@$binary_grid::grid_options{'suspend_files'}, &ldquo;new filename&rdquo;);)</span></div>
-
-<div class="standard" id='magicparlabel-4245'>The saved file name is defined in <span class="flex_perlcode">$binary_grid::grid_options{'snapshot_file'}</span> (default <span style='font-family:monospace;font-size: 18px;'>'</span><span class="flex_file">/tmp/<i>binary_c</i>-snapshot</span><span style='font-family:monospace;font-size: 18px;'>'</span>).</div>
-
-<div class="standard" id='magicparlabel-4254'>All the above <span class="flex_file">/tmp/</span> are actually <span class="flex_perlcode">$binary_grid::grid_options{tmp}</span> so you can define your own location for all the files (which is probably more secure, because then you can prevent anyone from touching the file and stopping your grid).</div>
-<h4 class="subsubsection" id='magicparlabel-4263'><span class="subsubsection_label">6.25.7</span> Restarting the grid</h4>
-<div class="standard" id='magicparlabel-4264'>If <span class="flex_perlcode">$binary_grid::grid_options{starting_snapshot_file}</span> is defined, it is used to load in a previously saved snapshot and the grid is restarted. You can usually just load this on the command line, e.g. by running your grid script as</div>
-
-<div class="standard" id='magicparlabel-4269'><span class="flex_perlcode">./src/perl/scripts/my_grid_script.pl starting_snapshot_file=my_snapshot_file</span></div>
-<h4 class="subsubsection" id='magicparlabel-4274'><span class="subsubsection_label">6.25.8</span> World Domination</h4>
-<div class="standard" id='magicparlabel-4275'><div id="subsec_World_Domination"></div>
-</div>
-
-<div class="standard" id='magicparlabel-4276'>I'm working on it. I have started to brew my own beer, does that count?</div>
-
-<div class="standard" id='magicparlabel-4277'><br />
-</div>
-<h3 class="subsection" id='magicparlabel-4278'><span class="subsection_label">6.26</span> FAQ</h3>
-<div class="standard" id='magicparlabel-4279'><div id="sec_FAQ"></div>
-Frequently asked questions. </div>
-<h4 class="subsubsection" id='magicparlabel-4280'><span class="subsubsection_label">6.26.1</span> Why&nbsp;not&nbsp;Monte&nbsp;Carlo?</h4>
-<div class="standard" id='magicparlabel-4281'><div id="FAQ_why_not_MC_"></div>
-The alternative to running a grid is a Monte Carlo method, where you throw systems in according to some initial distribution and a random number generator. In the high number limit this should give the <em>same</em> <em>result </em>as a grid. However, in the low-number limit, the results are probably going to be different, and this is when you test your code. The big advantage of a grid is that you have a good handle on <em>errors</em> due to the finite resolution of your sampling of the initial distribution(s) without the smearing out of a Monte Carlo approach. Furthermore, MC may accidentally miss part of the initial parameter space (it is, after all, random) which you know is covered by a grid approach (at least to within a known error e.g. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mo> ln </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>1</mn>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>). You are also guaranteed, on a grid, to sample even the rare systems which would be sparsely populated (if at all) in an MC simulation. Such systems will have a small probability per star, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, but on the other hand these might be the systems of particular interest to you!</div>
-
-<div class="standard" id='magicparlabel-4282'><b>Update: there is a monte carlo option to the flexigrid. It is not well tested, but could work for you if you really need it.</b></div>
-<h4 class="subsubsection" id='magicparlabel-4283'><span class="subsubsection_label">6.26.2</span> Why&nbsp;MC&nbsp;SN&nbsp;kicks?</h4>
-<div class="standard" id='magicparlabel-4284'><div id="FAQ_WhyMCSNkicks_"></div>
-Traditionally supernova (and white dwarf) kicks have had their velocity chosen in a Monte-Carlo way, rather than on a grid. This was left as-is because there are four dimensions for each kick, which – given a coarse grid of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>10</mn><mo> &times; </mo><mn>10</mn><mo> &times; </mo><mn>10</mn><mo> &times; </mo><mn>10</mn>
-  </mrow>
- </mrow></mstyle></math> – means the parameter space expands by a factor of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn><mo>,</mo><mspace width="6px" /><mn>000</mn>
-  </mrow>
- </mrow></mstyle></math> for stars with kicks. The runtime increase is not worth the effort as in order to finish anything in your lifetime you would have to either buy a supercomputer or run such a coarse grid in the original parameters that the whole exercise becomes pointless. The brute force resolution test is what you need here: just keep increasing the resolution until the numbers converge. It helps if you are clever about it: if you're interested in supernovae only then <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> is probably the dimension that requires the most resolution, or perhaps <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, but probably not <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math>.</div>
-<h4 class="subsubsection" id='magicparlabel-4285'><span class="subsubsection_label">6.26.3</span> Zombie&nbsp;<i>binary_c</i>&nbsp;processes </h4>
-<div class="standard" id='magicparlabel-4286'><div id="FAQ_Zombie_binary_c"></div>
-</div>
-
-<div class="standard" id='magicparlabel-4287'><b>This section is only relevant if you use the <em>Perl </em>backend.</b></div>
-
-<div class="standard" id='magicparlabel-4288'>When the grid exits abnormally, or is killed, a <em><span class='math'>binary_c</i></span>
- </em>process may be left behind in an infinite loop state and as such will take up your precious CPU time. You will have to kill it manually <em>if you are sure it is not doing anything with another grid process! </em>(Be careful and do <em>not</em> do &ldquo;killall <i>binary_c</i>&rdquo; as root&hellip;)</div>
-<h4 class="subsubsection" id='magicparlabel-4289'><span class="subsubsection_label">6.26.4</span> Zombie&nbsp;Perl&nbsp;processes </h4>
-<div class="standard" id='magicparlabel-4290'><b>This section is only relevant if you use the <em>Perl </em>backend.</b></div>
-
-<div class="standard" id='magicparlabel-4291'><div id="FAQ_Zombie_perl"></div>
-These should die naturally when the grid finishes and the Perl script exits. They are harmless and have never been seen to consume CPU time.</div>
-<h4 class="subsubsection" id='magicparlabel-4292'><span class="subsubsection_label">6.26.5</span> Setting&nbsp;functions&nbsp;and/or&nbsp;function&nbsp;pointers </h4>
-<div class="standard" id='magicparlabel-4293'><div id="FAQ_functions_and_pointers"></div>
-</div>
-
-<div class="standard" id='magicparlabel-4294'><b>Please set function pointers, not function names, especially with the <i>C</i> backend. I may remove this functionality in future, however convenient it once was. Function names will definitely not work with the <i>C</i> backend.</b></div>
-
-<div class="standard" id='magicparlabel-4295'>In the good old days you had to set up function pointers, e.g. <span class="flex_perlcode">\&amp;parse_bse</span>, manually when setting up your grid. However, in the latest version of <em><span class="flex_perlcode">flexigrid()</span></em>, this is set automatically (from <span class="flex_perlcode">\&amp;main::parse_bse</span>). However, you can override the settings. </div>
-
-<div class="standard" id='magicparlabel-4308'>As an example, if you want to set the <span class="flex_perlcode">parse_bse_function_pointer</span>, just set<span style='font-family:monospace;font-size: 18px;'> <br />
-<pre class ='listings Perl'>$binary_grid::grid_options{parse_bse_function}='my_parse_bse';</pre><br />
-</span>where <span class="flex_perlcode">my_parse_bse</span> is your new function name. 
-<br />
-
-This will automatically be converted into <span class="flex_perlcode">\&amp;main::my_parse_bse</span> at runtime.</div>
-
-<div class="standard" id='magicparlabel-4325'>This process is applied to any <span class="flex_perlcode">grid_option</span> whose key ends in <span class="flex_perlcode">_function</span>. These include </div>
-
-<ul class="itemize" id='magicparlabel-4334'><li class="itemize_item"><span class="flex_perlcode">thread_precreate_function</span></li>
-<li class="itemize_item"><span class="flex_perlcode">threads_entry_function</span></li>
-<li class="itemize_item"><span class="flex_perlcode">threads_flush_function</span></li>
-<li class="itemize_item"><span class="flex_perlcode">thread_postrun_function</span></li>
-<li class="itemize_item"><span class="flex_perlcode">thread_prejoin_function</span></li>
-<li class="itemize_item"><span class="flex_perlcode">threads_join_function</span></li>
-<li class="itemize_item"><span class="flex_perlcode">thread_postjoin_function</span></li>
-</ul>
-<div class="standard" id='magicparlabel-4369'>These are all <span class="flex_perlcode">undef</span> by default, so are ignored (unless you override them with function names), except
-<br />
-
- <span class="flex_perlcode">threads_join_function</span> which is set to <span class="flex_perlcode">binary_grid::join_flexigrid_thread</span> as usual.</div>
-<h3 class="subsection" id='magicparlabel-4382'><span class="subsection_label">6.27</span> Multi-core scaling</h3>
-<div class="standard" id='magicparlabel-4385'>The <i>binary_grid</i> software is used to run <i>binary_c</i>, and other stellar evolution codes, on either a single CPU or a grid of machines, e.g. with its <span class="flex_software">HTCondor</span> extension module. It is important to know whether <span class='math'>\binarygrid</span>
- scales appropriately to running on <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>N</mi>
- </mrow></mstyle></math> CPUs. This document answers this question by looking at <em>CPU-bound </em>and <em>IO-bound</em> jobs. In conclusion: it scales very well.<em> </em></div>
-<h3 class="subsection" id='magicparlabel-4390'><span class="subsection_label">6.28</span> Testing Setup</h3>
-<div class="standard" id='magicparlabel-4391'>It is not ideal to use <span class='math'>binary_c</i></span>
- as an evolution code. Instead, a <span class="flex_scriptinglanguage">Perl</span> script called
-<br />
-
-<span class="flex_file">./src/perl/scripts-flexigrid/<i>binary_c</i>-dummy.pl</span> was developed<div class="foot"><span class="foot_label">7</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-4403'>All files are relative to my<em> <span class='math'>binary_c</i></span>
- </em>branch – or maybe the trunk if I have time to merge it!</div>
-</div></div>. This has the following features:</div>
-
-<ol class="enumerate" id='magicparlabel-4404'><li class="enumerate_item">It can output <em><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>n</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>d</mi><mi>a</mi><mi>t</mi><mi>a</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math></em> lines of data for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>n</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>s</mi><mi>t</mi><mi>a</mi><mi>r</mi><mi>s</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> stars, both are free parameters. This simulates I/O limited runs.</li>
-<li class="enumerate_item">It simulates CPU burn (&ldquo;spin&rdquo; mode<div class="foot"><span class="foot_label">8</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-4409'>A <span class="flex_perlcode">while{}</span> loop until a specified time has lapsed.</div>
-</div></div>) or can simply &ldquo;sleep&rdquo; (with no CPU activity<div class="foot"><span class="foot_label">9</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-4417'>A call to the <span class="flex_perlmodule">Time::HiRes</span> <span style='font-family:monospace;font-size: 18px;'>sleep</span> function.</div>
-</div></div>) for a specified time <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi>
-  </mrow>
- </mrow></mstyle></math>.</li>
-</ol>
-<div class="standard" id='magicparlabel-4422'>By using this dummy script instead of <span class='math'>binary_c</i></span>
- we control the CPU and I/O usage precisely without relying on a complicated, and difficult to predict, piece of code to do it for us.</div>
-<h4 class="subsubsection" id='magicparlabel-4423'><span class="subsubsection_label">6.28.1</span> Multithread overhead</h4>
-<div class="standard" id='magicparlabel-4424'>The <em><span class='math'>\binarygrid</span>
-</em> software is designed to speed up running a full parameter space by splitting the work into <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>N</mi>
- </mrow></mstyle></math> threads (or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>N</mi>
- </mrow></mstyle></math> <span class="flex_software">HTCondor</span> jobs). When launching <span class='math'>\binarygrid</span>
- on <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>N</mi>
- </mrow></mstyle></math> threads, some overhead is involved in setting these up because each thread takes a copy of the global variables, file descriptors etc. (see <a href="http://perldoc.perl.org/threads.html">http://perldoc.perl.org/threads.html</a>). This overhead should <em>not</em> be considered when comparing grid runtimes if we are to use small numbers of stars reliably. To remove the overhead from the following results, a sample <span class='math'>\binarygrid</span>
- is launched which evolves just one &ldquo;star&rdquo; (using the <span class="flex_file"><i>binary_c</i>-dummy.pl</span> script with zero CPU time and zero I/O lines), i.e. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>n</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>s</mi><mi>t</mi><mi>a</mi><mi>r</mi><mi>s</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo>=</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>n</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>d</mi><mi>a</mi><mi>t</mi><mi>a</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo>=</mo><mn>0</mn>
-  </mrow>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>0</mn>
-  </mrow>
- </mrow></mstyle></math>. The runtime of this grid is then subtracted from the runtime of the true grid to accurately calculate the runtime of the grid while it is doing useful work.</div>
-
-<div class="standard" id='magicparlabel-4433'>When the grid resolution is large, e.g. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>n</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>s</mi><mi>t</mi><mi>a</mi><mi>r</mi><mi>s</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo> &gsim; </mo><mn>1000</mn>
-  </mrow>
- </mrow></mstyle></math>, the overhead cost is negligible. It is really only useful to subtract it to obtain more precise results and work with fewer stars.</div>
-<h4 class="subsubsection" id='magicparlabel-4434'><span class="subsubsection_label">6.28.2</span> PC setup</h4>
-<div class="standard" id='magicparlabel-4435'>The tests were run on the <em>klaipeda2 </em>machine at the Argelander Institute for Astronomy (AIfA). This is a 16-core (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>4</mn><mo> &times; </mo>
-  </mrow>
- </mrow></mstyle></math> quad-core AMD Opteron 8378) machine with CPU speeds of 2.4GHz (4800 bogomips), 512KB cache and 64GB (shared) RAM. Mostly the cores were empty, occasionally only 15 were available. This has a negligible effect on the results.</div>
-
-<div class="standard" id='magicparlabel-4436'>A few smaller scale tests were carried out on <em>aibn36</em> at the AIfA. This is a 4-core AMD Phenom II X4 945 running at 3GHz (6027 bogomips) with 8GB RAM. This machine was often multitasking with (background) jobs and a full KDE desktop running in the foreground. </div>
-<h4 class="subsubsection" id='magicparlabel-4437'><span class="subsubsection_label">6.28.3</span> Score</h4>
-<div class="standard" id='magicparlabel-4438'>Each test run has an associated <em>score </em>which is defined as, <math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mtable>
-  <mtr>
-   <mtd>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>s</mi><mi>c</mi><mi>o</mi><mi>r</mi><mi>e</mi>
-     </mrow>
-    </mstyle>
-   </mtd>
-   <mtd><mo>=</mo>
-   </mtd>
-   <mtd>
-    <mrow>
-     <mfrac>
-      <mrow>
-       <mrow><mi> &delta; </mi><mi>t</mi><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-        <msub subscriptshift="0.2ex">
-         <mrow><mi>N</mi>
-         </mrow>
-         <mrow>
-          <mstyle mathvariant='normal'>
-           <mrow><mi>t</mi><mi>h</mi><mi>r</mi><mi>e</mi><mi>a</mi><mi>d</mi><mi>s</mi>
-           </mrow>
-          </mstyle>
-         </mrow>
-        </msub>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-       </mrow>
-      </mrow>
-      <mrow>
-       <mrow>
-        <msub subscriptshift="0.2ex">
-         <mrow><mi>N</mi>
-         </mrow>
-         <mrow>
-          <mstyle mathvariant='normal'>
-           <mrow><mi>t</mi><mi>h</mi><mi>r</mi><mi>e</mi><mi>a</mi><mi>d</mi><mi>s</mi>
-           </mrow>
-          </mstyle>
-         </mrow>
-        </msub><mo> &times; </mo><mi> &delta; </mi><mi>t</mi><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-<mn>1</mn>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-       </mrow>
-      </mrow>
-     </mfrac><mspace width="6px" /><mo>,</mo>
-    </mrow>
-   </mtd>
-   <mtd>(6)
-   </mtd>
-  </mtr>
- </mtable></mstyle></math>where <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-<mi>n</mi>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-  </mrow>
- </mrow></mstyle></math> is the runtime for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>n</mi>
- </mrow></mstyle></math> threads and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>N</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>t</mi><mi>h</mi><mi>r</mi><mi>e</mi><mi>a</mi><mi>d</mi><mi>s</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> is the number of threads used.</div>
-
-<div class="standard" id='magicparlabel-4439'>A score of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1.0</mn>
- </mrow></mstyle></math> is considered <em>perfect scaling.</em> Higher scores are <em>bad scaling</em> and occasionally scores slightly less than <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1.0</mn>
- </mrow></mstyle></math> are seen. If <span class='math'>\binarygrid</span>
- does its job properly, the score should be around 1.0.</div>
-<h3 class="subsection" id='magicparlabel-4440'><span class="subsection_label">6.29</span> Results</h3>
-<h4 class="subsubsection" id='magicparlabel-4441'><span class="subsubsection_label">6.29.1</span> No CPU (sleep mode <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>0</mn>
-  </mrow>
- </mrow></mstyle></math>)</h4>
-<div class="standard" id='magicparlabel-4442'>When measuring runtimes in &ldquo;sleep&rdquo; mode it is trivial to test the pure grid and I/O overheads, as the sleep time can be set to zero (i.e. no &ldquo;runtime&rdquo; at all for <span class='math'>binary_c</i></span>
-). <em>By definition</em> these runs are I/O limited because there is no CPU use associated with &ldquo;stellar evolution&rdquo;. Figure&nbsp;<a href="#fig_Timing_tests_klaipeda_dt0">2</a> shows the results. The scaling is <em>not good </em>with scores above 1.0 for all but the runs with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>N</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>t</mi><mi>h</mi><mi>r</mi><mi>e</mi><mi>a</mi><mi>d</mi><mi>s</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo>=</mo><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math>. The tests on aibn36 show similar results (Fig.&nbsp;<a href="#fig_Timing_tests_aibn36_dt0">3</a>). </div>
-
-<div class="standard" id='magicparlabel-4443'>The poor results suggest that I/O limited runs do not perfect well when large numbers of threads are employed. Using two threads is still a <em>lot</em> faster than using just one, but after that there is no improvement. </div>
-
-<div class="standard" id='magicparlabel-4444'>The results can be understood if we consider that our I/O limited jobs <em>run at the maximum possible bandwidth of the CPU</em>. If the <span class='math'>\binarygrid</span>
- software <em>already maximises</em> its use of the I/O resources of the machine when running two threads, then running three or more will <em>never </em>result in reduced runtime. This describes the behaviour we see perfectly and is a limitation of the PC rather than <em><span class='math'>\binarygrid</span>
-</em>. The runtime then depends linearly on the product <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>N</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>s</mi><mi>t</mi><mi>a</mi><mi>r</mi><mi>s</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo> &times; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>N</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>l</mi><mi>i</mi><mi>n</mi><mi>e</mi><mi>s</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>, as clearly shown in Figs.&nbsp;<a href="#fig_Timing_tests_klaipeda_dt0">2</a>&nbsp;and&nbsp;<a href="#fig_Timing_tests_aibn36_dt0">3</a>.</div>
-
-
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-4449'><img style='width:85%;' src='images/6.png' alt='image: 12_tmp_binary_c_lyx_images_4.png' />
-</div>
-
-<div class="plain_layout" id='magicparlabel-4450'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 2:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>0</mn>
-  </mrow>
- </mrow></mstyle></math> (sleep mode) on Klaipeda.<div id="fig_Timing_tests_klaipeda_dt0"></div>
-</span></div>
-
-
-</div>
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-4459'><img style='width:85%;' src='images/7.png' alt='image: 13_tmp_binary_c_lyx_images_5.png' />
-</div>
-
-<div class="plain_layout" id='magicparlabel-4460'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 3:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>0</mn>
-  </mrow>
- </mrow></mstyle></math> (sleep mode) on aibn36.<div id="fig_Timing_tests_aibn36_dt0"></div>
-</span></div>
-</div>
-
-<h4 class="subsubsection" id='magicparlabel-4465'><span class="subsubsection_label">6.29.2</span> 1.0s runs (sleep mode <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1.0</mn>
-  </mrow>
- </mrow></mstyle></math>)</h4>
-<div class="standard" id='magicparlabel-4466'>Next up are sleep mode runs with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1.0</mn>
-   <mstyle mathvariant='normal'><mi>s</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> with results in Fig.&nbsp;<a href="#fig_Timing_tests_klaipeda_dt1">4</a>. These simulate <span class='math'>binary_c</i></span>
- &ldquo;runtimes&rdquo; of one second without taxing the CPU, so are a good test of how the grid itself scales when I/O is not the main time limitation. Scores of around <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1.0</mn>
- </mrow></mstyle></math> are <em>always</em> achieved, showing the <span class='math'>\binarygrid</span>
- does an excellent job in this case.</div>
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-4470'><img style='width:85%;' src='images/8.png' alt='image: 14_tmp_binary_c_lyx_images_6.png' />
-</div>
-
-<div class="plain_layout" id='magicparlabel-4471'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 4:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math> (sleep mode) on Klaipeda.<div id="fig_Timing_tests_klaipeda_dt1"></div>
-</span></div>
-</div>
-
-<h4 class="subsubsection" id='magicparlabel-4476'><span class="subsubsection_label">6.29.3</span> 1.0s runs (spin mode <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1.0</mn>
-  </mrow>
- </mrow></mstyle></math>)</h4>
-<div class="standard" id='magicparlabel-4477'>With no I/O (Fig.&nbsp;<a href="#fig_Timing_tests_klaipeda_spin_dt1_Nlines0">5</a>), i.e. <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>N</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>l</mi><mi>i</mi><mi>n</mi><mi>e</mi><mi>s</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo>=</mo><mn>0</mn>
-  </mrow>
- </mrow></mstyle></math>, <span class='math'>\binarygrid</span>
- scales excellently for a large number of stars (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &gsim; </mo><mn>100</mn>
-  </mrow>
- </mrow></mstyle></math>). With 10 stars and 32 threads, the tests are pretty much meaningless in any case because 22 threads do no work at all! </div>
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-4481'><img style='width:85%;' src='images/9.png' alt='image: 15_tmp_binary_c_lyx_images_7.png' />
-</div>
-
-<div class="plain_layout" id='magicparlabel-4482'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 5:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math> using &ldquo;spin mode&rdquo; on Klaipeda without any data lines (i.e. no I/O – this is a pure-CPU based test).<div id="fig_Timing_tests_klaipeda_spin_dt1_Nlines0"></div>
-</span></div>
-</div>
-
-
-<div class="standard" id='magicparlabel-4487'>With large amounts of I/O (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>N</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>l</mi><mi>i</mi><mi>n</mi><mi>e</mi><mi>s</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo>=</mo><mn>10000</mn>
-  </mrow>
- </mrow></mstyle></math>; Fig.&nbsp;<a href="#fig_Timing_tests_klaipeda_spin_dt1_Nlines10000">6</a>) again the scaling is excellent, in fact <em>even better than 1.0 </em>for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>N</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>l</mi><mi>i</mi><mi>n</mi><mi>e</mi><mi>s</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo>=</mo><mn>1000</mn>
-  </mrow>
- </mrow></mstyle></math><em>.</em> Again <span class='math'>\binarygrid</span>
- does a great job.</div>
-<div class='float-figure'><div class="plain_layout" style='text-align: center;' id='magicparlabel-4491'><img style='width:95%;' src='images/10.png' alt='image: 16_tmp_binary_c_lyx_images_8.png' />
-</div>
-
-<div class="plain_layout" id='magicparlabel-4492'><span class='float-caption-Standard float-caption float-caption-standard'>Figure 6:  Timing tests for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>t</mi><mo>=</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math> using &ldquo;spin mode&rdquo; on Klaipeda with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>N</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>l</mi><mi>i</mi><mi>n</mi><mi>e</mi><mi>s</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo>=</mo><mn>10000</mn>
-  </mrow>
- </mrow></mstyle></math>.<div id="fig_Timing_tests_klaipeda_spin_dt1_Nlines10000"></div>
-</span></div>
-</div>
-
-<h3 class="subsection" id='magicparlabel-4497'><span class="subsection_label">6.30</span> Conclusions</h3>
-<div class="standard" id='magicparlabel-4498'><em><span class='math'>\binarygrid</span>
- </em>does an excellent job of scaling to the number of CPUs available on multi-core architectures. The only exception is when a) the runtime is very short and b) the amount of data I/O is very large.</div>
-
-<div class="standard" id='magicparlabel-4499'>How can we improve this situation? Naturally, the first choice is the limit the amount of output from <span class='math'>binary_c</i></span>
- whenever possible. A first step is to for the user to choose what output is <em>truly necessary </em>for their project and only output this. However, this is not always a trivial question to answer. At some level, the CPU and I/O bus of the machine has limited bandwidth, and if it is this that is the bottleneck there is little that can be done <em>except </em>buy better machines or just wait.</div>
-
-<div class="standard" id='magicparlabel-4500'>To investigate whether Perl is the problem, I wrote a new function <span class="flex_perlcode">tbse_lines</span> which, instead of returning data line by line (as traditional calls to <span class="flex_perlcode">tbse_line</span> do) takes the data for each star, bundles it in an array and then sends this back instead (as an array reference). In my tests this actually <em>costs more time</em> than simply sending data line by line, probably because there is overhead involved in setting up an array and returning it. I will leave this in <span class='math'>\binarygrid</span>
- (as of version 0.24) for you to try.</div>
-
-<div class="standard" id='magicparlabel-4509'>Other updates to <span class='math'>\binarygrid</span>
- version 0.24 include the complete removal of support for separate <span class="flex_cvar">stdout</span> and <span class="flex_cvar">stderr</span> streams from the evolution code. I used to handle these streams separately, but if either stream buffer should fill then there would be deadlock. This could happen, for example, if there were a lot of errors so the <span class="flex_cvar">stderr</span> buffer fills before <span class="flex_cvar">stdout</span> is checked again. See also <a href="http://perl.plover.com/FAQs/Buffering.html">http://perl.plover.com/FAQs/Buffering.html</a>.</div>
-
-<div class="standard" id='magicparlabel-4526'>The latest grid <em>should</em> be faster because it combines <span class="flex_cvar">stdout</span> and <span class="flex_cvar">stderr</span>. Instead of having to flush the <span class="flex_cvar">stderr</span> buffer for each <span class="flex_cvar">stdout</span> read, it now just blocks on the combined <span class="flex_cvar">stdout</span>/<span class="flex_cvar">stderr</span>. The downside is that the user must detect errors:<em> <span class='math'>\binarygrid</span>
- </em>can no longer do it. This is generally not a problem because the user only cares about their own lines of data, prefixed with the appropriate header string (e.g.&nbsp;in <span class="flex_perlcode">parse_bse()</span>).</div>
-
-<div class="standard" id='magicparlabel-4555'>I have also considered whether it is the<em> </em>use of pipes to communicate to/from the evolution code that slows down <em><i>binary_grid</i></em> in an I/O dominated case. One way to test this would be to compress the returned data and send it in (say) <span class="flex_software">7zipped</span> or <span class="flex_software">bzipped</span> chunks of data instead of raw <em>ASCII</em> as at present. However, the overhead required for the compression slows down the data transfer so much that this seems to be a non-starter. I tried to compress the array provided by <span class="flex_perlscript">tbse_lines</span> with <span class="flex_perlmodule">Compress::Zlib::memGzip</span> and, while it works, it slowed the test grid – with lots of I/O! – by more than 30%. Perhaps there is a smarter way to do this, but I haven't found it yet. If you're interested, find the <span class="flex_perlcode">tbse_compressed_lines()</span> function in <em><span class='math'>\binarygrid</span>
-.</em></div>
-
-<div class="standard" id='magicparlabel-4576'>Of course, none of this matters if you don't use <em><span class='math'>\binarygrid</span>
-</em> the way it's designed. Sure, you can save your million-line data file to disk and reprocess it, but <em>nothing</em> will be faster than processing data on the fly. Also, when using <em><span class="flex_software">HTCondor</span></em>, remember to be smart and join the threads on the machine containing the data rather than across an NFS mountpoint on a PC in another building. Nothing I do in programming <em><span class='math'>\binarygrid</span>
-</em> better can make up stupid user decisions&hellip;</div>
-
-
-
-<div class="standard" id='magicparlabel-4581'><br />
-</div>
-<h2 class="section" id='magicparlabel-4582'><span class="section_label">7</span> <em><i>binary_c</i> </em>API</h2>
-<div class="standard" id='magicparlabel-4585'>The following describes functions in the <em><i>binary_c</i></em> <em>C</em> API. These functions are provided for access to <em><i>binary_c</i></em> through its shared library interface, <i>libbinary_c.so</i>, which is used by (for example) <em><i>binary_grid2</i> </em>with its <em>C</em> backend.</div>
-<h3 class="subsection" id='magicparlabel-4586'><span class="subsection_label">7.1</span> Naming conventions</h3>
-
-<ul class="itemize" id='magicparlabel-4587'><li class="itemize_item">Names of functions in the <span class='math'>binary_c</i></span>
- API start with binary_c_</li>
-<li class="itemize_item">Functions are declared with the attribute <span class="flex_cmacro">binary_c_API_function</span></li>
-<li class="itemize_item">The <span class='math'>binary_c</i></span>
- structure types 
-
-<ul class="itemize" id='magicparlabel-4594'><li class="itemize_item"><span class="flex_cstruct">stardata_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">star_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">preferences_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">store_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">tmpstore_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">model_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">common_t</span></li>
-<li class="itemize_item">etc.</li>
-</ul>
-<div class="standard" id='magicparlabel-4630'>should be declared in external code as</div>
-
-<ul class="itemize" id='magicparlabel-4631'><li class="itemize_item"><span class="flex_cstruct">libbinary_c_stardata_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">libbinary_c_star_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">libbinary_c_preferences_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">libbinary_c_store_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">libbinary_c_tmpstore_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">libbinary_c_model_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">libbinary_c_common_t</span></li>
-<li class="itemize_item"><span class="flex_cstruct">libbinary_c_&hellip;</span></li>
-</ul>
-<div class="standard" id='magicparlabel-4671'>This avoids name clashes with the functions of other libraries.</div>
-</li></ul>
-<h4 class="subsubsection" id='magicparlabel-4672'><span class="subsubsection_label">7.1.1</span> <i>binary_c</i> macros</h4>
-<div class="standard" id='magicparlabel-4673'><em>Binary_c</em> defines the following:</div>
-
-<dl class='description' id='magicparlabel-4674'><dt class="description_label"><span class="flex_cmacro">RESTRICT</span></dt>
-<dd class="description_item"> This is set to <span class="flex_cmacro">__restrict__</span> or a suitable equivalent when available (this depends on the compiler). </dd>
-<dt class="description_label"><span class="flex_cmacro">binary_c_API_function</span></dt>
-<dd class="description_item"> This is set to <span class="flex_cmacro">__attribute__ ((visibility("default")))</span> which is standard for exporting functions to shared libraries with <span class="flex_software">gcc</span> (and presumably <span class="flex_software">clang</span>). I have not yet investigated the equivalent for other compilers.</dd>
-</dl>
-<h4 class="subsubsection" id='magicparlabel-4700'><span class="subsubsection_label">7.1.2</span> <i>binary_c</i> headers</h4>
-<div class="standard" id='magicparlabel-4701'>Most <em><span class='math'>binary_c</i></span>
-</em> headers are loaded through <span class="flex_headerfile"><i>binary_c</i>.h</span>. While it slows compilation to include <em>all</em>&nbsp;the headers, the convenience (and imposed structure) of having just one file to access headers overrides this.</div>
-<h3 class="subsection" id='magicparlabel-4706'><span class="subsection_label">7.2</span> Using the API</h3>
-<div class="standard" id='magicparlabel-4707'>Using the API is simple in languages that can embed <span class="flex_programminglanguage">C</span> directly, e.g.&nbsp;<span class="flex_programminglanguage">C</span>, <span class="flex_programminglanguage">C++</span>, <span class="flex_programminglanguage">Perl</span> and <span class="flex_programminglanguage">Python</span>. Some other languages, e.g. <span class="flex_programminglanguage">FORTRAN</span>, require a special set of functions to be written in order to talk to them. Fortunately for you, I have already done this in <span class="flex_scriptinglanguage">FORTRAN</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-4736'><span class="subsubsection_label">7.2.1</span> In <i>C</i><div id="subsec_In_C"></div>
-</h4>
-<div class="standard" id='magicparlabel-4737'>To include the API functions, <span class="flex_headerfile"><i>binary_c</i>.h</span> must be included in your code. </div>
-<h4 class="subsubsection" id='magicparlabel-4742'><span class="subsubsection_label">7.2.2</span> Macro clashes</h4>
-<div class="standard" id='magicparlabel-4743'>You may find there is a clash between <em><span class='math'>binary_c</i></span>
-</em>'s <span class="flex_cmacro">Max</span> and <span class="flex_cmacro">Min</span> macros (and perhaps others) and various standard libraries. In which case, use <span class="flex_software">gcc</span>'s <span class="flex_cmacro">push_macro</span>/<span class="flex_cmacro">pop_macro</span> feature to include your functions in the following way:</div>
-
-<div class="standard" id='magicparlabel-4764'><br />
-
-<pre class ='listings <i>C</i>'>#pragma push_macro("Max")
-#pragma push_macro("Min")
-
-#undef Max
-#undef Min
-
-#include "<i>binary_c</i>.h"
-
-/* ... your subroutines go here ... */
-
-
-#undef Max
-#undef Min
-
-#pragma pop_macro("Min")
-#pragma pop_macro("Max")
-</pre><br />
- </div>
-<h4 class="subsubsection" id='magicparlabel-4786'><span class="subsubsection_label">7.2.3</span> In <i>C</i>++</h4>
-<div class="standard" id='magicparlabel-4787'>I have not written a wrapper in <span class="flex_programminglanguage">C++</span> because I figured you'd just use the <span class="flex_programminglanguage">C</span> functions. However, it might make sense to wrap the <span class="flex_programminglanguage">C</span> functions in some<em> </em><span class="flex_programminglanguage">C++</span> objects and indeed given that the <span class="flex_cstruct">stardata</span> struct functions very much like the data parts an object this should be quite trivial. Please let me know if you want to do this.</div>
-<h4 class="subsubsection" id='magicparlabel-4808'><span class="subsubsection_label">7.2.4</span> In <i>FORTRAN</i></h4>
-<div class="standard" id='magicparlabel-4809'>The file <span class="flex_file">binary_c_API_fortran.c</span> contains the API interface callable from <span class="flex_programminglanguage">FORTRAN</span>. The example <span class="flex_file">apitest.f90</span> (in the <em>apitest</em> directory) sets up and evolves a stellar system from <em><span class="flex_programminglanguage">FORTRAN</span></em>. Please take note of the following points:</div>
-
-<ul class="itemize" id='magicparlabel-4826'><li class="itemize_item">Only the <span class="flex_cvar">argstring</span> interface works (no <span class="flex_cvar">argc</span> and <span class="flex_cvar">argv</span>)</li>
-<li class="itemize_item">Remember to put a <span class="flex_cmacro">NUL</span> character at the end of the <span class="flex_cvar">argstring</span> with <span class="flex_fortranfunction">char(0)</span></li>
-<li class="itemize_item">There is a special function <span class="flex_fortranfunction">binary_c_fortran_api_stardata_info</span> which can extract some data from a <span style='font-family:monospace;font-size: 18px;'>stardata</span> struct. You must write code in <span class="flex_programminglanguage">C</span> to extract the data, because <span class="flex_programminglanguage">FORTRAN</span> knows little about <span class="flex_programminglanguage">C</span> structures. This code is meant as an example: you can always write your own function and export it to your <span class='math'>binary_c</i></span>
- shared library with the <span class="flex_cmacro">binary_c_API_function</span> macro.</li>
-</ul>
-<div class="standard" id='magicparlabel-4873'>The skeleton code below can be used as a basis to do whatever you like, see also <span class="flex_file">aptitest.f90</span> in the <span class="flex_file">apitest</span> directory.</div>
-
-<div class="standard" id='magicparlabel-4882'><br />
-
-<pre class ='listings <i>FORTRAN</i>'>program binary_cinfortran
-  use iso_c_binding
-  implicit none
-  character (len=1024) :: argstring   
-  character (len=1024) :: format_string
-  type(c_ptr),pointer :: stardata_pointer,store_pointer
-  type(c_ptr),target :: stardata,store
-  stardata_pointer =&gt; stardata
-  store_pointer =&gt; store
-  stardata_pointer = C_NULL_PTR
-  store_pointer = C_NULL_PTR
-
-  format_string = '( "<i>binary_c</i> M_1 ",E10.3," M_2 ",E10.3," metallicity ",E10.3," orbital_period ",E10.3," eccentricity ",E10.3," max_evolution_time ",E10.3,A)'
-  write(argstring,format_string) 10.d0,5.d0,1d6,0.d0,0.02d0,15000d0,char(0)
-  
-  call binary_c_fortran_api_new_system(stardata_pointer,C_NULL_PTR,C_NULL_PTR,store_pointer,argstring)
-  call binary_c_fortran_api_evolve_for_dt(dt,stardata_pointer) 
-  call binary_c_fortran_api_free_memory(stardata_pointer,1,1,1)
-
-end program</pre><br />
-</div>
-<h4 class="subsubsection" id='magicparlabel-4907'><span class="subsubsection_label">7.2.5</span> In Perl</h4>
-<div class="standard" id='magicparlabel-4908'>To use the API in <span class="flex_scriptinglanguage">Perl</span>, please use the <span class="flex_perlmodule">Inline::C</span> <span class="flex_scriptinglanguage">Perl</span> module (available on <em>CPAN</em>) and refer to Sec.&nbsp;<a href="#subsec_In_C">7.2.1</a>. It is easier if you copy the examples in the <span class="flex_perlmodule">binary_grid::C.pm</span> <span class="flex_scriptinglanguage">Perl</span> module that is provided with <span class='math'>\binarygrid</span>
-2.</div>
-<h4 class="subsubsection" id='magicparlabel-4929'><span class="subsubsection_label">7.2.6</span> In <i><a href="https://www.python.org/">Python</a></i></h4>
-<div class="standard" id='magicparlabel-4930'>There is a functional <span class="flex_scriptinglanguage">Python</span> currently interface available at <a href="https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>-python">https://gitlab.eps.surrey.ac.uk/ri0005/<i>binary_c</i>-python</a>.</div>
-<h3 class="subsection" id='magicparlabel-4939'><span class="subsection_label">7.3</span> Standard functions</h3>
-<div class="standard" id='magicparlabel-4940'>The following functions set up, evolve and modify stellar systems which are set up in <span class="flex_cstruct">stardata_t</span> structures.</div>
-<h4 class="subsubsection" id='magicparlabel-4945'><span class="subsubsection_label">7.3.1</span> binary_c_new_system<div id="subsec_binary_c_new_system"></div>
-</h4>
-<div class="standard" id='magicparlabel-4946'><br />
-<pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_new_system(
-     struct libbinary_c_stardata_t ** stardata,
-     struct libbinary_c_stardata_t ** previous_stardata,
-     struct libbinary_c_preferences_t ** preferences,
-     struct libbinary_c_store_t ** store,
-     char ** argv,
-     int argc);
-</pre><br />
-</div>
-
-<ul class="itemize" id='magicparlabel-4958'><li class="itemize_item"><span class="flex_cstruct">stardata</span> must be a pointer to a <span class="flex_cstruct">libbinary_c_stardata_t</span> struct pointer. The memory for the <span class="flex_cstruct">stardata</span> is allocated by this function.</li>
-<li class="itemize_item"><span class="flex_cstruct">previous_stardata</span> is usually <span class="flex_cmacro"><span style='font-family:monospace;font-size: 18px;'>NULL</span></span>, in which case space for it is allocated. If non-<span class="flex_cmacro"><span style='font-family:monospace;font-size: 18px;'>NULL</span></span>, it must point to a previously allocated <span class="flex_cstruct">libbinary_c_previous_stardata_t</span> struct.</li>
-<li class="itemize_item"><span class="flex_cstruct">preferences</span> is allocated and set up if <span class="flex_cmacro">NULL</span>, or should be a pointer to a pointer to a previous allocated <span class="flex_cstruct">libbinary_c_preferences_t</span> struct.</li>
-<li class="itemize_item"><span class="flex_cstruct">store</span> must be a pointer to a <span class="flex_cstruct">libbinary_c_store_t</span> struct pointer which is empty and <span class="flex_cmacro">NULL</span>, or a pointer to a pointer to a previously allocated <span class="flex_cstruct">libbinary_c_store_t</span> struct. This feature enables you to make the store only once, but call <span class="flex_cstruct">binary_c_new_system</span> repeatedly with it, thus saving a lot of CPU time.</li>
-<li class="itemize_item"><span class="flex_cvar">argv</span> and <span class="flex_cvar">argc</span> are, if <span class="flex_cvar">argc</span> is not -1, a set of arguments identical in format to the standard <i>C</i> command line arguments.
-<br />
-
-Alternatively, set <span class="flex_cvar">argc</span> to -1 then <span class="flex_cvar">argv</span> can be a pointer to a string containing a set of arguments (which must start with the word &ldquo;<i>binary_c</i>&rdquo; as this would be the first argument in the standard <i>C</i> format). These are split in <span class='math'>binary_c</i></span>
- and parsed as usual.</li>
-</ul>
-<div class="standard" id='magicparlabel-5043'>For example, the following makes a new stellar system in <span style='font-family:monospace;font-size: 18px;'>stardata</span> and sets up a new store.</div>
-
-<div class="standard" id='magicparlabel-5044'><br />
-<pre class ='listings <i>C</i>'>    struct libbinary_c_stardata_t * stardata = NULL;
-    struct libbinary_c_store_t * store = NULL;
-
-	char * argstring = "<i>binary_c</i> M_1 10 M_2 5 orbital_period 100 eccentricity 0.0 metallicity 0.02";
-
-    binary_c_new_system(&amp;stardata,
-                        NULL,
-                        NULL,
-                        &amp;store,
-                        &amp;argstring,
-                        -1);
-    /* ... */</pre><br />
-</div>
-<h4 class="subsubsection" id='magicparlabel-5060'><span class="subsubsection_label">7.3.2</span> binary_c_evolve_for_dt<div id="subsec_binary_c_evolve_for_dt"></div>
-</h4>
-<div class="standard" id='magicparlabel-5061'>This function evolves a stellar system defined in a <span style='font-family:monospace;font-size: 18px;'>stardata</span> struct for a time <span style='font-family:monospace;font-size: 18px;'>dt</span> Myr.</div>
-
-<div class="standard" id='magicparlabel-5062'><br />
-<pre class ='listings <i>C</i>'>int binary_c_API_function binary_c_evolve_for_dt(struct libbinary_c_stardata_t * stardata,
-                                                 double dt);</pre><br />
-</div>
-
-<ul class="itemize" id='magicparlabel-5068'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
-<li class="itemize_item"><span class="flex_cstruct">dt</span> is the number of MYr (megayears, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mi>M</mi><mi>y</mi><mi>r</mi>
-    </mrow>
-   </mstyle><mo>=</mo><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>6</mn>
-    </mrow>
-   </msup><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>y</mi><mi>e</mi><mi>a</mi><mi>r</mi><mi>s</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>)</li>
-</ul>
-<div class="standard" id='magicparlabel-5078'>Typically, output is sent to <span class="flex_cvar">stdout</span>, but you can capture it in a buffer. Please see Sec.&nbsp;<a href="#subsec_Capturing_the_buffer">7.5.2</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-5083'><span class="subsubsection_label">7.3.3</span> binary_c_buffer_info<div id="subsec_binary_c_buffer_info"></div>
-</h4>
-<div class="standard" id='magicparlabel-5084'>This function returns a pointer to the <span class='math'>binary_c</i></span>
- output buffer and its size.</div>
-
-<div class="standard" id='magicparlabel-5085'><br />
-<pre class ='listings'>void binary_c_API_function binary_c_buffer_info(struct libbinary_c_stardata_t * RESTRICT stardata,
-                                                char ** buffer,
-                                                int * size);</pre><br />
-</div>
-
-<ul class="itemize" id='magicparlabel-5092'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
-<li class="itemize_item"><span class="flex_cvar">buffer</span> is a pointer to a <span class="flex_cvar">char*</span> which points to <span class='math'>binary_c</i></span>
-'s internal buffer. Any changes you make to the contents of buffer thus also change <span class='math'>binary_c</i></span>
-'s internal buffer.</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-5106'><span class="subsubsection_label">7.3.4</span> binary_c_buffer_empty_buffer<div id="subsec_binary_c_buffer_empty_buffer"></div>
-</h4>
-<div class="standard" id='magicparlabel-5107'>This function frees the memory used in <span class='math'>binary_c</i></span>
-'s internal buffer. See also Sec.&nbsp;<a href="#subsec_binary_c_buffer_info">7.3.3</a>.</div>
-
-<div class="standard" id='magicparlabel-5108'><br />
-<pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_buffer_empty_buffer(struct stardata_t * RESTRICT stardata); </pre><br />
-</div>
-
-<ul class="itemize" id='magicparlabel-5113'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>) </li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-5118'><span class="subsubsection_label">7.3.5</span> binary_c_free_store_contents<div id="subsec_binary_c_free_store_contents"></div>
-</h4>
-<div class="standard" id='magicparlabel-5119'>Once you have finished running (possibly many) stellar systems, you can free the contents of the <span style='font-family:monospace;font-size: 18px;'>store</span> struct with a call to <span class="flex_cfunction">binary_c_free_store_contents</span></div>
-
-<div class="standard" id='magicparlabel-5124'><br />
-<pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_free_store_contents(struct libbinary_c_store_t * RESTRICT store);</pre><br />
-</div>
-
-<ul class="itemize" id='magicparlabel-5129'><li class="itemize_item">&nbsp;<span class="flex_cstruct">store</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-5134'><span class="subsubsection_label">7.3.6</span> binary_c_free_memory<div id="subsec_binary_c_free_memory"></div>
-</h4>
-<div class="standard" id='magicparlabel-5135'>Once your stellar evolution has finished, a <span class="flex_cstruct">stardata</span> struct needs to have its memory freed. This function enables you to free the <span class="flex_cstruct">stardata</span>, <span class="flex_cstruct">preferences</span> and <span class="flex_cstruct">store</span> structs if required. It is possible that <span style='font-family:monospace;font-size: 18px;'>preferences</span> and <span style='font-family:monospace;font-size: 18px;'>store</span> should <em>not</em> be freed, because these can be reused for future evolutionary runs.</div>
-
-<div class="standard" id='magicparlabel-5152'><br />
-<pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_free_memory(struct stardata_t ** RESTRICT stardata,
-                                                Boolean free_preferences,
-                                                Boolean free_stardata,
-                                                Boolean free_store);</pre><br />
-</div>
-
-<ul class="itemize" id='magicparlabel-5160'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
-<li class="itemize_item"><span class="flex_cvar">free_preferences</span>, <span class="flex_cvar">free_stardata</span> and <span class="flex_cvar">free_store</span> should be either <span class="flex_cmacro">TRUE</span> or <span class="flex_cmacro">FALSE</span>.</li>
-</ul>
-<h3 class="subsection" id='magicparlabel-5186'><span class="subsection_label">7.4</span> Extension functions</h3>
-<div class="standard" id='magicparlabel-5187'>A few functions have been defined which provide extensions to the basic API, but are very useful in the <span class="flex_perlmodule">binary_grid::C</span> Perl module. The number of extension functions may increase in the future, so this documentation is always likely to be out of date.</div>
-<h4 class="subsubsection" id='magicparlabel-5192'><span class="subsubsection_label">7.4.1</span> binary_c_version<div id="subsec_binary_c_version"></div>
-</h4>
-<div class="standard" id='magicparlabel-5193'>This function provides access to the (long) version string returned by <span class='math'>binary_c</i></span>
-</div>
-
-<div class="standard" id='magicparlabel-5194'><br />
-<pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_version(struct libbinary_c_stardata_t * RESTRICT stardata);</pre><br />
-</div>
-
-<ul class="itemize" id='magicparlabel-5199'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-5204'><span class="subsubsection_label">7.4.2</span> binary_c_show_instant_RLOF_period_or_separation<div id="subsec_binary_c_show_instant_RLOF_perio"></div>
-</h4>
-<div class="standard" id='magicparlabel-5205'>This function provides access to the <i>binary_c</i> function that determines the minimum orbital period or separation that leads to instantaneous Roche-lobe overflow for a given <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and metallicity.</div>
-
-<div class="standard" id='magicparlabel-5206'><br />
-<pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_show_instant_RLOF_period_or_separation(struct libbinary_c_stardata_t * stardata);</pre><br />
-</div>
-
-<ul class="itemize" id='magicparlabel-5211'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-5216'><span class="subsubsection_label">7.4.3</span> binary_c_initialize_parameters<div id="subsec_binary_c_initialize_parameters"></div>
-</h4>
-<div class="standard" id='magicparlabel-5217'>This function calls the <em><span class='math'>binary_c</i></span>
-</em> <span class="flex_cfunction">initialize_parameters</span> function which in turn is useful for reporting the initial abundance mixture (it is used for this purpose in <span class="flex_perlmodule">binary_grid::C</span>).</div>
-
-<div class="standard" id='magicparlabel-5226'><br />
-<pre class ='listings <i>C</i>'>void binary_c_API_function binary_c_initialize_parameters(struct libbinary_c_stardata_t * RESTRICT stardata);</pre><br />
-</div>
-
-<ul class="itemize" id='magicparlabel-5231'><li class="itemize_item"><span class="flex_cstruct">stardata</span> is defined previously (Sec.&nbsp;<a href="#subsec_binary_c_new_system">7.3.1</a>)</li>
-</ul>
-<h3 class="subsection" id='magicparlabel-5236'><span class="subsection_label">7.5</span> API Examples<div id="sec_Examples"></div>
-</h3>
-<div class="standard" id='magicparlabel-5237'>There are several examples of using the API in the <span class="flex_perlmodule">binary_grid::C</span> module.</div>
-<h4 class="subsubsection" id='magicparlabel-5242'><span class="subsubsection_label">7.5.1</span> Arguments and/or the argstring<div id="subsec_Arguments_and_the"></div>
-</h4>
-<div class="standard" id='magicparlabel-5243'>The <span class="flex_cvar">argstring</span>, or a combination of <span class="flex_cvar">argc</span> and <span class="flex_cvar">argv</span>, is used to send commands to <span class='math'>binary_c</i></span>, and this is sent to <span class="flex_cfunction">binary_c_new_system()</span> to specify (say) masses, orbits, metallicity etc. prior to a call to evolve a stellar system. You do not have to send an <span class="flex_cvar">argstring</span>, you could set the system directly, e.g. <br />
-<pre class ='listings <i>C</i>'>stardata-&gt;star[1].mass = 10.0;
-stardata-&gt;common.metallicity = 0.02;
-stardata-&gt;model.max_evolution_time = 15000.0;</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-5270'>but there are some functions which are called <em>after</em> the arguments are parsed which would be skipped if you do it manually. You will have to mimic (or copy from <span class='math'>binary_c</i></span>
-) this functionality.</div>
-<h4 class="subsubsection" id='magicparlabel-5271'><span class="subsubsection_label">7.5.2</span> Capturing the buffer output<div id="subsec_Capturing_the_buffer"></div>
-</h4>
-<div class="standard" id='magicparlabel-5272'>Usually, output is sent to the <span class="flex_cvar">stdout</span> stream. However, it is often more useful to capture the output and process it in an automated way. This is how the<em> <span class='math'>\binarygrid</span>
- </em><span class="flex_programminglanguage">C</span> backend works. You can do this with the following code which sets up a stellar system, suppresses logging to files, sets up the internal buffer, evolves the system, then grabs the buffer into memory. It is up to you to process this buffer (although see the <span class="flex_perlmodule">binary_grid::C</span> module for ways to do this) but it must then be freed before you finish.</div>
-
-<div class="standard" id='magicparlabel-5285'><br />
-<pre class ='listings <i>C</i>'>    struct libbinary_c_stardata_t * stardata = NULL;
-    struct libbinary_c_store_t * store = NULL;
-
-	char * argstring = "<i>binary_c</i> M_1 10 M_2 5 orbital_period 100 eccentricity 0.0 metallicity 0.02";
-
-    binary_c_new_system(&amp;stardata,
-                        NULL,
-                        NULL,
-                        &amp;store,
-                        &amp;argstring,
-                        -1);
-
-    /* suppress logging and use internal buffer */
-    strcpy(stardata-&gt;preferences-&gt;log_filename,"/dev/null");
-    strcpy(stardata-&gt;preferences-&gt;api_log_filename_prefix,"/dev/null");
-    stardata-&gt;preferences-&gt;internal_buffering = 2;
-    stardata-&gt;preferences-&gt;internal_buffering_compression = 0;
-    stardata-&gt;preferences-&gt;batchmode = BATCHMODE_LIBRARY;
-    binary_c_evolve_for_dt(stardata,stardata-&gt;model.max_evolution_time);  
-   
-    char * buffer = NULL;
-    int nbytes = 0;
-
-    /*
-     * Get the <i>binary_c</i> output in *buffer.
-     */
-    binary_c_buffer_info(stardata,&amp;buffer,&amp;nbytes);
- 
-    /* process the buffer */
-
-    /* ...... your code goes here ...... */
-
-    /* free the buffer */
-    binary_c_buffer_empty_buffer(stardata); 
-    buffer = NULL;</pre><br />
-</div>
-<h4 class="subsubsection" id='magicparlabel-5324'><span class="subsubsection_label">7.5.3</span> Memory management and maintaining a store<div id="subsec_Maintaining_a_store"></div>
-</h4>
-<div class="standard" id='magicparlabel-5325'>Memory is allocated during a call to <span class="flex_cfunction">binary_c_new_system()</span> which sets up the <span class="flex_cstruct">stardata</span> struct, the <span class="flex_cstruct">preferences</span> struct and the <span class="flex_cstruct">store</span> struct. Both the preferences and the store can be reused once defined, which means you do not have to go through the costly (in CPU cycles) process of setting up a multitude of data for each stellar system. The example below runs a number of systems while preserving the store. (It is based on the <span class="flex_programminglanguage">C</span> backend for <em><span class='math'>\binarygrid</span>
-2</em>.) It is not recommended to preserve the <span class="flex_cstruct">preferences</span> even though it is possible.</div>
-
-<div class="standard" id='magicparlabel-5350'><br />
-<pre class ='listings <i>C</i>'>    struct libbinary_c_stardata_t * stardata = NULL;
-    struct libbinary_c_store_t * store = NULL;
-	
-	unsigned int n = 0; // loop until n = 10
-	while(n++ &lt; 10)
-	{
-	   char * argstring;
-	   /*... code to define your args ...*/
-
-       binary_c_new_system(&amp;stardata,
-                           NULL,
-                           NULL,
-                           &amp;store,
-                           &amp;argstring,
-                           -1);
-	   
-        binary_c_evolve_for_dt(stardata,stardata-&gt;model.max_evolution_time); 
-
-        /* process (buffered) data here or maybe do nothing with it */
-		/* ... */
-
- 	   /* free everything except the store */
- 	   binary_c_free_memory(&amp;stardata,TRUE,TRUE,FALSE);  
-    }
-
-     /* free the store memory */
-     binary_c_free_store_contents(store);
-     store = NULL;
-
-   /* ... do your data processing ... */</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-5384'>You can also free <em>everything </em>with the following function call:</div>
-
-<div class="standard" id='magicparlabel-5385'><br />
-<pre class ='listings <i>C</i>'>      binary_c_free_memory(&amp;stardata,TRUE,TRUE,TRUE);   </pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-5390'>but beware that your local <span class="flex_cstruct">store</span> and <span class="flex_cstruct">stardata</span> must also be set to <span class="flex_cmacro">NULL</span> if you require it to be regenerated on a subsequent call to <span class="flex_cfunction">binary_c_new_system</span>, e.g.&nbsp;with </div>
-
-<div class="standard" id='magicparlabel-5407'><br />
-<pre class ='listings <i>C</i>'>      binary_c_free_memory(&amp;stardata,TRUE,TRUE,TRUE);
-      store = NULL;
-      stardata = NULL; </pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-5414'>You must not call <span class="flex_cfunction">binary_c_free_memory</span> to free your <span class="flex_cstruct">stardata</span> and <span class="flex_cstruct">store</span> and then immediately use <span class="flex_cmacro">Safe_free</span> on these pointers. They have already been freed, just not set to <span class="flex_cmacro">NULL</span> (because it is impossible to do so in <span class="flex_cfunction">binary_c_free_memory</span>), and freeing them – even with <span class="flex_cmacro">Safe_free</span> – will cause a crash.</div>
-
-<div class="standard" id='magicparlabel-5443'>If you are concerned that memory has <em>not</em> been freed, try running <span class='math'>binary_c</i></span>
- through <span class="flex_software">valgrind</span> or enable the <span class="flex_cmacro">CODESTATS</span> flag in <span class="flex_headerfile">binary_c_code_options.h</span>. If you cannot find the problem, or if it's a problem not of your making, please contact Rob about it so that it can be fixed for everyone.</div>
-
-<h2 class="section" id='magicparlabel-5456'><span class="section_label">8</span> Code description and internals</h2>
-<div class="standard" id='magicparlabel-5457'><div id="sec_Code_description"></div>
-</div>
-
-<div class="standard" id='magicparlabel-5458'>This section describes some of the internal details of the <em><i>binary_c</i></em> code.</div>
-<h3 class="subsection" id='magicparlabel-5459'><span class="subsection_label">8.1</span> History</h3>
-<div class="standard" id='magicparlabel-5460'><div id="subsec_History"></div>
-First, a bit of history. The <em><span class="flex_software">BSE</span></em> code was given to me by Chris Tout in October 2000 and some updates were made in May 2001 (from Jarrod Hurley). Jarrod was responsible for the October 2000 version, written as one monolithic block of evil <span class="flex_programminglanguage">Fortran</span>, although past collaborators such as Chris Tout, Sverre Aarseth, Onno Pols etc. (who else have I forgotten?) had input their talent to the code. The <span class="flex_programminglanguage">Fortran</span> version was converted to <em>C</em> (because I hate <em>Fortran</em> and it was <em>my</em> <em>bloody</em> <em>PhD</em>!) and (some of) the bugs worked out of it. This gave me a chance to lay the code out quite differently.</div>
-
-<div class="standard" id='magicparlabel-5473'>One major change is in the organisation of the variables. In the <span class="flex_programminglanguage">Fortran</span> code there are lots of arrays of size 2 (there are two stars) and a load of evil common blocks. These have been replaced by structures, one for each <span style='font-family:monospace;font-size: 18px;'>star</span>, the <span class="flex_cstruct">common</span> and <span class="flex_cstruct">model</span> structures, a <span class="flex_cstruct">preferences</span> structure to contain user-defined options, and a <span class="flex_cstruct">stardata</span> structure which contains pointers to everything else. Pointers are far quicker to use than passing the actual data around. Conceptually it's useful to have all the information about each star in one space, since most functions deal only with one star and can access all the information through a single pointer (and pointers are fast).</div>
-
-<div class="standard" id='magicparlabel-5494'>Throughout the code you'll see lots of <span style='font-family:monospace;font-size: 18px;'>Dprint</span> statements, these are enabled when debugging is turned on. These are very useful when something goes wrong (see section&nbsp;<a href="#sec_debugging">6.23</a>).</div>
-
-<div class="standard" id='magicparlabel-5495'>If you change anything, and would like me to debug it or you would like to commit it to the master branch, I insist on the following.</div>
-
-<ul class="itemize" id='magicparlabel-5496'><li class="itemize_item">Learn about how to write <span class="flex_programminglanguage">C</span>, e.g. <a href="https://www.maultech.com/chrislott/resources/cstyle/indhill-cstyle.pdf">https://www.maultech.com/chrislott/resources/cstyle/indhill-cstyle.pdf</a> or <a href="https://en.wikipedia.org/wiki/The_C_Programming_Language">https://en.wikipedia.org/wiki/The_C_Programming_Language</a>.</li>
-<li class="itemize_item">Learn how to format your <span class="flex_programminglanguage">C</span> code properly. Please use the <a href="https://en.wikipedia.org/wiki/Indentation_style#Allman_style">Allman style</a> and indent with four spaces (<a href="https://www.gnu.org/software/emacs/">emacs</a> indents <span class="flex_programminglanguage">C</span> like this automatically).</li>
-<li class="itemize_item">Include <em>good comments</em> even if these are &ldquo;this is a fudge&rdquo;. Remember that people who do not know how the code works will want to change the code in the future, and I have to check it before it is committed. Descriptions of the physics, paraphrased from a paper if you have to (but remember to give appropriate credit) are encouraged.</li>
-<li class="itemize_item">Include <span class="flex_cmacro">Dprint()</span> statements so that if there is a <span class="flex_cmacro">DEBUG</span> flag set there will be some (useful!) output to the screen during runtime.</li>
-<li class="itemize_item">Make sure the names of your variables <em>describe what they do</em> (in English :-). I do not care if the variable names are long (long is good!) and the computer certainly doesn't either.</li>
-</ul>
-<h3 class="subsection" id='magicparlabel-5521'><span class="subsection_label">8.2</span> How the <em><i>binary_c</i></em> code works</h3>
-<div class="standard" id='magicparlabel-5522'><div id="subsec_How_the_code"></div>
-The <em><i>binary_c</i></em> code, based on <em><span class="flex_software">BSE</span></em>, deals with stellar evolution and binary evolution i.e. the mass, core mass, luminosity, radius of both stars, mass loss and gain, orbital changes, supernovae and novae. Its<em> nucleosynthesis</em> (&ldquo;<em>nucsyn</em>&rdquo;) code deals with the surface abundance of the stars, follows this as mass is lost or gained and also the luminosity and radius on the TPAGB, dredge-ups, HBB, WR stars, supernova and nova yields. This does not sound like much but it's complicated enough! So as the <em><i>binary_c</i></em> code does the stellar (&ldquo;structure&rdquo;)<em> </em>evolution, the <em>nucsyn</em> code identifies when the surface abundances change. </div>
-
-<h3 class="subsection" id='magicparlabel-5529'><span class="subsection_label">8.3</span> Memory management in <span class='math'>binary_c</i></span>
-</h3>
-<div class="standard" id='magicparlabel-5530'><div id="subsec_Memory_management"></div>
-</div>
-<h4 class="subsubsection" id='magicparlabel-5531'><span class="subsubsection_label">8.3.1</span> Memory allocation</h4>
-<div class="standard" id='magicparlabel-5532'>Memory should be allocated using the macros <span class="flex_cmacro">Malloc</span>, <span class="flex_cmacro">Calloc</span> and <span class="flex_cmacro">Realloc</span> which replace the system <span class="flex_cfunction">malloc</span>, <span class="flex_cfunction">calloc</span> and <span class="flex_cfunction">realloc</span>, respectively. These macros allow for automatic error checking, e.g.&nbsp;when an allocation fails (i.e.&nbsp;when <span class="flex_cmacro">ALLOC_CHECKS</span> is defined), as well as the use of aligned memory (which should be faster).</div>
-<h4 class="subsubsection" id='magicparlabel-5561'><span class="subsubsection_label">8.3.2</span> Stack size</h4>
-<div class="standard" id='magicparlabel-5562'>The allocation of big data tables can require a large stack. Please remember to set your stack size, either in your shell e.g.&nbsp;with <em><span class="flex_software">ulimit</span></em> or in <span class="flex_software">Perl</span>'s threads, e.g.<span style='font-family:monospace;font-size: 18px;'>,<br />
-<pre class ='listings Perl'>use threads 'stack_size'=&gt;4096*10000</pre><br />
-</span>appropriately. If your stack is too small, you will get (possibly random) segmentation faults. See section&nbsp;<a href="#subsec_Segmentation_faults">8.5.5</a> for more information.</div>
-<h4 class="subsubsection" id='magicparlabel-5575'><span class="subsubsection_label">8.3.3</span> Main Memory Structures: stardata<div id="subsec_Memory_Structures"></div>
-</h4>
-<div class="standard" id='magicparlabel-5576'>Memory use in <em><span class='math'>binary_c</i></span>
-</em> is divided into structures which are allocated appropriately. The main structure, a pointer to which is passed around all over the place, is <em><span class="flex_cstruct">stardata</span></em>. Normally this is all you need. However, there are structures for specific purposes as described below. Memory allocation is mostly done in the <span class="flex_cfunction">main_allocations</span> subroutine.</div>
-
-<div class="standard" id='magicparlabel-5585'>Variables are stored as arrays within, e.g., <span class="flex_cstruct">stardata</span><em>,</em> which is dynamically allocated on the heap, rather than being dynamically allocated themeslves. You should probably not use <span class="flex_cstruct">stardata</span><em> </em>as a local stack variable, because it is liable to be quite large.</div>
-
-<dl class='description' id='magicparlabel-5594'><dt class="description_label">stardata_t</dt>
-<dd class="description_item"> The main <span class="flex_cstruct">stardata</span> structure is used to store the information about the stellar system currently being evolved, as well as pointers to all the other memory stores. <span class="flex_cstruct">stardata</span> is set to 0 (the <span style='font-family:monospace;font-size: 18px;'>NULL</span> byte '\0') at the beginning of evolution, so everything inside it is either zero (for floats, doubles, ints etc.), or <span style='font-family:monospace;font-size: 18px;'><span class="flex_cmacro">FALSE</span></span> (for Booleans).</dd>
-<dt class="description_label">previous_stardata_t</dt>
-<dd class="description_item"> A pointer to the top of the <span class="flex_cstruct">previous_stardata</span> stack. This is used at the end of an evolutionary step to calculate derivatives and perform logging (e.g.&nbsp;change of stellar type).</dd>
-<dt class="description_label">previous_stardatas</dt>
-<dd class="description_item"> A stack of copies of <span class="flex_cvar">stardata-&gt;n_previous_stardatas</span> previous timesteps' <span class="flex_cstruct">stardata</span> structures.</dd>
-<dt class="description_label">stardata_stack</dt>
-<dd class="description_item"> A stack of <span class="flex_cvar">stardata-&gt;n_stardata_stack</span> temporary <span class="flex_cstruct">stardata</span> structures used by the various numerical integration schemes (e.g.&nbsp;RK2, RK4). These are generally <em>not</em> final solutions – they are intemediate – and hence should never be touched.</dd>
-<dt class="description_label">common_t</dt>
-<dd class="description_item"> The common structure stores data that is persistent for this particular stellar system and relates to properties of the system. The space for this structure is inside <em><span class="flex_cstruct">stardata</span></em>. This structure should not contain dynamically allocated memory. <span class="flex_cstruct">common</span> is inside <span class="flex_cstruct">stardata</span> so is set to 0 (the <span class="flex_cmacro">NULL</span> byte '\0') at the beginning of evolution, so everything inside it is either zero (for floats, doubles, ints etc.), or <span class="flex_cmacro">FALSE</span> (for Booleans).</dd>
-<dt class="description_label">model_t</dt>
-<dd class="description_item"> The model structure stores data that is persistent for this particular stellar system and relates to the details of the binary model at a given time. The space for this structure is inside <em><span class="flex_cstruct">stardata</span></em>. This structure should not contain dynamically allocated memory. <em>model</em> is inside <span class="flex_cstruct">stardata</span> so is set to 0 (the <span class="flex_cmacro">NULL</span> byte '\0') at the beginning of evolution, so everything inside it is either zero (for floats, doubles, ints etc.), or <span class="flex_cmacro">FALSE</span> (for Booleans).</dd>
-<dt class="description_label">star_t[NUMBER_OF_STARS]</dt>
-<dd class="description_item"> The information stored to describe each star. <span class="flex_cmacro">NUMBER_OF_STARS</span> of these are in an array inside <em><span class="flex_cstruct">stardata</span></em>. This structure should not contain dynamically allocated memory. <span class="flex_cvar">star[]</span> is inside <span class="flex_cstruct">stardata</span> so is set to 0 (the <span class="flex_cmacro">NULL</span> byte '\0') at the beginning of evolution, so everything inside it is either zero (for floats, doubles, ints etc.), or <span class="flex_cmacro">FALSE</span> (for Booleans).</dd>
-<dt class="description_label">preferences_t</dt>
-<dd class="description_item"> The <span class="flex_cstruct">preferences</span> structure contains information about how a system should be set up and what physics apply. The location of <span class="flex_cstruct">preferences</span><em> </em>is saved as a pointer in <span class="flex_cstruct">stardata</span> but its data are not stored in <span class="flex_cstruct">stardata</span>, thus this structure must be allocated and set up separately. This structure should not contain dynamically allocated memory.</dd>
-<dt class="description_label">store_t</dt>
-<dd class="description_item"> The <span class="flex_cstruct">store</span> structure contains data which is constant, e.g.&nbsp;data tables. Space for the store is allocated on the first run, and it can be kept at the end of the run, so the store only has to be set once (or once per thread). The data in store should be dynamically allocated (e.g.&nbsp;with <span class="flex_cmacro">MALLOC</span>, <span class="flex_cmacro">CALLOC</span>, <span class="flex_cmacro">REALLOC</span>). The store is built in the <span class="flex_cfunction">build_store_contents</span> function, and deleted in the <span class="flex_cfunction">free_store_contents</span> function.</dd>
-<dt class="description_label">tmpstore_t</dt>
-<dd class="description_item"> The <span class="flex_cstruct">tmpstore</span> contains data which is required to be shared between functions, but is not required to be shared after the current evolutionary timestep is complete. Such data should be dynamically allocated, and each function which uses the <span class="flex_cstruct">tmpstore</span> should check if the appropriate pointer is <span class="flex_cmacro">NULL</span> in which case it should allocated the memory. The <span class="flex_cfunction">free_tmpstore</span> function deletes the data when required. This is usually at the end of stellar evolution, but potentially sooner if many <span class="flex_cstruct">stardata</span> structures are being switched in and out with the API. Data which is required to be persistent between timesteps, which is not constant, and which survives a change in <em><span class="flex_cstruct">stardata</span></em>, should be in <em><span class="flex_cstruct">common</span></em>. Constant data should be in <em><span class="flex_cstruct">store</span></em>.</dd>
-<dt class="description_label">data_table_t</dt>
-<dd class="description_item"> This stores information describing an interpolation table, including the number of parameters, number of values to be calculated, length of the table and the table data. See the <span class="flex_cfunction">rinterpolate</span> function from <span class="flex_software">librinterpolate</span>.</dd>
-<dt class="description_label">new_supernova_t</dt>
-<dd class="description_item"> This is a structure that stores information used by the <span class="flex_cfunction">supernova</span> functions. </dd>
-<dt class="description_label">splitinfo_t</dt>
-<dd class="description_item"> This contains information used by the evolution splitting algorithm.</dd>
-<dt class="description_label">diffstats_t</dt>
-<dd class="description_item"> This structure is used to compare the state of the stellar system to that of the previous timestep. Changes are then logged.</dd>
-<dt class="description_label">probability_distribution_t</dt>
-<dd class="description_item"> A generic probability distribution description.</dd>
-<dt class="description_label">power_law_t</dt>
-<dd class="description_item"> Defines a power law, used in the discs code.</dd>
-<dt class="description_label">disc_thermal_zone_t</dt>
-<dd class="description_item"> Defines a thermal zone in a disc, used in the discs code.</dd>
-<dt class="description_label">disc_loss_t</dt>
-<dd class="description_item"> Defines a mass/angular-momentum loss/gain rate, used in the discs code.</dd>
-<dt class="description_label">disc_t</dt>
-<dd class="description_item"> Defines a disc, used in the discs code.</dd>
-<dt class="description_label">new_stellar_structure_t</dt>
-<dd class="description_item"> Defines, in a (hopefully) code-independent way, the stellar structure. Used to interface the generic stellar structure algorithm with <span class='math'>binary_c</i></span>
-.</dd>
-<dt class="description_label">RLOF_orbit_t</dt>
-<dd class="description_item"> Information on mass loss/transfer/gain during RLOF.</dd>
-<dt class="description_label">binary_system_t</dt>
-<dd class="description_item"> Defines the binary system for use with the discs code.</dd>
-<dt class="description_label">kick_system_t</dt>
-<dd class="description_item"> Information used by the (supernova) kick code.</dd>
-<dt class="description_label">mersenne_twister_data</dt>
-<dd class="description_item"> Used by the random number generator.</dd>
-<dt class="description_label">binary_c_file</dt>
-<dd class="description_item"> Used by the file access routines, e.g.&nbsp;to store the amount of data written to a file and hence prevent it getting too large.</dd>
-<dt class="description_label">binary_c_fixed_timestep</dt>
-<dd class="description_item"> Used to make &ldquo;fixed&rdquo; timesteps, e.g.&nbsp;so you can output every <em>n </em>million years, exactly (also works in log time).</dd>
-<dt class="description_label">binary_c_event_t</dt>
-<dd class="description_item"> Used in the events code (see Section&nbsp;<a href="#subsec_Events">8.6</a>). There are various other custom structures which store data for events (see <span class="flex_headerfile">binary_c_structures.h</span>)</dd>
-</dl>
-<h4 class="subsubsection" id='magicparlabel-5801'><span class="subsubsection_label">8.3.4</span> Supplementary data structures</h4>
-<div class="standard" id='magicparlabel-5802'>There are a number of other data structures used by <em><i>binary_c</i></em>. A few are listed here and most are not of interest to you.</div>
-
-<dl class='description' id='magicparlabel-5803'><dt class="description_label">data_table_t</dt>
-<dd class="description_item"> This contains information about a data table. Set up (a pointer to, i.e. data_table_t*) the data table through <span class="flex_cmacro">NewDataTable_from_Array</span> or <span class="flex_cmacro">NewDataTable_from_Pointer</span>. Access the data table through the <span class="flex_cmacro">Interpolate</span> macro (which interfaces with <span class="flex_software">librinterpolate</span>). Delete the table with <span class="flex_cmacro">Delete_data_table</span>. The <span class="flex_cvar">data_table_t.data</span> pointer points to an array of doubles which contains the data: this memory is not allocated for you. If set up in the <span class="flex_cstruct">store</span> or <span class="flex_cstruct">tmpstore</span> this can be dynamically allocated, elsewhere you have to be careful and probably point to a data array inside <span class="flex_cstruct">stardata</span>.
-<br />
-
-If you want to set up a <span class="flex_cstruct">data_table_t</span> rather than a <span class="flex_cstruct">data_table_t*</span> you will have to do it manually.</dd>
-<dt class="description_label">splitinfo_t</dt>
-<dd class="description_item"> This contains information used when <span class="flex_cmacro">EVOLUTION_SPLITTING</span> is defined. See <span class="flex_cstruct">evolution_split</span>.</dd>
-<dt class="description_label">diffstats_t</dt>
-<dd class="description_item"> Used in constructing the standard log file. See <span class="flex_cfunction">evolution_difflog</span>.</dd>
-<dt class="description_label">probability_distribution_t</dt>
-<dd class="description_item"> Not sure this is used at present: it defines a probability distribution.</dd>
-<dt class="description_label">power_law_t</dt>
-<dd class="description_item"> Used to define a power law used by the disc code.</dd>
-<dt class="description_label">disc_thermal_zone_t</dt>
-<dd class="description_item"> Used to define a thermal zone of a disc in the disc code.</dd>
-<dt class="description_label">disc_t</dt>
-<dd class="description_item"> Used to define a disc in the disc code.</dd>
-<dt class="description_label">binary_system_t</dt>
-<dd class="description_item"> Used to define the properties of a binary-star system in the disc code.</dd>
-</dl>
-<h4 class="subsubsection" id='magicparlabel-5867'><span class="subsubsection_label">8.3.5</span> Thread safety</h4>
-<div class="standard" id='magicparlabel-5868'><em><span class='math'>binary_c</i></span>
-</em>, as of version 2.0pre21 and in all subsequent versions, i.e. in the version you are using!, is designed to be thread-safe, i.e.&nbsp;it can be built as a shared library (<span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ make <i>libbinary_c.so</i></pre><br />
-</span>) and deployed in many threads by one process (as in <em><span class='math'>\binarygrid</span>
-</em> with the <span class="flex_programminglanguage">C</span> backend). To this end:</div>
-
-<ul class="itemize" id='magicparlabel-5877'><li class="itemize_item">You <b>may not</b> use static variables. Put your data into <em><span class="flex_cstruct">stardata</span></em>.</li>
-<li class="itemize_item">You <b>may not</b> use global variables (i.e.&nbsp;no <span style='font-family:monospace;font-size: 18px;'>extern</span> statements). Put your data into <em><span class="flex_cstruct">stardata</span></em>.</li>
-<li class="itemize_item">You may not use non-thread-safe <span class="flex_programminglanguage">C</span> library functions (e.g. <span class="flex_cfunction">strtok</span> and hash functions, use the <span style='font-family:monospace;font-size: 18px;'>_r</span> or <span style='font-family:monospace;font-size: 18px;'>_s</span> equivalents). Some of these functions have been redefined as macros in <span class='math'>binary_c</i></span>
- – these macros will deliberately fail the compilation process and hopefully give you a warning.</li>
-<li class="itemize_item">You must follow the conventions given above regarding memory allocation in <em><span class="flex_cstruct">stardata</span></em>.</li>
-</ul>
-<div class="standard" id='magicparlabel-5901'>Please use the memory structures appropriately (see&nbsp;<a href="#subsec_Memory_Structures">8.3.3</a>). </div>
-<h3 class="subsection" id='magicparlabel-5902'><span class="subsection_label">8.4</span> Output</h3>
-<div class="standard" id='magicparlabel-5903'><div id="subsec_Output"></div>
-</div>
-
-<div class="standard" id='magicparlabel-5904'><span class='math'>binary_c</i></span>
- must communicate its results to you <em>somehow</em> otherwise what is the point? When running one star, it is sufficient to send output to either the screen (<span class="flex_cvar">stdout</span>) or to a file (with redirection, e.g. <span style='font-family:monospace;font-size: 18px;'>tbse &gt; file</span>). When running millions of stars, output must be sent to, e.g., a function you define (usually <span class="flex_perlcode">parse_bse</span>) when using the <em><span class='math'>\binarygrid</span>
-</em>. In this case, either data is sent through a pipe (using the <span class="flex_scriptinglanguage">Perl</span> backend) or in an array in memory (using the <span class="flex_programminglanguage">C</span> backend). Thus, <span class='math'>binary_c</i></span>
- has to intercept your output and decide where to send it. This is done as follows.</div>
-
-<ol class="enumerate" id='magicparlabel-5921'><li class="enumerate_item">Use <span class="flex_cmacro">Printf</span> instead of <span class="flex_cfunction">printf</span>: <span class="flex_cmacro">Printf</span> sends data to <span class="flex_cfunction">buffered_printf</span>. This stores raw output data in a buffer, and outputs either immediately, at the end of evolution, or not at all, depending on what you want to do with the buffer. It is up to you to clear out the buffer after evolution (or on a switch of <span class="flex_cstruct">stardata</span>) with a call to buffer_empty_buffer. You can get the pointer used to store the buffer from <span class="flex_cfunction">buffer_info</span>.</li>
-<li class="enumerate_item">Use _printf to actually output to stdout using the <i>C</i>-library's <span class="flex_cfunction">fprintf</span> function.</li>
-<li class="enumerate_item"><b>warning: experimental </b>If <span class="flex_cmacro">BUFFERED_STACK</span> is defined, you can use <em><span class="flex_cfunction">binary_c_stack_printf</span></em>, which is a more advanced buffer with a full stack API (e.g.&nbsp;push and pop functions), that can include (<span class="flex_software">zlib</span>) compression. However, at present this is not used, and may never be a standard part of <span class='math'>binary_c</i></span>
-.</li>
-</ol>
-<h4 class="subsubsection" id='magicparlabel-5964'><span class="subsubsection_label">8.4.1</span> Interaction with <i>binary_grid</i></h4>
-<div class="standard" id='magicparlabel-5965'>The interaction between <span class='math'>binary_c</i></span>
- and <span class='math'>\binarygrid</span>
- depends very much on how data is output. When using the Perl backend, pipes are used to funnel data from <span class='math'>binary_c</i></span>
- to <span class='math'>\binarygrid</span>
- and vice versa. Output should be sent to <span class="flex_cvar">stdout</span>. When using the <i>C</i> backend, data is sent to the buffer and then the buffer accessed from Perl (via <span class="flex_perlmodule">Inline::C</span>, i.e.&nbsp;using <span class="flex_perlmodule">XS</span>) directly without ever being sent to <span class="flex_cvar">stdout</span>. This <em>should</em> be faster.</div>
-<h3 class="subsection" id='magicparlabel-5982'><span class="subsection_label">8.5</span> Debugging <span class='math'>binary_c</i></span>
-</h3>
-<div class="standard" id='magicparlabel-5983'>I give here some general strategies for debugging <span class='math'>binary_c</i></span>, but of course there are many ways to debug code: you may know better ways, in which case please contribute to this manual!</div>
-<h4 class="subsubsection" id='magicparlabel-5984'><span class="subsubsection_label">8.5.1</span> General strategy: <span class="flex_bashscript">tbse</span>, <span class='math'>\binarygrid</span>
-</h4>
-<div class="standard" id='magicparlabel-5989'>The usual problem is that you are running a grid of stars and one star causes <span class='math'>binary_c</i></span>
- to crash. If you are lucky, this does not bring down the whole grid, but it might (especially if you are using the <span class="flex_programminglanguage">C</span> backend). It is important to identify precisely which star caused the crash. You will find this very hard to do if you are running a grid with more than one thread, because any thread could have caused the crash. So, the first thing you must do is run your grid with only one thread, and with <span class='math'>\binarygrid</span>
- debugging level at least set to 3 (e.g. run <span style='font-family:monospace;font-size: 18px;'>&lt;script&gt; vb=3</span>). This will tell you the arguments which were sent to <span class='math'>binary_c</i></span>
- that caused the crash. Save these to a file.</div>
-
-<div class="standard" id='magicparlabel-5994'>Next, you should use the <span class="flex_bashscript">tbse</span> (Test Binary Star Evolution) script to run <span class='math'>binary_c</i></span>
- with these arguments. This is very easy, just run</div>
-
-<div class="standard" id='magicparlabel-5999'><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ tbse &lt;filename&gt;</pre><br />
-</span></div>
-
-<div class="standard" id='magicparlabel-6004'>You should see output, and (hopefully) the same failure as caused the grid to crash. Now you can debug <span class='math'>binary_c</i></span>
- properly, in an isolated test case.</div>
-
-<div class="standard" id='magicparlabel-6005'>Note that the idea of isolating a test case which causes a failure is good practice in science and engineering in general, so you're doing nothing unusual here. The strategy now is:</div>
-
-<ul class="itemize" id='magicparlabel-6006'><li class="itemize_item">If you are seeing a segmentation fault, you probably want to now debug with <span class="flex_software">valgrind</span> or <em><span class="flex_software">gdb</span></em>.</li>
-<li class="itemize_item">If your problem is in your algorithm and is not really a coding error as such, you probably want to use the internal debugging with <span class="flex_cmacro">DEBUG</span>, <span class="flex_cmacro">DEBUG_EXP</span> and <span class="flex_cmacro">Dprint</span>. See Section&nbsp;<a href="#subsec_DEBUG__DEBUG_EXP_and">8.5.3</a> below.</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-6028'><span class="subsubsection_label">8.5.2</span> Configure script and debug builds<div id="subsec_debug_builds"></div>
-</h4>
-<div class="standard" id='magicparlabel-6029'>When debugging, it is important to disable any optimisation the compiler uses and turn on options that allow the code to be debugged with <span class="flex_software">gdb</span> and/or <em><span class="flex_software">valgrind</span></em>, and use the <span class="flex_cmacro">backtrace</span> feature (you must have <span class="flex_software">libbacktrace</span> installed, see Section&nbsp;<a href="#subsec_Backtrace">8.5.4</a>). To do this, run</div>
-
-<div class="standard" id='magicparlabel-6046'><br />
-<pre class\s*='listings bash'>$ ./configure debug
-$ make cleanall
-$ make</pre><br />
-to make a &ldquo;debug build&rdquo;. You should use the <span class="flex_software">gcc</span><em> </em>compiler to debug, e.g., <span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ export CC=gcc</pre><br />
-</span>prior to running <span class="flex_bashscript">configure</span>. While others, e.g.&nbsp;<em><span class="flex_software">clang</span></em>, probably work just fine, these have not been extensively tested. </div>
-<h4 class="subsubsection" id='magicparlabel-6069'><span class="subsubsection_label">8.5.3</span> DEBUG, DEBUG_EXP and Dprint<div id="subsec_DEBUG__DEBUG_EXP_and"></div>
-</h4>
-<div class="standard" id='magicparlabel-6070'>Internal debugging in <span class='math'>binary_c</i></span>
- is very useful to determine where an algorithm fails. It is not so useful in determining where segmentation faults and memory errors occur, although it is obviously useful in the sense that debugging will continue until a crash. </div>
-
-<div class="standard" id='magicparlabel-6071'>To enable internal debugging, edit code_options.h and set the appropriate line <span style='font-family:monospace;font-size: 18px;'>#define DEBUG 1</span>. You will then need to rebuild the all the code (see&nbsp;<a href="#subsec_debug_builds">8.5.2</a>). </div>
-
-<div class="standard" id='magicparlabel-6072'>When you now run <em>tbse</em> you will see many lines of data. These correspond to <span class="flex_cmacro">Dprint</span> (i.e.&nbsp;&ldquo;debug-print&rdquo;) lines in the code. </div>
-
-<div class="standard" id='magicparlabel-6077'>There are often too many lines of data. You can restrict the data output by defining the <span class="flex_cmacro">DEBUG_EXP</span> macro. There is only output when this is true (in a <span class="flex_programminglanguage">C</span> sense of truth) so it is usually set to 1. However, you can always restrict to, say, outputting between 9 and 10 Gyr:</div>
-
-<div class="standard" id='magicparlabel-6086'><br />
-<pre class ='listings <i>C</i>'>#define DEBUG_EXP (stardata-&gt;model.time &gt; 9000 &amp;&amp; stardata-&gt;model.time &lt; 10000)</pre><br />
-You will almost always have <span class="flex_cstruct">stardata</span><em> </em>available to <span class="flex_cmacro">Dprint</span>. </div>
-
-<div class="standard" id='magicparlabel-6099'>There are many other debugging options listed in debug_macros.h, most of which are not useful to you.</div>
-
-<div class="standard" id='magicparlabel-6100'>You can change the output of <span class="flex_cmacro">Dprint</span> in <span class="flex_cmacro">src/debug/debug_fprintf.c</span></div>
-
-<div class="standard" id='magicparlabel-6109'>Another macro, <span class="flex_cmacro">Dprint_no_newline</span>, is the same as <span class="flex_cmacro">Dprint</span> but without a &ldquo;<span class="flex_cmacro">\n</span>&rdquo; newline at the end of the string.</div>
-<h4 class="subsubsection" id='magicparlabel-6122'><span class="subsubsection_label">8.5.4</span> Backtrace<div id="subsec_Backtrace"></div>
-</h4>
-<div class="standard" id='magicparlabel-6123'>If <span class="flex_cmacro">BACKTRACE</span> is defined (in <span class="flex_headerfile">binary_c_code_options.h</span>) you have access to stack tracing features similar to those used in debuggers. Please install <span class="flex_software">libbacktrace</span> before expecting this to work. Calling the <span class="flex_cmacro">Backtrace</span> macro (with no arguments) allows you to see a list of callers of any function, anywhere in <span class='math'>binary_c</i></span>, through the <span class="flex_cfunction">print_trace</span> function. This is a very useful feature if you want to see which function called the function in which you have a problem. Note that it is, however, quite slow, and requires a debug build.</div>
-
-<div class="standard" id='magicparlabel-6144'>Note that this feature has not been tested on platforms other than Linux.</div>
-<h4 class="subsubsection" id='magicparlabel-6145'><span class="subsubsection_label">8.5.5</span> Segmentation faults<div id="subsec_Segmentation_faults"></div>
-</h4>
-<div class="standard" id='magicparlabel-6146'>As with any code with large chunks of data being dynamically allocated, any attempt to access data which is not allocated leads to a segmentation fault. It is often extremely difficult to determine where the cause lies, as it may be somewhere previous in the program, or even on another thread. Should you encounter such a segmentation fault, please try running through <span class="flex_software">gdb</span> and/or <span class="flex_software">valgrind</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-6155'><span class="subsubsection_label">8.5.6</span> gdb</h4>
-<div class="standard" id='magicparlabel-6156'>The <i>GNU</i> debugger, <span class="flex_software">gdb</span>, is a useful option for quickly finding the location of a segmentation fault. Run</div>
-
-<div class="standard" id='magicparlabel-6161'><br />
-<pre class\s*='listings bash'>$ tbse debug</pre><br />
-to launch<em> <span class='math'>binary_c</i></span>
- </em>with <span class="flex_software">gdb</span>. Once the crash has happened, use the backtrace command <span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings'>bt</pre><br />
-</span> to run a back trace and locate the cause of the crash.</div>
-<h4 class="subsubsection" id='magicparlabel-6174'><span class="subsubsection_label">8.5.7</span> valgrind and friends</h4>
-<div class="standard" id='magicparlabel-6175'><span class="flex_software">Valgrind</span> is a step up in technology from <em><span class="flex_software">gdb</span></em>. It not only locates segmentation faults, it also determines when (heap) memory is overwritten when it should not be, or unallocated memory is accessed. These are the two main causes of segmentation faults, so valgrind really is your friend.</div>
-
-<div class="standard" id='magicparlabel-6184'>There are many tools associated with <em><span class="flex_software">valgrind</span></em>:</div>
-
-<ul class="itemize" id='magicparlabel-6189'><li class="itemize_item"><em>memcheck</em>: this is the standard <span class="flex_software">valgrind</span><em> </em>tool for finding problems with (heap) memory access issues that lead to segfaults. Because the memory allocated in <em><span class='math'>binary_c</i></span>
-</em> is mostly on the the heap (e.g.&nbsp;<span class="flex_cstruct">stardata</span><em> </em>is allocated with <span class="flex_cmacro">MALLOC</span>) it is the most useful of <span class="flex_software">valgrind</span>'s tools.
-<br />
-
-Run this with <span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ tbse valgrind</pre><br />
-</span>Note that the <span class="flex_software">valgrind</span> options in <span class="flex_bashscript">tbse</span> work for me, but you may need something a bit different, in particular you may need to change the stack size and maximum stack frame.</li>
-<li class="itemize_item"><em>massif</em>
-<br />
-
-I cannot remember what this does! Run this with
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ tbse massif</pre><br />
-</li>
-<li class="itemize_item"><em>callgrind</em>: a tool to profile code i.e.&nbsp; determine where time is spent and hence optimize. 
-<br />
-
-Run this with 
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ tbse callgrind</pre><br />
-</li>
-<li class="itemize_item"><em>cachegrind</em>: a tool to analyse cache hits. Run this with 
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ tbse cachegrind</pre><br />
-</li>
-<li class="itemize_item"><em>sgcheck</em>: a tool for stack array overrun analyisis. 
-<br />
-
-Run this with 
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ tbse sgcheck</pre><br />
-</li>
-<li class="itemize_item"><em>drd</em> : a tool for thread analysis
-<br />
-
-Run this with 
-<br />
-
-<br />
-<pre class\s*='listings bash'>$ tbse drd</pre><br />
-</li>
-</ul>
-<div class="standard" id='magicparlabel-6243'>You can override the arguments sent to <span class="flex_software">valgrind</span> by <span class="flex_bashscript">tbse</span> by setting the environment variable <span class="flex_envvar">VALGRIND_ARGS</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-6256'><span class="subsubsection_label">8.5.8</span> Thread safety</h4>
-<h4 class="subsubsection" id='magicparlabel-6257'><span class="subsubsection_label">8.5.9</span> NaN (not a number) checks</h4>
-<div class="standard" id='magicparlabel-6258'>If <span class="flex_cmacro">NANCHECKS</span> is defined, you can use the <span class="flex_cmacro">Nancheck(X)</span> macro to test whether <span class="flex_cvar">X</span> is NaN. Note that checking for NaNs is computationally expensive, and you normally (once you trust your code) want <span class="flex_cmacro">NANCHECKS</span> to be undefined. If a NaN is detected, <span class='math'>binary_c</i></span>
- will segfault itself.</div>
-<h3 class="subsection" id='magicparlabel-6275'><span class="subsection_label">8.6</span> Events<div id="subsec_Events"></div>
-</h3>
-<div class="standard" id='magicparlabel-6276'>Starting from 2.0pre33 <span class='math'>binary_c</i></span>
- has a new events system. It now behaves more like a proper stellar evolution code, in that at each timestep derivatives of variables are calculated, then applied, and events that are set during the calculation (e.g.&nbsp;supernovae, common-envelope evolution, contact) are <em>then</em> applied. This allows the use of more advanced integrators than the standard forward Euler scheme. At the time of writing, RK2, RK4 and a predictor-corrector are alternatives, although the forward Euler is still the standard and fastest<div class="foot"><span class="foot_label">10</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-6280'>Forward Euler is standard except in the tidal calculations, some of which are calculated analytically, then linear derivatives are computed from these assuming everything else (stellar properties, etc.) in a hybrid scheme to avoid numerical instability.</div>
-</div></div>.</div>
-
-<div class="standard" id='magicparlabel-6281'>Events are stored on the event stack and then processed from the top to the bottom of the stack at the end of the timestep, if it is a successful timestep.</div>
-<h4 class="subsubsection" id='magicparlabel-6282'><span class="subsubsection_label">8.6.1</span> Queueing an event on the event stack</h4>
-<div class="standard" id='magicparlabel-6283'>Events are added with the <span class="flex_cmacro">Add_new_event</span> macro. This returns an integer which is the event number, if greater than or equal to zero, its index number on the event stack. If the integer is <span class="flex_cmacro">BINARY_C_EVENT_DENIED</span> (which is <span style='font-family:monospace;font-size: 18px;'>-1</span> so can never be an index) then the event has, for some reason, been refused.</div>
-
-<div class="standard" id='magicparlabel-6292'>The <span class="flex_cmacro">Add_new_event</span> macro call takes a number of arguments:</div>
-
-<ul class="itemize" id='magicparlabel-6297'><li class="itemize_item"><span class="flex_cstruct">stardata</span>: the usual pointer to a <span class="flex_cstruct">stardata</span> struct</li>
-<li class="itemize_item"><span class="flex_cvar">event_type</span>: an integer identifying the event type. There are defined in <span class="flex_headerfile">events_macros.h</span></li>
-<li class="itemize_item"><span class="flex_cvar">event_handler_function</span>: this is a pointer to a function to be called when the event is triggered. This is required to be non-<span class="flex_cmacro">NULL</span>.</li>
-<li class="itemize_item"><span class="flex_cvar">erase_event_handler_function</span>: this is a pointer to a function to be called when the event is erased. Ignored if <span class="flex_cmacro">NULL</span>.</li>
-<li class="itemize_item"><span class="flex_cvar">event_data</span>: this is a <span style='font-family:monospace;font-size: 18px;'><span class="flex_cvar"><span style='font-family:monospace;font-size: 18px;'>void*</span></span></span> pointer, i.e.&nbsp;it is of whatever type you want it to be (your handler function should know), to data to be sent to the handler function. This can be <span class="flex_cmacro">NULL</span>.</li>
-<li class="itemize_item"><span class="flex_cvar">unique</span>: a Boolean specifying whether this event is one of a kind, or not. For example there can only be one common envelope per timestep, so <br />
-<pre class ='listings <i>C</i>'>unique==TRUE</pre><br />
-, but there could be more than one supernova, so <br />
-<pre class ='listings <i>C</i>'>unique==FALSE</pre><br />
-.</li>
-</ul>
-<div class="standard" id='magicparlabel-6359'>The calling function should check the return value, and clean up any memory if required after a denial. For example, the following is the code to initiate dynamical common envelope evolution in the RLOF routines.</div>
-
-<div class="standard" id='magicparlabel-6360'><br />
-<pre class ='listings <i>C</i>'>        struct binary_c_new_common_envelope_event_t * event_data =              				MALLOC(sizeof(struct binary_c_new_common_envelope_event_t)); 
-
-        if(Add_new_event(stardata,
-                         BINARY_C_EVENT_COMMON_ENVELOPE,
-                         &amp;common_envelope_event_handler,
-                         NULL,
-                         event_data,
-                         UNIQUE_EVENT) == BINARY_C_EVENT_DENIED)
-        {
-            Dprint("not allowed an event :(\n");
-            Safe_free(event_data);
-        }
-        else
-        {
-            event_data-&gt;donor = donor;
-            event_data-&gt;accretor = accretor;
-            Dprint("added event!\n");
-        }</pre><br />
-</div>
-<h4 class="subsubsection" id='magicparlabel-6382'><span class="subsubsection_label">8.6.2</span> Testing the event stack</h4>
-
-<ul class="itemize" id='magicparlabel-6383'><li class="itemize_item">Call the <span class="flex_cfunction">events_pending</span> function to return <span class="flex_cmacro">TRUE</span> if there are events pending, <span class="flex_cmacro">FALSE</span> otherwise.<br />
-<pre class ='listings <i>C</i>'>Boolean x = events_pending(stardata);</pre><br />
-</li>
-<li class="itemize_item">Call <span class="flex_cfunction">events_pending_of_type</span> to return <dfn class='lyxnoun'><span class="flex_cmacro"><dfn class='lyxnoun'>TRUE</dfn></span></dfn> if there are events of a given type pending, <span class="flex_cmacro">FALSE</span> otherwise.<br />
-<pre class ='listings <i>C</i>'>Boolean y = events_pending_of_type(stardata,BINARY_C_EVENT_COMMON_ENVELOPE);</pre><br />
-</li>
-<li class="itemize_item">Call <span class="flex_cfunction">event_stack_string</span> to return a <span style='font-family:monospace;font-size: 18px;'><span class="flex_cvar"><span style='font-family:monospace;font-size: 18px;'>char*</span></span></span> string describing the stack, suitable for logging and/or debugging. You need to <span style='font-family:monospace;font-size: 18px;'><span class="flex_cmacro"><span style='font-family:monospace;font-size: 18px;'>Safe_free()</span></span></span> the string.<br />
-<pre class ='listings <i>C</i>'>char * evstring = event_stack_string(stardata);
-printf(&ldquo;Event stack: %s\n&rdquo;,evstring);
-Safe_free(evstring);</pre><br />
-</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-6436'><span class="subsubsection_label">8.6.3</span> Erase the stack</h4>
-<div class="standard" id='magicparlabel-6437'>The entire stack can be deleted by calling <span class="flex_cfunction">erase_events</span>. The <span style='font-family:monospace;font-size: 18px;'><span class="flex_cvar"><span style='font-family:monospace;font-size: 18px;'>void*</span></span></span> data associated with each event is freed.</div>
-
-<div class="standard" id='magicparlabel-6446'><br />
-<pre class ='listings <i>C</i>'>erase_events(stardata);</pre><br />
-This function is called automatically when a timestep is rejected from <span class="flex_cfunction">evolution_rejected()</span>.</div>
-
-<div class="standard" id='magicparlabel-6455'>You can also call <span class="flex_cfunction">erase_events_of_type</span><br />
-<pre class ='listings <i>C</i>'>erase_events_of_type(stardata,type,except);</pre><br />
-which will erase all events of given <span class="flex_cvar">type</span> except the event <span class="flex_cvar">except</span>. If the type is <span class="flex_cvar">-1</span> then events of any type are removed, except <span class="flex_cvar">except</span>. If <span class="flex_cvar">except</span> is <span class="flex_cmacro">NULL</span> then all events of the given type are removed.</div>
-
-<div class="standard" id='magicparlabel-6488'>You can erase an event without altering the event stack by calling<br />
-<pre class ='listings <i>C</i>'>erase_event(stardata,&amp;event);</pre><br />
-but beware that this will mess up the stack and <span class='math'>binary_c</i></span>
- is likely to be very confused.</div>
-
-<div class="standard" id='magicparlabel-6493'>When events are erased, the optional <span class="flex_cfunction">erase_event_handler_function()</span> function is called, with the same arguments as the event handler function. You can use this to clean up any allocated memory.</div>
-<h4 class="subsubsection" id='magicparlabel-6498'><span class="subsubsection_label">8.6.4</span> Catch events</h4>
-<div class="standard" id='magicparlabel-6499'>At the end of each (successful) timestep, <span class="flex_cfunction">catch_events</span> is called. This function loops through the stack, triggering each event by calling the handler function and sending it the event data as well as <span class="flex_cstruct">stardata</span>. Event data is freed automatically after the event is triggered, as is the event itself.</div>
-<h4 class="subsubsection" id='magicparlabel-6508'><span class="subsubsection_label">8.6.5</span> Event handler functions</h4>
-<div class="standard" id='magicparlabel-6509'>The event handler functions should look like the following, again using the common-envelope code as an example.</div>
-
-<div class="standard" id='magicparlabel-6510'><br />
-<pre class ='listings'>Event_handler_function common_envelope_event_handler(void * eventp,
-                                                     struct stardata_t * stardata,
-                                                     void * data)
-{
-	/* a pointer to the event */
-    struct binary_c_event_t * const event = eventp;
-    
-	/* a pointer to the event data */
-    struct binary_c_new_common_envelope_event_t * const event_data =
-        (struct binary_c_new_common_envelope_event_t*) data;
-
-	/* information stored in the event data */
-    struct star_t * const donor = event_data-&gt;donor;
-    struct star_t * const accretor = event_data-&gt;accretor;
-
-	/* ... now do stuff with donor and accretor ... */</pre><br />
-</div>
-<h3 class="subsection" id='magicparlabel-6530'><span class="subsection_label">8.7</span> Timestepping<div id="subsec_Timestepping"></div>
-</h3>
-<div class="standard" id='magicparlabel-6531'>The <span class='math'>binary_c</i></span>
- timestepping algorithm aims to smoothly, but efficiently, evolve your binary-star systems in time while maintaining a reasonable level of accuracy. The subroutine <span class="flex_cfunction">stellar_timestep</span> sets the timestep for each star and/or the binary system as a whole. Usually, timesteps relate a change in variable <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math> to its time derivative <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>d</mi><mi>x</mi><mo>/</mo><mi>d</mi><mi>t</mi><mo>=</mo>
-   <mover>
-    <mrow><mi>x</mi>
-    </mrow><mo stretchy="true">&dot;</mo>
-   </mover>
-  </mrow>
- </mrow></mstyle></math> and perhaps also its second derivative <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mover>
-    <mrow><mi>x</mi>
-    </mrow><mo stretchy="true">&Dot;</mo>
-   </mover><mo>=</mo>
-   <msup>
-    <mrow><mi>d</mi>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msup><mi>x</mi><mo>/</mo><mi>d</mi>
-   <msup>
-    <mrow><mi>t</mi>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math>, such that the timestep related to process <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>i</mi>
- </mrow></mstyle></math> is, <math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mtable>
-  <mtr>
-   <mtd>
-    <mrow><mi> &delta; </mi>
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>t</mi>
-      </mrow>
-      <mrow><mi>i</mi>
-      </mrow>
-     </msub>
-    </mrow>
-   </mtd>
-   <mtd><mo>=</mo>
-   </mtd>
-   <mtd>
-    <mrow>
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>f</mi>
-      </mrow>
-      <mrow><mi>i</mi>
-      </mrow>
-     </msub>
-     <mfrac>
-      <mrow><mi>x</mi>
-      </mrow>
-      <mrow>
-       <mrow><mi>d</mi><mi>x</mi><mo>/</mo><mi>d</mi><mi>t</mi>
-       </mrow>
-      </mrow>
-     </mfrac><mspace width="6px" /><mo>,</mo>
-    </mrow>
-   </mtd>
-  </mtr>
- </mtable></mstyle></math>where the multipliers <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>f</mi>
-    </mrow>
-    <mrow><mi>i</mi>
-    </mrow>
-   </msub><mo> &ll; </mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math> to resolve changes in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>x</mi>
- </mrow></mstyle></math>. The smallest of the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>t</mi>
-    </mrow>
-    <mrow><mi>i</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> is then the recommended timestep for the star (and the smaller of the two for each star is usually the <span class='math'>binary_c</i></span>
- timestep). The physical processes are labelled by integers <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>i</mi>
- </mrow></mstyle></math> which are given human-readable macros (that you should use) in <span class="flex_headerfile">timestep.h</span> e.g.&nbsp;<span class="flex_cmacro">DT_LIMIT_BLUE_STRAGGLER</span> or <span class="flex_cmacro">DT_LIMIT_TPAGB_NUCSYN_INTERPULSE</span>. The default multipliers corresponding to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>f</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> are set in <span class="flex_cfunction">timestep_set_default_multipliers</span>. You can set the timestep multipliers through command-line arguments, e.g.&nbsp;<span class="flex_args">timestep_multiplier44</span> corresponds to <span class="flex_cmacro">DT_LIMIT_TIDES</span>, because in timestep.h we have <br />
-<pre class ='listings <i>C</i>'>#define DT_LIMIT_TIDES 44</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-6564'>If you want to know what is limiting the timestep, the easiest way is to uncomment the line<br />
-<pre class ='listings <i>C</i>'>#define ___LOGGING</pre><br />
-which is near the bottom of the <span class="flex_cfunction">stellar_timestep</span> function. This will output, on every timestep, the timestep for each star and which limiter gave the smallest timestep.</div>
-<h4 class="subsubsection" id='magicparlabel-6573'><span class="subsubsection_label">8.7.1</span> Fixed timesteps</h4>
-<div class="standard" id='magicparlabel-6574'>Often you will want to output at a given fixed timestep, e.g.&nbsp;every <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>M</mi><mi>y</mi><mi>r</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>. You can do this by added a macro to the list of fixed timesteps in timestep.h and increasing the NUMBER_OF_FIXED_TIMESTEPS by one to match, e.g.&nbsp;to have output every <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>M</mi><mi>y</mi><mi>r</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> after <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>10</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>M</mi><mi>y</mi><mi>r</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>, we call this scheme &ldquo;MEGAYEAR&rdquo;, in <span class="flex_headerfile">timestep.h</span> you should have something like,<br />
-<pre class ='listings <i>C</i>'>#define FIXED_TIMESTEP_YIELDS 0
-#define FIXED_TIMESTEP_MEGAYEAR 1 
-#define NUMBER_OF_FIXED_TIMESTEPS 2 </pre><br />
-then in <span class="flex_cfunction">setup_fixed_timesteps</span> define the properties of your fixed timestep scheme, e.g.,<br />
-<pre class ='listings <i>C</i>'>    t = &amp;stardata-&gt;model.fixed_timesteps[FIXED_TIMESTEP_MEGAYEAR]; 
-    t-&gt;enabled = TRUE; // enable it
-    t-&gt;begin = 10.0; // start at 10Myr
-    t-&gt;end = stardata-&gt;model.max_evolution_time; // end at the end of evolution
-    t-&gt;step = 1.0; // step is 1Myr
-    t-&gt;next = t-&gt;begin + t-&gt;step; // next should be at the start + 1 Myr
-    t-&gt;logarithmic = FALSE; // do not use logarithmic times
-    t-&gt;final = TRUE; // do log on the final timestep
-    t-&gt;previous_trigger = t-&gt;previous_test = t-&gt;begin; // set trigger</pre><br />
-You can also have fixed intervals of logarithmic time by settings <span class="flex_cvar">t-&gt;logarithmic</span> to <span class="flex_cmacro">TRUE</span>.</div>
-
-<h3 class="subsection" id='magicparlabel-6609'><span class="subsection_label">8.8</span> Code layout, header files, flow</h3>
-<div class="standard" id='magicparlabel-6610'><div id="subsec_Code_layout"></div>
-The code is split into a series of directories. Some header file information is in <a href="#subsec_Advanced_Configuration">9</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-6611'><span class="subsubsection_label">8.8.1</span> API</h4>
-<div class="standard" id='magicparlabel-6612'>You can build <i>binary_c</i> as a shared library, and enable the API interface. The functions which do this are in this directory.</div>
-<h4 class="subsubsection" id='magicparlabel-6613'><span class="subsubsection_label">8.8.2</span> batchmode</h4>
-<div class="standard" id='magicparlabel-6614'>The batch mode functions handle the use of <i>binary_c</i> as part of <i>binary_grid</i>. Essentially they are a loop wrapped around the evolution functions which also scans arguments passed from <i>binary_grid</i> as if they were command line arguments.</div>
-<h4 class="subsubsection" id='magicparlabel-6615'><span class="subsubsection_label">8.8.3</span> binary_star_functions</h4>
-<div class="standard" id='magicparlabel-6616'><div id="subsec_binary_star_functions"></div>
-This directory contains functions which deal with the binary system such as Roche-Lobe radius calculation, contact systems (<span class="flex_sourcefile">contact_system.c</span>), stellar mergers (<span class="flex_sourcefile">mix.c</span>) and common envelope evolution (<span class="flex_sourcefile">common_envelope_evolution.c</span>). </div>
-<h4 class="subsubsection" id='magicparlabel-6629'><span class="subsubsection_label">8.8.4</span> buffering</h4>
-<div class="standard" id='magicparlabel-6630'>These functions provide an interface with <em><i>binary_grid</i></em> that improves buffering and hence <em><i>binary_grid</i></em>'s performance. When you use the <span class="flex_cmacro">Printf</span> macro, rather than <span class="flex_programminglanguage">C</span>'s native <span class="flex_cfunction">printf</span> routine, you are using the routines in here to put data into a memory buffer which is then sent to <i>binary_grid</i> for processing and statistical analysis.</div>
-<h4 class="subsubsection" id='magicparlabel-6643'><span class="subsubsection_label">8.8.5</span> common_envelope</h4>
-<div class="standard" id='magicparlabel-6644'>Common envelope evolution is dealt with in here. At present there is only the <span class="flex_software">BSE</span> algorithm, but you could put your own in here too.</div>
-<h4 class="subsubsection" id='magicparlabel-6649'><span class="subsubsection_label">8.8.6</span> debug</h4>
-<div class="standard" id='magicparlabel-6650'>This contains various debugging functions, such as <span class="flex_cfunction">debug_fprintf</span> which is called when you put <span class="flex_cmacro">Dprint</span> statements into <i>binary_c</i>. The <span class="flex_cfunction">backtrace</span> functionality is also in this directory, as is the <span class="flex_cfunction">show_stardata</span> function which allows you to output, in a readable way, the contents of a <span class="flex_cstruct">stardata</span> structure. Given this you can compare one structure's contents to another quickly and easily.</div>
-<h4 class="subsubsection" id='magicparlabel-6671'><span class="subsubsection_label">8.8.7</span> disc</h4>
-<div class="standard" id='magicparlabel-6672'>Work in progress, please ask RGI for details.</div>
-<h4 class="subsubsection" id='magicparlabel-6673'><span class="subsubsection_label">8.8.8</span> envelope_intgeration</h4>
-<div class="standard" id='magicparlabel-6674'>Experimental code.</div>
-<h4 class="subsubsection" id='magicparlabel-6675'><span class="subsubsection_label">8.8.9</span> equation_of_state</h4>
-<div class="standard" id='magicparlabel-6676'>Experimental code.</div>
-<h4 class="subsubsection" id='magicparlabel-6677'><span class="subsubsection_label">8.8.10</span> events</h4>
-<div class="standard" id='magicparlabel-6678'>See section&nbsp;<a href="#subsec_Events">8.6</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-6679'><span class="subsubsection_label">8.8.11</span> evolution</h4>
-<div class="standard" id='magicparlabel-6680'><div id="subsec_evolution"></div>
-The time integration, i.e. evolution, of the binary system. This contains the logic flow of the <em><i>binary_c</i></em> code. Of interest to the general user are:</div>
-
-<ul class="itemize" id='magicparlabel-6681'><li class="itemize_item"><span class="flex_cfunction">evolve_system_binary_c</span> is the main time loop which sets up the system at its initiation, loops over time (at each timestep calling <span class="flex_cfunction">evolution</span>, see below) and then cleans up when things are all finished.</li>
-<li class="itemize_item"><span class="flex_cfunction">evolution</span> The main time-evolution function. This calls the appropriate integration scheme to further the binary system under investigation in time. The default scheme is forward-Euler, but Runge-Kutta 2nd and 4th order are also available. The function <span class="flex_cfunction">evolution_step</span> in turn, for all the schemes, calls the other parts of <i>binary_c</i> that do all the appropriate physics.</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-6699'><span class="subsubsection_label">8.8.12</span> file</h4>
-<div class="standard" id='magicparlabel-6700'>File input/output code. <i>binary_c</i> provides a custom file output routine which can limit output by size of the file, as well as output filtering routines.</div>
-<h4 class="subsubsection" id='magicparlabel-6701'><span class="subsubsection_label">8.8.13</span> galactic</h4>
-<div class="standard" id='magicparlabel-6702'>Experimental! A set of routines to calculate apparent and bolometric luminosities, and develop a model of galactic coordinates. It's not clear that we should be even doing this in <i>binary_c</i>&hellip;</div>
-<h4 class="subsubsection" id='magicparlabel-6703'><span class="subsubsection_label">8.8.14</span> libmemoize</h4>
-<div class="standard" id='magicparlabel-6704'>This is a copy of RGI's memoizing library <span class="flex_software">libmemoize</span>. The idea is that repeated calls to a function with the same arguments are automatically cached so that the function is actually only called once. Note: if you have <span class="flex_software">libmemoize</span> properly installed on your system, e.g. in <span class="flex_file"><span class="flex_envvar">$HOME</span>/lib</span> or <span class="flex_file">/usr/local/lib</span>, which is what you <em>should</em> do, then the installed version is used. The version in <i>binary_c</i> is a backup version only, and may lack the latest features.</div>
-<h4 class="subsubsection" id='magicparlabel-6725'><span class="subsubsection_label">8.8.15</span> librinterpolate</h4>
-<div class="standard" id='magicparlabel-6726'>This is a copy of RGI's <span class="flex_software">librinterpolate</span> linear interpolation library. If you have <span class="flex_software">librinterpolate</span> installed properly, e.g. in <span class="flex_file"><span class="flex_envvar">$HOME</span>/lib</span> or <span class="flex_file">/usr/local/lib</span>, which is what you should do, then the version in <i>binary_c</i> is ignored.</div>
-<h4 class="subsubsection" id='magicparlabel-6747'><span class="subsubsection_label">8.8.16</span> logging</h4>
-<div class="standard" id='magicparlabel-6748'><div id="subsec_logging"></div>
-Contains some functions used to output either to the screen or a file. Not very interesting but vital if you are to get anything out of <i>binary_c</i>.</div>
-
-<ul class="itemize" id='magicparlabel-6749'><li class="itemize_item"><span class="flex_cfunction">log_every_timestep</span> which is called every (successful) timestep to output the current state of the star. This is where you want to put your logging code! Please remember: when logging use the <span class="flex_cmacro">Printf</span> macro, not <span class="flex_programminglanguage">C</span>'s <span class="flex_cfunction">printf</span>-type function calls.</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-6766'><span class="subsubsection_label">8.8.17</span> maths</h4>
-<div class="standard" id='magicparlabel-6767'>Contains a selection of routines to do some mathematical tasks that are useful to <em><i>binary_c</i></em>, many of these routines are wrappers to <span class="flex_software">GSL</span> functions. There are not-a-number (NaN) checking routines, random number generators, a Kaps-Rentrop solver, a generic Brent minimizer, and the <span class="flex_cfunction">apply_derivative</span> function which is used by <span class="flex_cfunction">evolution</span> to integrate numerical derivatives at each timestep.</div>
-
-<ul class="itemize" id='magicparlabel-6780'><li class="itemize_item">Some of the code is experimental so probably not used.</li>
-<li class="itemize_item">Anything you put in this directory must be free and freely distributable software. There are no routines from <em>Numerical Recipes in <i>C</i></em> because these are not free software.</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-6782'><span class="subsubsection_label">8.8.18</span> memory</h4>
-<div class="standard" id='magicparlabel-6783'>In here reside <i>binary_c</i>'s memory allocation and freeing (garbage collection) routines.</div>
-<h4 class="subsubsection" id='magicparlabel-6784'><span class="subsubsection_label">8.8.19</span> misc</h4>
-<div class="standard" id='magicparlabel-6785'>Routines that don't go anywhere else. At the moment this contains nothing.</div>
-<h4 class="subsubsection" id='magicparlabel-6786'><span class="subsubsection_label">8.8.20</span> nucsyn</h4>
-<div class="standard" id='magicparlabel-6787'>See section&nbsp;<a href="#subsec_nucsyn">8.9</a>.</div>
-<h4 class="subsubsection" id='magicparlabel-6788'><span class="subsubsection_label">8.8.21</span> opacity</h4>
-<div class="standard" id='magicparlabel-6789'>Experimental.</div>
-<h4 class="subsubsection" id='magicparlabel-6790'><span class="subsubsection_label">8.8.22</span> orbit</h4>
-<div class="standard" id='magicparlabel-6791'>Routines which calculate orbital properties go in here.</div>
-<h4 class="subsubsection" id='magicparlabel-6792'><span class="subsubsection_label">8.8.23</span> perl</h4>
-<div class="standard" id='magicparlabel-6793'>Not strictly part of the <em><i>binary_c</i></em> <span class="flex_programminglanguage">C</span> source, but contains some useful <span class="flex_scriptinglanguage">Perl</span> modules (e.g.<em>&nbsp;<i>binary_grid</i></em>) and scripts.</div>
-<h4 class="subsubsection" id='magicparlabel-6802'><span class="subsubsection_label">8.8.24</span> python</h4>
-<div class="standard" id='magicparlabel-6803'><span class="flex_scriptinglanguage">Python</span> scripts, e.g. to access the API through <span class="flex_scriptinglanguage">Python</span>, are in here.</div>
-<h4 class="subsubsection" id='magicparlabel-6812'><span class="subsubsection_label">8.8.25</span> RLOF</h4>
-<div class="standard" id='magicparlabel-6813'><div id="subsec_RLOF"></div>
-This has functions which deal with dynamical timescale Roche lobe overflow. </div>
-
-<div class="standard" id='magicparlabel-6814'>First, there is the question of when <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>R</mi><mo>=</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>R</mi>
-    </mrow>
-    <mrow><mi>L</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>. Because of limited time resolution, if RLOF happens then it starts with <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>R</mi><mo> &gg; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>R</mi>
-    </mrow>
-    <mrow><mi>L</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> (the code overshoots the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>R</mi><mo>=</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>R</mi>
-    </mrow>
-    <mrow><mi>L</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> time). In the original <span class="flex_software">BSE</span> code, and still in <em><i>binary_c</i></em> if you set <span class="flex_envvar">RLOF_interpolation_method=RLOF_INTERPOLATION_BSE(=1)</span>, a Newton-like interpolation in time is performed to find <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>R</mi><mo>=</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>R</mi>
-    </mrow>
-    <mrow><mi>L</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> to within some threshold (usually 2%). However, this means taking <em>negative</em> timesteps, which plays havoc with logging and nucleosynthesis algorithms.</div>
-
-<div class="standard" id='magicparlabel-6823'>In the latest <em><i>binary_c</i></em>, a simpler (albeit slower) algorithm is used which rejects the evolution when <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>R</mi><mo> &gg; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>R</mi>
-    </mrow>
-    <mrow><mi>L</mi>
-    </mrow>
-   </msub><mn>.</mn>
-  </mrow>
- </mrow></mstyle></math> The previous <span class="flex_cstruct">stardata</span> is loaded over the current <span class="flex_cstruct">stardata</span>, and the timestep is halved. Evolution then continues until <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>R</mi><mo>=</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>R</mi>
-    </mrow>
-    <mrow><mi>L</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>, always with a positive timestep.</div>
-
-<div class="standard" id='magicparlabel-6832'>RLOF itself is followed according to one of a number of algorithms. First, the system is tested for the stability of RLOF (<span class="flex_cfunction">RLOF_stability_tests</span>). If RLOF is unstable, a merger or common envelope usually entails. Second, if the RLOF is stable, there are several methods for calculating the mass transfer rate. The formulaic approach assumes that for a given <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>R</mi><mo> &ge; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>R</mi>
-    </mrow>
-    <mrow><mi>L</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> there is a function, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <mover>
-    <mrow><mi>M</mi>
-    </mrow><mo stretchy="true">&dot;</mo>
-   </mover><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-   <mrow><mi>R</mi><mo>-</mo>
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>R</mi>
-     </mrow>
-     <mrow><mi>L</mi>
-     </mrow>
-    </msub>
-   </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-
-  </mrow>
- </mrow></mstyle></math>, which gives the mass transfer rate. This is numerically quite stable. The alternative <em>adpative</em> approach consists of iterating to find a solution to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>R</mi><mo>=</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>R</mi>
-    </mrow>
-    <mrow><mi>L</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>. This is more exact, but requires more calculation steps. Usually, the two methods give similar answers, but if mass transfer is particularly fast, e.g. in massive stars, this may not be the case.</div>
-<h4 class="subsubsection" id='magicparlabel-6837'><span class="subsubsection_label">8.8.26</span> <span style='font-family:monospace;font-size: 18px;'>setup</span></h4>
-<div class="standard" id='magicparlabel-6838'><div id="subsec_setup"></div>
-This sets the code up because <span class="flex_cfunction">set_up_variables</span> is called by the <span class="flex_cfunction">main</span> function. It reads in the command line arguments and sets them to variables.</div>
-
-<div class="standard" id='magicparlabel-6847'>The <span class="flex_cfunction">parse_arguments</span> function takes command line arguments and puts them into (in particular) the <span style='font-family:monospace;font-size: 18px;'>preferences</span> structure. This function is very useful if you want to put in your own arguments, which should go into <span class="flex_headerfile">cmd_line_args.h</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-6856'><span class="subsubsection_label">8.8.27</span> signals</h4>
-<div class="standard" id='magicparlabel-6857'><span class="flex_os">Unix</span>/<span class="flex_os">Linux</span> uses signals to communicate with running programs. Code in here allows you to catch signals, as well as catching (and trapping) segmentation faults which is very useful for debugging (e.g. with <span class="flex_software">gdb</span> and/or <span class="flex_software">valgrind</span>).</div>
-<h4 class="subsubsection" id='magicparlabel-6874'><span class="subsubsection_label">8.8.28</span> single_star_functions</h4>
-<div class="standard" id='magicparlabel-6875'>Many functions which only affect single star, or detached binary, evolution are in this directory.</div>
-<h4 class="subsubsection" id='magicparlabel-6876'><span class="subsubsection_label">8.8.29</span> spectra</h4>
-<div class="standard" id='magicparlabel-6877'>Functions in here link stars, through their temperature and luminosity, to spectra. At present only a blackbody spectrum is supported, but the algorithm for calculating the blackbody flux in regions of wavelength parameter space is fast and accurate.</div>
-<h4 class="subsubsection" id='magicparlabel-6878'><span class="subsubsection_label">8.8.30</span> stellar_colours</h4>
-<div class="standard" id='magicparlabel-6879'>This contains some routines to calculate stellar colours, which may or may not be reliable.</div>
-<h4 class="subsubsection" id='magicparlabel-6880'><span class="subsubsection_label">8.8.31</span> stellar_structure</h4>
-<div class="standard" id='magicparlabel-6881'><div id="subsec_stellar_structure"></div>
-Sets up a <span class="flex_cstruct">new_structure</span> struct, and passes this to the appropriate stellar structure calculation code. Currently only <span style='font-family:monospace;font-size: 18px;'>stellar_structure_BSE</span> is available, but in future different codes may arise.</div>
-
-<div class="standard" id='magicparlabel-6886'><span class="flex_cfunction">stellar_structure_BSE</span> is based on the <span class="flex_fortranfunction">hrdiag</span> function of <span class="flex_software">SSE/BSE</span>. It computes the stellar structure variables at a given time. In addition, it handles supernova explosions and kicks. Note that this functionality may eventually be removed from the stellar_structure directory.</div>
-<h4 class="subsubsection" id='magicparlabel-6899'><span class="subsubsection_label">8.8.32</span> stellar_timescales</h4>
-<div class="standard" id='magicparlabel-6900'>This set of functions calculates the timescales required by stellar_evolution, as in the <span class="flex_software">SSE/BSE</span> stellar evolution package (in which it is the function <span class="flex_fortranfunction">star.f</span>, and in <em><i>binary_c</i></em> V1.x it is <span class="flex_cfunction">calc_lum_and_evol_time</span> in <span class="flex_file">claet</span>).</div>
-<h4 class="subsubsection" id='magicparlabel-6917'><span class="subsubsection_label">8.8.33</span> string</h4>
-<div class="standard" id='magicparlabel-6918'>Functions to manipulate strings go in here, including <span class="flex_cfunction">binary_c_asprintf</span> (to replace asprintf if <span class="flex_software">Gnu</span> or <span class="flex_software">libbsd</span>'s version is not available) and <span class="flex_cfunction">chomp</span> (to remove newlines at the end of a string, identical to <span class="flex_scriptinglanguage">Perl</span>'s <span class="flex_perlcode">chomp</span>).</div>
-<h4 class="subsubsection" id='magicparlabel-6943'><span class="subsubsection_label">8.8.34</span> supernovae</h4>
-<div class="standard" id='magicparlabel-6944'>Functions which deal with supernovae, e.g.&nbsp;kicks, NS/BH mass as a function of progentior, etc. Note that supernovae are dealt with at the end of a timestep as an event (see section&nbsp;<a href="#subsec_Events">8.6</a>).</div>
-<h4 class="subsubsection" id='magicparlabel-6945'><span class="subsubsection_label">8.8.35</span> tables</h4>
-<div class="standard" id='magicparlabel-6946'>Various tables of data, used by <span class="flex_software">librinterpolate</span>, are included in <i>binary_c</i>. This directory contains the data for them and the various setup functions. In future, this data may be held elsewhere and its location accessed through an environment variable.</div>
-<h4 class="subsubsection" id='magicparlabel-6951'><span class="subsubsection_label">8.8.36</span> timers</h4>
-<div class="standard" id='magicparlabel-6952'>These are functions which start and stop the ticks counters. They are used to measure CPU time use, i.e.&nbsp;profiling of the code. Note that there are many ways to profile (including e.g.&nbsp;<span class="flex_software">cachegrind</span> and <span class="flex_software">callgrind</span>, functions of <span class="flex_software">valgrind</span>, and the ever reliable <span class="flex_software">gprof</span>).</div>
-<h4 class="subsubsection" id='magicparlabel-6969'><span class="subsubsection_label">8.8.37</span> timestep</h4>
-<div class="standard" id='magicparlabel-6970'>Routines for calculating the stellar timestep, see the function <span class="flex_cfunction">stellar_timestep</span> for details.</div>
-<h4 class="subsubsection" id='magicparlabel-6975'><span class="subsubsection_label">8.8.38</span> triple_star_functions</h4>
-<div class="standard" id='magicparlabel-6976'>Experimental! As the name suggests, these are functions to calculate the various physics in triple stars.</div>
-<h4 class="subsubsection" id='magicparlabel-6977'><span class="subsubsection_label">8.8.39</span> wind</h4>
-<div class="standard" id='magicparlabel-6978'>Routines for calculating the stellar wind loss rate. Note that the main function that calculates the wind mass-loss rate is actually in <span class="flex_file">src/single_star_functions/calc_stellar_wind_mass_loss.c</span> but that just calls <span class="flex_cfunction">wind_mass_loss_rate</span> which is in this directory.</div>
-<h4 class="subsubsection" id='magicparlabel-6987'><span class="subsubsection_label">8.8.40</span> zfuncs</h4>
-<div class="standard" id='magicparlabel-6988'><div id="subsec_zfuncs"></div>
-The so called &ldquo;metallicity functions&rdquo; of <span class="flex_software">BSE</span> i.e.&nbsp;the many fits to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>L</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>R</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'><mi>c</mi>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> etc.&nbsp;as a function of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>Z</mi>
- </mrow></mstyle></math> (and perhaps other parameters). These are lots of tiny functions which contain fitting formulae.</div>
-
-<div class="standard" id='magicparlabel-6993'>Lately I have added some new functions, such as <span class="flex_cfunction">mc_1DUP</span> (the core mass at which first dredge up occurs), <span class="flex_cfunction">fphase</span> (the fractional age in a given stellar evolution phase), <span class="flex_cfunction">rwd</span> and <span class="flex_cfunction">lwd</span> (radius and luminosity of a white dwarf) etc. This seems a reasonable location for storing small, useful functions.</div>
-
-<div class="standard" id='magicparlabel-7010'>Please note that I have optimized these functions to the hilt because they are called very often.</div>
-<h3 class="subsection" id='magicparlabel-7011'><span class="subsection_label">8.9</span> nucsyn</h3>
-<div class="standard" id='magicparlabel-7012'><div id="subsec_nucsyn"></div>
-The nucleosynthesis functions are in a directory of their own. It contains the functions which deal with the nucleosynthesis part of the code which runs in parallel to <span class="flex_software">SSE/BSE</span>. That is <em>not</em> to say that all the nucleosynthesis is done here, but most of it is.</div>
-
-<div class="standard" id='magicparlabel-7017'>To enable nucleosynthesis in the code you must</div>
-
-<div class="standard" id='magicparlabel-7018'><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings <i>C</i>'>#define NUCSYN</pre><br />
-</span></div>
-
-<div class="standard" id='magicparlabel-7023'>somewhere, usually in <span class="flex_headerfile">binary_c_parameters.h</span> (which gets included in <span class="flex_headerfile">binary_c_macros.h</span> so <span class="flex_headerfile">nucsyn.h</span> – you should include <span class="flex_headerfile">nucsyn.h</span> in every nucsyn library file). It is vitally important that if you add anything to the nucleosynthesis code you enclose it in something like</div>
-
-<div class="standard" id='magicparlabel-7040'><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings <i>C</i>'>#ifdef NUCSYN
-...
-#endif /* NUCSYN */</pre><br />
-</span></div>
-
-<div class="standard" id='magicparlabel-7047'>so that if nucleosynthesis is not required it can be turned off.</div>
-
-<div class="standard" id='magicparlabel-7048'>There are then further options in <span class="flex_headerfile">nucsyn_parameters.h</span> (see section <a href="#subsec_Advanced_Configuration">9</a>).</div>
-
-<div class="standard" id='magicparlabel-7053'>NOTE! <em>Every function in the nucsyn library has</em> <span class="flex_cfunction">nucsyn</span> <em>prepended to the function name - please maintain this convention!</em></div>
-<h4 class="subsubsection" id='magicparlabel-7058'><span class="subsubsection_label">8.9.1</span> Header files and isotope arrays</h4>
-<div class="standard" id='magicparlabel-7059'><div id="subsec_Header_files_and_isotope_arrays"></div>
-All abundances are stored as mass fractions when the array is called <span style='font-family:monospace;font-size: 18px;'>X&hellip;</span>, number densities are referred to as <span style='font-family:monospace;font-size: 18px;'>N&hellip;</span>. The index for each array ranges from <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0</mn>
- </mrow></mstyle></math> to <span class="flex_cmacro">ISOTOPE_ARRAY_SIZE</span> which is defined in <span class="flex_headerfile">nucsyn_isotopes.h</span> however you should <em>NEVER</em> manually access the array by number, e.g.<span style='font-family:monospace;font-size: 18px;'>&nbsp;<br />
-<pre class ='listings'>X[0]=0.5;</pre><br />
-</span>you should use the predefined macros referring to each isotope in <span class="flex_headerfile">nucsyn_isotopes.h</span> and <span class="flex_headerfile">nucsyn_isotope_list.h</span>. For example, <span class="flex_cmacro">XC12</span> is defined like this<div class="foot"><span class="foot_label">11</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-7087'>Actually, in a modern <i>binary_c</i>, it is defined to be one more than the previous isotope. This is just an integer, of course, and you don't care what that integer is.</div>
-</div></div>,</div>
-
-<div class="standard" id='magicparlabel-7088'><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings'>#define XC12 2</pre><br />
-</span>so the second isotope in the array is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>12</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'><mi>C</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>. All the others are defined similarly. To access the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>12</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'><mi>C</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> abundance you should then use <br />
-<pre class ='listings'>X[XC12]=0.5;
-/* or, similarly */
-N[XC12]=1e-8;</pre><br />
- Perhaps also useful for you is <span class="flex_cmacro">ISOTOPE_MEMSIZE</span> which is just the size (in bytes) of the abundance array.</div>
-
-<div class="standard" id='magicparlabel-7103'>Why is this an advantage? It is very useful to be able to pull isotopes out which are not of interest (this speeds up the code) without breaking all the others, the historical development of the code (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>1</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'><mi>H</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>4</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'>
-    <mrow><mi>H</mi><mi>e</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> and CNO came first) is not a problem and the addition of new nuclei is easy (but remember section <a href="#subsec_Setup_functions">8.9.2</a>). It also makes the code <em>bloody easy to read</em> since it is painfully obvious which isotope you are referring to! This is important late at night after too much coffee (or other drink!).</div>
-<h4 class="subsubsection" id='magicparlabel-7104'><span class="subsubsection_label">8.9.2</span> Setup functions</h4>
-<div class="standard" id='magicparlabel-7105'><div id="subsec_Setup_functions"></div>
-<span class="flex_cfunction">nucsyn_set_nuc_masses</span> sets the nuclear masses (in grams) and atomic numbers. If you add an isotope to <span class="flex_headerfile">nucsyn_isotopes.h</span> (see section <a href="#subsec_Header_files_and_isotope_arrays">8.9.1</a>) you <em>MUST</em> change this function to set the nuclear mass or atomic number. If you do not then the number will be undefined and strange things will happen even though your nice new code looks fine (and <span class="flex_software">valgrind</span> will immediately fail because you'll be reading from undefined memory).</div>
-
-<div class="standard" id='magicparlabel-7118'><span class="flex_cfunction">nucsyn_initial_abundances</span> is obviously important because it defines your initial abundance mix, usually as a function of the metallicity.</div>
-<h4 class="subsubsection" id='magicparlabel-7123'><span class="subsubsection_label">8.9.3</span> First and Second Dredge-up</h4>
-<div class="standard" id='magicparlabel-7124'><div id="subsec_First_and_Second_DUP"></div>
-First and second dredge-up are handled by the functions <span class="flex_cfunction">nucsyn_set_1st_dup_abunds</span> and <span class="flex_cfunction">nucsyn_set_2nd_dup_abunds</span> which perturb the surface abundances. There may be problems in binaries because the evolution is different to single stars, but I try to take this into account by scaling the CNO abundances to whatever the stellar CNO abundance is. Thanks to Evert Glebbeek and Richard Stancliffe for helping out with this, the results will be published in one of our CEMP papers soon.</div>
-<h4 class="subsubsection" id='magicparlabel-7133'><span class="subsubsection_label">8.9.4</span> TPAGB functions (3rd dredge-up and HBB)</h4>
-<div class="standard" id='magicparlabel-7134'><div id="subsec_TPAGB_functions"></div>
-The first section of the library to be written was the synthetic TPAGB evolution (see <a href='#LyXCite-Izzard_et_al_2003b_AGBs'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2004</span></a>). This is controlled by the function <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_tpagb</span></span></span>. The function determines whether the next thermal pulse has been reached by the star and if so it does third dredge-up (and perhaps there's some hot-bottom burning [HBB]).</div>
-
-<div class="standard" id='magicparlabel-7139'>On the first pulse (when the function is first called for the star, actually if <br />
-<pre class ='listings <i>C</i>'>num_thermal_pulses &lt; 0</pre><br />
-, which is the case for any stellar type other than TPAGB) the function <span class="flex_cfunction">nucsyn_init_first_pulse</span> is called which sets a few things like the interpulse period and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mi>c</mi><mo>,</mo><mi>m</mi><mi>i</mi><mi>n</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> for dredge-up.</div>
-
-<div class="standard" id='magicparlabel-7148'>For subsequent timesteps the <span class="flex_cfunction">nucsyn_tpagb function</span> calls <span class="flex_cfunction">nucsyn_tpagb_H_shell_burn</span> to burn the hydrogen shell during the interpulse period and save the amount of core mass growth <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo> &Delta; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'><mi>c</mi>
-     </mstyle>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>. </div>
-
-<div class="standard" id='magicparlabel-7157'>There is then a check to see if the star is hot enough for HBB – this is done by fitting the temperature (see <span class="flex_cfunction">nucsyn_set_hbb_conditions</span>, <span class="flex_cfunction">nucsyn_hbbtmax</span> and <span class="flex_cfunction">nucsyn_tpagb_rhomax</span>) to mass and metallicity. If so the <span class="flex_cfunction">nucsyn_hbb</span> function is called. The free parameters associated with HBB (<a href='#LyXCite-Izzard_et_al_2003b_AGBs'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2004</span></a>) are set in <span class="flex_cfunction">nucsyn_set_tpagb_free_parameters</span> (these are the burn times, mixing fractions etc.).</div>
-
-<div class="standard" id='magicparlabel-7178'>If the next pulse is reached then <span class="flex_cfunction">nucsyn_third_dredge_up</span> is called to deal with third dredge-up. This dredges up a mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &lambda; </mi><mo> &times; </mo><mo> &Delta; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'><mi>c</mi>
-     </mstyle>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> and mixes it with the envelope. The abundances of the dredged-up material are set in <span class="flex_cfunction">nucsyn_set_third_dredgeup_abunds</span> (and <span class="flex_cfunction">nucsyn_s_process for s-process</span> elements).</div>
-
-<div class="standard" id='magicparlabel-7191'>Version 1.2 of <i>binary_c</i> included an option to evolve &ldquo;super AGB&rdquo; (STPAGB) stars but this has since been deprecated.</div>
-<h4 class="subsubsection" id='magicparlabel-7192'><span class="subsubsection_label">8.9.5</span> Hot-Bottom Burning</h4>
-<div class="standard" id='magicparlabel-7193'><div id="subsec_Hot_Bottom_Burning"></div>
-While this sounds painful, really it's not! HBB is the process where the convective zone in a TPAGB star reaches down into the hydrogen burning shell. This occurs in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>4</mn><mo>-</mo><mn>8</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> stars (for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>Z</mi><mo>=</mo><mn>0.02</mn>
-  </mrow>
- </mrow></mstyle></math>, lower masses for lower metallicity). I have two burning routines which can deal with this:</div>
-
-<ol class="enumerate" id='magicparlabel-7194'><li class="enumerate_item">The original analytic routine. This uses analytic solutions to the CN, ON, NeNa and MgAl cycles, together with some approximate fudges to join them into the CNO and NeNaMgAl cycles, to solve for the abundances. This is fast but sometimes, when used outside the range of the approximations, <em>very</em> unstable.</li>
-<li class="enumerate_item">The new numerical solver. This uses a 4th-order implict (Kaps-Rentrop) scheme to solve for the abundances as a function of time. It does <em>not</em> depend on approximations, and currently burns the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>p</mi><mi>p</mi>
-  </mrow>
- </mrow></mstyle></math>-chain, CNO cycles (hot or cold) and the full NeNa/MgAl chains/cycles. In theory it can be extended to any nuclear network (although it is designed for small networks – it will get very slow with larger networks). It turns out that, after much code optimization, the numerical solver is about as fast as the analytic solver! I think this is because to solve numerically requires additions, subtractions, multiplications and divisions, while analytic solutions require lots of exponentials. However, whether the numerical solver quickly converges on a result depends on the initial timestep. Be careful with that, I have a number of schemes which can improve this.</li>
-</ol>
-<h4 class="subsubsection" id='magicparlabel-7196'><span class="subsubsection_label">8.9.6</span> nucsyn_WR</h4>
-<div class="standard" id='magicparlabel-7197'><div id="subsec_nucsyn_WR"></div>
-This is a set of phenomenological fits to Lynnette Dray's models for massive stars and helium star remnants. It is self-contained (see the details above and in the function) and contains useful stuff regarding logging of O/B and WR stars. I recently updated it to use tabular lookups instead of fitting functions. </div>
-
-<div class="standard" id='magicparlabel-7198'>The latest version includes tables from Richard Stancliffe which follow all isotopes, not just elemental CNO and H, He. Thanks Richard!</div>
-<h4 class="subsubsection" id='magicparlabel-7199'><span class="subsubsection_label">8.9.7</span> The <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>r</mi>
- </mrow></mstyle></math>-process</h4>
-<div class="standard" id='magicparlabel-7200'><div id="subsec_The_r_process"></div>
-I have included some yields from <a href='#LyXCite-1999ApJ___525__886A'><span class="bib-abbrvciteauthor">Arlandini et al.</span></a> (<span class="bib-year">1999</span>) and <a href='#LyXCite-2004ApJ___617_1091S'><span class="bib-abbrvciteauthor">Simmerer et al.</span></a> (<span class="bib-year">2004</span>) which you can activate with the appropriate define in <span class="flex_headerfile">nucsyn_parameters.h</span>. This code has <em>not been well tested</em> so beware!</div>
-<h4 class="subsubsection" id='magicparlabel-7205'><span class="subsubsection_label">8.9.8</span> Winds and Mixing</h4>
-<div class="standard" id='magicparlabel-7206'><div id="subsec_Winds_and_Mixing"></div>
-Colliding winds and the like are a complicated business! <span class="flex_cfunction">nucsyn_update_abundances</span> is called when to deal with this. The function is well commented so for details please refer to it but briefly it takes the wind loss from each star and the amount of that accreted by the companion, determines whether the accreted matter should reach the surface (by the factor set in <span class="flex_cfunction">nucsyn_choose_wind_mixing_factor</span>) or not and if so mixes it in or makes a new accretion layer on the surface. It also yields the wind loss by a call to <span class="flex_cfunction">nucsyn_calc_yields</span> and the mass accreted by a similar call but with a negative number. Note: mass is removed from the surface of the star by the function <span class="flex_cfunction">nucsyn_remove_dm_from_surface</span> so that it is preferentially removed from the accretion layer rather than the stellar envelope. Convective stars have no accretion layer, if one is present a call to <span class="flex_cfunction">nucsyn_mix_accretion_layer_and_envelope</span> soon removes it.</div>
-<h4 class="subsubsection" id='magicparlabel-7227'><span class="subsubsection_label">8.9.9</span> Explosions (supernovae and novae)</h4>
-<div class="standard" id='magicparlabel-7228'><div id="subsec_Explosions"></div>
-Supernova yields are looked up in tables and yielded in <span class="flex_cfunction">nucsyn_sn_yield</span>. Nova ejecta are calculated in <span class="flex_cfunction">nucsyn_set_nova_abunds</span>.</div>
-<h4 class="subsubsection" id='magicparlabel-7237'><span class="subsubsection_label">8.9.10</span> Yield calculations</h4>
-<div class="standard" id='magicparlabel-7238'><div id="subsec_Yield_calculations"></div>
-The calls to <span class="flex_cfunction">nucsyn_calc_yields</span> modify the arrays <span class="flex_cvar">Xyield</span> in the star structures. These contain the mass of material of each isotope lost by the star, so if <span class="flex_cfunction">nucsyn_calc_yields</span> is called for (say) wind loss by an amount <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>m</mi>
-  </mrow>
- </mrow></mstyle></math> with abundances <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>X</mi>
-   </mrow>
-   <mrow><mi>i</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> then the amount of mass lost as isotope <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>i</mi>
- </mrow></mstyle></math> is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>m</mi><mo> &times; </mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>X</mi>
-    </mrow>
-    <mrow><mi>i</mi>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> which is added to the appropriate <span class="flex_cvar">Xyield</span> array item <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>i</mi>
- </mrow></mstyle></math>. This is a simple definition for single stars but gets complicated in binaries because wind/RLOF accretion takes place. In that case the same <span class="flex_cfunction">nucsyn_calc_yields</span> function is called but for a negative mass <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo>-</mo><mi> &delta; </mi><mi>m</mi>
-  </mrow>
- </mrow></mstyle></math>. In this way <em>mass is conserved</em> because the other star yields the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &delta; </mi><mi>m</mi>
-  </mrow>
- </mrow></mstyle></math> (or perhaps more mass if some is lost from the system). The total mass lost from the system is then just the sum of the <span class="flex_cvar">Xyield</span> for both stars. </div>
-
-<div class="standard" id='magicparlabel-7263'>The array <span class="flex_cvar">mpyield</span> stores the values of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow>
-    <mrow>
-     <mstyle mathvariant='normal'><mi>m</mi>
-     </mstyle><mo>,</mo><mi>i</mi>
-    </mrow>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, the enhancement of isotope <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>i</mi>
- </mrow></mstyle></math> relative to the ZAMS abundance and divided by the initial mass (note use <span class="flex_cvar">pms_mass</span> not <span style='font-family:monospace;font-size: 18px;'>ZAMS_mass</span> since the latter is redefined by accretion processes).</div>
-
-<div class="standard" id='magicparlabel-7272'>Binary system yields are easy to calculate because they are just the sum of both stars' yields, this is done in <span class="flex_cfunction">nucsyn_binary_yield</span>. The appropriate <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'><mi>m</mi>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> yields are more difficult to define but there is an attempt. </div>
-<h4 class="subsubsection" id='magicparlabel-7277'><span class="subsubsection_label">8.9.11</span> Logging and minor functions</h4>
-<div class="standard" id='magicparlabel-7278'><div id="subsec_Logging_and_minor_functions"></div>
-There are numerous logging functions for debugging and general pretty-picture-manufacture, e.g. <span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_log</span></span>, <span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_long_log</span></span>, <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_short_log</span></span></span>, <span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_j_log</span></span>. Most of these are activated or deactivated in <span class="flex_headerfile">nucsyn_log.h</span>. Other minor functions: <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_totalX</span></span></span> calculates the total mass fraction (or actually the total sum of array elements), <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_square_bracket</span></span></span> calculates an abundance in &ldquo;square bracket notation&rdquo; by mass fraction (should it be by number?); <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_mix_shells</span></span></span> mixes two isotope arrays together (very useful!) there are the other mixing functions <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_dilute_shell</span></span></span> and <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_dilulte_shell_to</span></span></span> which are similarly useful; <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_radioactive_decay</span></span></span> decays a few isotopes – it is by no means exhaustive, there may be other isotopes you wish to place in here but it's easy to extend; <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_mole_fraction</span></span></span> converts an array of mass fractions to mole fractions, perhaps useful for the square bracket logging?</div>
-<h4 class="subsubsection" id='magicparlabel-7327'><span class="subsubsection_label">8.9.12</span> Other stellar remnants</h4>
-<div class="standard" id='magicparlabel-7328'><div id="subsec_Other_stellar_remnants"></div>
-Some stellar types are not dealt with by nucleosynthesis. There include WDs (<span style='font-family:monospace;font-size: 18px;'>nucsyn_set_WD_abunds</span>), which are assumed to: <span class="flex_cmacro">HeWD</span> 100% <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>4</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'>
-    <mrow><mi>H</mi><mi>e</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>, <span class="flex_cfunction">COWD</span> 80% <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>12</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'><mi>C</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> and 20% <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>16</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'><mi>O</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> while <span class="flex_cmacro">ONeWD</span> 80% <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>16</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'><mi>O</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> and 20% <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>20</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'>
-    <mrow><mi>N</mi><mi>e</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>. This could be improved (to take into account, say, the heavier metals) but note that any accretion onto the surface from a non-degenerate companion will mask the above abundances (since an accretion layer will form on the surface unless there are novae) and the business of accretion onto WDs is very complicated indeed.</div>
-
-<div class="standard" id='magicparlabel-7341'>NSs and BHs are remnants with their abundances set in <span style='font-family:monospace;font-size: 18px;'><span class="flex_cfunction"><span style='font-family:monospace;font-size: 18px;'>nucsyn_set_remnant_abunds</span></span></span> are assumed to be all neutrons with<span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings <i>C</i>'>Xsurf[Xn]=1.0;</pre><br />
-</span></div>
-<h3 class="subsection" id='magicparlabel-7350'><span class="subsection_label">8.10</span> Coding style</h3>
-<div class="standard" id='magicparlabel-7351'><i>binary_c</i> <i>C</i> code follows a particular style to which you should adhere.</div>
-
-<ul class="itemize" id='magicparlabel-7352'><li class="itemize_item">Please use the <a href="https://en.wikipedia.org/wiki/Indentation_style#Allman_style">Allman style</a> </li>
-<li class="itemize_item">Indent with four spaces (<a href="https://www.gnu.org/software/emacs/">emacs</a> indents <span class="flex_programminglanguage">C</span> like this automatically).</li>
-</ul>
-<h4 class="subsubsection" id='magicparlabel-7358'><span class="subsubsection_label">8.10.1</span> Macros</h4>
-<div class="standard" id='magicparlabel-7359'>C preprocessor macros are a very powerful way to make code more readable, or less, depending on their use, hence <i>binary_c</i> has strict rules for their use.</div>
-
-<ul class="itemize" id='magicparlabel-7360'><li class="itemize_item">Macros used as flags should use <span class="flex_cmacro">CAPTIALS</span> and, when used in <span class="flex_cmacro">#ifdef &hellip; #endif</span> pairs, you should include a comment at the end of the pair to say specify the opening macro, for example. <br />
-<pre class ='listings'>#define FLAG_MACRO
-
-
-#ifdef FLAG_MACRO
-
-... do stuff 
-
-#endif // FLAG_MACRO</pre><br />
-</li>
-<li class="itemize_item">Constant macros should use upper case, e.g.,<br />
-<pre class ='listings'>#define CONSTANT_MACRO 3</pre><br />
-</li>
-<li class="itemize_item">Macro functions should be named with the first character in upper case, the rest in lower case, and when you address arguments remember to wrap them in parentheses, e.g.,<br />
-<pre class ='listings'>#define Pow2(X) ((X)*(X))
-#define Other_star(K) ((K)==0 ? 1 : 0) </pre><br />
-exceptions to this are the macros used for stellar types, <span class="flex_cmacro">PRINTF</span> which is just mapped to <span class="flex_cmacro">Printf</span> for backward compatibility, and macros such as <span class="flex_cmacro">likley</span> and <span class="flex_cmacro">unlikley</span> which are kept in lower case to match external code (in this case the <span class="flex_os">Linux</span> kernel).</li>
-<li class="itemize_item">Macros which are used only locally, and variables used in macro expressions, should be prefixed with two underscores</li>
-</ul>
-<h3 class="subsection" id='magicparlabel-7412'><span class="subsection_label">8.11</span> Control scripts</h3>
-<div class="standard" id='magicparlabel-7413'><div id="subsec_Control_scripts"></div>
-I have a number of control scripts written in <span class="flex_scriptinglanguage">Perl</span>  which test the code and output graphs and data for e.g. AGB stars and WR stars (to compare to full evolution models), stellar yields etc. There might be some documentation here eventually&hellip; it all depends on whether you prefer writing your own scripts (that way you'll learn how it all works) or just having a black-box that works (you can always look at the source code).</div>
-
-<div class="standard" id='magicparlabel-7418'>A very useful script is <span class="flex_bashscript">zipup</span> which makes a file <span class="flex_file"><i>binary_c</i>.zip</span> containing this manual and all the source code. See also <span class="flex_perlscript">grid.pl</span>.</div>
-
-<div class="standard" id='magicparlabel-7431'><br />
-</div>
-<h2 class="section" id='magicparlabel-7432'><span class="section_label">9</span> Advanced Configuration</h2>
-<div class="standard" id='magicparlabel-7433'><div id="subsec_Advanced_Configuration"></div>
-</div>
-
-<div class="standard" id='magicparlabel-7434'>There are three main <i>C</i> header files which affect how the <i>binary_c</i> code is built: <span class="flex_headerfile">binary_c_code_options.h</span>, <span class="flex_headerfile">binary_c_parameters.h</span> and <span class="flex_headerfile">nucsyn/nucsyn_parameters.h</span>. Some low-level configuration is also performed by the <span class="flex_software">Meson</span> build process.</div>
-<h3 class="subsection" id='magicparlabel-7451'><span class="subsection_label">9.1</span> Meson configuation</h3>
-<div class="standard" id='magicparlabel-7452'>When you change something in <span class="flex_headerfile">binary_structures.h</span>, or one of the other header files, you may have to reconfigure <span class="flex_software">Meson</span> because this in turn reruns <span class="flex_perlscript">make_showstruct.pl</span> which builds code to show the contents of <span class="flex_cstruct">stardata_t</span> structures.</div>
-<h3 class="subsection" id='magicparlabel-7469'><span class="subsection_label">9.2</span> <i>binary_c</i>-config<div id="subsec_binary_c_config"></div>
-</h3>
-<div class="standard" id='magicparlabel-7470'>Many <em><span class="flex_os"><em>Unix</em></span>-</em>type commands have an associated <span class="flex_command">*-config</span> command which gives details of their build flags, version, build date etc. As of recently, so does <i>binary_c</i>, so you can run,</div>
-
-<div class="standard" id='magicparlabel-7479'><br />
-<pre class\s*='listings bash'>$ <i>binary_c</i>-config help</pre><br />
-to see the available flags, which at the time of writing are<br />
-<pre class ='listings'>--cflags        Show the flags which were used to build <i>binary_c</i> (same as --flags)
---libs          Show library linking information
---libs_list     Show library linking information as a space-separated list without -l
---help          Show this help and exit
---version       Show <i>binary_c</i>'s version string.
---cc            Show the <i>C</i> compiler used to build <i>binary_c</i>
---cc_version    Show the version of the <i>C</i> compiler used to build <i>binary_c</i>
---ld            Show the linker used to build <i>binary_c</i>
---ldd           Show <i>binary_c</i>'s dependencies
---incdirs       Show <i>binary_c</i>'s include dirs (for header files)
---incdirs_list  Show <i>binary_c</i>'s include dirs (for header files) as a space-separated list without -I
---libdirs       Show <i>binary_c</i>'s library search directories during build
---libdirs_list  Show <i>binary_c</i>'s library search directories during build as a space separated list without -L
---git_url       Show the URL of <i>binary_c</i>'s git source (if available)
---git_branch    Show the git branch being used (if available)
---git_revision  Show the revision of <i>binary_c</i>'s git source (if available)
---svn_url       Show the URL of <i>binary_c</i>'s svn source (if available)
---svn_revision  Show the revision of <i>binary_c</i>'s svn source (if available)
---build_date    Show the date and time of <i>binary_c</i>'s build
---define_macros Show macros defined by -D... in the CFLAGS
---undef_macros  Show macros undefined by -U... in the CFLAGS</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-7508'>note that the double minus sign is optional (it can be one minus, or none). For example,<br />
-<pre class ='listings'>$ <i>binary_c</i>-config define_macros
--DALIGNSIZE=16 -DCPUFREQ=3500 -DLINUX -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DGIT_REVISION=4132:20190711:e754a8a7 -DGIT_URL=gitlab@gitlab.eps.surrey.ac.uk:ri0005/<i>binary_c</i>.git -DGIT_BRANCH=izzard-discs -D__HAVE_AVX__ -D__HAVE_DRAND48__ -D__HAVE_GSL__ -DUSE_GSL -D__HAVE_LIBBACKTRACE__ -D__HAVE_LIBBFD__ -D__HAVE_LIBBSD__ -D__HAVE_LIBIBERTY__ -D__HAVE_LIBMEMOIZE__ -D__HAVE_MALLOC_H__ -D__HAVE_PKG_CONFIG__ -D__HAVE_VALGRIND__ -D__SHOW_STARDATA__  
-
-$ <i>binary_c</i>-config version
-2.0pre32
-
-$ <i>binary_c</i>-config cflags
--DALIGNSIZE=16   -fPIC -Wall -Wstrict-prototypes -O3   -mtune=native -march=native  -DCPUFREQ=3500  -DLINUX  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -frounding-math -fsignaling-nans -fno-finite-math-only -fno-stack-protector -ffloat-store -fno-fast-math  -DGIT_REVISION=4132:20190711:e754a8a7 -DGIT_URL=gitlab@gitlab.eps.surrey.ac.uk:ri0005/<i>binary_c</i>.git -DGIT_BRANCH=izzard-discs  -D__HAVE_AVX__  -mavx  -D__HAVE_DRAND48__  -D__HAVE_GSL__  -DUSE_GSL  -I/home/izzard/include  -D__HAVE_LIBBACKTRACE__  -D__HAVE_LIBBFD__  -D__HAVE_LIBBSD__  -D__HAVE_LIBIBERTY__  -D__HAVE_LIBMEMOIZE__  -D__HAVE_MALLOC_H__  -D__HAVE_PKG_CONFIG__  -D__HAVE_VALGRIND__  -D__SHOW_STARDATA__     -mtune=native  -ffunction-sections  -mtune=native -march=native  -fsignaling-nans -fno-finite-math-only  -fsignaling-nans -fno-finite-math-only</pre><br />
-</div>
-
-<div class="standard" id='magicparlabel-7520'>The <i>binary_grid</i> <span class="flex_scriptinglanguage">Perl</span> module makes extensive use of <span class="flex_bashscript"><i>binary_c</i>-config</span> to determine which flags it should use to build its <span class="flex_programminglanguage">C</span> interface to <i>libbinary_c</i>.</div>
-
-<div class="standard" id='magicparlabel-7533'>Note that the <span class="flex_command"><i>binary_c</i>-config</span> tool is actually a <span class="flex_scriptinglanguage">bash</span> script that requires <i>binary_c</i> to be built, and working tools such as <span class="flex_command">grep</span>, <span class="flex_command">tr</span>, <span class="flex_command">sed</span> and <span class="flex_command">ldd</span>. These are standard tools on most <span class="flex_os">Unix</span> systems.</div>
-<h3 class="subsection" id='magicparlabel-7562'><span class="subsection_label">9.3</span> Makefile -D&hellip;</h3>
-<div class="standard" id='magicparlabel-7563'>Some options are set up by <span class="flex_software">Meson</span><em> </em>and passed<em> </em>as <span class="flex_args">-D&hellip;</span> arguments to the compiler:</div>
-
-<ul class="itemize" id='magicparlabel-7572'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LINUX</span> is defined if you're running <span class="flex_os">Linux</span>. This is useful for some timers and segfault catchers which only work with the <span class="flex_os">Linux</span> libraries.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LARGEFILE_SOURCE</span> and <span style='font-family:monospace;font-size: 18px;'>FILE_OFFSET_BITS</span> were once useful for large output files on 64-bit machines (&gt;2GB). This may no longer be a problem but they do not hurt.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CPUFREQ</span> is the frequency of your CPU (in Mhz) – this is very useful for timing information. (Taken from <span class="flex_file">/proc/cpuinfo</span> if available, <span class="flex_command">sysctl -a</span> on MacOS/Darwin) </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>GIT_REVISION</span> and <span style='font-family:monospace;font-size: 18px;'>GIT_URL</span> provide <em><i>binary_c</i></em> with information about the version of the code you are using. This can prove essential when debugging. See section&nbsp;<a href="#subsec_git_revision">11.17</a> for more details. </li>
-</ul>
-<h3 class="subsection" id='magicparlabel-7592'><span class="subsection_label">9.4</span> binary_c_code_options.h</h3>
-<div class="standard" id='magicparlabel-7593'><div id="subsec_binary_c_code_options_h"></div>
-This contains <em>non-physics</em> options. You probably do not want to change this file unless you have compilation problems or you want to optimize the code (even more!). The options are the following (in the order given in the file)</div>
-
-<ul class="itemize" id='magicparlabel-7594'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SEGFAULTS</span> This should be set if want segfaults on a code failure. This is useful if you are debugging with gdb.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ACML</span> should be set if you wish to use the AMD math (sic) library. Note: this has not been tested for a long time.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DUMA</span> should be set if you wish to use the DUMA memory checking library. Note: this has not been tested for a long time.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DEBUG</span> is either zero (<span style='font-family:monospace;font-size: 18px;'>0</span>) or one (<span style='font-family:monospace;font-size: 18px;'>1</span>). All debugging statements should use the <span style='font-family:monospace;font-size: 18px;'>Dprint</span> function instead of the standard <i>C</i>-library function <span style='font-family:monospace;font-size: 18px;'>printf</span>. If <span style='font-family:monospace;font-size: 18px;'>DEBUG</span> is zero, then the compiler should never build the debug statements into the code (modern compilers will behave in this way). However, if in doubt enable the <span style='font-family:monospace;font-size: 18px;'>DISABLE_DPRINT</span> option.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>COMPARE_FORTRAN</span> activates a number of extra print statements for comparison with a version of Jarrod's <i>FORTRAN</i> code I have lying around. It's probably of little interest to you.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LOGGING</span> Enables logging, you want this otherwise what is the point in running the code?</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>FASTEST</span> Makes things a little faster, or used to. I am not sure it does now&hellip;</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>BATCHMODE</span> Enables the interactive batch mode. You should compile this in because the grid.pl script (which makes populations of stars) uses it. </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>TIMEOUT_SECONDS</span> Every time the code is run, a timer is set. If this is not reset within <span style='font-family:monospace;font-size: 18px;'>TIMEOUT_SECONDS</span> seconds, <em><i>binary_c</i></em> is deliberately crashed. Clearly, if your star has not evolved in 60 seconds then something is wrong.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>USE_MEMSET</span> This uses memset instead of loops to set memory. I think all modern <i>C</i> libraries should have this so it may be standard in future. Use it.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ALLOC_CHECKS</span> This should be defined, it enables checks on memory allocation (which slows the code down a little bit). Note that if DEBUG is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1</mn>
- </mrow></mstyle></math> this will be set automatically.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>STARDATA_STATUS</span> used to allow output from the stardata_status function, but it is not clear if this does anything anymore.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>INTERPOLATE_*</span> These are used for the fast linear interpolation routine, you should not change them. </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>TABLE_*</span> These are the interpolation tables. Each has to be defined because the results are cached with an integer number as an identifier. If you add another table remember to increment NUMBER_OF_INTERPOLATION_TABLES.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RESTRICT</span>, <span style='font-family:monospace;font-size: 18px;'>FASTCALL</span>, <span style='font-family:monospace;font-size: 18px;'>CONST_FUNC</span> and <span style='font-family:monospace;font-size: 18px;'>pure_function</span> are used to tell the compiler if a function can use restricted memory access, should use fastcall (something to do with registers?) or is a constant function. See the <em>gcc</em> manual for details, or just leave them.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>FLUSH_LOG</span> If true then keeps the log buffer flushed, otherwise when the code crashes (which it can!) the log is out of date. Recommended!</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>USE_MADVISE</span> allows you to specify to the compiler (or the kernel running your code) how memory is accessed. This should speed up the code.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CLAET_CACHE </span>enables the calc_lum_and_evol_time cache (see the function for more details). This should be used as it buys 10-15% of runtime.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MILLISECOND_RANDOMNESS</span> Improves the resolution of the random number seed. You probably want this.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>IDUM_COMMAND_LINE_SPECIFICATION</span> Allows you to specify the random number (<span style='font-family:monospace;font-size: 18px;'>IDUM</span>) seed on the command line (<span style='font-family:monospace;font-size: 18px;'>--idum xyz</span>)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SAVE_IDUM</span> and I<span style='font-family:monospace;font-size: 18px;'>DUM_LOG</span> log the random number which is used, just so you can check it. (<span style='font-family:monospace;font-size: 18px;'>IDUM_LOG_STREAM </span>sets the output stream, usually <span style='font-family:monospace;font-size: 18px;'>stderr</span>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>UNROLL_NUCSYN_LOOPS</span> allows use of the automatically generated loop unrolling. <b>Note: this option is deprecated.</b></li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NANCHECKS</span> enables checks in many parts of the code for <span style='font-family:monospace;font-size: 18px;'>NaN</span> (Not A Number). While <em>this is slow</em> it is very useful for catching bugs.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>STATIC_ARRAYS</span> prevents memory space which is in stardata or its child structures (star_t, common_t, model_t, preferences_t etc) from being allocated dynamically, i.e. with malloc or calloc. Instead, the space is allocated statically. This has the advantage that the whole stardata structure can be copied and replaced with another (for some experimental code this is <em>required</em>). In later versions the dynamic allocation option may be removed (i.e. <span class="flex_cmacro">STATIC_ARRAYS</span> will be standard). I know this goes against programming ideals, in which all memory should be dynamically allocated, but it makes life much easier.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CC_TIMER</span> does not work but perhaps you can fix it.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RDTSC_TIMER</span> uses the RDTSC timer on modern Intel (and compatible?) chips to time code runs. Use this instead of <span style='font-family:monospace;font-size: 18px;'>CC_TIMER</span> if you can.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>REPEAT_RUN </span>allows the use of the <span class="flex_args">--repeat &lt;n&gt;</span> command line argument to run the code <em>n</em> times. Note that timing statistics are adapted as required and a runtime <em>per run</em> is given (which is what you want).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RANDOM_SYSTEMS </span>is used in conjunction with <span style='font-family:monospace;font-size: 18px;'>--repeat </span>to run randomly chosen systems to check for bugs. This is deprecated and will be removed in future. Instead you should use the <span style='font-family:monospace;font-size: 18px;'>random_systems.pl</span> script to generate random binaries. </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MULTISTAR</span> is an experimental attempt to run many stars in parallel. It does not work and is highly experimental.</li>
-</ul>
-<h3 class="subsection" id='magicparlabel-7631'><span class="subsection_label">9.5</span> binary_c_parameters.h</h3>
-<div class="standard" id='magicparlabel-7632'><div id="subsec_binary_c_parameters_h"></div>
-The options in this file are non-nucleosynthesis, (single or) binary stellar evolution options. This file also automatically includes many header files, <span class="flex_headerfile">binary_c_code_options.h</span> and <span class="flex_headerfile">nucsyn_parameters.h</span> so is very useful as a &ldquo;catch-all&rdquo; at the top of each source code file. </div>
-
-<ul class="itemize" id='magicparlabel-7641'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>AXEL</span> if this is defined then Axel Bonacic's changes to the code are applied (but <em>NOT necessarily</em> <span style='font-family:monospace;font-size: 18px;'>AXEL_RGB_FIX</span>). <em><b>WARNING!</b></em> This is often broken and subject to development. Axel's code is not usually that well tested&hellip;</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SMOOTH_AGB</span> enables code to smooth the HR-diagram through the transition between the original overshooting models and Amanda's TPAGB models. May not be reliable – you may want to use <span style='font-family:monospace;font-size: 18px;'>ROBSMOOTH</span> instead.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ROBSMOOTH</span> does the same as <span style='font-family:monospace;font-size: 18px;'>SMOOTH_AGB</span> but is simpler and more reliable.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUMBER_OF_STARS</span> This should always be defined as 2, it is a binary star code&hellip;</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>PRIMARY</span>, <span style='font-family:monospace;font-size: 18px;'>SECONDARY</span> These are 1 and 2.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CFAMANDA</span> enables TPAGB logging so that you can compare your output to Amanda's TPAGB models.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CF_LYNNETTE </span>enables massive-star logging so that you can compare your output to Lynnette's models.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>WIND_MASS_LOSS</span> This used to be a constant (<span style='font-family:monospace;font-size: 18px;'>TRUE</span>) but now points to an option in the preferences struct which allows you to turn (wind) mass-loss on and off on the command line.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ROTATIONALLY_ENHANCED_MASS_LOSS</span> If defined enables stellar-wind mass loss when stars rotate close to their breakup velocity (see <span style='font-family:monospace;font-size: 18px;'>calc_stellar_wind_mass_loss.c</span>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RETURN_ANGMOM_TO_ORBIT</span> returns the angular momentum from rotationally-induced winds back to the orbit. If this is not defined, it is just lost from the system (this is the default).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>TIDAL_CIRCULARIZATION</span> This should be defined as <span style='font-family:monospace;font-size: 18px;'>TRUE</span>, if <span style='font-family:monospace;font-size: 18px;'>FALSE</span> then tides are off (does this work? perhaps it's best to set <span style='font-family:monospace;font-size: 18px;'>TIDAL_STRENGTH_FACTOR</span> to 0)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>TIDAL_STRENGTH_FACTOR</span> This points to a preferences struct option so the tidal strength can be altered on the comamnd line.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>TIDAL_STRENGTH_FACTOR_DEFAULT</span> This should be <span style='font-family:monospace;font-size: 18px;'>1.0</span>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MERGER_ANGULAR_MOMENTUM_FACTOR_DEFAULT</span> This defines the angular momentum left in a stellar merger as a fraction of its breakup angular momentum (assuming the angular momentum is available from the orbit and the pre-merger stellar spins).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>BETA</span> This is a mass loss factor which affects the wind velocity. Default is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn><mo>/</mo><mn>8</mn>
-  </mrow>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>XI</span> This is the wind accretion factor which is usually <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1</mn>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MIN_SEP_FOR_CLOSE_ANG_MOM_LOSS</span> This is the minimum separation for which close angular momentum loss algorithms (e.g. gravitational waves) are applied. Default is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>10</mn>
- </mrow></mstyle></math> (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mstyle mathvariant='normal'>
-   <mrow><mspace width="6px" />
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>R</mi>
-     </mrow>
-     <mrow><mo> &odot; </mo>
-     </mrow>
-    </msub>
-   </mrow>
-  </mstyle>
- </mrow></mstyle></math>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>EPSNOV_DEFAULT</span> The default amount of matter accreted in a nova explosion (default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn><mo>/</mo><mn>1000</mn>
-  </mrow>
- </mrow></mstyle></math>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>EPSNOV</span> points to a preferences option (see <span style='font-family:monospace;font-size: 18px;'>EPSNOV_DEFAULT</span>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ACCRETION_RATE_</span>&hellip; These govern the rates at which matter can be stably accreted: important for SN Ia production. They point to preferences options so you can vary these limits on the command line, but also have defaults set here as the <span style='font-family:monospace;font-size: 18px;'>&hellip;_DEFAULT</span> macros.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>GAMMA_DEFAULT</span> This governs the angular momentum loss rate for mass lost during RLOF. (Default 0 or -1)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CEFLAG</span> A common envelope parameters, if more than zero then spin-energy corrections are applied in the common envelope routine. (Not tested!)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SN_SIGMA_DEFAULT</span> The SN kick velocity dispersion (Maxwellian distribution). Default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>190</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>k</mi><mi>m</mi>
-    </mrow>
-   </mstyle><mo>/</mo>
-   <mstyle mathvariant='normal'><mi>s</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>WD_SIGMA_DEFAULT</span> The WD kick velocity default – NB this is <em>not</em> a velocity dispersion, it is a constant value. Default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>0</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>k</mi><mi>m</mi>
-    </mrow>
-   </mstyle><mo>/</mo>
-   <mstyle mathvariant='normal'><mi>s</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DISTRIBUTED_SN_KICKS</span> This is an old option (no longer supported) which, when there is a SN, runs the code a number (say <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1000</mn>
- </mrow></mstyle></math>) times with different kicks. It has not been tested for years (instead, the <span style='font-family:monospace;font-size: 18px;'>--repeat</span> option should be used – although it is not as efficient it is at least more reliable)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>PTS1</span>, <span style='font-family:monospace;font-size: 18px;'>PTS2</span> and <span style='font-family:monospace;font-size: 18px;'>PTS3</span> are timestepping options for the various evolutionary phases. Do not touch! Defaults 0.05, 0.02 and 0.01.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NETA_DEFAULT</span> sets the default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &eta; </mi>
- </mrow></mstyle></math> for the Reimers formula (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0.5</mn>
- </mrow></mstyle></math>). </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NETA</span> points to a preferences struct option for the Reimers <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &eta; </mi>
- </mrow></mstyle></math> parameter.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>BB_DEFAULT</span> The CRAP parameters (enhanced wind loss due to binaries) default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0</mn>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>BB</span> points to a preferences struct option for the CRAP parameter.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LUM0</span>, <span style='font-family:monospace;font-size: 18px;'>KAP</span>, <span style='font-family:monospace;font-size: 18px;'>AHE</span>, <span style='font-family:monospace;font-size: 18px;'>ACO</span>, <span style='font-family:monospace;font-size: 18px;'>TAUMIN</span>, <span style='font-family:monospace;font-size: 18px;'>MLP</span>, <span style='font-family:monospace;font-size: 18px;'>IZETA</span> and <span style='font-family:monospace;font-size: 18px;'>ACC1</span> are simply constants.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ACC2</span> The Bondi-Hoyle wind accretion parameter (default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>3</mn><mo>/</mo><mn>2</mn>
-  </mrow>
- </mrow></mstyle></math>) points to <span style='font-family:monospace;font-size: 18px;'>preferences</span>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ACC2_DEFAULT</span> The default value of ACC2</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DTFAC</span> and <span style='font-family:monospace;font-size: 18px;'>DTFAC_DEFAULT</span> This multiplies the timestep during the TPAGB phase (if NUCSYN is defined, usually <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1</mn>
- </mrow></mstyle></math>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>HBBTFAC </span>and<span style='font-family:monospace;font-size: 18px;'> HBBTFAC_DEFAULT</span> This multiplies the temperature during HBB on the TPAGB (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1</mn>
- </mrow></mstyle></math>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>EDDFAC_DEFAULT</span> The Eddington limit for accretion is multiplied by this, which implies that the default (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>6</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math>) means there is effectively no Eddington limit.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MAXIMUM_STELLAR_MASS</span> This is the maximum stellar mass the code can handle (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>100</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>). If <span style='font-family:monospace;font-size: 18px;'>TRIM_SUPERMASSIVE_STARS</span> is defined then stars of more than <span style='font-family:monospace;font-size: 18px;'>MAXIMUM_STELLAR_MASS</span> are trimmed down (the excess material <em>is</em> counted as stellar yield, so think of this as a <em>very</em> strong mass loss).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MINIMUM_STELLAR_MASS</span> is used to prevent the fitting formulae from giving spurious results if the mass fed into them is too small.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>TIMESTEP_MODULATION</span> if defined allows the timestep to be modulated by a number given in <span style='font-family:monospace;font-size: 18px;'>preferences-&gt;timestep_modulator</span></li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DEFAULT_LAMBDA_CE</span> This is the default value of the common envelope parameter <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &lambda; </mi>
- </mrow></mstyle></math>. If it is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo>-</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math> then <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &lambda; </mi>
- </mrow></mstyle></math> is calculated from fits to real stellar models according to <a href='#LyXCite-2000A_A___360_1043D'><span class="bib-abbrvciteauthor">Dewi and Tauris</span></a> (<span class="bib-year">2000</span>). If it is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo>&gt;</mo><mn>0</mn>
-  </mrow>
- </mrow></mstyle></math> then it is used directly.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DEFAULT_LAMBDA_IONISATION</span> If <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo>&gt;</mo><mn>0</mn>
-  </mrow>
- </mrow></mstyle></math> then energy from ionization is used to help eject the envelope.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DEFAULT_COMENV_PRESCRIPTION</span> can be <span style='font-family:monospace;font-size: 18px;'>COMENV_HURLEY</span> or <span style='font-family:monospace;font-size: 18px;'>COMENV_NELEMANS</span>, which means you use either the <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>, <span class="bib-textafter">$\alpha$</span>) or the <a href='#LyXCite-2001A_A___365__491N'><span class="bib-abbrvciteauthor">Nelemans et al.</span></a> (<span class="bib-year">2001</span>, <span class="bib-textafter">$\gamma$</span>) prescription.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DEFAULT_NELEMANS_GAMMA</span> is the default value of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &gamma; </mi>
- </mrow></mstyle></math> in the case that you use the <a href='#LyXCite-2001A_A___365__491N'><span class="bib-abbrvciteauthor">Nelemans et al.</span></a> (<span class="bib-year">2001</span>, <span class="bib-textafter">gamma</span>) prescription (i.e. <span style='font-family:monospace;font-size: 18px;'>COMENV_NELEMANS</span>)</li>
-<li class="itemize_item">There are some other parameters associated with the Nelemans mechanism (<span style='font-family:monospace;font-size: 18px;'>NELEMANS_*</span>), but these are not standard so if you want to use them please consult the code directly.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DEFAULT_ALPHA1</span> This is the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &alpha; </mi>
- </mrow></mstyle></math> parameter used in the <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>) prescription of common envelope evolution (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1</mn>
- </mrow></mstyle></math> or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>3</mn>
- </mrow></mstyle></math>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CE_DURATION_DEFAULT</span> defines the time which is spent in common envelope evolution. This is not used at present.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NO_MERGER_NUCLEOSYNTHESIS</span> prevents the <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>) algorithm which ignites degenerate cores when they merge. This does not mean a SN will not occur when appropriate, but it does mean that helium white dwarf mergers do not explode.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>HeWD_HeCORE_MERGER_IGNITION</span> if defined allows stars which have degenerate He cores and then merge to ignore. This is probably nonsense, so you should <em>not</em> enable this option.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>HeWD_HeWD_IGNITION_MASS</span> is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>0.3</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> and is the mass at which an accreting helium white dwarf reignites helium and turns into a helium star. This number will, in reality, depend on the accretion rate, composition etc. and is something that could be worked on.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ALLOW_HeWD_SUPERNOVAE</span> if defined allows HeIa supernovae for HeWDs above <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>0.7</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>. It is <em>not</em> defined by default (see above for reasoning).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>COMENV_NS_ACCRETION</span> is used to accrete material onto neutron stars inside common envelopes. You can either accrete a fraction of the envelope (through <span style='font-family:monospace;font-size: 18px;'>COMENV_NS_ACCRETION_FRACTION_DEFAULT</span>) or a fixed mass (<span style='font-family:monospace;font-size: 18px;'>COMENV_NS_ACCRETION_MASS_DEFAULT</span>). Both are <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0</mn>
- </mrow></mstyle></math> by default (i.e. nothing happens) and <span style='font-family:monospace;font-size: 18px;'>COMENV_NS_ACCRETION</span> is not defined by default.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>COMENV_MS_ACCRETION</span> is used to accrete material onto main sequence (and other?) stars during a common envelope phase, the amount accreted is <span style='font-family:monospace;font-size: 18px;'>COMENV_MS_ACCRETION_MASS_DEFAULT</span> (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0.01</mn>
- </mrow></mstyle></math> by default, but <span style='font-family:monospace;font-size: 18px;'>COMENV_MS_ACCRETION</span> is not usually defined so this does not happen). NOTE at present this seems a little buggy&hellip;</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CHANDRASEKHAR_MASS</span> is the Chandrasekhar mass, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>C</mi><mi>h</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub><mo>=</mo><mn>1.44</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MAX_NEUTRON_STAR_MASS</span> If a compact remnant has a mass greater than this, it is turned into a black hole (default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1.8</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MINIMUM_MASS_FOR_CARBON_IGNITION</span> If a helium core (during CHeB or the EAGB before second dredge up) has more than this mass then it goes on to ignite carbon (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1.6</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MAX_TPAGB_CORE_MASS</span> The maximum core mass of a TPAGB star (which will have an ONeMg – or, in rare circumstances – a CO core) before it collapses to a NS. This is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1.44</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle><mo>=</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>C</mi><mi>h</mi>
-      </mrow>
-     </mstyle>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> or perhaps <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1.38</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> (taking into account the composition).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MAX_CONVECTIVE_MASS</span> and <span style='font-family:monospace;font-size: 18px;'>MIN_CONVECTIVE_MASS</span>: if a star is in this mass range and is a main sequence star it is defined as &ldquo;convective&rdquo;.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MASS_ACCRETION_FOR_ELD_DEFAULT</span> This is the amount of mass accreted to make an Edge Lit Detonation (which might be SNIa) default is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>0.15</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math></li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>GIANT_AGE_FATAL_ERRORS</span> Occasionally this function spits out an error: if this is defined then the error stops the code (default: no, go with it)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ACQUIRE_FUDGE_NEGATIVE_AGES</span> Sometimes the age can be negative. This allows it to be set to zero if it is small, in which case we assume it's because RGI has broken something or there is a small numerical error. (Defined by default but note that <em>FUDGE</em> is a correct description!)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ACQUIRE_TEST_FOR_NEGATIVE_AGES</span> If enabled causes the code to stop when the age is very negative. (Default off)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MINIMUM_TIMESTEP_DEFAULT </span>This sets the minimum timestep (in Myr, although this can be overwritten by command line options)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MINIMUM_TIMESTEP_DEFAULT</span> The minimum timestep (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1000</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>M</mi><mi>y</mi><mi>r</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>HACHISU_DISK_WIND</span> If defined then the disk wind of <a href='#LyXCite-1996ApJ___470L__97H'><span class="bib-abbrvciteauthor">Hachisu et al.</span></a> (<span class="bib-year">1996</span>) is used, with a rate limit given by <span style='font-family:monospace;font-size: 18px;'>ACCRETION_RATE_LIMIT_HACHISU</span>. The wind is mulitplied by <span style='font-family:monospace;font-size: 18px;'>HACHISU_DISK_WIND_FACTOR_DEFAULT</span> (default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>20</mn>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math>) which when set very high (like the default) has no effect. This code has not been well tested.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>BINARY_STARS_ONLY</span> When defined the evolution code does not evolve through phases involving just one star.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN</span> When defined then the nucleosynthesis code is built (and nucsyn/nucsyn_parameters.h is included, see <a href="#subsec_nucsyn_nucsyn_parameters_h">9.6</a>). When not defined you are just building my <i>C</i> version of BSE.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ANG_MOM_CHECKS</span> is used to log angular momenta just prior to a SN.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DELIBERATE_BUG1</span> enables a bug which you don't want enabled.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>BINARY_COLOURS</span> builds some code which includes UBV colour calculations based on Kurucz atmospheres (thanks to Jarrod).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NO_IMMEDIATE_MERGERS</span> if defined does not allow early MS-MS mergers to evolve (do these systems ever exist?).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CGI_EXTENSIONS</span> builds code suitable for the website <a href="http://www.phys.uu.nl/~izzard/cgi-bin/binary2.cgi">http://www.phys.uu.nl/~izzard/cgi-bin/binary2.cgi</a>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SDB_CHECKS</span> logs information on subdwarf-B stars.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>BI_LYN</span> logs information on BI Lyn stars (what are they???).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>XRAY_BINARIES</span> logs information on X-ray binaries, specifically their luminosities.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>STELLAR_TYPE_LOG</span> logs stellar type information.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LOG_JJE</span> is the log for John Eldridge, <span style='font-family:monospace;font-size: 18px;'>LTEST</span> is related to this, <span style='font-family:monospace;font-size: 18px;'>JJE_FUDGES</span> fudges parts of the code to behave more like John's.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOG_JL</span> is for some abundance logging (for John Lattanzio) &hellip;I can't remember what.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SELMA</span> enables some logging for Selma which she ended up not using. Typical!</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SELMA_MASS_EJECTA</span>, <span style='font-family:monospace;font-size: 18px;'>SELMA_MASS_EJECTA_N</span>, <span style='font-family:monospace;font-size: 18px;'>SELMA_DM_MASS_RESOLUTION</span> enable some logging for Selma.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LOG_CE_PARAMETERS</span> Logs stuff fromt he common-envelope phase to the c_log file.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>FORM_STARS_AT_BREAKUP_ROTATION</span> If this is defined then the initial rotation rate of the stars is as high as it can be before they break up.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>FILE_LOG</span> logs output to a file, usually /tmp/c_log.dat (but this can be defined on the command line). You want this to be defined (it is by default).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>AXEL_RGB_FIX</span> fixes a bug in the giant branch radius function, you want this to be defined.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NS_BH_AIC_LOG</span> logs when neutron stars turn into black holes, for Enrico.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NELEMANS_MASS_PLOT</span> was an attempt to reproduce some of Gijs' work (which was quite successful).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DETMERS_LOG</span> outputs information for Rob Detmers' upcoming paper (which will be finished one day).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LOG_TO_STDOUT</span> and <span style='font-family:monospace;font-size: 18px;'>LOG_TO_STDERR</span> allow the standard log to be sent to stdout or stderr without the need to do this manually each time.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NO_UNEXPECTED_MASS_CHANGES</span> removes the mass changes which occur in hrdiag, which are otherwise quite bad as that's not what hrdiag is supposed to do!</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RSTARS</span> if defined activates the following flags, which were used to make the R stars paper <a href='#LyXCite-2007A_A___470__661I'><span class="bib-abbrvciteauthor">Izzard et al.</span></a> (<span class="bib-year">2007</span><span class="bib-modifier">a</span>), namely the following:
-<br />
-
-
-
-<ul class="itemize" id='magicparlabel-7734'><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NO_MERGER_NUCLEOSYNTHESIS</span> Stops ignition of helium cores when they merge (<a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span>, <span class="bib-year">2002</span></a> did this but I do not believe it is correct)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>HeWD_HeCORE_MERGER_IGNITION</span> Forces HeWD+GB to form a new GB star, and HeWD+CHeB to form a new CHeB star (a little thought tells you that the latter cannot happen)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LOG_COMENV_RSTARS</span> Logs R star mergers resulting from common envelope evolution</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LOG_RSTARS</span> Logs R stars during the CHeB stage</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOW_MASS_STRIPPING</span> Follow surface abundance changes in low mass stars due to mass stripping during the MS (i.e. nitrogen enhancement, carbon depletion) This <em>only works for star 1</em>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SMALL_GB_CORES</span> This forces the cores in GB stars to be the same as the equivalent mass WD rather than the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>5</mn><mo> &times; </mo>
-  </mrow>
- </mrow></mstyle></math> &ldquo;hot subdwarf&rdquo; which was made up by Chris Tout.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CONSERVE_ANGMOM_IN_COMENV</span> Conserves angular momentum in the common envelope merged core.</li>
-</ul>
-</li><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>HRDIAG</span> When defined HR-diagram information is output (can be useful).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>INITIAL_FINAL_MASS_RELATION</span> outputs information about initial/final masses.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>DTR_FUDGES</span> enables some timestep function (see deltat.c) fudges to stop the code grinding to a halt when it shouldn't.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>COMPARE_FORTRAN</span> enables some logging so I can compare my <i>FORTRAN</i> version of BSE to the <i>C</i> version.</li>
-<li class="itemize_item">The three defines <span style='font-family:monospace;font-size: 18px;'>GIANT_CRITICAL_Q_ORIGINAL</span>, <span style='font-family:monospace;font-size: 18px;'>GIANT_CRITICAL_Q_HJELLMING_WEBBINK</span> and <span style='font-family:monospace;font-size: 18px;'>GIANT_CRITICAL_Q_NO_COMENV</span> refer to the prescription used for the critical <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>q</mi><mo>=</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>1</mn>
-    </mrow>
-   </msub><mo>/</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>M</mi>
-    </mrow>
-    <mrow><mn>2</mn>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> which determines the stability of mass transfer from a giant. The original is as <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>).</li>
-<li class="itemize_item">White dwarf cooling rates are defined by <span style='font-family:monospace;font-size: 18px;'>MESTEL_COOLING</span> or <span style='font-family:monospace;font-size: 18px;'>MODIFIED_MESTEL_COOLING</span>, the former was originally used in <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>EXTRA_IA_LOGGING</span> enables SNIa logging.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>COMENV_CO_MERGER_GIVES_IIa</span> forces CO-CO mergers inside common envelopes to log as SNeIa. Are they?</li>
-<li class="itemize_item">When HeWDs accrete hydrogen, what happens? Novae? If so, then we wait until <span style='font-family:monospace;font-size: 18px;'>He_REIGNITION_LAYER_THICKNESS</span> accretes (guessed at <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>0.01</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> although the exact number may not matter too much) and form a helium star. To disable this enable <span style='font-family:monospace;font-size: 18px;'>NO_HeWD_NOVAE</span>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>STARDATA_STATUS</span> outputs some status information regarding the stardata struct. Quite what I am not sure&hellip; and it doesn't seem to do anything at the moment.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>TPAGB_SPEEDUP</span> activates an algorithm for speeding up TPAGB evolution after it becomes &ldquo;asymptotic&rdquo;, i.e. after <span style='font-family:monospace;font-size: 18px;'>TPAGB_SPEEDUP_AFTER</span> pulses. This is useful, but of course reduces time resolution so be careful when using it (default is on). </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>VW93_MIRA_SHIFT</span> and <span style='font-family:monospace;font-size: 18px;'>VW93_MULTIPLIER</span> allow fudge factors in the VW93 mass-loss formula.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>STEP_BACK_RLOF</span> is a better attempt at dealing with the transition into RLOF, but was never finished (should not be on!)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>PATHOLOGICAL_RLOF_CHECK</span> checks if the star expands when it should shrink in the RLOF interpolation steps.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SLOW_DOWN_PREROCHE_EAGB</span> and <span style='font-family:monospace;font-size: 18px;'>SLOW_DOWN_PREROCHE_TPAGB</span> force the timestep to be reduced when the star is an EAGB or TPAGB star respectively and approaches RLOF (i.e <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>R</mi><mo>/</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>R</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'><mi>L</mi>
-     </mstyle>
-    </mrow>
-   </msub><mo> &rarr; </mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MANUAL_VROT</span> allows you to specify the spin of the stars on the command line.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>VROT_LOGGING</span> enables the log output for Norbert Langer. This is every <span style='font-family:monospace;font-size: 18px;'>VROT_LOGGING_DT</span> Myr.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>STOP_ACCRETION_OF_MATERIAL_BEYOND_BREAKUP</span> enables the lines of code which Jarrod put in the code to prevent accretion of material beyond the breakup velocity.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ZAMS_MENV_METALLICITY_CORRECTION</span> enables new fits to the convective envelope mass based on a model grid from Evert Glebbeek. This is valid for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>Z</mi><mo>=</mo><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow>
-     <mrow><mo>-</mo><mn>4</mn>
-     </mrow>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math> to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>Z</mi><mo>=</mo><mn>0.02</mn>
-  </mrow>
- </mrow></mstyle></math> which is an improvement on the old version which only worked for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>Z</mi><mo>=</mo><mn>0.02</mn>
-  </mrow>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RLOF_RADIATION_CORRECTION</span> is an experiment to allow radiation effects to affect the size of the Roche lobe (default off, the code requires an update with the latest fitting formula).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RLOF_MDOT_MODULATION</span> if defines allows modulation of the (non-dynamical) RLOF mass-transfer rate</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RLOF_LIMIT_ALL_STARS_TO_THERMAL_RATE</span> forces all (non-dynamical) RLOF mass transfer rates to be limited by the KH timescale (in the old code it was just giants)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CALCULATE_EXTRA_ROTATION_VARIABLES</span> Enables the calculation of extra variables related to rotation – often required by logging routines and adaptive Roche-lobe overflow, etc.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ADAPTIVE_RLOF</span> enables the new RLOF code which attempts to judge the mass transfer rate based on an iterative procedure which forces the star to remain inside its Roche lobe.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ADAPTIVE_RLOF_CONVECTIVE_CHECK</span> enables code which shortcuts the adaptive iterative procedure for stars with giant envelopes. These would just attempt to lose all their envelopes anyway (in which case the thermal limit caps the transfer rate).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ADAPTIVE_RLOF_LOG</span> enables some logging of RLOF information.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LIMIT_RLOF_ACCRETION_TO_THERMAL_RATE</span> If defined, limits accretion on the secondary to the thermal rate of the secondary.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RLOF_OVERFLOW_THRESHOLD(2)</span>, <span style='font-family:monospace;font-size: 18px;'>ADAPTIVE_RLOF_THRESHOLD</span> and <span style='font-family:monospace;font-size: 18px;'>RLOF_STABILITY_FACTOR</span> are numerical factors which affect the RLOF routines. </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ADAPTIVE_RLOF_IMIN</span> and <span style='font-family:monospace;font-size: 18px;'>ADAPTIVE_RLOF_IMAX</span> are the minimum and maximum number of iterations the adaptive RLOF code may perform.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ADAPTIVE_RLOF_MINIMUM_RADIUS_ERROR</span> If the radius error (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo form='prefix' fence='true' stretchy='true' symmetric='true'>(</mo>
-
-   <mrow><mi>R</mi><mo>-</mo>
-    <msub subscriptshift="0.2ex">
-     <mrow><mi>R</mi>
-     </mrow>
-     <mrow>
-      <mstyle mathvariant='normal'><mi>L</mi>
-      </mstyle>
-     </mrow>
-    </msub>
-   </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>)</mo>
-<mo>/</mo>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>R</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'><mi>L</mi>
-     </mstyle>
-    </mrow>
-   </msub><mo>)</mo>
-  </mrow>
- </mrow></mstyle></math> is less than this, stop the iterations to avoid a <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>0</mn><mo>/</mo><mn>0</mn>
-  </mrow>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ADAPTIVE_RLOF_DM_MAX</span> An expression which gives the maximyum change in the mass in one iteration.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ADAPTIVE_RLOF_MAX_ENV_FRAC</span> An expression which limits the mass transfer rate such that it is the maximum fraction of the envelope mass that can be transferred in a timestep.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ADAPTIVE_RLOF_ALPHA</span> A fudge factor, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo>&lt;</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math>, which is used in the calculation of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi> &part; </mi><mi>R</mi><mo>/</mo><mi> &part; </mi><mi>M</mi>
-  </mrow>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MAX_NUM_RLOFS</span> is the maximum number of RLOF events a system may experience. If zero (the default) then it is not used and the system can have as many RLOFs as it likes.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RLOF_NO_TRANSFER_LIMITS</span> prevents the thermal limits (etc) on mass-transfer rates. This is not realistic but is useful for forcing the system to be conservative.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RLOF_MINIMUM_SPEEDUP_FACTOR</span> is used as a minimum for the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>k</mi>
-   </mrow>
-   <mrow><mi>w</mi>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> (number of orbits per timestep) factor. Whenever I have used it I have found a pathological case which breaks, so you should not defined it.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RLOF_REDUCE_TIMESTEP</span> (and <span style='font-family:monospace;font-size: 18px;'>RLOF_REDUCE_TIMESTEP_AGGRESSION</span>, <span style='font-family:monospace;font-size: 18px;'>RLOF_REDUCE_TIMESTEP_MINIMUM_FACTOR</span>, <span style='font-family:monospace;font-size: 18px;'>RLOF_REDUCE_TIMESTEP_THRESHOLD</span>) is used to reduce the timestep during RLOF (controlled by the other parameters). It can result in a very small timestep, but is useful for testing.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RLOF_MINIMUM_TIMESTEP</span> The minimum timestep during RLOF (in Myr) – may be removed in the near future.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RLOF_NO_STELLAR_TYPE_CHANGE_IF_DTM_NEGATIVE</span> If enabled do not let the stellar type go backwards during RLOF (could cause problems? or perhaps solve them&hellip;)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CONSERVE_ANGULAR_MOMENTUM_DURING_MERGERS</span> Is supposed to conserve angular momentum during a stellar merger – however Selma suggests it may not work quite as planned.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CONSERVATIVE_SYSTEM</span> if defined then checks are compiled in which check if the system is conservative, and if not an error is logged and the code exits. Useful with <span style='font-family:monospace;font-size: 18px;'>RLOF_NO_TRANSFER_LIMITS</span> but otherwise do not use it.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SINGLE_STAR_LIFETIMES</span> If defined outputs the lifetime of a single star with the given mass – used for the time-adaptive mass grid.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CIRCUMBINARY_DISK</span> Experimental circumbinary-disk routines – ask Tyl Dermine about it.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>ECCENTRIC_CRAP</span> Experimental code – may be removed because I cannot remember what it does!</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>COMENV_LOG</span> logs post-common envelope information</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>SELMA_MASS_EJECTA</span>, <span style='font-family:monospace;font-size: 18px;'>SELMA_DM_MASS_EJECTA_N</span> and <span style='font-family:monospace;font-size: 18px;'>SELMA_DM_MASS_RESOLUTION</span> are for Selma</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>FABIAN_IMF_LOG</span> is Fabian Schneider's single/binary star initial mass function log</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>STARSEARCH</span> is a general logging device for outputting stellar information when stellar variables change by prescribed amounts. See the comments in <span style='font-family:monospace;font-size: 18px;'>binary_c_parameters.h</span> for more information.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>POST_CE_OBJECTS_HAVE_ENVELOPES</span> (and associated options) allow stars exiting the common-envelope phase to keep their envelopes (e.g. an AGB star which has its envelope stripped remains an AGB star). The envelope mass is fixed according to the stellar type by <span style='font-family:monospace;font-size: 18px;'>POST_CE_ENVELOPE_DM_GB</span>, <span style='font-family:monospace;font-size: 18px;'>POST_CE_ENVELOPE_DM_EAGB</span> and <span style='font-family:monospace;font-size: 18px;'>POST_CE_ENVELOPE_DM_TPAGB</span>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>POST_CE_ADAPTIVE_MENV</span> is an improvement on the previous option. When the common-envelope phase terminates, the star is left with the envelope mass appropriate to being just inside its Roche lobe. </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>PN_FAST_WIND</span> When the stellar envelope mass is less than a given amount (<span style='font-family:monospace;font-size: 18px;'>PN_FAST_WIND_DM_GB</span> for first GB stars, <span style='font-family:monospace;font-size: 18px;'>PN_FAST_WIND_DM_AGB</span> for AGB stars) the standard stellar wind is switched off and a fast wind at a fixed rate (<span style='font-family:monospace;font-size: 18px;'>PN_FAST_WIND_MDOT_GB</span> and <span style='font-family:monospace;font-size: 18px;'>PN_FAST_WIND_MDOT_AGB</span>) is used instead.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>RESOLVE_PN_FAST_WIND</span> decreases the stellar timestep (in deltat.c) in order to better resolve (in time) the PN wind. A star is defined as a planetary nebula if its luminosity exceeds <span style='font-family:monospace;font-size: 18px;'>PN_MIN_L</span> and its temperature exceeds <span style='font-family:monospace;font-size: 18px;'>PN_MIN_TEFF</span>. This is only activated if the stellar envelope has a mass less than <span style='font-family:monospace;font-size: 18px;'>RESOLVE_PN_FAST_WIND_MAX_MENV</span>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>PN_PROJECT</span> is a catchall for Rob's PN+nucleosynthesis project.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>WRLOF_MASS_TRANSFER</span> is Carlo Abate's wind-RLOF prescription (see Abate et al 2013, MNRAS accepted).</li>
-</ul>
-<h3 class="subsection" id='magicparlabel-7795'><span class="subsection_label">9.6</span> nucsyn/nucsyn_parameters.h</h3>
-<div class="standard" id='magicparlabel-7796'><div id="subsec_nucsyn_nucsyn_parameters_h"></div>
-While many important options are set on the command line the options governing which nucleosynthesis algorithms to use and what to output are set in the file <span class="flex_headerfile">nucsyn/nucsyn_parameters.h</span>. More detailed descriptions of the variables used in the code are given in section <a href="#sec_Code_description">8</a>.</div>
-
-<ul class="itemize" id='magicparlabel-7801'><li class="itemize_item">Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP</span> to make first dredge-up happen on the GB. 
-<br />
-
-
-
-<ul class="itemize" id='magicparlabel-7802'><li class="itemize_item">You want this, and probably you want to enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_AMANDAS_TABLE</span> and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_ACCRETION_CORRECTION</span>. These enable tabular lookups of the abundance changes (better than fitting formulae) and a simple prescription to deal with abundance changes due to accretion.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_ACCRETION_CORRECTION_FROM_TAMS</span> is similar but bases changes on the <em>terminal-age main sequence</em> abundances – this is better in the case of accretion of e.g. carbon (i.e. for CEMPs). </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_PHASE_IN</span> enables a phased change of the abundance to better match detailed models (the default model assumes that 1st DUP happens instantaneously). </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_RICHARDS_TABLE</span> should be enabled in addition to <span style='font-family:monospace;font-size: 18px;'>NUCSYN_FIRST_DREDGE_UP_AMANDAS_TABLE</span> to use Richard Stancliffe's models in place of Amanda's when in the appropriate mass/metallicity range (down to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>Z</mi><mo>=</mo><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow>
-     <mrow><mo>-</mo><mn>5</mn>
-     </mrow>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math> while Amanda's are valid only down to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow>
-     <mrow><mo>-</mo><mn>4</mn>
-     </mrow>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math>).</li>
-</ul>
-</li><li class="itemize_item">Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_SECOND_DREDGE_UP</span> to make second dredge-up happen at the beginning of the TPAGB. You want this.</li>
-<li class="itemize_item">Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_THIRD_DREDGE_UP</span> to make third dredge-up happen during the TPAGB. 
-<br />
-
-
-
-<ul class="itemize" id='magicparlabel-7808'><li class="itemize_item">You probably also want <span style='font-family:monospace;font-size: 18px;'>NUCSYN_THIRD_DREDGE_UP_AMANDA</span> to get the intershell abundances from a table based on Amanda's models.</li>
-<li class="itemize_item">You can choose whether to get these numbers from either the old data <span style='font-family:monospace;font-size: 18px;'>USE_TABULAR_INTERSHELL_ABUNDANCES_KARAKAS_2002</span> (no s-process; use only for testing!) or the new table <span style='font-family:monospace;font-size: 18px;'>USE_TABULAR_INTERSHELL_ABUNDANCES_KARAKAS_2012</span> (with s-process, deprecates the Busso/Gallino tables which have been removed).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MINIMUM_ENVELOPE_MASS_FOR_THIRD_DREDGEUP</span> is the minimum mass for third dredge up, set on the command line with <span style='font-family:monospace;font-size: 18px;'>--minimum_envelope_mass_for_third_dredgeup</span> or <span style='font-family:monospace;font-size: 18px;'>MINIMUM_ENVELOPE_MASS_FOR_THIRD_DREDGEUP_DEFAULT</span> by default (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>0.5</mn>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> based on Straniero's models).</li>
-<li class="itemize_item">You have the option of defining <span style='font-family:monospace;font-size: 18px;'>NUCSYN_THIRD_DREDGE_UP_RICHARD</span> instead, which uses Richard's intershell material (but is less complete than Amanda's tables).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_THIRD_DREDGE_UP_TABULAR_NCAL</span> should be used for tabular fits to the NCAL parameter instead of the old (dodgy?) formula fit.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_THIRD_DREDGE_UP_HYDROGEN_SHELL</span> activates the algorithm which takes into account dredge up of the hydrogen-burning shell at low metallicity. At high metallicity it is negligible. You should activate this.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_THIRD_DREDGE_UP_MULTIPLIERS</span> allows command-line modification of the amount of material dredge up. It does not hurt to define this if you do not use it.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>USE_TABULAR_INTERSHELL_ABUNDANCES</span> forces the use of tables instead of fits to the intershell abundances: this is probably what you want (there are checks for going off the end of the tables).</li>
-</ul>
-</li><li class="itemize_item">Enable <span style='font-family:monospace;font-size: 18px;'>PADOVA_MC1TP</span> to use the Padova group's <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msubsup>
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'><mi>c</mi>
-    </mstyle>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mrow><mn>1</mn><mi>T</mi><mi>P</mi>
-     </mrow>
-    </mstyle>
-   </mrow>
-  </msubsup>
- </mrow></mstyle></math> rather than the <a href='#LyXCite-Parameterising_3DUP_Karakas_Lattanzio_Pols'><span class="bib-abbrvciteauthor">Karakas et al.</span></a> (<span class="bib-year">2002</span>) fits (only for <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>M</mi><mo>&lt;</mo><mn>3</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>, above <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>3</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>M</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math> the difference is small anyway).</li>
-<li class="itemize_item">Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB</span> if you want to use nucleosynthesis on the TPAGB (e.g. third dredge-up and HBB).</li>
-<li class="itemize_item">You can control the luminosity behaviour on the TPAGB with <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_LUMTYPE</span>. If zero then an average luminosity is used, if 1 then post-flash dips are included for the first <span style='font-family:monospace;font-size: 18px;'>NUCSYN_PULSE_LUM_DROP_N_PULSES</span> dips (<span style='font-family:monospace;font-size: 18px;'>DTFAC</span> must be set to something small e.g. 0.1 to resolve the dips). The drop is by a factor <span style='font-family:monospace;font-size: 18px;'>THERMAL_PULSE_LUM_DROP_FACTOR</span> and the luminosity rises again on a timescale 1/<span style='font-family:monospace;font-size: 18px;'>THERMAL_PULSE_LUM_DROP_TIMESCALE</span> of the interpulse period. The <span style='font-family:monospace;font-size: 18px;'>spiky_luminosity</span> variable in each star structure follows the luminosity changes. It is impossible to put the changes in the luminosity itself because the timestep becomes very small when the luminosity (and so radius) changes suddenly._</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_SMOOTH_AGB_RADIUS_TRANSITION</span> smooths the transition between Hurley and Karakas <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>L</mi>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>R</mi>
- </mrow></mstyle></math>: it's a bit of a fudge (uses <span style='font-family:monospace;font-size: 18px;'>NUCSYN_SMOOTH_AGB_RADIUS_TRANSITION_SMOOTHING_TIME</span>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_MIN_LUMINOSITY</span> is a minimum luminosity for TPAGB stars, a bit of a fudge, usually <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>100</mn><mspace width="6px" />
-   <msub subscriptshift="0.2ex">
-    <mrow>
-     <mstyle mathvariant='normal'><mi>L</mi>
-     </mstyle>
-    </mrow>
-    <mrow><mo> &odot; </mo>
-    </mrow>
-   </msub>
-  </mrow>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MAX_TPAGB_TIME</span> the maximum time (in years) for which the TPAGB phase is allowed to run, just in case something goes wrong, default is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>8</mn>
-    </mrow>
-   </msup><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>y</mi><mi>e</mi><mi>a</mi><mi>r</mi><mi>s</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_ROBS_REFITTED_TPAGB_INTERPULSES</span> enables updated fits for the interpulse period.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MINIMUM_INTERPULSE_PERIOD</span> is the minimum interpulse period, default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow>
-     <mrow><mo>-</mo><mn>4</mn>
-     </mrow>
-    </mrow>
-   </msup><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>y</mi><mi>e</mi><mi>a</mi><mi>r</mi><mi>s</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math></li>
-<li class="itemize_item">Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB</span> if you want to HBB on the TPAGB. Choose either the analytic burning method, <span style='font-family:monospace;font-size: 18px;'>NUCSYN_ANAL_BURN</span>, or the numerical solver <span style='font-family:monospace;font-size: 18px;'>NUCSYN_NUMERICAL_BURN</span>. The latter has proved to be reliable, and more flexible, so I would go with that.
-<br />
-
-
-
-<ul class="itemize" id='magicparlabel-7825'><li class="itemize_item">If you choose <span style='font-family:monospace;font-size: 18px;'>NUCSYN_ANAL_BURN</span> you can specify which nuclear reactions to include: <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_CN_CYCLE</span> and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_ON_CYCLE</span> are the CN and ON parts of the CNO cycling in HBB, <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_NeNa_CYCLE</span> activates the approximate NeNa cycling, <span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_HBB_MgAl_CYCLE</span> activates the approximate MgAl cycling. Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CNO_ASSUME_STABLE</span> to assume solutions of the CNO quadratic are always real (i.e. a stable solution, neglect the oscillating parts), <span style='font-family:monospace;font-size: 18px;'>NUCSYN_NENA_LEAK</span> will allow leakage from NeNa to MgAl (do this), <span style='font-family:monospace;font-size: 18px;'>NUCSYN_Na22_EQUILIBRIUM</span> will force Na22 into equilibrium (otherwise it is not calculated because it is unstable and you probably do not care), <span style='font-family:monospace;font-size: 18px;'>NUCSYN_Al26m</span> follows the metastable state of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>26</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'>
-    <mrow><mi>A</mi><mi>l</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> (again, do you care? it makes little difference except at low <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>Z</mi>
- </mrow></mstyle></math>) and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_MGAL_LEAKBACK</span> allows the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>27</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'>
-    <mrow><mi>A</mi><mi>l</mi>
-    </mrow>
-   </mstyle><mo>(</mo><mi>p</mi><mo>,</mo><mi> &alpha; </mi>
-   <msup>
-    <mrow><mo>)</mo>
-    </mrow>
-    <mrow><mn>24</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'>
-    <mrow><mi>M</mi><mi>g</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> reaction, which should be negligible.</li>
-<li class="itemize_item">If you choose <span style='font-family:monospace;font-size: 18px;'>NUCSYN_NUMERICAL_BURN</span> then most of the above options are automatically taken into account by the burning schemes. However, you can choose your schemes with <span style='font-family:monospace;font-size: 18px;'>NUCSYN_NETWORK_PP</span> (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>p</mi><mi>p</mi>
-  </mrow>
- </mrow></mstyle></math>-chain), <span style='font-family:monospace;font-size: 18px;'>NUCSYN_NETWORK_COLDCNO</span> (cold CNO cycle, which is sufficient for temperatures less than <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mo> log </mo>
-    </mrow>
-    <mrow><mn>10</mn>
-    </mrow>
-   </msub><mi>T</mi><mo>/</mo>
-   <mstyle mathvariant='normal'><mi>K</mi>
-   </mstyle><mo> &lsim; </mo><mn>8.2</mn>
-  </mrow>
- </mrow></mstyle></math>), <span style='font-family:monospace;font-size: 18px;'>NUCSYN_NETWORK_HOTCNO</span> (hot CNO cycle, explicitly includes <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &beta; </mi>
- </mrow></mstyle></math> decays and is probably not necessary for most purposes) and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_NETWORK_NeNaMgAl</span> (NeNa and MgAl cycles/chains). <span style='font-family:monospace;font-size: 18px;'>NUCSYN_NORMALIZE_NUCLEONS</span> preserves the number of nucleons in the burning routine, which should prevent numerical errors.</li>
-</ul>
-</li><li class="itemize_item">Further, <span style='font-family:monospace;font-size: 18px;'>NUCSYN_HBB_RENORMALIZE_MASS_FRACTIONS</span> will renormalize the total mass fraction to one in order to remove some errors. </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_S_PROCESS</span> activates the elemental <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>s</mi>
- </mrow></mstyle></math>-process, you might well want this. <span style='font-family:monospace;font-size: 18px;'>NUCSYN_EXTENDED_S_PROCESS</span> does the same for isotopes, but is not properly implemented yet. If you want to implement this then you should probably remove the elemental part, and I have not had a reason to do this yet (elements are observed&hellip; isotopes are not). The &ldquo;<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>13</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'><mi>C</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>-efficiency&rdquo; is set to its default by <span style='font-family:monospace;font-size: 18px;'>DEFAULT_C13_EFFICIENCY</span> (usually <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1</mn>
- </mrow></mstyle></math>) but see also <a href='#LyXCite-2007A_A___469_1013B'><span class="bib-abbrvciteauthor">Bonačić Marinović et al.</span></a> (<span class="bib-year">2007</span>). If you define <span style='font-family:monospace;font-size: 18px;'>C13_POCKET_CORRECTION</span> then the amount of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>s</mi>
- </mrow></mstyle></math>-process material is correctly for a change in intershell mass, the standard being <span style='font-family:monospace;font-size: 18px;'>STD_M_C13_POCKET</span>.</li>
-<li class="itemize_item">Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_STPAGB</span> for STPAGB stars. There are many associated options which you should not play with.</li>
-<li class="itemize_item">The <span style='font-family:monospace;font-size: 18px;'>NUCSYN_HS_LS_LOG</span> is an option for s-process logging and outputs the value of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mo form='prefix' fence='true' stretchy='true' symmetric='true'>[</mo>
-
-  <mrow><mi>h</mi><mi>s</mi>
-  </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>]</mo>
-
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mo form='prefix' fence='true' stretchy='true' symmetric='true'>[</mo>
-
-  <mrow><mi>l</mi><mi>s</mi>
-  </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>]</mo>
-
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mo form='prefix' fence='true' stretchy='true' symmetric='true'>[</mo>
-
-  <mrow><mi>h</mi><mi>s</mi><mo>/</mo><mi>l</mi><mi>s</mi>
-  </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>]</mo>
-
- </mrow></mstyle></math> (see e.g. <a href='#LyXCite-1998ApJ___497__388G'><span class="bib-abbrvciteauthor">Gallino et al.</span>, <span class="bib-year">1998</span></a>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_RADIOACTIVE_DECAY</span> allows decay of isotopes.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_FORCE_DUP_IN_COMENV</span> forces dredge up when a common envelope forms. This seems likely, as a companion star spiralling in will mix up the envelope.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_WR</span> switches on the massive star (and WR/Helium star) code. <span style='font-family:monospace;font-size: 18px;'>NUCSYN_WR_METALLICITY_CORRECTIONS</span> switches on the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>Z</mi><mo> &ne; </mo><mn>0.02</mn>
-  </mrow>
- </mrow></mstyle></math> extension to this code. <span style='font-family:monospace;font-size: 18px;'>NUCSYN_WR_LOG</span> outputs some information during the O/B or WR phase. <span style='font-family:monospace;font-size: 18px;'>NUCSYN_WR_TABLES</span> uses tabular values instead of fits (please use this) and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_WR_RS_TABLE</span> enables Richard Stancliffe's tables (this code is in <em>testing</em>).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_NOVAE</span> and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_SUPERNOVAE</span> switch on the novae and supernovae respectively. You should enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_NOVAE_FROM_TABLES</span> to use tables instead of fits. </li>
-<li class="itemize_item">For core-collapse supernovae choose either <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CCSNE_WOOSLEY_WEAVER_1995</span> or <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CCSNE_CHIEFFI_LIMONGI_2004</span>. 
-<br />
-
-
-
-<ul class="itemize" id='magicparlabel-7836'><li class="itemize_item">In the case of <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CCSNE_WOOSLEY_WEAVER_1995</span> you can choose to use their <span style='font-family:monospace;font-size: 18px;'>NUCSYN_SUPERNOVAE_CC_WW95_A</span> or <span style='font-family:monospace;font-size: 18px;'>B</span> or <span style='font-family:monospace;font-size: 18px;'>C</span> models.</li>
-<li class="itemize_item">In the case of <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CCSNE_CHIEFFI_LIMONGI_2004</span> you can either use their yields directly (best to do this as then the yields really are a function of mass cut) or use the Portinari-corrected versions which are less accurate (<span style='font-family:monospace;font-size: 18px;'>NUCSYN_CCSNE_CHIEFFI_LIMONGI_2004_PORTINARI</span>). Define <span style='font-family:monospace;font-size: 18px;'>NUCSYN_CCSNE_CHIEFFI_LIMONGI_2004_EXTRAPOLATE</span> to extrapolate beyond the end of their table at the high metallicity (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mi>Z</mi><mo>&gt;</mo><mn>0.02</mn>
-  </mrow>
- </mrow></mstyle></math>) end.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_SN_REDUCE_SODIUM</span> reduces the sodium yield: avoid this.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LIMIT_SN_TYPES</span> allows you to exclude SN yields from various types on the command line</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_R_PROCESS</span> allows <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>r</mi>
- </mrow></mstyle></math>-process yields: choose from <span style='font-family:monospace;font-size: 18px;'>NUCSYN_R_PROCESS_ARLANDINI1999</span> or <span style='font-family:monospace;font-size: 18px;'>NUCSYN_R_PROCESS_SIMMERER2004</span>. You also need to choose <span style='font-family:monospace;font-size: 18px;'>NUCSYN_R_PROCESS_FROM_SNE_MASS</span> which is the mass of <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>r</mi>
- </mrow></mstyle></math>-process material ejected in the SN, typically I choose <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow>
-     <mrow><mo>-</mo><mn>6</mn>
-     </mrow>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'>
-    <mrow><mspace width="6px" />
-     <msub subscriptshift="0.2ex">
-      <mrow><mi>M</mi>
-      </mrow>
-      <mrow><mo> &odot; </mo>
-      </mrow>
-     </msub>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> but this is quite arbitrary.</li>
-</ul>
-</li><li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCLEAR_REACTION_RATE_MULTIPLIERS</span> allows you to change nuclear reaction rates on the command line (see <a href='#LyXCite-2007A_A___466__641I'><span class="bib-abbrvciteauthor">Izzard et al.</span>, <span class="bib-year">2007</span><span class="bib-modifier">b</span></a> for the reasoning).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_SIGMAV_PRE_INTERPOLATE</span> allows interpolation of the nuclear cross section <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mo form='prefix' fence='true' stretchy='true' symmetric='true'>&lang;</mo>
-
-  <mrow><mi> &sigma; </mi><mi>v</mi>
-  </mrow>
-<mo form='postfix' fence='true' stretchy='true' symmetric='true'>&rang;</mo>
-
- </mrow></mstyle></math> from a pre-calculated table, rather than a recalculation of the values from analytic formulae as a function of temperature. This is about <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>10</mn>%
-  </mrow>
- </mrow></mstyle></math> quicker. You can change the resolution in <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>T</mi>
-    </mrow>
-    <mrow><mn>9</mn>
-    </mrow>
-   </msub><mo>=</mo><mi>T</mi><mo>/</mo><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>9</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'><mi>K</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> with <span style='font-family:monospace;font-size: 18px;'>NUCSYN_SIGMAV_INTERPOLATION_RESOLUTION</span> and you should enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_SIGMAV_INTERPOLATE_LOGT9</span> and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_SIGMAV_INTERPOLATE_LOGSIGMAV</span> so the interpolations are done in log space. <span style='font-family:monospace;font-size: 18px;'>SIGMAV_TINY</span> (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow>
-     <mrow><mo>-</mo><mn>100</mn>
-     </mrow>
-    </mrow>
-   </msup>
-  </mrow>
- </mrow></mstyle></math>) is a minimum value for the cross section. Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_HOT_SIGMAV</span> if you want to use high-temperature (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mo>&gt;</mo><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>9</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'><mi>K</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>) reaction rates (otherwise don't calculate them, because it's slower). Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_THERMALIZED_CORRECTIONS</span> for high temperature reactions (not normally required).</li>
-<li class="itemize_item">Enable <span style='font-family:monospace;font-size: 18px;'>NUCSYN_ALLOW_NO_PRODUCTION</span> to prevent the surface abundances from changing if <span style='font-family:monospace;font-size: 18px;'>--no_production</span> is used on the command line.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOW_MASS_STRIPPING</span> is used to change surface abundances as a function of mass stripped for star 1 and only for low mass. It is based on a lookup table of <em>TWIN</em>-code results. It is a temporary fudge for a particular problem and you probably do not want it.</li>
-<li class="itemize_item">There are various logging options. <span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOGGING</span> should be defined if you want any output at all.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_YIELDS</span> should be used if you want to calculate the yield from each star. Note that yields are calculated for each single star and the whole binary system separately. </li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOG_BINARY_MPYIELDS</span> outputs the yield <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'><mi>M</mi>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> for the binary system (if <span style='font-family:monospace;font-size: 18px;'>NUCSYN_YIELDS</span> and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOG_YIELDS</span> are defined).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOG_YIELDS</span> outputs the yields <em>at every timestep</em> (warning! this is a lot of output since it applies to <em>all</em> the isotopes, perhaps run through <span style='font-family:monospace;font-size: 18px;'>gawk</span> to reduce the output) if <span style='font-family:monospace;font-size: 18px;'>NUCSYN_YIELDS</span> is defined. If <span style='font-family:monospace;font-size: 18px;'>NUCSYN_YIELDS</span> is defined and <span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOG_YIELDS</span> is <em>not defined</em> then the yields will be output at the end of the evolution time – this is the usual case.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOG_BINARY_X_YIELDS</span> outputs the mass ejected from the binary.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOG_SINGLE_X_YIELDS</span> outputs the mass ejected from each star.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOG_MPYIELDS</span> outputs the <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>p</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'><mi>M</mi>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> yield for each star.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOG_DX_YIELDS</span> outputs the mass ejected from each star for each timestep.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_SHORT_LOG</span> outputs some stuff about the stars (usually in the TPAGB phase)</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LOG</span> outputs more stuff.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_LONG_LOG</span> outputs even more stuff.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_J_LOG</span> outputs some stuff for J-type stars.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_S_PROCESS_LOG</span> outputs some stuff to do with the s-process.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_STRUCTURE_LOG</span> outputs stuff to do with the stellar structure.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_XTOT_CHECKS</span> is supposed to check that <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msub subscriptshift="0.2ex">
-    <mrow><mo> &Sigma; </mo>
-    </mrow>
-    <mrow><mi>i</mi>
-    </mrow>
-   </msub>
-   <msub subscriptshift="0.2ex">
-    <mrow><mi>X</mi>
-    </mrow>
-    <mrow>
-     <mstyle mathvariant='normal'><mi>i</mi>
-     </mstyle>
-    </mrow>
-   </msub><mo>=</mo><mn>1</mn>
-  </mrow>
- </mrow></mstyle></math> (i.e. the mass fractions add to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1</mn>
- </mrow></mstyle></math>) all the time. This has not been used in a long time&hellip; so do not be surprised if it fails!</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_CEMP_LOGGING</span> and associated options are for the CEMP papers. Do not use these, they are experimental.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_PLANETARY_NEBULAE</span> provides some information about PNe formation.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_RUNTIME</span> provides information about the time the code spends in the <span style='font-family:monospace;font-size: 18px;'>nucsyn_tpagb</span> function.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_ID_SOURCES</span> is used to identify where the yields come from and is extremely useful.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>CONSMASS</span> is activated to check whether mass is conserved when a call is made to the <span style='font-family:monospace;font-size: 18px;'>nucsyn_binary_yield</span> function. If you find you are losing mass somewhere then this is probably a bug (or a numerical error, in which case you should try to fix it!) so activate <span style='font-family:monospace;font-size: 18px;'>CONSMASS</span> and the code will dump out when there is missing mass. See the <span style='font-family:monospace;font-size: 18px;'>nucsyn_binary_yield</span> function for details. <span style='font-family:monospace;font-size: 18px;'>CONSMASSDM</span> is an extension to this but I cannot remember what it does.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MIXDEBUG</span> outputs some debugging information in the mixing routines, but there's a lot of data... <span style='font-family:monospace;font-size: 18px;'>MIXLOG</span> is supposed to be a shorter version but I haven't used this for ages so it might not work. <span style='font-family:monospace;font-size: 18px;'>MIXDEBUG</span> is usually set in the routine you are considering rather than here because if it is activated in <span style='font-family:monospace;font-size: 18px;'>nucsyn.h</span> then it will be passed to <em>all</em> routines.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>AMU_GRAMS</span> and <span style='font-family:monospace;font-size: 18px;'>ANU_MEV</span> are constants and should not be changed! They give the atomic mass unit in grams and MeV.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUC_MASSES_DEBUG</span> enables debugging in the nuclear mass setting code.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_TPAGB_EDDINGTON_CHECKS</span> does something to tell you whether your AGB star exceeds the Eddington limit.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_GCE</span> enables other options which are used in my GCE code. Do not touch this unless you know what you are doing.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_ROTATION_EFFECTS</span> simulates extra <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow>
-   <msup><mrow />
-    <mrow><mn>14</mn>
-    </mrow>
-   </msup>
-   <mstyle mathvariant='normal'><mi>N</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> production at low-<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>Z</mi>
- </mrow></mstyle></math>. Do not touch.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_HUGE_PULSE_CRISTALLO</span> Enables a huge third dredge up based on Sergio Cristallo's models. Experimental.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_CONVECTIVE_MIXIN</span> Instead of mixing material into the whole envelope (as the original thermohaline mixing routine does) this uses the estimate of the convective envelope given in mrenv and mixes into that instead. Requires that you turn off thermohaline mixing (see <span style='font-family:monospace;font-size: 18px;'>MAYBE_NO_THERMOHALINE_MIXING</span> and the <span class="flex_args">--no_thermohaline_mixing 1</span><span style='font-family:monospace;font-size: 18px;'> </span>command-line option).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_STAR_BY_STAR_MATCHING</span> Enables some code to match stars to given observations.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_SAFE_XSURF</span> is defined if there is no possibility of a feedback loop which used to occur in the <span style='font-family:monospace;font-size: 18px;'>nucsyn_WR</span> functions. Newer versions avoid this by using <span style='font-family:monospace;font-size: 18px;'>NUCSYN_WR_TABLES</span> and so it should defined if <span style='font-family:monospace;font-size: 18px;'>NUCSYN_WR_TABLES</span> is defined.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>NUCSYN_MU_FUZZ</span> blurs the condition for accretion layers to sink to prevent unecessary calculations.</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>MATTSSON_MASS_LOSS</span> experimental mass-loss rates from Lars Mattsson (based on carbon abundances).</li>
-<li class="itemize_item"><span style='font-family:monospace;font-size: 18px;'>LITHIUM_TAB</span>LES experiments to introduce lithium as a function of mass and pulse number in HBBing stars.</li>
-</ul>
-<div class="standard" id='magicparlabel-7882'>Now you have edited this file to your specifications you need to rebuild the code. </div>
-
-<div class="standard" id='magicparlabel-7883'>There are further options in the file <span class="flex_file">binary_c_parameters.h</span> (details below) although it's unlikely you'll want to change any of them.</div>
-
-<div class="standard" id='magicparlabel-7888'><br />
-</div>
-<h2 class="section" id='magicparlabel-7889'><span class="section_label">10</span> <em><i>binary_c</i> </em>software development cycle</h2>
-<div class="standard" id='magicparlabel-7892'>This section describes the <span class='math'>binary_c</i></span>
- software development cycle.</div>
-<h3 class="subsection" id='magicparlabel-7893'><span class="subsection_label">10.1</span> The git revolution</h3>
-<div class="standard" id='magicparlabel-7894'>In its earliest days, I was the only person using <span class='math'>binary_c</i></span>
-. It didn't really work properly, so this was not surprising. As time went on, I aged and other, younger people started using <span class='math'>binary_c</i></span>
-. While this is great, it puts some burden on me as the maintainer. However, there is a better way! The decision was made to put <span class='math'>binary_c</i></span>
- into subversion (<span class="flex_software">SVN</span>) and all<div class="foot"><span class="foot_label">12</span><div class="foot_inner"><div class="plain_layout" id='magicparlabel-7902'>Well, <em>some</em>&hellip;</div>
-</div></div> was solved. Unfortunately, the University of Surrey has no <span class="flex_software">SVN</span> support, so I had to move everything to git which is apparently more modern (although I cannot really tell the difference).</div>
-
-<div class="standard" id='magicparlabel-7907'>You could use a graphical interface, such as <span class="flex_software">Gitkraken</span>, to work with <span class="flex_software">git</span><em> – </em>this may save you a lot of time and effort!</div>
-<h3 class="subsection" id='magicparlabel-7916'><span class="subsection_label">10.2</span> The master(trunk)–branch model<div id="sec_The_trunk_branch_model"></div>
-</h3>
-<div class="standard" id='magicparlabel-7917'>Code on <span class="flex_software">git</span> is like a tree. The main version of <span class='math'>binary_c</i></span>
- resides in the <em>master</em> version (like <span class="flex_software">SVN</span>'s <em>trunk</em>). When you first requested access to<em> </em><span class='math'>binary_c</i></span>, Rob will have made you a copy of the latest master version. This copy is called your <em>branch</em>. You could, in theory, have more than one <em>branch</em>, like a real (healthy) tree, but most people have just one branch.</div>
-
-<div class="standard" id='magicparlabel-7926'>To get <span class='math'>binary_c</i></span>, run</div>
-
-<div class="standard" id='magicparlabel-7927'><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings'>git clone gitlab@gitlab.eps.surrey.ac.uk:ri0005/<i>binary_c</i>.git</pre><br />
-</span>and you can make a new branch with <span class="flex_software">git</span> branch. </div>
-
-<div class="standard" id='magicparlabel-7936'>In your branch you can do <em>whatever you like</em>! Change the code, delete things, make new things, whatever. It's your branch. But, beware. You will want bug fixes to merge easily, so don't change your branch too radically, and make sure you update with trunk changes regularly (see Section&nbsp;<a href="#subsec_Updating_with_the">10.2.1</a> below).</div>
-<h4 class="subsubsection" id='magicparlabel-7937'><span class="subsubsection_label">10.2.1</span> Updating with the latest fixes<div id="subsec_Updating_with_the"></div>
-</h4>
-<div class="standard" id='magicparlabel-7938'>The <em>master</em> is periodically updated with fixes. Only Rob can do this. However, he posts to the <span class='math'>binary_c</i></span>
- mailing list to describe what he has done. Now, let's say you want to merge these fixes with your branch. You have to do </div>
-
-<div class="standard" id='magicparlabel-7939'><br />
-<pre class ='listings'>git merge</pre><br />
-and you're done.</div>
-
-<div class="standard" id='magicparlabel-7944'>Beware: there may be conflicts with your code (you will be informed). <em>git</em> tries very hard to merge code automatically, but sometimes this just is not possible. You have to fix these files and then tell git they are fixed.</div>
-
-<div class="standard" id='magicparlabel-7945'>Rob <em>assumes</em> you merge the trunk regularly and often. If you leave a long time between merging you will have problems, often because something in the code <em>on which you rely</em> has been changed (hopefully for the better). Do not let this happen! Merge regularly and often.</div>
-<h4 class="subsubsection" id='magicparlabel-7946'><span class="subsubsection_label">10.2.2</span> Committing your changes</h4>
-<div class="standard" id='magicparlabel-7947'>When you make changes in your branch, you should <em>commit</em> your code. Do this with</div>
-
-<div class="standard" id='magicparlabel-7948'><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings'>git commit </pre><br />
-</span>or possibly</div>
-
-<div class="standard" id='magicparlabel-7953'><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings'>git commit -a</pre><br />
-</span>which then will ask you to write a comment describing your changes. Please use your brain – one word comments are not (usually) of much use either to you or anyone else.</div>
-
-<div class="standard" id='magicparlabel-7958'>You should commit regularly and often. I do it every night. You then have a backup of your code for free!</div>
-<h4 class="subsubsection" id='magicparlabel-7959'><span class="subsubsection_label">10.2.3</span> Submitting changes to the <em>master</em></h4>
-<div class="standard" id='magicparlabel-7960'>Only Rob can/should make changes to the <em>master</em>. If you are ready to have your changes incorporated into the main version of <span class='math'>binary_c</i></span>
- which, need I remind you, you are obliged to do by the terms of the licence agreement, you should do the following:</div>
-
-<ul class="itemize" id='magicparlabel-7961'><li class="itemize_item">Run <span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings'>git pull</pre><br />
-</span> to make sure you have the latest version of your code.</li>
-<li class="itemize_item">Test your code to make sure it works as you expect.</li>
-<li class="itemize_item">Run <span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings'>git commit -a</pre><br />
-</span> to commit your code. Note that this does <em>not</em> send any information to the server, it is all done offline until you <em>push</em> you code (see below).</li>
-<li class="itemize_item">Run <span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings'>git merge</pre><br />
- </span>to merge all the latest changes into your code.</li>
-<li class="itemize_item">Fix any conflicts, test the code, make sure it works as you expect even with the latest changes to the trunk.</li>
-<li class="itemize_item">Run <span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings'>git push</pre><br />
- </span>to send code to the server.</li>
-<li class="itemize_item">Email Rob, tell him your branch is ready to commit, and tell him the <span class="flex_software">git</span> revision number of your last commit. You can also submit merge requests via the <span class="flex_software">gitlab</span> interface.</li>
-</ul>
-<div class="standard" id='magicparlabel-7992'>The rest is Rob's job. If you want another branch to work on while you wait, just do it.</div>
-<h4 class="subsubsection" id='magicparlabel-7993'><span class="subsubsection_label">10.2.4</span> Getting your old code back</h4>
-<div class="standard" id='magicparlabel-7994'>If you make a mistake, you can always get your old code back.</div>
-
-<div class="standard" id='magicparlabel-7995'><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings'>git revert </pre><br />
-</span> will change a file back to the version currently on the server.</div>
-
-
-<div class="standard" id='magicparlabel-8000'><br />
-</div>
-<h2 class="section" id='magicparlabel-8001'><span class="section_label">11</span> Cookbook</h2>
-<h3 class="subsection" id='magicparlabel-8002'><span class="subsection_label">11.1</span> How to log output</h3>
-<div class="standard" id='magicparlabel-8003'>Put your logging statement into <span class="flex_file">log_every_timestep.c</span> using the <span class="flex_cmacro">Printf</span> macro, e.g.,<br />
-<pre class ='listings <i>C</i>'>Printf();</pre><br />
-</div>
-<h3 class="subsection" id='magicparlabel-8016'><span class="subsection_label">11.2</span> How to find which source files contain a string</h3>
-<div class="standard" id='magicparlabel-8017'>Run</div>
-
-<div class="standard" id='magicparlabel-8018'><br />
-<pre class\s*='listings bash'>$ ./rgrep &lt;string&gt; {opts}</pre><br />
-The options (<span class="flex_args">{opts}</span>) are passed to <span class="flex_command">grep -r</span>, see <span class="flex_command">man grep</span> for details, and these are not required. Binary (object, executable, shared library) files are automatically skipped. Most often you will want to ignore case, e.g.,</div>
-
-<div class="standard" id='magicparlabel-8035'><b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ ./rgrep &lt;string&gt; -i</pre><br />
-</span></b></div>
-<h3 class="subsection" id='magicparlabel-8040'><span class="subsection_label">11.3</span> How to build with debugging output</h3>
-<div class="standard" id='magicparlabel-8041'><em>Binary_c</em> provides the <span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings <i>C</i>'>Dprint(...)</pre><br />
-</span> macro to allow you to output what is going on to the screen (<span style='font-family:monospace;font-size: 18px;'>stdout</span>). To turn this on, change the line in <em>binary_c_code_options.h</em> to</div>
-
-<div class="standard" id='magicparlabel-8046'><br />
-<pre class ='listings <i>C</i>'>#define DEBUG 1</pre><br />
-Then rebuild with debugging enabled,<br />
-<pre class\s*='listings bash'>$ cd builddir
-$ meson --reconfigure --buildtype=debug
-$ ninja</pre><br />
-You can provide an expression which must return true for debugging to be output. This is <span class="flex_cmacro">DEBUG_EXP</span> in <span class="flex_headerfile">binary_c_debug.h</span>. E.g.&nbsp;to only have output after 10Myr, use:</div>
-
-<div class="standard" id='magicparlabel-8065'><b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings <i>C</i>'>#define DEBUG_EXP (stardata-&gt;model.time &gt; 10.0)</pre><br />
-</span></b>Again, you will need to do a complete rebuild to make this work. You can use<span style='font-family:monospace;font-size: 18px;'> </span><span class="flex_cmacro">Dprint_no_newline()</span><span style='font-family:monospace;font-size: 18px;'> </span>macro to prevent the newline after a debugging statement.</div>
-<h3 class="subsection" id='magicparlabel-8074'><span class="subsection_label">11.4</span> How to check for NaNs (not a numbers)</h3>
-<div class="standard" id='magicparlabel-8075'>If <span class="flex_cmacro">NANCHECKS</span> is enabled in<span style='font-family:monospace;font-size: 18px;'> </span><span class="flex_headerfile">binary_c_code_options.h</span> you can use the <span class="flex_cmacro">NANCHECK(A)</span> macro, which checks whether <span class="flex_cmacro">A</span> is not a number, exiting with an error if this is the case. This is rather compiler dependent but should work fine with <span class="flex_software">gcc</span>.</div>
-<h3 class="subsection" id='magicparlabel-8096'><span class="subsection_label">11.5</span> How to exit <em><i>binary_c</i></em></h3>
-<div class="standard" id='magicparlabel-8097'>Do <em>not</em> use <span class="flex_programminglanguage">C</span>'s <span class="flex_cfunction">exit</span> function. Instead use the <span class="flex_cmacro">Exit_binary_c(&hellip;)</span> macro, with an error code from <span class="flex_headerfile">binary_c_error_codes.h</span>, e.g.</div>
-
-<div class="standard" id='magicparlabel-8114'><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class ='listings <i>C</i>'>Exit_binary_c(PIPE_FAILURE, &ldquo;My pipe failed! ARGH!&rdquo;);</pre><br />
-</span></div>
-<h3 class="subsection" id='magicparlabel-8119'><span class="subsection_label">11.6</span> How to debug segfaults</h3>
-<div class="standard" id='magicparlabel-8120'>Install <span class="flex_software">gdb</span>. Build <i>binary_c</i> with debugging:
-<br />
-
-<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ cd builddir
-$ meson --reconfigure --buildtype=debug
-$ ninja
-$ cd ..</pre><br />
-</span></b></div>
-
-<div class="standard" id='magicparlabel-8132'>Then run your test star with
-<br />
-
-<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ tbse debug </pre><br />
-</span></b></div>
-
-<div class="standard" id='magicparlabel-8137'>which will run <span class="flex_software">gdb</span> for you with the appropriate arguments to run the star. To find out where the bug is, use &ldquo;<span class="flex_args">bt</span>&rdquo; (backtrace) in <span class="flex_software">gdb</span>.</div>
-
-<div class="standard" id='magicparlabel-8150'>See also <a href="https://en.wikipedia.org/wiki/GNU_Debugger">https://en.wikipedia.org/wiki/GNU_Debugger</a></div>
-
-<div class="standard" id='magicparlabel-8155'>You may find that <span class="flex_software">valgrind</span> provides more information, especially when your segfault is caused by a memory leak.</div>
-<h3 class="subsection" id='magicparlabel-8160'><span class="subsection_label">11.7</span> How to debug memory leaks</h3>
-<div class="standard" id='magicparlabel-8161'>Build with debugging:
-<br />
-
-<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ cd builddir
-$ meson --reconfigure --buildtype=debug
-$ ninja
-$ cd ..</pre><br />
-</span></b></div>
-
-<div class="standard" id='magicparlabel-8169'>Then run 
-<br />
-
-<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ tbse valgrind</pre><br />
-</span></b></div>
-
-<div class="standard" id='magicparlabel-8174'>Find out how to use <em><span class="flex_software"><em>valgrind</em></span></em> at <a href="http://valgrind.org/">http://valgrind.org/</a>
-<br />
-
-You can also run <br />
-<pre class\s*='listings bash'>$ tbse callgrind</pre><br />
-<br />
-<pre class\s*='listings bash'>$ tbse cachegrind</pre><br />
-<br />
-<pre class\s*='listings bash'>$ tbse ptrcheck</pre><br />
-<br />
-<pre class\s*='listings bash'>$ tbse sgcheck</pre><br />
-</div>
-<h3 class="subsection" id='magicparlabel-8199'><span class="subsection_label">11.8</span> How to show the arguments that <em>tbse</em> would use, but do not evolve a star</h3>
-<div class="standard" id='magicparlabel-8200'>Run
-<br />
-
-<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ tbse echo</pre><br />
-</span></b></div>
-<h3 class="subsection" id='magicparlabel-8205'><span class="subsection_label">11.9</span> How to run a star which has the arguments in a file</h3>
-<div class="standard" id='magicparlabel-8206'>This is handy when you have a fail case (e.g. from a population synthesis run). Just run
-<br />
-
-<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ tbse &lt;filename&gt;</pre><br />
-</span></b></div>
-<h3 class="subsection" id='magicparlabel-8211'><span class="subsection_label">11.10</span> How to use profile guided optimization (PGO)</h3>
-<div class="standard" id='magicparlabel-8212'>When compiling with <span class="flex_software">gcc</span>, just run
-<br />
-
-<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ tbse pgo</pre><br />
-</span></b></div>
-
-<div class="standard" id='magicparlabel-8221'>You may want to change the <span class="flex_args">REPEAT</span> variable as defined in <span class="flex_bashscript">tbse</span>. It is set to 10000, but if your code is running too slowly, set it to less.</div>
-
-<div class="standard" id='magicparlabel-8230'>For details see <a href="https://en.wikipedia.org/wiki/Profile-guided_optimization">https://en.wikipedia.org/wiki/Profile-guided_optimization</a></div>
-
-<div class="standard" id='magicparlabel-8235'>Generally, I find a 5-10% speedup from PGO.</div>
-<h3 class="subsection" id='magicparlabel-8236'><span class="subsection_label">11.11</span> How to get help</h3>
-<h4 class="subsubsection" id='magicparlabel-8237'><span class="subsubsection_label">11.11.1</span> How to know what a parameter does</h4>
-<div class="standard" id='magicparlabel-8238'>Run 
-<br />
-
-<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ <i>binary_c</i> help &lt;parameter_name&gt;</pre><br />
-</span></b></div>
-
-<div class="standard" id='magicparlabel-8243'>or
-<br />
-
-<b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ <i>binary_c</i> help_all</pre><br />
-</span></b></div>
-
-<div class="standard" id='magicparlabel-8248'>You can even just give <em><i>binary_c</i></em> part of a parameter name and it will try to find the best match.</div>
-<h4 class="subsubsection" id='magicparlabel-8249'><span class="subsubsection_label">11.11.2</span> The mailing lists</h4>
-<div class="standard" id='magicparlabel-8250'>There is a development mailing list for <i>binary_c</i>, for details see section&nbsp;<a href="#subsec_mailing_lists">1.3</a>. </div>
-<h3 class="subsection" id='magicparlabel-8251'><span class="subsection_label">11.12</span> How to add a parameter</h3>
-<div class="standard" id='magicparlabel-8252'>Look at <span class="flex_headerfile">src/setup/cmd_line_args.h</span> . You will need to add a structure to <span class="flex_cmacro">CMD_LINE_ARGS</span>. Please read the comments in that file for instructions.</div>
-
-<div class="standard" id='magicparlabel-8261'>The storage space for the new parameter goes in the <span class="flex_cstruct">preferences_t</span> structure (see <span class="flex_headerfile">binary_c_structures.h</span>).</div>
-<h3 class="subsection" id='magicparlabel-8270'><span class="subsection_label">11.13</span> How to build on a Mac</h3>
-<div class="standard" id='magicparlabel-8271'>I hear it is possible! Please ask the mailing list.</div>
-<h3 class="subsection" id='magicparlabel-8272'><span class="subsection_label">11.14</span> How to build as a shared library</h3>
-<div class="standard" id='magicparlabel-8273'>Easy, just execute<b><span style='font-family:monospace;font-size: 18px;'> <br />
-<pre class\s*='listings bash'>$ ./make <i>libbinary_c.so</i></pre><br />
-</span></b> The API uses this shared library.</div>
-<h3 class="subsection" id='magicparlabel-8278'><span class="subsection_label">11.15</span> How to calculate stellar yields or population statistics</h3>
-
-<ol class="enumerate" id='magicparlabel-8279'><li class="enumerate_item">You have to build <em><i>binary_c</i></em> with <span class="flex_cmacro">NUCSYN</span> and <span class="flex_cmacro">NUCSYN_GCE</span> enabled, as well as the required physics</li>
-<li class="enumerate_item">You have to (re)build the shared library with <b><span style='font-family:monospace;font-size: 18px;'><br />
-<pre class\s*='listings bash'>$ make <i>libbinary_c.so</i></pre><br />
-</span></b></li>
-<li class="enumerate_item">You have to install the <span class="flex_perlmodule"><i>binary_grid</i></span> <span class="flex_scriptinglanguage">Perl</span> module (which must build <span class="flex_perlmodule"><i>binary_grid2</i></span> correctly).</li>
-<li class="enumerate_item">Edit the <span class="flex_perlscript">src/perl/yield_vs_time.pl</span> script to set paths and the output directory, and the various parameters.</li>
-<li class="enumerate_item">Now run the <span class="flex_perlscript">src/perl/yield_vs_time.pl</span> script. Likely you will have to edit this script to make sure the output directory is correct, and read its comments to make sure you set the timestep, choose between single/binary/mixed populations, etc. Run it with e.g.<b><span style='font-family:monospace;font-size: 18px;'> <br />
-<pre class\s*='listings bash'>$ ./src/perl/scripts2/yield_vs_time.pl dt=10 max_evolution_time=13700 vb=1</pre><br />
- </span></b>Note that, depending on the options you choose in <span class="flex_perlscript">yield_vs_time.pl</span>, this may take a long time!</li>
-</ol>
-<h3 class="subsection" id='magicparlabel-8324'><span class="subsection_label">11.16</span> <em>bash</em> autocompletion of <i>binary_c</i> arguments</h3>
-<div class="standard" id='magicparlabel-8325'>You can make <span class="flex_software">bash</span> autocomplete arguments to <i>binary_c</i> by putting the following in your <span class="flex_file">.bashrc</span> file (assuming you have <em><i>binary_c</i></em> in the directory specified by the environment variable <span class="flex_envvar">BINARY_C</span>) and restart <em>bash</em>.<br />
-
-<pre class ='listings Perl'># completion of <i>binary_c</i> arguments 
-_binary_c() 
-{
-    COMPREPLY=()
-    cur="${COMP_WORDS[COMP_CWORD]}"
-    prev="${COMP_WORDS[COMP_CWORD-1]}"
-    opts=$($BINARY_C/<i>binary_c</i> help |grep -A2 "where the arguments are a selection of :"|tail -1|tr " " "\n")
-    COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
-    return 0
-}
-complete -F _binary_c <i>binary_c</i>
-</pre><br />
-</div>
-<h3 class="subsection" id='magicparlabel-8354'><span class="subsection_label">11.17</span> <div id="subsec_git_revision"></div>
-How to find the <em>git</em> revision and <em>git</em> URL</h3>
-<div class="standard" id='magicparlabel-8355'>Put the following into your <span class="flex_bashscript">.bashrc</span> file, restart <em>bash</em> and use the command <span class="flex_command">git_rev</span> to find a suitable <span class="flex_software">git</span> revision string and <span class="flex_command">git_url</span> to find the repository URL.<br />
-<pre class ='listings'># git function for review number
-git_rev ()
-{
-    d=`date +%Y%m%d`
-    c=`git rev-list --full-history --all --abbrev-commit | wc -l | sed -e 's/^ *//'`
-    h=`git rev-list --full-history --all --abbrev-commit | head -1`
-    echo ${c}:${d}:${h}
-}
-
-# git function to find the repository url
-git_url ()
-{
-    git config --get remote.origin.url
-}
-</pre><br />
-</div>
-<h2 class="section" id='magicparlabel-8390'><span class="section_label">12</span> Changelog</h2>
-<div class="standard" id='magicparlabel-8391'>Note this is always an incomplete list!</div>
-
-<dl class='description' id='magicparlabel-8392'><dt class="description_label">Version&nbsp;2.1</dt>
-<dd class="description_item"> Time integration is now forward-Euler, RK2 or RK4, rationalised the time evolution loop, events subsystem introduced, fixed timesteps now standard, command line macros, update mass transfer rates, many bug fixes.</dd>
-<dt class="description_label">Version&nbsp;2.0</dt>
-<dd class="description_item"> Finally, RGI had some time to sit down and redesign the guts of <em><i>binary_c</i></em>. Version 2.0 is a cleaned up, sensible version of the old code. It has better logic, naming, time resolution, setup, etc.</dd>
-<dt class="description_label">Version&nbsp;1.2prexx</dt>
-<dd class="description_item"> Lots of updates! CEMPs project (Utrecht), experimental stuff to better model rotation, tables replace many fits (e.g.<span style='font-family:monospace;font-size: 18px;'>&nbsp;</span><span class="flex_cfunction">nucsyn_WR</span>), interaction with <span style='font-family:monospace;font-size: 18px;'><i>binary_grid</i></span> <span class="flex_scriptinglanguage">Perl</span>  module for population synthesis, external users (Selma, Joke, Carlo).</dd>
-<dt class="description_label">Version&nbsp;1.2</dt>
-<dd class="description_item"> Include STPAGB stars, batchmode and <span class="flex_perlscript">grid.pl</span> references, <span class="flex_cfunction">spiky_luminosity</span>, removal of the adaptive grid. Also mention <span class="flex_perlcode">gce.pl</span>. </dd>
-<dt class="description_label">Version&nbsp;1.1</dt>
-<dd class="description_item"> Minor changes to include support for variation of initial abundances via command-line switches for Hilke's GCE project.</dd>
-<dt class="description_label">Version&nbsp;1.0</dt>
-<dd class="description_item"> The original version.</dd>
-</dl>
-<h2 class="section" id='magicparlabel-8418'><span class="section_label">13</span> Acknowledgements</h2>
-<div class="standard" id='magicparlabel-8419'>This document was prepared using the wonderful <a href="https://www.lyx.org/">LyX</a>.</div>
-
-<div class="standard" id='magicparlabel-8420'><br />
-</div>
-
-<div class="standard" id='magicparlabel-8421'><h2 class='bibtex'>References</h2><div class='bibtex'><div class='bibtexentry' id='LyXCite-1999ApJ___525__886A'><span class='bibtexlabel'>Arlandini et al. 1999</span><span class='bibtexinfo'><span class="bib-fullnames:author">Arlandini, <i>C</i>., Käppeler, F., Wisshak, K., Gallino, R., Lugaro, M., Busso, M., and Straniero, O.</span>, "<span class="bib-title">Neutron Capture in Low-Mass Asymptotic Giant Branch Stars: Cross Sections and Abundance Signatures</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">525</span> (<span class="bib-year">1999</span>), pp. <span class="bib-pages">886-900</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2007A_A___469_1013B'><span class='bibtexlabel'>Bonačić Marinović et al. 2007</span><span class='bibtexinfo'><span class="bib-fullnames:author">Bonačić Marinović, A., Izzard, R.~G., Lugaro, M., and Pols, O.~R.</span>, "<span class="bib-title">The s-process in stellar population synthesis: a new approach to understanding AGB stars</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">469</span> (<span class="bib-year">2007</span>), pp. <span class="bib-pages">1013-1025</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2004ApJ___608__405C'><span class='bibtexlabel'>Chieffi and Limongi 2004</span><span class='bibtexinfo'><span class="bib-fullnames:author">Chieffi, A. and Limongi, M.</span>, "<span class="bib-title">Explosive Yields of Massive Stars from $Z=0$ to $Z = Z_{\odot}$</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">608</span> (<span class="bib-year">2004</span>), pp. <span class="bib-pages">405-410</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2002NewA____7___55D'><span class='bibtexlabel'>De Donder and Vanbeveren 2002</span><span class='bibtexinfo'><span class="bib-fullnames:author">De Donder, E. and Vanbeveren, D.</span>, "<span class="bib-title">The chemical evolution of the solar neighbourhood: the effect of binaries</span>", <i><span class="bib-journal">New Astronomy</span></i>  <span class="bib-volume">7</span> (<span class="bib-year">2002</span>), pp. <span class="bib-pages">55-84</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2017PASA___34____1D'><span class='bibtexlabel'>De Marco and Izzard 2017</span><span class='bibtexinfo'><span class="bib-fullnames:author">De Marco, O. and Izzard, R.~G.</span>, "<span class="bib-title">Dawes Review 6: The Impact of Companions on Stellar Evolution</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">34</span> (<span class="bib-year">2017</span>), pp. <span class="bib-pages">e001</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2000A_A___360_1043D'><span class='bibtexlabel'>Dewi and Tauris 2000</span><span class='bibtexinfo'><span class="bib-fullnames:author">Dewi, J.~D.~M. and Tauris, T.~M.</span>, "<span class="bib-title">On the energy equation and efficiency parameter of the common envelope evolution</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">360</span> (<span class="bib-year">2000</span>), pp. <span class="bib-pages">1043-1051</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2003MNRAS_338__973D'><span class='bibtexlabel'>Dray et al. 2003</span><span class='bibtexinfo'><span class="bib-fullnames:author">Dray, L.~M., Tout, <i>C</i>.~A., Karakas, A.~I., and Lattanzio, J.~C.</span>, "<span class="bib-title">Chemical enrichment by Wolf-Rayet and asymptotic giant branch stars</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">338</span> (<span class="bib-year">2003</span>), pp. <span class="bib-pages">973-989</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-1998ApJ___497__388G'><span class='bibtexlabel'>Gallino et al. 1998</span><span class='bibtexinfo'><span class="bib-fullnames:author">Gallino, R., Arlandini, <i>C</i>., Busso, M., Lugaro, M., Travaglio, <i>C</i>., Straniero, O., Chieffi, A., and Limongi, M.</span>, "<span class="bib-title">Evolution and Nucleosynthesis in Low-Mass Asymptotic Giant Branch Stars. II. Neutron Capture and the s-Process</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">497</span> (<span class="bib-year">1998</span>), pp. <span class="bib-pages">388</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-1996ApJ___470L__97H'><span class='bibtexlabel'>Hachisu et al. 1996</span><span class='bibtexinfo'><span class="bib-fullnames:author">Hachisu, I., Kato, M., and Nomoto, K.</span>, "<span class="bib-title">A New Model for Progenitor Systems of Type IA Supernovae</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">470</span> (<span class="bib-year">1996</span>), pp. <span class="bib-pages">L97+</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2002MNRAS_329_897H'><span class='bibtexlabel'>Hurley et al. 2002</span><span class='bibtexinfo'><span class="bib-fullnames:author">Hurley, J.~R., Tout, <i>C</i>.~A., and Pols, O.~R.</span>, "<span class="bib-title">Evolution of binary stars and the effect of tides on binary populations</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">329</span> (<span class="bib-year">2002</span>), pp. <span class="bib-pages">897--928</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2013A_ARv__21___59I'><span class='bibtexlabel'>Ivanova et al. 2013</span><span class='bibtexinfo'><span class="bib-fullnames:author">Ivanova, N., Justham, S., Chen, X., De Marco, O., Fryer, <i>C</i>.~L., Gaburov, E., Ge, H., Glebbeek, E., Han, Z., Li, X.-D., Lu, G., Marsh, T., Podsiadlowski, P., Potter, A., Soker, N., Taam, R., Tauris, T.~M., van den Heuvel, E.~P.~J., and Webbink, R.~F.</span>, "<span class="bib-title">Common envelope evolution: where we stand and how we can move forward</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">21</span> (<span class="bib-year">2013</span>), pp. <span class="bib-pages">59</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-1999ApJS__125__439I'><span class='bibtexlabel'>Iwamoto et al. 1999</span><span class='bibtexinfo'><span class="bib-fullnames:author">Iwamoto, K., Brachwitz, F., Nomoto, K., Kishimoto, N., Umeda, H., Hix, W.~R., and Thielemann, F.~K.</span>, "<span class="bib-title">Nucleosynthesis in Chandrasekhar Mass Models for Type IA Supernovae and Constraints on Progenitor Systems and Burning-Front Propagation</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">125</span> (<span class="bib-year">1999</span>), pp. <span class="bib-pages">439-462</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-Izzard_et_al_2003c_Monash'><span class='bibtexlabel'>Izzard and Tout 2003</span><span class='bibtexinfo'><span class="bib-fullnames:author">Izzard, R.~G. and Tout, <i>C</i>.~A.</span>, "<span class="bib-title">Nucleosynthesis in Binary Populations</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">20</span> (<span class="bib-year">2003</span>), pp. <span class="bib-pages">345-350</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-Izzard_et_al_2003b_AGBs'><span class='bibtexlabel'>Izzard et al. 2004</span><span class='bibtexinfo'><span class="bib-fullnames:author">Izzard, R.~G., Tout, <i>C</i>.~A., Karakas, A.~I., and Pols, O.~R.</span>, "<span class="bib-title">A New Synthetic Model for AGB Stars</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">350</span> (<span class="bib-year">2004</span>), pp. <span class="bib-pages">407-426</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2006astro_ph_12390I'><span class='bibtexlabel'>Izzard et al. 2006a</span><span class='bibtexinfo'><span class="bib-fullnames:author">Izzard, R.~G., Gibson, B.~K., and Stancliffe, R.~J.</span>, "<span class="bib-title">Galactic Sodium from AGB Stars</span>", <i><span class="bib-journal">ArXiv Astrophysics e-prints</span></i>  (<span class="bib-year">2006</span>).</span></div>
-<div class='bibtexentry' id='LyXCite-2006A_A___460__565I'><span class='bibtexlabel'>Izzard et al. 2006b</span><span class='bibtexinfo'><span class="bib-fullnames:author">Izzard, R.~G., Dray, L.~M., Karakas, A.~I., Lugaro, M., and Tout, <i>C</i>.~A.</span>, "<span class="bib-title">Population nucleosynthesis in single and binary stars. I. Model</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">460</span> (<span class="bib-year">2006</span>), pp. <span class="bib-pages">565-572</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2007A_A___470__661I'><span class='bibtexlabel'>Izzard et al. 2007a</span><span class='bibtexinfo'><span class="bib-fullnames:author">Izzard, R.~G., Jeffery, <i>C</i>.~S., and Lattanzio, J.</span>, "<span class="bib-title">Origin of the early-type R stars: a binary-merger solution to a century-old problem?</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">470</span> (<span class="bib-year">2007</span>), pp. <span class="bib-pages">661-673</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2007A_A___466__641I'><span class='bibtexlabel'>Izzard et al. 2007b</span><span class='bibtexinfo'><span class="bib-fullnames:author">Izzard, R.~G., Lugaro, M., Karakas, A.~I., Iliadis, <i>C</i>., and van Raai, M.</span>, "<span class="bib-title">Reaction rate uncertainties and the operation of the NeNa and MgAl chains during HBB in intermediate-mass AGB stars</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">466</span> (<span class="bib-year">2007</span>), pp. <span class="bib-pages">641-648</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2009A_A___508_1359I'><span class='bibtexlabel'>Izzard et al. 2009</span><span class='bibtexinfo'><span class="bib-fullnames:author">Izzard, R.~G., Glebbeek, E., Stancliffe, R.~J., and Pols, O.~R.</span>, "<span class="bib-title">Population synthesis of binary carbon-enhanced metal-poor stars</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">508</span> (<span class="bib-year">2009</span>), pp. <span class="bib-pages">1359-1374</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2012IAUS__283___95I'><span class='bibtexlabel'>Izzard et al. 2012</span><span class='bibtexinfo'><span class="bib-fullnames:author">Izzard, R.~G., Hall, P.~D., Tauris, T.~M., and Tout, <i>C</i>.~A.</span>, "<span class="bib-title">Common envelope evolution</span>", in <i><span class="bib-booktitle">IAU Symposium</span></i> vol. <span class="bib-volume">283</span>,  (<span class="bib-year">2012</span>), pp. <span class="bib-pages">95-102</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2018MNRAS_473_2984I'><span class='bibtexlabel'>Izzard et al. 2018</span><span class='bibtexinfo'><span class="bib-fullnames:author">Izzard, R.~G., Preece, H., Jofre, P., Halabi, G.~M., Masseron, T., and Tout, <i>C</i>.~A.</span>, "<span class="bib-title">Binary stars in the Galactic thick disc</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">473</span> (<span class="bib-year">2018</span>), pp. <span class="bib-pages">2984-2999</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-1998ApJ___494__680J'><span class='bibtexlabel'>José  and Hernanz 1998</span><span class='bibtexinfo'><span class="bib-fullnames:author">José , J. and Hernanz, M.</span>, "<span class="bib-title">Nucleosynthesis in Classical Novae: CO versus ONe White Dwarfs</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">494</span> (<span class="bib-year">1998</span>), pp. <span class="bib-pages">680</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-Parameterising_3DUP_Karakas_Lattanzio_Pols'><span class='bibtexlabel'>Karakas et al. 2002</span><span class='bibtexinfo'><span class="bib-fullnames:author">Karakas, A.~I., Lattanzio, J.~C., and Pols, O.~R.</span>, "<span class="bib-title">Parameterising the third dredge-up in asymptotic giant branch stars.</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">19</span> (<span class="bib-year">2002</span>), pp. <span class="bib-pages">515-526</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2001MNRAS_322__231K'><span class='bibtexlabel'>Kroupa 2001</span><span class='bibtexinfo'><span class="bib-fullnames:author">Kroupa, P.</span>, "<span class="bib-title">On the variation of the initial mass function</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">322</span> (<span class="bib-year">2001</span>), pp. <span class="bib-pages">231-246</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-KTG1993MNRAS_262_545K'><span class='bibtexlabel'>Kroupa et al. 1993</span><span class='bibtexinfo'><span class="bib-fullnames:author">Kroupa, P., Tout, <i>C</i>.A., and Gilmore, G.</span>, "<span class="bib-title">The distribution of low-mass stars in the Galactic disc</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">262</span> (<span class="bib-year">1993</span>), pp. <span class="bib-pages">545--587</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-1995ApJ___452___62L'><span class='bibtexlabel'>Livne and Arnett 1995</span><span class='bibtexinfo'><span class="bib-fullnames:author">Livne, E. and Arnett, D.</span>, "<span class="bib-title">Explosions of Sub--Chandrasekhar Mass White Dwarfs in Two Dimensions</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">452</span> (<span class="bib-year">1995</span>), pp. <span class="bib-pages">62</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2001A_A___365__491N'><span class='bibtexlabel'>Nelemans et al. 2001</span><span class='bibtexinfo'><span class="bib-fullnames:author">Nelemans, G., Yungelson, L.~R., Portegies Zwart, S.~F., and Verbunt, F.</span>, "<span class="bib-title">Population synthesis for double white dwarfs . I. Close detached systems</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">365</span> (<span class="bib-year">2001</span>), pp. <span class="bib-pages">491-507</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-2004ApJ___617_1091S'><span class='bibtexlabel'>Simmerer et al. 2004</span><span class='bibtexinfo'><span class="bib-fullnames:author">Simmerer, J., Sneden, <i>C</i>., Cowan, J.~J., Collier, J., Woolf, V.~M., and Lawler, J.~E.</span>, "<span class="bib-title">The Rise of the s-Process in the Galaxy</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">617</span> (<span class="bib-year">2004</span>), pp. <span class="bib-pages">1091-1114</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-1993ApJ___413__641V'><span class='bibtexlabel'>Vassiliadis and Wood 1993</span><span class='bibtexinfo'><span class="bib-fullnames:author">Vassiliadis, E. and Wood, P.~R.</span>, "<span class="bib-title">Evolution of low- and intermediate-mass stars to the end of the asymptotic giant branch with mass loss</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">413</span> (<span class="bib-year">1993</span>), pp. <span class="bib-pages">641--657</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-1995ApJS__101__181W'><span class='bibtexlabel'>Woosley and Weaver 1995</span><span class='bibtexinfo'><span class="bib-fullnames:author">Woosley, S.~E. and Weaver, T.~A.</span>, "<span class="bib-title">The Evolution and Explosion of Massive Stars. II. Explosive Hydrodynamics and Nucleosynthesis</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">101</span> (<span class="bib-year">1995</span>), pp. <span class="bib-pages">181</span>.</span></div>
-<div class='bibtexentry' id='LyXCite-1986ApJ___301__601W'><span class='bibtexlabel'>Woosley et al. 1986</span><span class='bibtexinfo'><span class="bib-fullnames:author">Woosley, S.~E., Taam, R.~E., and Weaver, T.~A.</span>, "<span class="bib-title">Models for Type I supernova. I - Detonations in white dwarfs</span>", <i><span class="bib-journal"></span></i>  <span class="bib-volume">301</span> (<span class="bib-year">1986</span>), pp. <span class="bib-pages">601-623</span>.</span></div>
-</div></div>
-
-<div class="standard" id='magicparlabel-8422'><br />
-</div>
-
-
-<HR><H1>Appendix</H1>
-<h2 class="section" id='magicparlabel-8425'><span class="section_label">A</span> Grid options (<em>grid_options</em> hash)</h2>
-<div class="standard" id='magicparlabel-8426'><div id="sec_grid_options"></div>
-The following summarises the <span style='font-family:monospace;font-size: 18px;'>grid_options</span> hash elements as stored in
-<br />
-
- <span style='font-family:monospace;font-size: 18px;'>$binary_grid2_object-&gt;{_hash_options}</span>. Please note that some options are (perhaps) no longer used and are left in this manual as a reference guide only. </div>
-
-<dl class='description' id='magicparlabel-8427'><dt class="description_label">alarm_procedure</dt>
-<dd class="description_item"> When a signal is captured (usually on a timeout) the alarm_procedure tells us what to do. If <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0</mn>
- </mrow></mstyle></math> then the grid exits. If <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1</mn>
- </mrow></mstyle></math> it tries to restart on the next star (although this may be buggy it is the default!). Really you should fix the problem if there is a timeout because it should not happen.</dd>
-<dt class="description_label">always_reopen_arg_files</dt>
-<dd class="description_item"> If 1 then argument log files are always reopened when new arguments are sent to <i>binary_c</i>. Can be very expensive in I/O operations, i.e. slow. </dd>
-<dt class="description_label">always&nbsp;flush&nbsp;binary_err</dt>
-<dd class="description_item"> Set to 1 (default) to force the flushing of the <span style='font-family:monospace;font-size: 18px;'>stderr</span> channel out of <em><i>binary_c</i></em>. If you don't do this, stderr output will pile up and eventually stop the grid from functioning. Do not change it unless you <em>know</em> there will be no <span style='font-family:monospace;font-size: 18px;'>stderr</span> output from <em><i>binary_c</i></em>.</dd>
-<dt class="description_label">arg_checking</dt>
-<dd class="description_item"> Sometimes, an argument to <i>binary_c</i> will not be recognised (e.g. if you set something in a bse_option which is not compatible with your <i>binary_c</i>, perhaps because you haven't enabled some feature in <i>binary_c</i>) and the grid will give errors (and/or crash) which are rather cryptic. Instead of this, you can set arg_checking to 1 to have strict checking of each argument that is passed to <i>binary_c</i>. This is, however, rather slow (because it requires a lot of I/O) so the default is 0. </dd>
-<dt class="description_label">args</dt>
-<dd class="description_item"> Not technically an option, but is the string of arguments which is passed to <em><i>binary_c</i>/nucsyn</em>. Useful for logging or debugging.</dd>
-<dt class="description_label">binary</dt>
-<dd class="description_item"> The duplicity. If binary is 1 then the grid runs binary stars, if 0 then single stars.</dd>
-<dt class="description_label">cache_binary_c_output</dt>
-<dd class="description_item"> If this is 1 (the default) then output from <i>binary_c</i> is cached in a local array before being processed through <span style='font-family:monospace;font-size: 18px;'>tbse_line()</span> calls. This should be faster, because it means less switching from one process to another, but its use means that <em><i>binary_c</i></em> is out of sync with <span style='font-family:monospace;font-size: 18px;'>tbse_line()</span>, so debugging is more difficult.</dd>
-<dt class="description_label">colour</dt>
-<dd class="description_item"> If <span style='font-family:monospace;font-size: 18px;'>colour=1</span> then verbose output (see <span style='font-family:monospace;font-size: 18px;'>vb</span>) is in colour, using the <span style='font-family:monospace;font-size: 18px;'>Term::ANSIColor</span> Perl module. This is recommended.</dd>
-<dt class="description_label">disable_signal</dt>
-<dd class="description_item"> You can disable a specific signal with this hash, e.g. to disable <span style='font-family:monospace;font-size: 18px;'>INT</span> signals, set <span style='font-family:monospace;font-size: 18px;'>$binary_grid::grid_options{disable_signal}{INT}=1;</span></dd>
-<dt class="description_label">exit_on_eval_failure</dt>
-<dd class="description_item"> When each star is run, it is inside a <em>Perl</em> <span style='font-family:monospace;font-size: 18px;'>eval</span> construct. If there is an error (i.e. <span style='font-family:monospace;font-size: 18px;'>$@</span> is not undef) <em>and</em> <span style='font-family:monospace;font-size: 18px;'>exit_on_eval_failure</span> is defined then the grid is stopped. Otherwise, the grid goes on in the hope that the error does not persist (possibly dubious!).</dd>
-<dt class="description_label">force_local_hdd_use</dt>
-<dd class="description_item"> Checks to see if the disks to which you are outputting data are local or remotely mounted. If the latter, <i>binary_grid</i> refuses to work. You should (of course) always use local disks for your output – it is much faster. (Defaults to 1 on Unix systems.)</dd>
-<dt class="description_label">flexigrid</dt>
-<dd class="description_item"> Hash used to set up the flexigrid, see Section&nbsp;<a href="#sec_flexigrid">6.11</a>.</dd>
-<dt class="description_label">grid_defaults_set</dt>
-<dd class="description_item"> Logic control variable, set to 1 if grid_defaults has been called.</dd>
-<dt class="description_label">lastargs</dt>
-<dd class="description_item"> Very similar to log_args but at a slightly different place in the code. Should be avoided, use <span style='font-family:monospace;font-size: 18px;'>log_args</span> instead.</dd>
-<dt class="description_label">libpath</dt>
-<dd class="description_item"> Path to libraries to be included in the calling of the <em><i>binary_c</i>/nucsyn</em> executable. This harks back to the days whens <em><i>binary_c</i>/nucsyn</em> was built as a set of shared libraries. These days it is built statically, so libpath is usually an empty string (and hence is ignored).</dd>
-<dt class="description_label">log_args</dt>
-<dd class="description_item"> If this is set to <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1</mn>
- </mrow></mstyle></math> then the arguments passed to <em><i>binary_c</i>/nucsyn</em> are saved in a file in <span style='font-family:monospace;font-size: 18px;'>/tmp/</span> (usually <span style='font-family:monospace;font-size: 18px;'>/tmp/<i>binary_c</i>-args</span> or similar, with separate files for each thread). This is very useful when the grid freezes as you can immediately see which stellar system has caused the problem and then rerun it manually. </dd>
-<dt class="description_label">maxq_per_thread</dt>
-<dd class="description_item"> The maximum number of stars allowed to sit on the thread queue, per thread. You do not want the thread queue to become indefinitely large because when that happens the resources to store the queue (RAM) will become significant. Default is 10.</dd>
-<dt class="description_label">newline</dt>
-<dd class="description_item"> If <span style='font-family:monospace;font-size: 18px;'>vb=1</span> then the value of this option is used as the end of line character. You can use either <span style='font-family:monospace;font-size: 18px;'>&ldquo;\x0d&rdquo;</span> (just a carriage return) or <span style='font-family:monospace;font-size: 18px;'>&ldquo;\n&rdquo;</span> which is the carriage return with a line feed (the usual concept of &ldquo;new line&rdquo;).</dd>
-<dt class="description_label">nice</dt>
-<dd class="description_item"> A string containing the nice command used to run <i><i>binary_c</i>/nucsyn</i>. Usually no nice is used, so this is '<span style='font-family:monospace;font-size: 18px;'>nice -n +0</span>'. You can leave this as it is and run '<span style='font-family:monospace;font-size: 18px;'>nice grid.pl</span>' if you want the whole grid to be &ldquo;niced&rdquo;.</dd>
-<dt class="description_label">no_signals</dt>
-<dd class="description_item"> Set to 1 to disable Perl signals. Useful for working with Condor.</dd>
-<dt class="description_label">operating_system</dt>
-<dd class="description_item"> Saves details of the current operating system (from <em>rob_misc.pm</em>)</dd>
-<dt class="description_label">parse_bse_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>parse_bse_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>).</dd>
-<dt class="description_label">parse_bse_function_pointer</dt>
-<dd class="description_item"> In your grid script you need to define a subroutine (also known as a function) to be used for data parsing. Usually this is called <span style='font-family:monospace;font-size: 18px;'>parse_bse </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>).</dd>
-<dt class="description_label">prog</dt>
-<dd class="description_item"> The <em><i>binary_c</i>/nucsyn</em> executable name, usually '<span style='font-family:monospace;font-size: 18px;'><i>binary_c</i></span>'. See also <span style='font-family:monospace;font-size: 18px;'>rootpath</span>.</dd>
-<dt class="description_label">progenitor</dt>
-<dd class="description_item"> Not really a grid option, but stores the system information (<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math> or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>P</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>e</mi>
- </mrow></mstyle></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>p</mi>
- </mrow></mstyle></math> etc.) – useful for debugging or logging.</dd>
-<dt class="description_label">progenitor_hash</dt>
-<dd class="description_item"> As progenitor but stores each item in a hash.<em> </em></dd>
-<dt class="description_label">repeat</dt>
-<dd class="description_item"> The number of times <em><span style='font-family:monospace;font-size: 18px;'><i>binary_c</i></span></em> is called for each grid point, default is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>1</mn>
- </mrow></mstyle></math>. This is useful for increasing the resolution in situations where Monte-Carlo methods are used such as the random supernova or white dwarf kicks.</dd>
-<dt class="description_label">rootpath</dt>
-<dd class="description_item"> The directory in which the <em><i>binary_c</i>/nucsyn</em> code source and executable reside. See also <span style='font-family:monospace;font-size: 18px;'>prog</span> and <span style='font-family:monospace;font-size: 18px;'>srcpath</span>.</dd>
-<dt class="description_label">single_star_period</dt>
-<dd class="description_item"> The orbital period (days) given to single stars (default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>1</mn>
-   <msup>
-    <mrow><mn>0</mn>
-    </mrow>
-    <mrow><mn>50</mn>
-    </mrow>
-   </msup><mspace width="6px" />
-   <mstyle mathvariant='normal'><mi>d</mi>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>).</dd>
-<dt class="description_label">starting_snapshot_file</dt>
-<dd class="description_item"> Filename of a snapshot to be loaded before the grid is started.</dd>
-<dt class="description_label">snapshot_file</dt>
-<dd class="description_item"> Filename used to save the status of the grid in a snapshot so it can be restarted. Defaults to <span style='font-family:monospace;font-size: 18px;'>/tmp/<i>binary_c</i>-snapshot</span> (where /tmp/ is set by the '<span style='font-family:monospace;font-size: 18px;'>tmp</span>' grid option). </dd>
-<dt class="description_label">srcpath</dt>
-<dd class="description_item"> Location of the <i>binary_c</i> source files. Usually this is just <span style='font-family:monospace;font-size: 18px;'>rootpath</span> with '<span style='font-family:monospace;font-size: 18px;'>/src</span>' appended. </dd>
-<dt class="description_label">suspend_files</dt>
-<dd class="description_item"> An anonymous array (set with <span style='font-family:monospace;font-size: 18px;'>[...]</span>) containing filenames that should be watched. If one exists, the grid is suspended to disk using the snapshotting mechanism (see snapshot_file).</dd>
-<dt class="description_label">tmp</dt>
-<dd class="description_item"> Location of temporary files. Usually this is <em>/tmp</em> (on Unix/Linux) and certainly it should be a local disk. If you have multiple users on one PC, they cannot <em>all</em> use <em>/tmp</em>.</dd>
-<dt class="description_label">thread_max_freeze_time_before_warning</dt>
-<dd class="description_item"> The maximum time a thread loops its calls to <span style='font-family:monospace;font-size: 18px;'>tbse()</span> before a warning is issued (seconds, default 10).</dd>
-<dt class="description_label">thread_precreate_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_precreate_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>).</dd>
-<dt class="description_label">thread_precreate_function_pointer</dt>
-<dd class="description_item"> A pointer to a function to be called just before <span style='font-family:monospace;font-size: 18px;'>threads-&gt;create</span> is used to start a thread. Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
-<dt class="description_label">thread_prejoin_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_prejoin_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>).</dd>
-<dt class="description_label">thread_prejoin_function_pointer</dt>
-<dd class="description_item"> A pointer to a function called just before a thread is <span style='font-family:monospace;font-size: 18px;'>join</span>ed. Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
-<dt class="description_label">thread_presleep</dt>
-<dd class="description_item"><span style='font-family:monospace;font-size: 18px;'> </span>A thread waits for this length of time (in seconds) before it starts in order that all other threads have time to start before any output is logged to the screen. As such this is just to keep output pretty and should be small (default 1 second).</dd>
-<dt class="description_label">thread_postjoin_function</dt>
-<dd class="description_item"><span style='font-family:monospace;font-size: 18px;'> </span>Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_postjoin_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
-<dt class="description_label">thread_postjoin_function_pointer</dt>
-<dd class="description_item"> A pointer to a function called just after a thread is <span style='font-family:monospace;font-size: 18px;'>join</span>ed. Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
-<dt class="description_label">thread_postrun_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>thread_postrun_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
-<dt class="description_label">thread_postrun_function_pointer</dt>
-<dd class="description_item"> A pointer to a function to be called just after a <span style='font-family:monospace;font-size: 18px;'>thread-&gt;create</span> call (and just after <span style='font-family:monospace;font-size: 18px;'>$@</span> is checked for a thread-creation error). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
-<dt class="description_label">threads_entry_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>threads_entry_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
-<dt class="description_label">threads_entry_function_pointer</dt>
-<dd class="description_item"> A pointer to a function called from inside a thread just before flexigrid() is called. Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
-<dt class="description_label">threads_flush_function</dt>
-<dd class="description_item"><span style='font-family:monospace;font-size: 18px;'> </span>Used to create the <span style='font-family:monospace;font-size: 18px;'>threads_flush_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
-<dt class="description_label">threads_flush_function_pointer</dt>
-<dd class="description_item"> A pointer to a function called from inside a thread just after flexigrid() returns. Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
-<dt class="description_label">threads_join_function</dt>
-<dd class="description_item"> Used to create the <span style='font-family:monospace;font-size: 18px;'>threads_join_function_pointer </span>(see FAQ&nbsp;<a href="#FAQ_functions_and_pointers">6.26.5</a>). Ignored if <span style='font-family:monospace;font-size: 18px;'>undef</span>.</dd>
-<dt class="description_label">threads_join_function_pointer</dt>
-<dd class="description_item"> When using a threaded grid you have to define a subroutine (also known as a function) pointer which points to the function to be called after each thread have finished. This function is responsible for &ldquo;joining&rdquo; the threads, which means it collects the results from the thread and adds them to the global results. This is usually a function called <span style='font-family:monospace;font-size: 18px;'>join_thread</span> and is set with a line in grid-xxx.pl similar to:
-<br />
-
-<span style='font-family:monospace;font-size: 18px;'>$binary_grid::grid_options{'threads_join_function_pointer'}=\&amp;join_thread; </span></dd>
-<dt class="description_label">threads_stack_size</dt>
-<dd class="description_item"> The stack size (in MBytes) for each of the Perl threads. Default is <span style='font-family:monospace;font-size: 18px;'>32</span> (MBytes).</dd>
-<dt class="description_label">timeout</dt>
-<dd class="description_item"> When possible the grid sets an alarm (a Linux/UNIX signal) which means that warnings are given and perhaps the grid stopped after <span style='font-family:monospace;font-size: 18px;'>timeout</span> seconds. Set to zero to ignore, usually 30 is enough. This assumes your<em> <i>binary_c</i>/nucsyn</em> process takes less than <span style='font-family:monospace;font-size: 18px;'>timeout</span> seconds to run a system so if you have problems with this please check your system to make sure you have the CPU time you need.</dd>
-<dt class="description_label">vb</dt>
-<dd class="description_item"> Verbosity level. With <span style='font-family:monospace;font-size: 18px;'>vb=1</span> you get some output about the grid, i.e. the number of stars run, the number to go, the current <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>M</mi>
- </mrow></mstyle></math>, or <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>1</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math>,&nbsp;<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>M</mi>
-   </mrow>
-   <mrow><mn>2</mn>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi>a</mi>
- </mrow></mstyle></math>, an estimate of the time taken, time remaining and the time at which the grid is expected to finish. You may also get information about memory usage (if available). Make sure your terminal window is quite wide to accommodate the information! If <span style='font-family:monospace;font-size: 18px;'>vb=2</span> you will get additional information about each system. This is very useful for determining which stellar system is causing the code to freeze and/or crash. See also <span style='font-family:monospace;font-size: 18px;'>nmod</span>, <span style='font-family:monospace;font-size: 18px;'>colour</span> and <span style='font-family:monospace;font-size: 18px;'>log_args</span>. Some verbose logging is only switched on if <span style='font-family:monospace;font-size: 18px;'>vb=3</span>, although this should be considered experimental.</dd>
-<dt class="description_label">weight</dt>
-<dd class="description_item"> The probability is weighted by this value. </dd>
-</dl>
-<div class="standard" id='magicparlabel-8481'><br />
-</div>
-<h2 class="section" id='magicparlabel-8482'><span class="section_label">B</span> Binary_c/nucsyn options (<em>bse_options</em> hash)</h2>
-<div class="standard" id='magicparlabel-8483'><div id="sec_bse_options"></div>
- The following options correspond to variables in the <span style='font-family:monospace;font-size: 18px;'>$binary_grid2_object-&gt;{_bse_options}</span> hash. These correspond to options of <em><i>binary_c</i></em>.</div>
-
-<div class="standard" id='magicparlabel-8484'>The most important options are listed here, however you should consult <em><i>binary_c</i></em> for the main options list because these options are (mostly) just passed to <em><i>binary_c</i></em>. The full list of options is given in <span style='font-family:monospace;font-size: 18px;'>src/setup/cmd_line_args.h</span>. You can access a full list of arguments by running 
-<br />
-
-<b><span style='font-family:monospace;font-size: 18px;'><i>binary_c</i> --help</span></b>
-<br />
-
- <em>BSE</em> refers to <a href='#LyXCite-2002MNRAS_329_897H'><span class="bib-abbrvciteauthor">Hurley et al.</span></a> (<span class="bib-year">2002</span>).</div>
-
-<dl class='description' id='magicparlabel-8485'><dt class="description_label">acc2</dt>
-<dd class="description_item"> Bondi-Hoyle accretion rate parameter (default 1.5). Deprecated in <i>binary_c</i> V2.0, please use Bondi_Hoyle_accretion_factor instead."</dd>
-<dt class="description_label">alpha_ce</dt>
-<dd class="description_item"> Common envelope ejection efficiency, default 1.0.</dd>
-<dt class="description_label">bb</dt>
-<dd class="description_item"> CRAP parameter, default 0. Deprecated in <i>binary_c</i> V2.0, please use CRAP_parameter instead.</dd>
-<dt class="description_label">BH_prescription</dt>
-<dd class="description_item"> Black hole mass as a function of CO core mass prescription. Default 0 (<em>BSE</em>), can be 1 (Belczynski).</dd>
-<dt class="description_label">Bondi_Hoyle_accretion_factorBondi-Hoyle</dt>
-<dd class="description_item"> accretion rate parameter (default 1.5). </dd>
-<dt class="description_label">CRAP_parameter</dt>
-<dd class="description_item"> CRAP parameter, default 0.</dd>
-<dt class="description_label">delta_mcmin</dt>
-<dd class="description_item"> Shift in the core mass used to calculate the third dredge up efficiency (default 0).</dd>
-<dt class="description_label">eddfac</dt>
-<dd class="description_item"> Eddington limit multiplier (default 1e6, i.e. no Eddington limit).</dd>
-<dt class="description_label">extra</dt>
-<dd class="description_item"> A string which is appended to the arguments for <em><i>binary_c</i></em>. You should not use this form if you can avoid it, but it might be useful in some cases. </dd>
-<dt class="description_label">lambda_ce</dt>
-<dd class="description_item"> Common envelope envelope binding energy parameter (default -1, i.e. set according to fitting functions).</dd>
-<dt class="description_label">lambda_ionisation</dt>
-<dd class="description_item"> Amount of recombination energy used to eject the common envelope (default 0.0, only acts if lambda_ce (above) is -1).</dd>
-<dt class="description_label">lambda_min</dt>
-<dd class="description_item"> Minimum value of the third dredge up efficiency&nbsp;<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &lambda; </mi>
- </mrow></mstyle></math> (default 0).</dd>
-<dt class="description_label">max_evolution_time</dt>
-<dd class="description_item"> Maximum time for stellar evolution, default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>13.7</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>G</mi><mi>y</mi><mi>r</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math>.</dd>
-<dt class="description_label">metallicity</dt>
-<dd class="description_item"> The metallicity (default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0.02</mn>
- </mrow></mstyle></math>). </dd>
-<dt class="description_label">minimum_envelope_mass_for_third_dredgeup</dt>
-<dd class="description_item"> Minimum envelope mass for third dredge up (default 0.5).</dd>
-<dt class="description_label">qcrit_GB_method</dt>
-<dd class="description_item"> Method for choosing <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <msub subscriptshift="0.2ex">
-   <mrow><mi>q</mi>
-   </mrow>
-   <mrow>
-    <mstyle mathvariant='normal'>
-     <mstyle mathvariant='normal'>
-      <mrow><mi>c</mi><mi>r</mi><mi>i</mi><mi>t</mi>
-      </mrow>
-     </mstyle>
-    </mstyle>
-   </mrow>
-  </msub>
- </mrow></mstyle></math> on the giant branch.</dd>
-<dt class="description_label">sn_sigma</dt>
-<dd class="description_item"> SN kick velocity dispersion.</dd>
-<dt class="description_label">superwind_mira_switchon</dt>
-<dd class="description_item"> Mira period at which the superwind switches on in TPAGB stars, default is <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow>
-  <mrow><mn>500</mn><mspace width="6px" />
-   <mstyle mathvariant='normal'>
-    <mrow><mi>d</mi><mi>a</mi><mi>y</mi><mi>s</mi>
-    </mrow>
-   </mstyle>
-  </mrow>
- </mrow></mstyle></math> as in <a href='#LyXCite-1993ApJ___413__641V'><span class="bib-abbrvciteauthor">Vassiliadis and Wood</span></a> (<span class="bib-year">1993</span>).</dd>
-<dt class="description_label">tidal_strength_factor</dt>
-<dd class="description_item"> Modules the tidal timescale, default 1.0.</dd>
-<dt class="description_label">tpagbwind</dt>
-<dd class="description_item"> TPAGB wind prescription. Default 0 is <a href='#LyXCite-Parameterising_3DUP_Karakas_Lattanzio_Pols'><span class="bib-abbrvciteauthor">Karakas et al.</span></a> (<span class="bib-year">2002</span>).</dd>
-<dt class="description_label">tpagb_reimers_eta</dt>
-<dd class="description_item"> <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mi> &eta; </mi>
- </mrow></mstyle></math> for Reimers on the TPAGB.</dd>
-<dt class="description_label">vw_mira_shift</dt>
-<dd class="description_item"> Shifts the superwind Mira switchon (default 0.0).</dd>
-<dt class="description_label">vw_multipler</dt>
-<dd class="description_item"> Multiplier for the VW93 wind (default 0.0).</dd>
-<dt class="description_label">wr_wind</dt>
-<dd class="description_item"> Wolf-Rayet (massive star) wind prescription, default 0 is <em>BSE</em>.</dd>
-<dt class="description_label">wr_wind_fac</dt>
-<dd class="description_item"> Multiplier for WR winds, default 1.0.</dd>
-<dt class="description_label">z</dt>
-<dd class="description_item"> The metallicity (default <math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle mathvariant='sans-serif-italic' mathsize='85%'>
- <mrow><mn>0.02</mn>
- </mrow></mstyle></math>). Deprecated in <em><i>binary_c</i> V2.0</em> – please use &ldquo;metallicity&rdquo; instead.</dd>
-</dl>
-
-</div></div></div></div></body>
-</html>
diff --git a/doc/binary_c2.lyx b/doc/binary_c2.lyx
index 2079d0c04..126e83e3a 100644
--- a/doc/binary_c2.lyx
+++ b/doc/binary_c2.lyx
@@ -4792,7 +4792,10 @@ C
 API
 \emph default
  functions.
- The 
+\end_layout
+
+\begin_layout Standard
+The 
 \begin_inset Flex Args
 status open
 
@@ -4802,7 +4805,21 @@ libbinary_c_symlink
 
 \end_inset
 
- build sets up a symbolic link in the 
+ call to 
+\begin_inset Flex Software
+status open
+
+\begin_layout Plain Layout
+ninja
+\end_layout
+
+\end_inset
+
+ symbolically links the 
+\begin_inset Formula $\binaryc$
+\end_inset
+
+ executable to the 
 \begin_inset Formula $\binaryc$
 \end_inset
 
@@ -4816,15 +4833,39 @@ src
 
 \end_inset
 
- directory which allows 
-\begin_inset Formula $\binarygrid$
+ directory.
+ Warning: if the 
+\begin_inset Flex File
+status open
+
+\begin_layout Plain Layout
+builddir
+\end_layout
+
 \end_inset
 
+ is deleted, this link will not work.
+ If you want the executable copied, consider running 
+\begin_inset Flex Command
+status open
 
-\emph on
-2 
-\emph default
-to function.
+\begin_layout Plain Layout
+ninja binary_c_install_legacy
+\end_layout
+
+\end_inset
+
+ instead (see below) or use 
+\begin_inset Flex Command
+status open
+
+\begin_layout Plain Layout
+ninja install
+\end_layout
+
+\end_inset
+
+.
 \end_layout
 
 \begin_layout Subsubsection
diff --git a/doc/binary_c2.pdf b/doc/binary_c2.pdf
index 799c3af1bf4b26d92d42363bd9176e30d1fa3340..32ae3d7ac568eeaa8f851f504ed1e6e932253dff 100644
GIT binary patch
delta 14686
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

delta 14536
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%0A7HAD=EtAb}h+7;HJ_NJ8?
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
A#sB~S

diff --git a/src/binary_c_parameters.h b/src/binary_c_parameters.h
index 98c98c288..2c67ee6d9 100644
--- a/src/binary_c_parameters.h
+++ b/src/binary_c_parameters.h
@@ -1385,7 +1385,7 @@
  * see nucsyn/nucsyn.h for details of parts you can switch on 
  * off.
  ************************************************************/
-//#define NUCSYN
+#define NUCSYN
 
 /************************************************************
  * Stellar colour library
diff --git a/src/nucsyn/nucsyn_parameters.h b/src/nucsyn/nucsyn_parameters.h
index 0b67abc82..5183b135d 100644
--- a/src/nucsyn/nucsyn_parameters.h
+++ b/src/nucsyn/nucsyn_parameters.h
@@ -52,18 +52,10 @@
  * case A and B mass transfer, and it will do first dredge
  * up for these elements as well.
  * 
+ * Model details are in Izzard et al. (2018).
+ *
  * Does nothing post-first dredge up: these stars are treated as 
  * previously.
- *
- * Todo :
- * 
- * Fix the profile at the beginning of the main sequence.
- *
- * Thermohaline mix into said profile.
- * 
- * If we really want a challenge, DON'T fix the profile at 
- * the beginning of the main sequence, instead let it evolve.
- * This is very tricky without doing proper nuclear burning.
  */
 //#define NUCSYN_STRIP_AND_MIX
 
-- 
GitLab