/*  
 *  - - - - - - - - - - -
 *   g a l _ d s i n i t  
 *  - - - - - - - - - - -
 *  
 *  This routine is part of the General Astrodynamics Library  
 *
 *  Description:
 *
 *     This routine provides deep space contributions to mean motion dot due
 *     to geopotential resonance with half day and one day orbits.
 *  
 *  Status: 
 *  
 *     SGP4 support routine.  
 *  
 *  Given:  
 *
 *     *gm           gal_gm_t       Gravity Model
 *     cosim            d 
 *     sinim            d
 *     emsq             d           Eccentricity squared
 *     argpo            d           Argument of Perigee
 *     s1               d            
 *     s2               d            
 *     s3               d            
 *     s4               d            
 *     s5               d           
 *     ss1              d            
 *     ss2              d            
 *     ss3              d            
 *     ss4              d            
 *     ss5              d           
 *     sz1              d            
 *     sz3              d            
 *     sz11             d            
 *     sz13             d            
 *     sz21             d            
 *     sz23             d            
 *     sz31             d            
 *     sz33             d           
 *     t                d           Time
 *     tc               d           
 *     gsto             d           Greenwich Sidereal Time ( rad )
 *     mo               d           Mean Anomaly
 *     mdot             d           Mean Anomaly Dot (rate)
 *     no               d           Mean Motion
 *     nodeo            d           Right Ascension of Ascending Node
 *     nodedot          d           Right Ascension of Ascending Node Dot (rate)
 *     xpidot           d           
 *     z1               d            
 *     z3               d           
 *     z11              d            
 *     z13              d           
 *     z21              d           
 *     z23              d           
 *     z31              d           
 *     z33              d           
 *     eccm             d           Eccentricity
 *     *argpm           d           Argument of Perigee
 *     *inclm           d           Inclination
 *     *mm              d           Mean Anomaly
 *     xn               d           Mean Motion
 *     *nodem           d           Right Ascension of Ascending Node
 *  
 *  Returned:  
 *  
 *     *em              d           Eccentricity
 *     *argpm           d           Argument of Perigee
 *     *inclm           d           Inclination
 *     *mm              d           Mean Anomaly
 *     *nm              d           Mean Motion
 *     *nodem           d           Right Ascension of Ascending Node
 *     *irez            i           Flag for Resonance           
 *                                  0 = none
 *                                  1 = one day
 *                                  2 = half day
 *     *atime           d           
 *     *d2201           d           
 *     *d2211           d           
 *     *d3210           d           
 *     *d3222           d           
 *     *d4410           d           
 *     *d4422           d            
 *     *d5220           d           
 *     *d5232           d           
 *     *d5421           d           
 *     *d5433           d           
 *     *dedt            d           
 *     *didt            d           
 *     *dmdt            d           
 *     *dndt            d           
 *     *dnodt           d           
 *     *domdt           d           
 *     *del1            d           
 *     *del2            d           
 *     *del3            d           
 *     *ses             d           
 *     *sghl            d            
 *     *sghs            d           
 *     *sgs             d           
 *     *shl             d           
 *     *shs             d           
 *     *sis             d           
 *     *sls             d           
 *     *theta           d           
 *     *xfact           d           
 *     *xlamo           d           
 *     *xli             d           
 *     *xni             d           
 *
 *  Notes:  
 *  
 *  1) This routine is a translation from c++ to c of David Vallado's SGP4UNIT.dsinit 
 *     routine ( 2007 November 16 ). 
 *
 *  Called:
 *
 *     gal_sgp4gm       Get gravity model parameters for SGP4
 *
 *  References:
 *
 *     NORAD Spacetrack Report #3 1980
 *     Hoots, Roehrich 
 *
 *     NORAD Spacetrack Report #6 1986
 *     Hoots 
 *
 *     Hoots, Schumacher and Glover 2004
 *
 *     Revisting Spacetrack Report #3
 *     Vallado, David, Crawford, Paul, Hujsak, Richard, Kelso, T.S.
 *     AIAA 2006-6753
 *
 *  This revision:  
 * 
 *     2008 April 6 
 *  
 *  Copyright (C) 2008 Paul C. L. Willmott. See notes at end. 
 *  
 *-----------------------------------------------------------------------  
 */  

#ifndef _GAL_DSINIT_H_  
#define _GAL_DSINIT_H_ 1  

#include "gal_gm.h"
  
#undef  __BEGIN_DECLS  
#undef  __END_DECLS  
#ifdef  __cplusplus  
#define __BEGIN_DECLS extern "C" {  
#define __END_DECLS }  
#else  
#define __BEGIN_DECLS /* empty */  
#define __END_DECLS   /* empty */  
#endif
  
__BEGIN_DECLS  
  
void 
gal_dsinit
  (
    gal_gm_t *gm,
    double cosim,  
    double emsq,   
    double argpo,   
    double s1,     
    double s2,
    double s3,     
    double s4,     
    double s5,      
    double sinim,  
    double ss1,
    double ss2,    
    double ss3,    
    double ss4,     
    double ss5,    
    double sz1,
    double sz3,    
    double sz11,   
    double sz13,    
    double sz21,   
    double sz23,
    double sz31,   
    double sz33,   
    double t,       
    double tc,     
    double gsto,
    double mo,     
    double mdot,   
    double no,      
    double nodeo,  
    double nodedot,
    double xpidot, 
    double z1,     
    double z3,      
    double z11,    
    double z13,
    double z21,    
    double z23,    
    double z31,     
    double z33,    
    double ecco,
    double eccsq,  
    double *em,    
    double *argpm,  
    double *inclm, 
    double *mm,
    double *nm,    
    double *nodem,
    int    *irez,
    double *atime, 
    double *d2201, 
    double *d2211,  
    double *d3210, 
    double *d3222,
    double *d4410, 
    double *d4422, 
    double *d5220,  
    double *d5232, 
    double *d5421,
    double *d5433, 
    double *dedt,  
    double *didt,   
    double *dmdt,  
    double *dndt,
    double *dnodt, 
    double *domdt, 
    double *del1,   
    double *del2,  
    double *del3,
    double *xfact, 
    double *xlamo, 
    double *xli,    
    double *xni
  ) ; 
   
__END_DECLS  
  
#endif /* !_GAL_DSINIT_H_ */ 

/*
 *  gal - General Astrodynamics Library  
 *  Copyright (C) 2008 Paul C. L. Willmott  
 *  
 *  This program is free software; you can redistribute it and/or modify  
 *  it under the terms of the GNU General Public License as published by  
 *  the Free Software Foundation; either version 2 of the License, or  
 *  (at your option) any later version.  
 *  
 *  This program is distributed in the hope that it will be useful,  
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of  
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
 *  GNU General Public License for more details.  
 *  
 *  You should have received a copy of the GNU General Public License along  
 *  with this program; if not, write to the Free Software Foundation, Inc.,  
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.  
 *    
 *  Contact:  
 *    
 *  Paul Willmott  
 *  vp9mu@amsat.org  
 */  
  
