**********************************************************************
                          getPWGH
----------------------------------------------------------------------                          
This program computes the median or average mass accretion history
(MAH) and potential well growth history (PWGH) for a dark matter 
halo of mass M_0 at redshift z_0. In addition, it also computes the
NFW halo concentration parameter, c, of the main progenitor.
---------------------------------------------------------------------- 
Author: Frank van den Bosch                             Yale, Jun 2014     
**********************************************************************

CONTENTS:
---------

getPWGH.f    : main program
cosmo_sub.f  : cosmological subroutines
quadpack.f   : numerical routines (mainly for integration) from 
               QuadPack (http://www.netlib.org/quadpack/)

getPWGH.mke  : make file
getPWGH.in   : input file

PWGH_average.dat: example output file (corresponds to getPWGH.in)

DESCRIPTION:
------------

Program uses the method of van den Bosch et al. (2014) to compute
the average or median MAH and PWGH for a dark matter halo of mass
M_0 at redshift z_0. Output is written to 
`PWGH_median.dat' or `PWGH_average.dat', depending on whether the user
opted to compute medians or averages, respectively.
The output is organized as follows:

column 1 : index (can be ignored)
column 2 : z, redshift
column 3 : t, lookback time (in Gyr)
column 4 : log[M(z)/M_0]  where M is mass of main progenitor
column 5 : log[Vmax(z)/Vmax(z=0)]
column 6 : log[Vmax(z)/Vvir(z=0)]   aka PWGH
column 7 : c = concentration parameter of main progenitor at z
column 8 : dM/dt, mass accretion rate in units of h^{-1} Msun/yr

NOTE: log refers to 10-based logarithm.

An example output file (PWGH_average.dat) is included, and is
the output generated by the code for the input file (getPWGH.in)
that is included.

TO COMPILE:
-----------

  make -f getPWGH.mke


TO RUN:
-------

First edit the input file (getPWGH.in). Indicate cosmology, 
halo mass, redshift, and whether you want averages or medians.
Next run the program by issuing the command

  getPWGH <  getPWGH.in
  
  
KNOWN BUGS OR ISSUES:
---------------------

After completion, some warning may appear regarding floating-point
exceptions. These can be ignored, as they have no impact on the
outcome.

WARNING:
--------

The code is tested for flat LCDM cosmologies with cosmological
parameters that cover a fairly broad range of parameters centered
on the values currently favored by various CMB experiments (see
paper for a more detailed description). We caution against using
this program for cosmologies that differ strongly from such flat
LCDM cosmologies; although we have no reason to believe it would
fail, the program has not been tested in that regime.