Topic: How to obtain values at arbitrary energies/temperatures

The NON-SMOKER database and NON-SMOKER(WEB) return cross sections on a non-equidistant energy grid and reaction rates (and MACS) on a fixed temperature grid. Sometimes it is necessary to know those values at other energies (e.g. with equidistant energy spacing) or temperatures than the given ones. To this end I provide a FORTRAN 90/95 program to interpolate the results. It performs a natural cubic spline interpolation and can also be used for interpolating any other data.

It is easy to use: Download the program 'interpolate.f90' and compile it. The values to be interpolated have then to be presented in the file 'interpol.dat' as x and y values, (you can just copy/paste the NON-SMOKER output into a text file).
A second file 'interpolate.tab' contains a table of the desired x values for which we want to compute interpolated values. The x values defined in that file should not lie outside the x range defined by the data; this is interpolation, not extrapolation!
Run the program and the computed values are written to the standard output. cool

Hint: For rapidly increasing or decreasing functions spanning several orders of magnitude (like astrophysical reaction rates or charged particle cross sections) it is always more accurate to interpolate the logarithm of the y values and recompute the values after interpolation. This can be done in two ways:
1) put x,log(y) in 'interpol.dat' and take the exponential of the returned value;
2) put 'log' as the first line in 'interpol.dat'; the code internally automatically takes the logarithm and performs the exponentiation before returning the value!

For further details see the comments in the code.

Note 1: NON-SMOKER automatically chooses an energy grid optimized to calculate the reaction rates on the standard temperature grid. It is more widely spaced when the cross section is smooth and can be interpolated easily and more densly spaced when a strong variation of the cross section occurs (at channel openings). Thus, the default cross sections are ideally suited for interpolation.

Note 2: There is an option in NON-SMOKER(WEB) to change the default energy grid. It is not advisable to use this option in order to extract results at the desired energies because the numerics of the calculations depend on this grid and a different grid can lead to different cross sections! Use the above program instead!


Re: How to obtain values at arbitrary energies/temperatures

New FORTRAN90/95 version of the interpolation code with some nice additional features:

- The data in 'interpol.dat' need not be sorted.
- Comments and blank lines are allowed in the input files.
- An arbitrary number of data  and desired grid points can be specified in 'interpol.dat' and 'interpol.tab', respectively; the upper limit on the number is only restricted by the computer's memory (and diskspace).
- Nicer, modular code.