-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModIndices.f90
More file actions
100 lines (78 loc) · 2.7 KB
/
ModIndices.f90
File metadata and controls
100 lines (78 loc) · 2.7 KB
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
MODULE ModIndices
use ModIndConsts
use ModTimeConvert
use ModIoUnit
use ModErrors
use ModKind
implicit none
private
TYPE LookupTable
integer :: iIndex
character(len=30) :: idxName
END TYPE LookupTable
integer, parameter :: nValidIndices = 17
type(LookupTable), parameter, dimension(nValidIndices) :: &
indicesLookup = [LookupTable(1, "f107"), &
LookupTable(2, "f107a"), &
LookupTable(3, "imfbx"), &
LookupTable(4, "imfby"), &
LookupTable(5, "imfbz"), &
LookupTable(6, "swvx"), &
LookupTable(7, "swvy"), &
LookupTable(8, "swvz"), &
LookupTable(9, "swvmag"), &
LookupTable(10, "swn"), &
LookupTable(11, "swt"), &
LookupTable(12, "ae"), &
LookupTable(13, "au"), &
LookupTable(14, "al"), &
LookupTable(15, "hpi"), &
LookupTable(16, "hpin"), &
LookupTable(17, "hpis") &
]
! Initializers
! Call these to kick off the process of reading & storing stuff
public :: init_f107, init_ae, init_imf, init_hpi
public :: indexType
type IndexType
integer :: iIndex ! f107, bz, etc.
integer :: nValues = 0
! Each index stores arrays of the times & values
real, allocatable, dimension(:) :: values
type(TimeType), allocatable, dimension(:) :: times
end type indexType
! Central storage for all loaded indices
type(indexType), dimension(nValidIndices) :: allIndices
! Current time for "set once, query many" pattern
type(TimeType) :: currentTime = &
TimeType(0, 0, 0, 0, 0, 0, 0.0d0, -1.0d0, "")
public :: decode_index
interface decode_index
module procedure get_index_name
module procedure get_index_id
end interface decode_index
public :: get_index
interface get_index
module procedure get_index_int_wtime
module procedure get_index_int_wotime
module procedure get_index_char_wtime
module procedure get_index_char_wotime
end interface get_index
public :: get_nValues
interface get_nValues
module procedure get_nValues_from_int
module procedure get_nValues_from_char
end interface
public :: set_index
public :: set_time
interface set_time
module procedure set_time_real
module procedure set_time_type
module procedure set_time_components
end interface set_time
contains
INCLUDE "time_subroutines.inc"
INCLUDE "indices_lookup.inc"
INCLUDE "initialize_indices.inc"
INCLUDE "index_retrieval.inc"
end MODULE ModIndices