Skip to content

Driver Program

The DRIVER is the entry point for the entire propagation system. It reads TLE data from standard input, selects the appropriate model based on orbital period, and dispatches to the correct subroutine.

The DATA statement on lines 13–17 defines all physical and geopotential constants. These are WGS-72, not WGS-84 — deliberately, because NORAD TLEs are fitted to the SGP4/WGS-72 model.

* DRIVER 3 NOV 80
*
* WGS-72 PHYSICAL AND GEOPOTENTIAL CONSTANTS
* CK2= .5*J2*AE**2 CK4=-.375*J4*AE**4
*
DOUBLE PRECISION EPOCH,DS50
COMMON/E1/XMO,XNODEO,OMEGAO,EO,XINCL,XNO,XNDT2O,XNDD6O,BSTAR,
1 X,Y,Z,XDOT,YDOT,ZDOT,EPOCH,DS50
COMMON/C1/CK2,CK4,E6A,QOMS2T,S,TOTHRD,
1 XJ3,XKE,XKMPER,XMNPDA,AE
COMMON/C2/DE2RA,PI,PIO2,TWOPI,X3PIO2
DATA IHG/1HG/
DATA DE2RA,E6A,PI,PIO2,QO,SO,TOTHRD,TWOPI,X3PIO2,XJ2,XJ3,
1 XJ4,XKE,XKMPER,XMNPDA,AE/.174532925E-1,1.E-6,
2 3.14159265,1.57079633,120.0,78.0,.66666667,
4 6.2831853,4.71238898,1.082616E-3,-.253881E-5,
5 -1.65597E-6,.743669161E-1,6378.135,1440.,1./
DIMENSION ISET(5)
CHARACTER*80 ABUF(2)
DATA (ISET(I),I=1,5)/3HSGP,4HSGP4,4HSDP4,4HSGP8,4HSDP8/
ConstantValueDescription
DE2RA0.0174532925Degrees to radians
E6A1.0E-6Kepler iteration tolerance
PI3.14159265π\pi
QO120.0Atmospheric parameter q0q_0 (km above Earth radius)
SO78.0Atmospheric parameter ss (km above Earth radius)
TOTHRD0.6666666723\frac{2}{3}
XJ21.082616E-32nd zonal harmonic J2J_2
XJ3-2.53881E-53rd zonal harmonic J3J_3
XJ4-1.65597E-64th zonal harmonic J4J_4
XKE0.0743669161GM\sqrt{GM} in Earth-radii1.5^{1.5}/min
XKMPER6378.135Earth equatorial radius (km)
XMNPDA1440Minutes per day
AE1.0Earth radius in Earth radii (normalization)

The driver reads two card formats: T (transmission/public two-line) and G (internal three-card G-card format used within NORAD):

* READ IN MEAN ELEMENTS FROM 2 CARD T(TRANS) OR G(INTERN) FORMAT
READ (5,706) ABUF
READ(ABUF(1),707) ITYPE
IF(ITYPE.EQ.IHG) GO TO 5
READ (ABUF,702) EPOCH,XNDT2O,XNDD6O,IEXP,BSTAR,IBEXP,XINCL,
1 XNODEO,EO,OMEGAO,XMO,XNO
GO TO 7
5 READ(ABUF,701) EPOCH,XMO,XNODEO,OMEGAO,EO,XINCL,XNO,XNDT2O,
1 XNDD6O,IEXP,BSTAR,IBEXP

The IHG Hollerith constant (1HG) stores the character “G” in an integer for comparison — a pre-CHARACTER*N technique from FORTRAN 66.

Deep-space classification is determined by checking if the orbital period exceeds 225 minutes:

* INPUT CHECK FOR PERIOD VS EPHEMERIS SELECTED
* PERIOD GE 225 MINUTES IS DEEP SPACE
A1=(XKE/XNO)**TOTHRD
TEMP=1.5*CK2*(3.*COS(XINCL)**2-1.)/(1.-EO*EO)**1.5
DEL1=TEMP/(A1*A1)
AO=A1*(1.-DEL1*(.5*TOTHRD+DEL1*(1.+134./81.*DEL1)))
DELO=TEMP/(AO*AO)
XNODP=XNO/(1.+DELO)
IF((TWOPI/XNODP/XMNPDA) .GE. .15625) IDEEP=1

Where .15625 = 225/1440 — 225 minutes as a fraction of a day. The computed GO TO on line 72 dispatches to the selected model:

10 GO TO (21,22,23,24,25), IEPT
21 CALL SGP(IFLAG,TSINCE)
22 CALL SGP4(IFLAG,TSINCE)
23 CALL SDP4(IFLAG,TSINCE)
24 CALL SGP8(IFLAG,TSINCE)
25 CALL SDP8(IFLAG,TSINCE)

The models compute position/velocity in Earth radii and Earth radii per minute. The driver converts to km and km/s:

60 X=X*XKMPER/AE
Y=Y*XKMPER/AE
Z=Z*XKMPER/AE
XDOT=XDOT*XKMPER/AE*XMNPDA/86400.
YDOT=YDOT*XKMPER/AE*XMNPDA/86400.
ZDOT=ZDOT*XKMPER/AE*XMNPDA/86400.

Two changes from the original printed source:

  1. CHARACTER*80 ABUF(2) — the original CHARACTER ABUF*80(2) placed the length specifier between variable name and array dimension
  2. READ for DECODE — the original used the DEC/VAX DECODE statement, a non-standard extension for internal reads