#ifndef F77FS_H
#define F77FS_H

//-----------------------------------------------------------------------------
//
//  Peter Richter (prichter@princeton.edu)
//  Princeton Plasma Physics Laboratory
//  August 2000
//
//  f77fs.h - Interface for F77 fusion reaction routines.
//
//-----------------------------------------------------------------------------

#include "preact/fortran.h"

// initialize reaction and return handle...
integer_function F77NAME(fs_init)(integer& icode, integer& ierrlo,
			      	  integer& ierrhi);

// sigma, vrel as real*8 functions of Erel...
real_function F77NAME(fs_sigma)(integer& ihandle, real_8& Erel);
real_function F77NAME(fs_vrel)(integer& ihandle, real_8& Erel);

// sigma*v for beam to cold (T=0) target...
subroutine F77NAME(fs_coldtarget_sigmatimesv)(integer& ihandle, real_8 *E,
					      real_8 *f, integer& n);
subroutine F77NAME(fs_coldtarget_erange)(integer& ihandle, real_8& Emin,
					 real_8& Emax,
					 integer& min_policy,
					 integer& max_policy);
subroutine F77NAME(fs_coldtarget_epolicy)(integer& ihandle,
					  integer& min_policy,
					  integer& max_policy);

// <sigma*v> for beam to warm (T>0) target...
subroutine F77NAME(fs_warmtarget_sigmatimesv)(integer& ihandle, real_8 *E,
					      real_8 *T, real_8 *f,integer& n);
subroutine F77NAME(fs_warmtarget_erange)(integer& ihandle, real_8& Emin,
					 real_8& Emax,
					 integer& min_policy,
					 integer& max_policy);
subroutine F77NAME(fs_warmtarget_trange)(integer& ihandle, real_8& Tmin,
					 real_8& Tmax,
					 integer& min_policy,
					 integer& max_policy);
subroutine F77NAME(fs_warmtarget_epolicy)(integer& ihandle,
					  integer& min_policy,
					  integer& max_policy);
subroutine F77NAME(fs_warmtarget_tpolicy)(integer& ihandle,
					  integer& min_policy,
					  integer& max_policy);

// <<sigma*v>> thermonuclear...
subroutine F77NAME(fs_thermonuclear_sigmatimesv)(integer& ihandle, real_8 *T,
						 real_8 *f, integer& n);
subroutine F77NAME(fs_thermonuclear_trange)(integer& ihandle, real_8& Tmin,
					    real_8& Tmax,
					    integer& min_policy,
					    integer& max_policy);
subroutine F77NAME(fs_thermonuclear_tpolicy)(integer& ihandle,
					     integer& min_policy,
					     integer& max_policy);

// <sigma*v> gyro average...
subroutine F77NAME(fs_gyroavg_sigmatimesv)(integer& ihandle, real_8 *E,
					   real_8 *Var, real_8 *f, integer& n);
subroutine F77NAME(fs_gyroavg_erange)(integer& ihandle, real_8& Emin,
				      real_8& Emax,
				      integer& min_policy,
				      integer& max_policy);
subroutine F77NAME(fs_gyroavg_varrange)(integer& ihandle, real_8& Varmin,
					real_8& Varmax,
					integer& min_policy,
					integer& max_policy);
subroutine F77NAME(fs_gyroavg_epolicy)(integer& ihandle,
				       integer& min_policy,
				       integer& max_policy);
subroutine F77NAME(fs_gyroavg_varpolicy)(integer& ihandle,
					 integer& min_policy,
					 integer& max_policy);

//-----------------------------------------------------------------------------

#endif
