/*******************************************************************************
*$ Component_name:
*	FKEP_COMBO
*$ Abstract:
*	Calculates an arbitrary "combination" frequency, equal to a sum of
*	integer coefficients times the orbital rates omega, kappa and nu.
*$ Keywords:
*	KEPLER, ORBITAL_MOTION
*	FORTRAN, PUBLIC
*$ Declarations:
*	real*8 function	KEP_COMBO( a, mOmega, mKappa, mNu )
*	real*8		a
*	integer		mOmega, mKappa, mNu
*$ Inputs:
*	a		mean orbital radius in km.
*	mOmega		integer coefficient on omega (angular frequency).
*	mKappa		integer coefficient on kappa (radial frequency).
*	mNu		integer coefficient on nu (vertical frequency).
*$ Outputs:
*	none
*$ Returns:
*	"combination" frequency in radians/second.
*$ Detailed_description:
*	This FORTRAN-callable function returns an arbitrary "combination"
*	frequency as a function of mean orbital radius:
*		mOmega*omega(a) + mKappa*kappa(a) + mNu*nu(a) .
*	Here omega, kappa and nu are the mean motion, radial oscillation
*	frequency and vertical frequency, respectively.  It should be quite
*	accurate even in the case where the terms cancel to leading order. 
*	The planetary field must have been defined previously using subroutine
*	FKEP_SETPLANET().  Cf. FKEP_OMEGA(), FKEP_KAPPA(), and FKEP_NU().
*$ External_references:
*	Kep_Combo(), fKep_Planet
*$ Examples:
*	FKEP_COMBO(a, 1, 0, 0) is equivalent to FKEP_OMEGA(a);
*	FKEP_COMBO(a, 0, 1, 0) is equivalent to FKEP_KAPPA(a);
*	FKEP_COMBO(a, 0, 0, 1) is equivalent to FKEP_NU(a).
*
*	KEP_COMBO(a, 1, -1, 0) returns the apsidal precession rate, but will be
*	faster and much more accurate than (FKEP_OMEGA(a) - FKEP_KAPPA(a)).
*$ Error_handling:
*	none
*$ Limitations:
*	Result should be exact for infinitesimal radial perturbations to a small
*	body on a circular orbit about an oblate planet.  Perturbations from the
*	sun and any other moons and rings are not included.  A nonzero
*	eccentricity or inclination would introduce relative errors of order
*	(e^2 J2 (R/a)^2) and (sin^2(i) J2 (R/a)^2), or larger if (mOmega + 
*	mKappa + mNu) = 0.
*
*	The function employs a special "trick" to retain precision in the 
*	special case where (mOmega + mKappa + mNu) = 0.  However, accuracy will
*	be somewhat lower when mKappa = -mOmega/2 and mNu = -mOmega/2, since
*	cancellation occurs to very high order in this obscure situation.
*$ Author_and_institution:
*	Mark R. Showalter
*	NASA/Ames Research Center
*$ Version_and_date:
*	1991 June 18
*$ Change_history:
*	none
*******************************************************************************/
#include "fortran.h"
#include "kepler.h"

extern KEP_PLANET fKep_Planet;

double	FORTRAN_NAME(fkep_combo) ( a, mOmega, mKappa, mNu )
double	*a;
int	*mOmega, *mKappa, *mNu;
{
	return Kep_Combo( &fKep_Planet, *a, *mOmega, *mKappa, *mNu );
}

/******************************************************************************/
