Skip to content

fix: geopack_08 and T01_S fixes#72

Open
xnchu wants to merge 4 commits intoPRBEM:mainfrom
xnchu:fix/geopack-t01s-fixes
Open

fix: geopack_08 and T01_S fixes#72
xnchu wants to merge 4 commits intoPRBEM:mainfrom
xnchu:fix/geopack-t01s-fixes

Conversation

@xnchu
Copy link

@xnchu xnchu commented Mar 11, 2026

Summary

  • Add IGRF coefficients support and update .gitignore for geopack_08.f
  • Fix k_ext=10 to correctly call T01_S instead of T01_01
  • Fix line continuation and indentation in geopack_08.f to resolve Make error
  • Remove /rconst/ COMMON block dependency from T01_S and use self-contained pi/180 conversion

Test plan

  • Build library: make OS=osx64 ENV=gfortran64 all
  • Verify k_ext=10 dispatches to T01_S correctly
  • Verify T01_S produces correct results without /rconst/ dependency

xnchu added 4 commits March 5, 2026 12:46
- Added new entries to .gitignore for local files and test scripts.
- Updated IGRF coefficients in geopack_08.f to reflect the latest values as of December 24, 2024, and adjusted the date range for model acceptance to 2030.
The storm-time branch (k_ext=10, Tsyganenko 2001 storm) was silently
calling T01_01 (quiet-time model) instead of T01_S (storm-time model).
Both share the same subroutine interface so the bug compiled without
error but produced incorrect results: T01_01 expects G1 and G2 in
PARMOD(5:6), while T01_S expects G2 and G3, which is what the PARMOD
assignments at lines 220-221 correctly provide.

Also fix comment at line 213: "G1,G2" → "G2,G3".

Historical k_ext=10 results will differ after this fix.
…olve Make error

Fixed a Fortran fixed-form formatting issue in the IGRF coefficient DATA
statement: replaced `-.04D0` with `-0.04D0`, split an overlong continuation
line, and corrected the indentation of the `DATA G25` statement (5→6 spaces)
so that the file compiles without errors.
…180 conversion

T01_S computed ps = tilt * rad, where rad came from the uninitialized /rconst/
common block (only populated by SUBROUTINE INITIZE). When T01_S was called before
INITIZE ran, rad = 0, giving ps = 0 (zero tilt) regardless of actual conditions.

Replace with the self-contained formula ps = tilt * 4.D0*ATAN(1.D0)/180.d0,
consistent with T89, T96, T01, and TS04. Remove the now-unused REAL*8 pi,rad
and common /rconst/rad,pi declarations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant