Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for IGRF 14. #8635

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 76 additions & 45 deletions src/mgd77/mgd77.c
Original file line number Diff line number Diff line change
Expand Up @@ -5013,10 +5013,13 @@ int MGD77_igrf10syn (struct GMT_CTRL *GMT, int isv, double date, int itype, doub
*
* 22-DEC-2019
* Updated for IGRF 13th generation
*
* 26-NOV-2024
* Updated for IGRF 14th generation
*/

/* Initialized data */
static double gh[3645] = {
static double gh[3840] = {
-31543., -2298., 5922., -677., 2905., -1061., 924., 1121., /* g0 (1900) */
1022., -1469., -330., 1256., 3., 572., 523., 876.,
628., 195., 660., -69., -361., -210., 134., -75.,
Expand Down Expand Up @@ -5444,46 +5447,74 @@ int MGD77_igrf10syn (struct GMT_CTRL *GMT, int isv, double date, int itype, doub
-0.42, -0.50, 0.96, -1.24, -0.19, -0.10, 0.81,
0.42, -0.13, -0.04, 0.38, 0.48, 0.08, 0.48,
0.46, -0.30, -0.35, -0.43, -0.36, -0.71,
-29404.8, -1450.9, 4652.5, -2499.6, 2982.0, -2991.6, 1677.0, /* gr (2020) */
-734.6, 1363.2, -2381.2, -82.1, 1236.2, 241.9, 525.7,
-543.4, 903.0, 809.5, 281.9, 86.3, -158.4, -309.4,
199.7, 48.0, -349.7, -234.3, 363.2, 47.7, 187.8,
208.3, -140.7, -121.2, -151.2, 32.3, 13.5, 98.9,
66.0, 65.5, -19.1, 72.9, 25.1, -121.5, 52.8,
-36.2, -64.5, 13.5, 8.9, -64.7, 68.1, 80.6,
-76.7, -51.5, -8.2, -16.9, 56.5, 2.2, 15.8,
23.5, 6.4, -2.2, -7.2, -27.2, 9.8, -1.8,
23.7, 9.7, 8.4, -17.6, -15.3, -0.5, 12.8,
-21.1, -11.7, 15.3, 14.9, 13.7, 3.6, -16.5,
-6.9, -0.3, 2.8, 5.0, 8.4, -23.4, 2.9,
11.0, -1.5, 9.8, -1.1, -5.1, -13.2, -6.3,
1.1, 7.8, 8.8, 0.4, -9.3, -1.4, -11.9,
9.6, -1.9, -6.2, 3.4, -0.1, -0.2, 1.7,
3.6, -0.9, 4.8, 0.7, -8.6, -0.9, -0.1,
1.9, -4.3, 1.4, -3.4, -2.4, -0.1, -3.8,
-8.8, 3.0, -1.4, 0.0, -2.5, 2.5, 2.3,
-0.6, -0.9, -0.4, 0.3, 0.6, -0.7, -0.2,
-0.1, -1.7, 1.4, -1.6, -0.6, -3.0, 0.2,
-2.0, 3.1, -2.6, -2.0, -0.1, -1.2, 0.5,
0.5, 1.3, 1.4, -1.2, -1.8, 0.7, 0.1,
0.3, 0.8, 0.5, -0.2, -0.3, 0.6, -0.5,
0.2, 0.1, -0.9, -1.1, 0.0, -0.3, 0.5,
0.1, -0.9, -0.9, 0.5, 0.6, 0.7, 1.4,
-0.3, -0.4, 0.8, -1.3, 0.0, -0.1, 0.8,
0.3, 0.0, -0.1, 0.4, 0.5, 0.1, 0.5,
0.5, -0.4, -0.5, -0.4, -0.4, -0.6,
5.7, 7.4, -25.9, -11.0, -7.0, -30.2, -2.1, /* sv (2020) */
-22.4, 2.2, -5.9, 6.0, 3.1, -1.1, -12.0,
0.5, -1.2, -1.6, -0.1, -5.9, 6.5, 5.2,
3.6, -5.1, -5.0, -0.3, 0.5, 0.0, -0.6,
2.5, 0.2, -0.6, 1.3, 3.0, 0.9, 0.3,
-0.5, -0.3, 0.0, 0.4, -1.6, 1.3, -1.3,
-1.4, 0.8, 0.0, 0.0, 0.9, 1.0, -0.1,
-0.2, 0.6, 0.0, 0.6, 0.7, -0.8, 0.1,
-0.2, -0.5, -1.1, -0.8, 0.1, 0.8, 0.3,
0.0, 0.1, -0.2, -0.1, 0.6, 0.4, -0.2,
-0.1, 0.5, 0.4, -0.3, 0.3, -0.4, -0.1,
0.5, 0.4, 0.0, 0.0, 0.0, 0.0, 0.0,
-29403.41, -1451.37, 4653.35, -2499.78, 2981.96, -2991.72, 1676.85, /* gr (2020) */
-734.62, 1363.00, -2380.80, -81.96, 1236.06, 241.80, 525.60,
-542.52, 902.82, 809.47, 282.10, 86.18, -158.50, -309.47,
199.75, 47.44, -350.30, -234.42, 363.26, 47.52, 187.86,
208.36, -140.73, -121.43, -151.16, 32.09, 13.98, 99.14,
65.97, 65.56, -19.22, 72.96, 25.02, -121.57, 52.76,
-36.06, -64.40, 13.60, 8.96, -64.80, 68.04, 80.54,
-76.63, -51.50, -8.23, -16.85, 56.45, 2.36, 15.80,
23.56, 6.30, -2.19, -7.21, -27.19, 9.77, -1.90,
23.66, 9.74, 8.43, -17.49, -15.23, -0.49, 12.83,
-21.07, -11.76, 15.28, 14.94, 13.65, 3.62, -16.59,
-6.90, -0.34, 2.90, 5.03, 8.36, -23.44, 2.84,
11.04, -1.48, 9.86, -1.14, -5.13, -13.22, -6.20,
1.08, 7.79, 8.82, 0.40, -9.23, -1.44, -11.86,
9.60, -1.84, -6.25, 3.38, -0.11, -0.18, 1.66,
3.50, -0.86, 4.86, 0.65, -8.62, -0.88, -0.11,
1.88, -4.26, 1.44, -3.43, -2.38, -0.10, -3.84,
-8.84, 2.96, -1.36, -0.02, -2.51, 2.50, 2.31,
-0.55, -0.85, -0.39, 0.28, 0.62, -0.66, -0.21,
-0.07, -1.66, 1.44, -1.60, -0.59, -2.98, 0.18,
-1.97, 3.09, -2.51, -2.00, -0.13, -1.15, 0.43,
0.52, 1.28, 1.37, -1.14, -1.81, 0.71, 0.08,
0.31, 0.71, 0.49, -0.15, -0.26, 0.55, -0.47,
0.16, 0.09, -0.93, -1.13, -0.04, -0.33, 0.52,
0.08, -0.93, -0.88, 0.53, 0.64, 0.72, 1.40,
-0.30, -0.38, 0.75, -1.31, -0.01, -0.09, 0.76,
0.29, -0.05, -0.11, 0.37, 0.47, 0.13, 0.54,
0.45, -0.41, -0.46, -0.36, -0.40, -0.60,
-29350.0, -1410.3, 4545.5, -2556.2, 2950.9, -3133.6, 1648.7, /* gs (2025) */
-814.2, 1360.9, -2404.2, -56.9, 1243.8, 237.6, 453.4,
-549.6, 894.7, 799.6, 278.6, 55.8, -134.0, -281.1,
212.0, 12.0, -375.4, -232.9, 369.0, 45.3, 187.2,
220.0, -138.7, -122.9, -141.9, 42.9, 20.9, 106.2,
64.3, 63.8, -18.4, 76.7, 16.8, -115.7, 48.9,
-40.9, -59.8, 14.9, 10.9, -60.8, 72.8, 79.6,
-76.9, -48.9, -8.8, -14.4, 59.3, -1.0, 15.8,
23.5, 2.5, -7.4, -11.2, -25.1, 14.3, -2.2,
23.1, 10.9, 7.2, -17.5, -12.6, 2.0, 11.5,
-21.8, -9.7, 16.9, 12.7, 14.9, 0.7, -16.8,
-5.2, 1.0, 3.9, 4.7, 8.0, -24.8, 3.0,
12.1, -0.2, 8.3, -2.5, -3.4, -13.1, -5.3,
2.4, 7.2, 8.6, -0.6, -8.7, 0.8, -12.8,
9.8, -1.3, -6.4, 3.3, 0.2, 0.1, 2.0,
2.5, -1.0, 5.4, -0.5, -9.0, -0.9, 0.4,
1.5, -4.2, 0.9, -3.8, -2.6, 0.9, -3.9,
-9.0, 3.0, -1.4, 0.0, -2.5, 2.8, 2.4,
-0.6, -0.6, 0.1, 0.0, 0.5, -0.6, -0.3,
-0.1, -1.2, 1.1, -1.7, -1.0, -2.9, -0.1,
-1.8, 2.6, -2.3, -2.0, -0.1, -1.2, 0.4,
0.6, 1.2, 1.0, -1.2, -1.5, 0.6, 0.0,
0.5, 0.6, 0.5, -0.2, -0.1, 0.8, -0.5,
0.1, -0.2, -0.9, -1.2, 0.1, -0.7, 0.2,
0.2, -0.9, -0.9, 0.6, 0.7, 0.7, 1.2,
-0.2, -0.3, 0.5, -1.3, 0.1, -0.1, 0.7,
0.2, 0.0, -0.2, 0.3, 0.5, 0.2, 0.6,
0.4, -0.6, -0.5, -0.3, -0.4, -0.5,
12.6, 10.0, -21.5, -11.2, -5.3, -27.3, -8.3, /* sv (2025) */
-11.1, -1.5, -4.4, 3.8, 0.4, -0.2, -15.6,
-3.9, -1.7, -2.3, -1.3, -5.8, 4.1, 5.4,
1.6, -6.8, -4.1, 0.6, 1.3, -0.5, 0.0,
2.1, 0.7, 0.5, 2.3, 1.7, 1.0, 1.9,
-0.2, -0.3, 0.3, 0.8, -1.6, 1.2, -0.4,
-0.8, 0.8, 0.4, 0.7, 0.9, 0.9, -0.1,
-0.1, 0.6, -0.1, 0.5, 0.5, -0.7, -0.1,
0.0, -0.8, -0.9, -0.8, 0.5, 0.9, -0.3,
-0.1, 0.2, -0.3, 0.0, 0.4, 0.4, -0.3,
-0.1, 0.4, 0.3, -0.5, 0.1, -0.6, 0.0,
0.3, 0.3, 0.2, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
Expand All @@ -5508,12 +5539,12 @@ int MGD77_igrf10syn (struct GMT_CTRL *GMT, int isv, double date, int itype, doub
double p[105], q[105], r, t, a2, b2;
double H, F, X = 0, Y = 0, Z = 0, dec, dip;

if (date < 1900.0 || date > 2025.0) {
GMT_Report (GMT->parent, GMT_MSG_ERROR, "Your date (%g) is outside valid extrapolated range for IGRF (1900-2025)\n", date);
if (date < 1900.0 || date > 2030.0) {
GMT_Report (GMT->parent, GMT_MSG_ERROR, "Your date (%g) is outside valid extrapolated range for IGRF (1900-2030)\n", date);
return (MGD77_BAD_IGRFDATE);
}

if (date < 2020.) {
if (date < 2025.) {
t = 0.2 * (date - 1900.);
ll = (int) t;
one = (double) ll;
Expand All @@ -5537,7 +5568,7 @@ int MGD77_igrf10syn (struct GMT_CTRL *GMT, int isv, double date, int itype, doub
}
}
else {
t = date - 2020.;
t = date - 2025.;
tc = 1.;
if (isv == 1) {
t = 1.;
Expand Down
Loading