-
Notifications
You must be signed in to change notification settings - Fork 103
/
SHTOOLS.f95
1180 lines (1053 loc) · 57 KB
/
SHTOOLS.f95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
module SHTOOLS
!------------------------------------------------------------------------------
!
! This module contains an interface block defining all the routines
! used in the archive SHTOOLS. These are necessary in order to use
! implicitly shaped arrays with most subroutines.
!
! Note: This module does not use the ftypes module because this creates
! a dependency problem when compiling pyshtools using pip.
!
!------------------------------------------------------------------------------
implicit none
interface
subroutine PlmBar(p, lmax, z, csphase, cnorm, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:)
real(dp), intent(in) :: z
integer(int32), intent(in), optional :: csphase, cnorm
integer(int32), intent(out), optional :: exitstatus
end subroutine PlmBar
subroutine PlmBar_d1(p, dp1, lmax, z, csphase, cnorm, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:), dp1(:)
real(dp), intent(in) :: z
integer(int32), intent(in), optional :: csphase, cnorm
integer(int32), intent(out), optional :: exitstatus
end subroutine PlmBar_d1
subroutine PlBar(p, lmax, z, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:)
real(dp), intent(in) :: z
integer(int32), intent(out), optional :: exitstatus
end subroutine PlBar
subroutine PlBar_d1(p, dp1, lmax, z, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:), dp1(:)
real(dp), intent(in) :: z
integer(int32), intent(out), optional :: exitstatus
end subroutine PlBar_d1
subroutine PlmON(p, lmax, z, csphase, cnorm, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:)
real(dp), intent(in) :: z
integer(int32), intent(in), optional :: csphase, cnorm
integer(int32), intent(out), optional :: exitstatus
end subroutine PlmON
subroutine PlmON_d1(p, dp1, lmax, z, csphase, cnorm, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:), dp1(:)
real(dp), intent(in) :: z
integer(int32), intent(in), optional :: csphase, cnorm
integer(int32), intent(out), optional :: exitstatus
end subroutine PlmON_d1
subroutine PlON(p, lmax, z, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:)
real(dp), intent(in) :: z
integer(int32), intent(out), optional :: exitstatus
end subroutine PlON
subroutine PlON_d1(p, dp1, lmax, z, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:), dp1(:)
real(dp), intent(in) :: z
integer(int32), intent(out), optional :: exitstatus
end subroutine PlON_d1
subroutine PlmSchmidt(p, lmax, z, csphase, cnorm, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:)
real(dp), intent(in) :: z
integer(int32), intent(in), optional :: csphase, cnorm
integer(int32), intent(out), optional :: exitstatus
end subroutine PlmSchmidt
subroutine PlmSchmidt_d1(p, dp1, lmax, z, csphase, cnorm, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:), dp1(:)
real(dp), intent(in) :: z
integer(int32), intent(in), optional :: csphase, cnorm
integer(int32), intent(out), optional :: exitstatus
end subroutine PlmSchmidt_d1
subroutine PlSchmidt(p, lmax, z, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:)
real(dp), intent(in) :: z
integer(int32), intent(out), optional :: exitstatus
end subroutine PlSchmidt
subroutine PlSchmidt_d1(p, dp1, lmax, z, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:), dp1(:)
real(dp), intent(in) :: z
integer(int32), intent(out), optional :: exitstatus
end subroutine PlSchmidt_d1
subroutine PLegendreA(p,lmax,z, csphase, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:)
real(dp), intent(in) :: z
integer(int32), intent(in), optional :: csphase
integer(int32), intent(out), optional :: exitstatus
end subroutine PLegendreA
subroutine PLegendreA_d1(p, dp1, lmax, z, csphase, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:), dp1(:)
real(dp), intent(in) :: z
integer(int32), intent(in), optional :: csphase
integer(int32), intent(out), optional :: exitstatus
end subroutine PLegendreA_d1
subroutine PLegendre(p,lmax,z, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:)
real(dp), intent(in) :: z
integer(int32), intent(out), optional :: exitstatus
end subroutine PLegendre
subroutine PLegendre_d1(p, dp1, lmax, z, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: p(:), dp1(:)
real(dp), intent(in) :: z
integer(int32), intent(out), optional :: exitstatus
end subroutine PLegendre_d1
function PlmIndex(l,m)
use iso_fortran_env, only: int32, dp=>real64
integer(int32) :: PlmIndex
integer(int32), intent(in) :: l, m
end function PlmIndex
subroutine SHExpandDH(grid, n, cilm, lmax, norm, sampling, &
csphase, lmax_calc, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: grid(:,:)
real(dp), intent(out) :: cilm(:,:,:)
integer(int32), intent(in) :: n
integer(int32), intent(out) :: lmax
integer(int32), intent(in), optional :: norm, sampling, csphase, &
lmax_calc
integer(int32), intent(out), optional :: exitstatus
end subroutine SHExpandDH
subroutine MakeGridDH(griddh, n, cilm, lmax, norm, sampling, &
csphase, lmax_calc, extend, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:)
real(dp), intent(out) :: griddh(:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(out) :: n
integer(int32), intent(in), optional :: norm, sampling, csphase, &
lmax_calc, extend
integer(int32), intent(out), optional :: exitstatus
end subroutine MakeGridDH
subroutine SHExpandDHC(grid, n, cilm, lmax, norm, sampling, &
csphase, lmax_calc, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
complex(dp), intent(in) :: grid(:,:)
complex(dp), intent(out) :: cilm(:,:,:)
integer(int32), intent(in) :: n
integer(int32), intent(out) :: lmax
integer(int32), intent(in), optional :: norm, sampling, csphase, &
lmax_calc
integer(int32), intent(out), optional :: exitstatus
end subroutine SHExpandDHC
subroutine MakeGridDHC(griddh, n, cilm, lmax, norm, sampling, &
csphase, lmax_calc, extend, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
complex(dp), intent(in) :: cilm(:,:,:)
complex(dp), intent(out) :: griddh(:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(out) :: n
integer(int32), intent(in), optional :: norm, sampling, csphase, &
lmax_calc, extend
integer(int32), intent(out), optional :: exitstatus
end subroutine MakeGridDHC
subroutine SHGLQ(lmax, zero, w, plx, norm, csphase, cnorm, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: zero(:), w(:)
real(dp), intent(out), optional :: plx(:,:)
integer(int32), intent(in), optional :: norm, csphase, cnorm
integer(int32), intent(out), optional :: exitstatus
end subroutine SHGLQ
subroutine SHExpandGLQ(cilm, lmax, gridglq, w, plx, zero, norm, &
csphase, lmax_calc, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: w(:), gridglq(:,:)
real(dp), intent(in), optional :: plx(:,:), zero(:)
real(dp), intent(out) :: cilm(:,:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(in), optional :: norm, csphase, lmax_calc
integer(int32), intent(out), optional :: exitstatus
end subroutine SHExpandGLQ
subroutine MakeGridGLQ(gridglq, cilm, lmax, plx, zero, norm, &
csphase, lmax_calc, extend, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:)
real(dp), intent(in), optional :: plx(:,:), zero(:)
real(dp), intent(out) :: gridglq(:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(in), optional :: norm, csphase, lmax_calc, &
extend
integer(int32), intent(out), optional :: exitstatus
end subroutine MakeGridGLQ
subroutine SHExpandGLQC(cilm, lmax, gridglq, w, plx, zero, norm, &
csphase, lmax_calc, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: w(:)
complex(dp), intent(in) :: gridglq(:,:)
real(dp), intent(in), optional :: plx(:,:), zero(:)
complex(dp), intent(out) :: cilm(:,:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(in), optional :: norm, csphase, lmax_calc
integer(int32), intent(out), optional :: exitstatus
end subroutine SHExpandGLQC
subroutine MakeGridGLQC(gridglq, cilm, lmax, plx, zero, norm, &
csphase, lmax_calc, extend, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
complex(dp), intent(in) :: cilm(:,:,:)
real(dp), intent(in), optional :: plx(:,:), zero(:)
complex(dp), intent(out) :: gridglq(:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(in), optional :: norm, csphase, lmax_calc, &
extend
integer(int32), intent(out), optional :: exitstatus
end subroutine MakeGridGLQC
subroutine GLQGridCoord(latglq, longlq, lmax, nlat, nlong, extend, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
integer(int32), intent(out) :: nlat, nlong
real(dp), intent(out) :: latglq(:), longlq(:)
integer(int32), intent(in), optional :: extend
integer(int32), intent(out), optional :: exitstatus
end subroutine GLQGridCoord
subroutine SHExpandLSQ(cilm, d, lat, lon, nmax, lmax, norm, &
chi2, csphase, weights, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: d(:), lat(:), lon(:)
real(dp), intent(out) :: cilm(:,:,:)
integer(int32), intent(in) :: nmax, lmax
integer(int32), intent(in), optional :: norm, csphase
real(dp), intent(out), optional :: chi2
real(dp), intent(in), optional :: weights(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHExpandLSQ
subroutine MakeGrid2d(grid, cilm, lmax, interval, nlat, nlong, &
norm, csphase, f, a, north, south, east, west, &
dealloc, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:), interval
real(dp), intent(out) :: grid(:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(out) :: nlat, nlong
integer(int32), intent(in), optional :: norm, csphase, dealloc
real(dp), intent(in), optional :: f, a, north, south, east, west
integer(int32), intent(out), optional :: exitstatus
end subroutine MakeGrid2D
function MakeGridPoint(cilm, lmax, lat, lon, norm, csphase, dealloc)
use iso_fortran_env, only: int32, dp=>real64
real(dp) :: MakeGridPoint
real(dp), intent(in) :: cilm(:,:,:), lat, lon
integer(int32), intent(in) :: lmax
integer(int32), intent(in), optional :: norm, csphase, dealloc
end function MakeGridPoint
function MakeGridPointC(cilm, lmax, lat, lon, norm, csphase, dealloc)
use iso_fortran_env, only: int32, dp=>real64
complex(dp) :: MakeGridPointC
complex(dp), intent(in) :: cilm(:,:,:)
real(dp), intent(in) :: lat, lon
integer(int32), intent(in) :: lmax
integer(int32), intent(in), optional :: norm, csphase, dealloc
end function MakeGridPointC
subroutine SHMultiply(cilmout, cilm1, lmax1, cilm2, lmax2, precomp, &
norm, csphase, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: cilmout(:,:,:)
real(dp), intent(in) :: cilm1(:,:,:), cilm2(:,:,:)
integer(int32), intent(in) :: lmax1, lmax2
integer(int32), intent(in), optional :: precomp, norm, csphase
integer(int32), intent(out), optional :: exitstatus
end subroutine SHMultiply
subroutine SHRead(filename, cilm, lmax, skip, header, error, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
character(*), intent(in) :: filename
integer(int32), intent(out) :: lmax
real(dp), intent(out) :: cilm(:,:,:)
real(dp), intent(out), optional :: header(:), error(:,:,:)
integer(int32), intent(in), optional :: skip
integer(int32), intent(out), optional :: exitstatus
end subroutine SHRead
subroutine SHRead2(filename, cilm, lmax, gm, r0_pot, error, dot, &
doystart, doyend, epoch, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
character(*), intent(in) :: filename
integer(int32), intent(out) :: lmax
real(dp), intent(out) :: cilm(:,:,:), gm, r0_pot
real(dp), intent(out), optional :: error(:,:,:), dot(:,:,:), &
doystart, doyend, epoch
integer(int32), intent(out), optional :: exitstatus
end subroutine SHRead2
subroutine SHReadJPL(filename, cilm, lmax, error, gm, formatstring, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
character(*), intent(in) :: filename
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: cilm(:,:,:)
real(dp), intent(out), optional :: error(:,:,:), gm(2)
character(6), intent(in), optional :: formatstring
integer(int32), intent(out), optional :: exitstatus
end subroutine SHReadJPL
subroutine SHCilmToVector(cilm, vector, lmax, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:)
real(dp), intent(out) :: vector(:)
integer(int32), intent(in) :: lmax
integer(int32), intent(out), optional :: exitstatus
end subroutine SHCilmToVector
subroutine SHVectorToCilm(vector, cilm, lmax, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: cilm(:,:,:)
real(dp), intent(in) :: vector(:)
integer(int32), intent(in) :: lmax
integer(int32), intent(out), optional :: exitstatus
end subroutine SHVectorToCilm
subroutine SHCilmToCindex(cilm, cindex, degmax, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:)
real(dp), intent(out) :: cindex(:,:)
integer(int32), intent(in), optional :: degmax
integer(int32), intent(out), optional :: exitstatus
end subroutine SHCilmToCindex
subroutine SHCindexToCilm(cindex, cilm, degmax, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: cilm(:,:,:)
real(dp), intent(in) :: cindex(:,:)
integer(int32), intent(in), optional :: degmax
integer(int32), intent(out), optional :: exitstatus
end subroutine SHCindexToCilm
subroutine SHrtoc(rcilm, ccilm, degmax, convention, switchcs, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: rcilm(:,:,:)
real(dp), intent(out) :: ccilm(:,:,:)
integer(int32), intent(in), optional :: degmax, convention, switchcs
integer(int32), intent(out), optional :: exitstatus
end subroutine SHrtoc
subroutine SHctor(ccilm, rcilm, degmax, convention, switchcs, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: ccilm(:,:,:)
real(dp), intent(out) :: rcilm(:,:,:)
integer(int32), intent(in), optional :: degmax, convention, switchcs
integer(int32), intent(out), optional :: exitstatus
end subroutine SHctor
subroutine djpi2(dj, lmax, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: dj(:,:,:)
integer(int32), intent(out), optional :: exitstatus
end subroutine djpi2
subroutine SHRotateCoef(x, cof, rcof, dj, lmax, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cof(:,:), dj(:,:,:), x(3)
real(dp), intent(out) :: rcof(:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(out), optional :: exitstatus
end subroutine SHRotateCoef
subroutine SHRotateRealCoef(cilmrot, cilm, lmax, x, dj, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:), x(:), dj(:,:,:)
real(dp), intent(out) :: cilmrot(:,:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(out), optional :: exitstatus
end subroutine SHRotateRealCoef
function SHPowerL(cilm, l)
use iso_fortran_env, only: int32, dp=>real64
real(dp) :: SHPowerL
real(dp), intent(in) :: cilm(:,:,:)
integer(int32), intent(in) :: l
end function SHPowerL
function SHPowerDensityL(cilm, l)
use iso_fortran_env, only: int32, dp=>real64
real(dp) :: SHPowerDensityL
real(dp), intent(in) :: cilm(:,:,:)
integer(int32), intent(in) :: l
end function SHPowerDensityL
function SHCrossPowerL(cilm1, cilm2, l)
use iso_fortran_env, only: int32, dp=>real64
real(dp) :: SHCrossPowerL
real(dp), intent(in) :: cilm1(:,:,:), cilm2(:,:,:)
integer(int32), intent(in) :: l
end function SHCrossPowerL
function SHCrossPowerDensityL(cilm1, cilm2, l)
use iso_fortran_env, only: int32, dp=>real64
real(dp) :: SHCrossPowerDensityL
real(dp), intent(in) :: cilm1(:,:,:), cilm2(:,:,:)
integer(int32), intent(in) :: l
end function SHCrossPowerDensityL
subroutine SHPowerSpectrum(cilm, lmax, spectra, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:)
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: spectra(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHPowerSpectrum
subroutine SHPowerSpectrumDensity(cilm, lmax, spectra, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:)
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: spectra(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHPowerSpectrumDensity
subroutine SHCrossPowerSpectrum(cilm1, cilm2, lmax, cspectra, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm1(:,:,:), cilm2(:,:,:)
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: cspectra(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHCrossPowerSpectrum
subroutine SHCrossPowerSpectrumDensity(cilm1, cilm2, lmax, cspectra, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm1(:,:,:), cilm2(:,:,:)
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: cspectra(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHCrossPowerSpectrumDensity
subroutine SHAdmitCorr(gilm, tilm, lmax, admit, corr, admit_error, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: gilm(:,:,:), tilm(:,:,:)
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: admit(:), corr(:)
real(dp), intent(out), optional :: admit_error(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHAdmitCorr
function SHConfidence(l_conf, r)
use iso_fortran_env, only: int32, dp=>real64
real(dp) :: SHConfidence
real(dp), intent(in) :: r
integer(int32), intent(in) :: l_conf
end function SHConfidence
function SHPowerLC(cilm, l)
use iso_fortran_env, only: int32, dp=>real64
real(dp) :: SHPowerLC
complex(dp), intent(in) :: cilm(:,:,:)
integer(int32), intent(in) :: l
end function SHPowerLC
function SHPowerDensityLC(cilm, l)
use iso_fortran_env, only: int32, dp=>real64
real(dp) :: SHPowerDensityLC
complex(dp), intent(in) :: cilm(:,:,:)
integer(int32), intent(in) :: l
end function SHPowerDensityLC
function SHCrossPowerLC(cilm1, cilm2, l)
use iso_fortran_env, only: int32, dp=>real64
complex(dp) :: SHCrossPowerLC
complex(dp), intent(in) :: cilm1(:,:,:), cilm2(:,:,:)
integer, intent(in) :: l
end function SHCrossPowerLC
function SHCrossPowerDensityLC(cilm1, cilm2, l)
use iso_fortran_env, only: int32, dp=>real64
complex(dp) :: SHCrossPowerDensityLC
complex(dp), intent(in) :: cilm1(:,:,:), cilm2(:,:,:)
integer(int32), intent(in) :: l
end function SHCrossPowerDensityLC
subroutine SHPowerSpectrumC(cilm, lmax, spectra, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
complex(dp), intent(in) :: cilm(:,:,:)
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: spectra(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHPowerSpectrumC
subroutine SHPowerSpectrumDensityC(cilm, lmax, spectra, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
complex(dp), intent(in) :: cilm(:,:,:)
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: spectra(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHPowerSpectrumDensityC
subroutine SHCrossPowerSpectrumC(cilm1, cilm2, lmax, cspectra, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
complex(dp), intent(in) :: cilm1(:,:,:), cilm2(:,:,:)
integer(int32), intent(in) :: lmax
complex(dp), intent(out) :: cspectra(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHCrossPowerSpectrumC
subroutine SHCrossPowerSpectrumDensityC(cilm1, cilm2, lmax, cspectra, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
complex(dp), intent(in) :: cilm1(:,:,:), cilm2(:,:,:)
integer(int32), intent(in) :: lmax
complex(dp), intent(out) :: cspectra(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHCrossPowerSpectrumDensityC
subroutine SHMultiTaperSE(mtse, sd, cilm, lmax, tapers, taper_order, &
lmaxt, k, alpha, lat, lon, taper_wt, norm, &
csphase, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: mtse(:), sd(:)
real(dp), intent(in) :: cilm(:,:,:), tapers(:,:)
integer(int32), intent(in) :: lmax, lmaxt, k, taper_order(:)
real(dp), intent(in), optional :: alpha(:), lat, lon, taper_wt(:)
integer(int32), intent(in), optional :: csphase, norm
integer(int32), intent(out), optional :: exitstatus
end subroutine SHMultiTaperSE
subroutine SHMultiTaperCSE(mtse, sd, cilm1, lmax1, cilm2, lmax2, &
tapers, taper_order, lmaxt, k, alpha, lat, &
lon, taper_wt, norm, csphase, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: mtse(:), sd(:)
real(dp), intent(in) :: cilm1(:,:,:), cilm2(:,:,:), tapers(:,:)
integer(int32), intent(in) :: lmax1, lmax2, lmaxt, k, taper_order(:)
real(dp), intent(in), optional :: alpha(:), lat, lon, taper_wt(:)
integer(int32), intent(in), optional :: csphase, norm
integer(int32), intent(out), optional :: exitstatus
end subroutine SHMultiTaperCSE
subroutine SHLocalizedAdmitCorr(tapers, taper_order, lwin, lat, lon, &
gilm, tilm, lmax, admit, corr, k, &
admit_error, corr_error, taper_wt, &
mtdef, k1linsig, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: tapers(:,:), lat, lon, gilm(:,:,:), &
tilm(:,:,:)
integer(int32), intent(in) :: lwin, lmax, k, taper_order(:)
real(dp), intent(out) :: admit(:), corr(:)
real(dp), intent(out), optional :: admit_error(:), corr_error(:)
integer(int32), intent(in), optional :: mtdef, k1linsig
real(dp), intent(in), optional :: taper_wt(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHLocalizedAdmitCorr
subroutine SHReturnTapers(theta0, lmax, tapers, eigenvalues, &
taper_order, degrees, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: theta0
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: tapers(:,:), eigenvalues(:)
integer(int32), intent(out) :: taper_order(:)
integer(int32), intent(in), optional :: degrees(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHReturnTapers
subroutine SHReturnTapersM(theta0, lmax, m, tapers, eigenvalues, &
shannon, degrees, ntapers, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: theta0
integer(int32), intent(in) :: lmax, m
real(dp), intent(out) :: tapers(:,:), eigenvalues(:)
real(dp), intent(out), optional :: shannon
integer(int32), intent(in), optional :: degrees(:)
integer(int32), intent(out), optional :: ntapers
integer(int32), intent(out), optional :: exitstatus
end subroutine SHReturnTapersM
subroutine ComputeDm(dllm, lmax, m, theta0, degrees, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: dllm(:,:)
real(dp), intent(in) :: theta0
integer(int32), intent(in) :: lmax, m
integer(int32), intent(in), optional :: degrees(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine ComputeDm
subroutine ComputeDG82(dG82, lmax, m, theta0, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: dG82(:,:)
real(dp), intent(in) :: theta0
integer(int32), intent(in) :: lmax, m
integer(int32), intent(out), optional :: exitstatus
end subroutine ComputeDG82
function SHFindLWin(theta0, m, alpha, taper_number)
use iso_fortran_env, only: int32, dp=>real64
integer(int32) :: SHFindLWin
real(dp), intent(in) :: theta0, alpha
integer(int32), intent(in) :: m
integer(int32), intent(in), optional :: taper_number
end function SHFindLWin
subroutine SHBiasK(tapers, lwin, k, incspectra, ldata, &
outcspectra, taper_wt, save_cg, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: tapers(:,:), incspectra(:)
real(dp), intent(out) :: outcspectra(:)
integer(int32), intent(in) :: lwin, ldata, k
real(dp), intent(in), optional :: taper_wt(:)
integer(int32), intent(in), optional :: save_cg
integer(int32), intent(out), optional :: exitstatus
end subroutine SHBiasK
subroutine SHMTCouplingMatrix(Mmt, lmax, tapers_power, lwin, k, &
taper_wt, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: Mmt(:,:)
real(dp), intent(in) :: tapers_power(:,:)
real(dp), intent(in), optional :: taper_wt(:)
integer(int32), intent(in) :: lmax, k, lwin
integer(int32), intent(out), optional :: exitstatus
end subroutine
subroutine SHBiasAdmitCorr(sgt, sgg, stt, lmax, tapers, lwin, k, &
admit, corr, mtdef, taper_wt, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: sgt(:), sgg(:), stt(:), tapers(:,:)
integer(int32), intent(in) :: lmax, lwin, k
real(dp), intent(out) :: admit(:), corr(:)
integer(int32), intent(in), optional :: mtdef
real(dp), intent(in), optional :: taper_wt(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHBiasAdmitCorr
subroutine SHMTDebias (mtdebias, mtspectra, lmax, tapers, lwin, k, &
nl, lmid, n, taper_wt, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: mtdebias(:,:), lmid(:)
real(dp), intent(in) :: mtspectra(:,:), tapers(:,:)
real(dp), intent(in), optional :: taper_wt(:)
integer(int32), intent(in) :: lmax, k, lwin, nl
integer(int32), intent(out) :: n
integer(int32), intent(out), optional :: exitstatus
end subroutine SHMTDebias
subroutine SHMTVarOpt(l, tapers, taper_order, lwin, kmax, Sff, &
var_opt, var_unit, weight_opt, &
unweighted_covar, nocross, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: tapers(:,:), Sff(:)
real(dp), intent(out) :: var_opt(:), var_unit(:)
integer(int32), intent(in) :: l, lwin, kmax, taper_order(:)
real(dp), intent(out), optional :: weight_opt(:,:), &
unweighted_covar(:,:)
integer(int32), intent(in), optional :: nocross
integer(int32), intent(out), optional :: exitstatus
end subroutine SHMTVarOpt
subroutine SHMTVar(l, tapers, taper_order, lwin, kmax, Sff, &
variance, taper_wt, unweighted_covar, nocross, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: tapers(:,:), Sff(:)
real(dp), intent(out) :: variance
integer(int32), intent(in) :: l, lwin, kmax, taper_order(:)
real(dp), intent(in), optional :: taper_wt(:)
real(dp), intent(out), optional :: unweighted_covar(:,:)
integer(int32), intent(in), optional :: nocross
integer(int32), intent(out), optional :: exitstatus
end subroutine SHMTVar
function SHSjkPG(incspectra, l, m, mprime, hj_real, hk_real, mj, mk, &
lwin, hkcc)
use iso_fortran_env, only: int32, dp=>real64
complex(dp) :: SHSjkPG
real(dp), intent(in) :: incspectra(:), hj_real(:), hk_real(:)
integer(int32), intent(in) :: lwin, l, m, mprime, mj, mk, hkcc
end function SHSjkPG
subroutine SHReturnTapersMap(tapers, eigenvalues, dh_mask, n_dh, &
lmax, sampling, ntapers, degrees, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: tapers(:,:), eigenvalues(:)
integer(int32), intent(in) :: dh_mask(:,:), n_dh, lmax, sampling
integer(int32), intent(in), optional :: ntapers, degrees(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHReturnTapersMap
subroutine SHBiasKMask(tapers, lwin, k, incspectra, ldata, &
outcspectra, taper_wt, save_cg, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: tapers(:,:), incspectra(:)
real(dp), intent(out) :: outcspectra(:)
integer(int32), intent(in) :: lwin, ldata, k
real(dp), intent(in), optional :: taper_wt(:)
integer(int32), intent(in), optional :: save_cg
integer(int32), intent(out), optional :: exitstatus
end subroutine SHBiasKMask
subroutine SHMultiTaperMaskSE(mtse, sd, cilm, lmax, tapers, &
lmaxt, k, taper_wt, norm, csphase, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: mtse(:), sd(:)
real(dp), intent(in) :: cilm(:,:,:), tapers(:,:)
integer(int32), intent(in) :: lmax, lmaxt, k
real(dp), intent(in), optional :: taper_wt(:)
integer(int32), intent(in), optional :: csphase, norm
integer(int32), intent(out), optional :: exitstatus
end subroutine SHMultiTaperMaskSE
subroutine SHMultiTaperMaskCSE(mtse, sd, cilm1, lmax1, cilm2, lmax2, &
tapers, lmaxt, k, taper_wt, norm, &
csphase, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: mtse(:), sd(:)
real(dp), intent(in) :: cilm1(:,:,:), cilm2(:,:,:), tapers(:,:)
integer(int32), intent(in) :: lmax1, lmax2, lmaxt, k
real(dp), intent(in), optional :: taper_wt(:)
integer(int32), intent(in), optional :: csphase, norm
integer(int32), intent(out), optional :: exitstatus
end subroutine SHMultiTaperMaskCSE
subroutine ComputeDMap(Dij, dh_mask, n_dh, lmax, sampling, degrees, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: Dij(:,:)
integer(int32), intent(in) :: dh_mask(:,:), n_dh, lmax
integer(int32), intent(in), optional :: sampling, degrees(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine ComputeDMap
subroutine Curve2Mask(dhgrid, n, sampling, profile, nprofile, NP, &
extend, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
integer, intent(out) :: dhgrid(:,:)
real(dp), intent(in) :: profile(:,:)
integer(int32), intent(in) :: n, sampling, nprofile, np
integer(int32), intent(in), optional :: extend
integer(int32), intent(out), optional :: exitstatus
end subroutine Curve2Mask
subroutine SHBias(Shh, lwin, incspectra, ldata, outcspectra, save_cg, &
exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: Shh(:), incspectra(:)
real(dp), intent(out) :: outcspectra(:)
integer(int32), intent(in) :: lwin, ldata
integer(int32), intent(in), optional :: save_cg
integer(int32), intent(out), optional :: exitstatus
end subroutine SHBias
subroutine SphericalCapCoef(coef, theta, lmax, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: coef(:)
real(dp), intent(in) :: theta
integer(int32), intent(in), optional :: lmax
integer(int32), intent(out), optional :: exitstatus
end subroutine SphericalCapCoef
subroutine MakeGravGridDH(cilm, lmax, gm, r0, a, f, rad, theta, phi, &
total, n, sampling, lmax_calc, omega, &
normal_gravity, pot, extend, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:), gm, r0, a, f
real(dp), intent(out) :: rad(:,:), theta(:,:), phi(:,:), total(:,:)
real(dp), intent(in), optional :: omega
real(dp), intent(out), optional :: pot(:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(out) :: n
integer(int32), intent(in), optional :: sampling, lmax_calc, &
normal_gravity, extend
integer(int32), intent(out), optional :: exitstatus
end subroutine MakeGravGridDH
function MakeGravGridPoint(cilm, lmax, gm, r0, r, lat, lon, omega, &
dealloc)
use iso_fortran_env, only: int32, dp=>real64
real(dp), dimension(3) :: MakeGravGridPoint
real(dp), intent(in) :: cilm(:,:,:), gm, r0, r, lat, lon
integer(int32), intent(in) :: lmax
real(dp), intent(in), optional :: omega
integer(int32), intent(in), optional :: dealloc
end function MakeGravGridPoint
subroutine MakeGravGradGridDH(cilm, lmax, gm, r0, a, f, vxx, vyy, &
vzz, vxy, vxz, vyz, n, sampling, &
lmax_calc, extend, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:), gm, r0, a, f
real(dp), intent(out) :: vxx(:,:), vyy(:,:), vzz(:,:), vxy(:,:), &
vxz(:,:), vyz(:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(out) :: n
integer(int32), intent(in), optional :: sampling, lmax_calc, extend
integer(int32), intent(out), optional :: exitstatus
end subroutine MakeGravGradGridDH
subroutine MakeMagGradGridDH(cilm, lmax, r0, a, f, vxx, vyy, &
vzz, vxy, vxz, vyz, n, sampling, &
lmax_calc, extend, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:), r0, a, f
real(dp), intent(out) :: vxx(:,:), vyy(:,:), vzz(:,:), vxy(:,:), &
vxz(:,:), vyz(:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(out) :: n
integer(int32), intent(in), optional :: sampling, lmax_calc, extend
integer(int32), intent(out), optional :: exitstatus
end subroutine MakeMagGradGridDH
function MakeMagGridPoint(cilm, lmax, a, r, lat, lon, dealloc)
use iso_fortran_env, only: int32, dp=>real64
real(dp), dimension(3) :: MakeMagGridPoint
real(dp), intent(in) :: cilm(:,:,:), a, r, lat, lon
integer(int32), intent(in) :: lmax
integer(int32), intent(in), optional :: dealloc
end function MakeMagGridPoint
subroutine MakeGeoidGrid(geoid, cilm, lmax, r0pot, GM, PotRef, omega, &
r, gridtype, order, nlat, nlong, interval, &
lmax_calc, a, f, extend, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: geoid(:,:)
real(dp), intent(in) :: cilm(:,:,:), r0pot, GM, r, PotRef, omega
integer(int32), intent(in) :: lmax, order, gridtype
integer(int32), intent(in), optional :: lmax_calc, extend
integer(int32), intent(out) :: nlat, nlong
real(dp), intent(in), optional :: interval, a, f
integer(int32), intent(out), optional :: exitstatus
end subroutine MakeGeoidGrid
subroutine CilmPlus(cilm, gridin, lmax, nmax, mass, d, rho, gridtype, &
w, zero, plx, n, dref, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: gridin(:,:), mass, rho
real(dp), intent(in), optional :: w(:), zero(:), plx(:,:), dref
real(dp), intent(out) :: cilm(:,:,:), d
integer(int32), intent(in) :: lmax, nmax, gridtype
integer(int32), intent(in), optional :: n
integer(int32), intent(out), optional :: exitstatus
end subroutine CilmPlus
subroutine CilmMinus(cilm, gridin, lmax, nmax, mass, d, rho, &
gridtype, w, zero, plx, n, dref, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: gridin(:,:), mass, rho
real(dp), intent(in), optional :: w(:), zero(:), plx(:,:), dref
real(dp), intent(out) :: cilm(:,:,:), d
integer(int32), intent(in) :: lmax, nmax, gridtype
integer(int32), intent(in), optional :: n
integer(int32), intent(out), optional :: exitstatus
end subroutine CilmMinus
subroutine CilmPlusRhoH(cilm, gridin, lmax, nmax, mass, d, rho, &
gridtype, w, zero, plx, n, dref, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: gridin(:,:), mass, rho(:,:)
real(dp), intent(in), optional :: w(:), zero(:), plx(:,:), dref
real(dp), intent(out) :: cilm(:,:,:), d
integer(int32), intent(in) :: lmax, nmax, gridtype
integer(int32), intent(in), optional :: n
integer(int32), intent(out), optional :: exitstatus
end subroutine CilmPlusRhoH
subroutine CilmMinusRhoH(cilm, gridin, lmax, nmax, mass, d, rho, &
gridtype, w, zero, plx, n, dref, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: gridin(:,:), mass, rho(:,:)
real(dp), intent(in), optional :: w(:), zero(:), plx(:,:), dref
real(dp), intent(out) :: cilm(:,:,:), d
integer(int32), intent(in) :: lmax, nmax, gridtype
integer(int32), intent(in), optional :: n
integer(int32), intent(out), optional :: exitstatus
end subroutine CilmMinusRhoH
subroutine BAtoHilm(cilm, ba, gridglq, lmax, nmax, mass, r0, rho, &
gridtype, w, plx, zero, filter_type, filter_deg, &
lmax_calc, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: cilm(:,:,:)
real(dp), intent(in) :: ba(:,:,:), gridglq(:,:), mass, r0, rho
real(dp), intent(in), optional :: plx(:,:), zero(:), w(:)
integer(int32), intent(in) :: lmax, nmax, gridtype
integer(int32), intent(in), optional :: filter_type, filter_deg, lmax_calc
integer(int32), intent(out), optional :: exitstatus
end subroutine BAtoHilm
subroutine BAtoHilmRhoH(cilm, ba, gridglq, lmax, nmax, mass, r0, &
rho, gridtype, w, plx, zero, filter_type, &
filter_deg, lmax_calc, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(out) :: cilm(:,:,:)
real(dp), intent(in) :: ba(:,:,:), gridglq(:,:), mass, r0, rho(:,:)
real(dp), intent(in), optional :: plx(:,:), zero(:), w(:)
integer(int32), intent(in) :: lmax, nmax, gridtype
integer(int32), intent(in), optional :: filter_type, filter_deg, lmax_calc
integer(int32), intent(out), optional :: exitstatus
end subroutine BAtoHilmRhoH
function DownContFilterMA(l, half, r, d)
use iso_fortran_env, only: int32, dp=>real64
real(dp) :: DownContFilterMA
integer(int32), intent(in) :: l, half
real(dp), intent(in) :: r, d
end function DownContFilterMA
function DownContFilterMC(l, half, r, d)
use iso_fortran_env, only: int32, dp=>real64
real(dp) :: DownContFilterMC
integer(int32), intent(in) :: l, half
real(dp), intent(in) :: r, d
end function DownContFilterMC
function NormalGravity(geocentric_lat, gm, omega, a, b)
use iso_fortran_env, only: int32, dp=>real64
real(dp) :: NormalGravity
real(dp), intent(in) :: geocentric_lat, gm, omega, a, b
end function NormalGravity
subroutine MakeMagGridDH(cilm, lmax, r0, a, f, rad_grid, theta_grid, &
phi_grid, total_grid, n, sampling, &
lmax_calc, pot_grid, extend, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:), r0, a, f
real(dp), intent(out) :: rad_grid(:,:), theta_grid(:,:), &
phi_grid(:,:), total_grid(:,:)
real(dp), intent(out), optional :: pot_grid(:,:)
integer(int32), intent(in) :: lmax
integer(int32), intent(out) :: n
integer(int32), intent(in), optional :: sampling, lmax_calc, extend
integer(int32), intent(out), optional :: exitstatus
end subroutine MakeMagGridDH
subroutine SHMagPowerSpectrum(cilm, a, r, lmax, spectra, exitstatus)
use iso_fortran_env, only: int32, dp=>real64
real(dp), intent(in) :: cilm(:,:,:)
real(dp), intent(in) :: a, r
integer(int32), intent(in) :: lmax
real(dp), intent(out) :: spectra(:)
integer(int32), intent(out), optional :: exitstatus
end subroutine SHMagPowerSpectrum
function SHMagPowerL(cilm, a, r, l)