FORTRAN Source Overview
The FORTRAN IV source code presented here is the original implementation of the five NORAD satellite propagation models: SGP, SGP4, SDP4, SGP8, and SDP8. This code was extracted from the printed source listing in the 1980 report — no authoritative digital source files have ever existed.
File Inventory
Section titled “File Inventory”| File | Lines | Description |
|---|---|---|
driver.f | 113 | Main driver program with WGS-72 constants |
sgp.f | 109 | SGP model (Simplified General Perturbations) |
sgp4.f | 215 | SGP4 model with Brouwer mean elements |
sdp4.f | 187 | SDP4 deep-space model (calls DEEP) |
sgp8.f | 185 | SGP8 model with Hoots drag |
sdp8.f | 226 | SDP8 deep-space model (column 72 fix) |
deep.f | 451 | DEEP subroutine — lunar-solar perturbations |
actan.f | 22 | Four-quadrant arctangent |
fmod2p.f | 11 | Modulo 2 |
thetag.f | 22 | Greenwich sidereal angle |
Compilation
Section titled “Compilation”To compile with modern gfortran:
FFLAGS = -O0 -w -fdefault-real-8 -fno-automatic
gfortran $(FFLAGS) -c sgp.f sgp4.f sdp4.f sgp8.f sdp8.f deep.f \ driver.f actan.f fmod2p.f thetag.fgfortran $(FFLAGS) -o spacetrk *.oEach flag is required:
| Flag | Purpose |
|---|---|
-O0 | Disable optimization — the ENTRY point pattern miscompiles at -O1+ |
-w | Suppress warnings for Hollerith constants, assigned GOTOs |
-fdefault-real-8 | Promote all REAL to 8-byte, matching original assumptions |
-fno-automatic | Emulate FORTRAN IV static local variable allocation |
FORTRAN IV Column Rules
Section titled “FORTRAN IV Column Rules”FORTRAN IV uses fixed-format source inherited from the 80-column punch card:
| Columns | Purpose |
|---|---|
| 1–5 | Statement labels (numeric) |
| 6 | Continuation character (any non-blank, non-zero) |
| 7–72 | Source code — the only columns the compiler reads |
| 73–80 | Sequence numbers (silently ignored) |
The column 72 boundary is invisible in every visual representation of the source. Anything past it is silently discarded. This is the root cause of the transcription problem that produced decades of divergent SGP4 implementations.
The Transcription Problem
Section titled “The Transcription Problem”No authoritative digital source files for the 1980 FORTRAN have ever existed. Every digital copy in circulation was produced by hand-typing, OCR, PDF text extraction, or copying from someone else’s copy — all methods vulnerable to column-shift errors.
During our 2026 extraction, a continuation line in sdp8.f was indented too deeply,
pushing the I in COSI to column 73. The compiler silently discarded it, turning
*COSI into *COS — a function call with no arguments. This is precisely the kind
of invisible bug that plagued card-punch era programming and contributed to 25 years
of divergent SGP4 implementations, as documented in
Vallado et al.’s Rev-1 paper.
Compatibility Fixes Applied
Section titled “Compatibility Fixes Applied”Five changes from the original printed source to compile on modern gfortran:
CHARACTER*80 ABUF(2)— the originalCHARACTER ABUF*80(2)placed the length specifier between variable name and dimension, a non-standard syntaxREADforDECODE— replaced DEC/VAXDECODEextension with standard FORTRAN 77 internalREADDOUBLE PRECISION Tindeep.f— explicit declaration for theDPSECentry point parameter that was implicitly REAL- Cross-entry local copies —
SIQSAV,CIQSAV,OGDSAV,TSAVEto avoid accessing dummy arguments from foreign entry points - Column 72 fix in
sdp8.f— re-indented the continuation line to keepCOSIwithin the active code region
Validation Results
Section titled “Validation Results”All 25 reference vectors from Chapter 13 were verified against the compiled binary:
| Model | Type | Max Position Error | Max Velocity Error |
|---|---|---|---|
| SGP | Near-earth | 0.011 km | 0.000012 km/s |
| SGP4 | Near-earth | 0.001 km | 0.000001 km/s |
| SGP8 | Near-earth | 0.000 km | 0.000000 km/s |
| SDP4 | Deep-space | 1.769 km | 0.001366 km/s |
| SDP8 | Deep-space | 1.463 km | 0.000680 km/s |
Near-earth models achieve sub-meter agreement. Deep-space models show 1–2 km drift at large propagation times due to the precision difference between our full double-precision compilation and the original mixed single/double precision reference values.