Space weather data management type
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=ip), | private | :: | n_records | = | 0 |
Number of valid records loaded |
|
| real(kind=dp), | private, | allocatable | :: | mjd(:) |
Modified Julian Dates for each record |
||
| real(kind=dp), | private, | allocatable | :: | f107_obs(:) |
Observed F10.7 solar flux for each record |
||
| real(kind=dp), | private, | allocatable | :: | f107_adj(:) |
Adjusted F10.7 solar flux for each record |
||
| real(kind=dp), | private, | allocatable | :: | f107a_obs_ctr(:) |
Observed F10.7 81-day centered average for each record |
||
| real(kind=dp), | private, | allocatable | :: | f107a_adj_ctr(:) |
Adjusted F10.7 81-day centered average for each record |
||
| real(kind=dp), | private, | allocatable | :: | kp(:,:) |
Kp indices for 8 3-hour periods (8, n_records) |
||
| real(kind=dp), | private, | allocatable | :: | ap_avg(:) |
Average Ap for each record |
||
| logical, | private | :: | initialized | = | .false. |
Flag to indicate if data has been loaded |
|
| real(kind=dp), | private | :: | historic_start | = | -1.0_dp |
First epoch in data |
|
| real(kind=dp), | private | :: | historic_end | = | -1.0_dp |
Last daily epoch + 1 |
|
| real(kind=dp), | private | :: | historic_daily_end | = | -1.0_dp |
Last contiguous daily data epoch |
|
| logical, | private | :: | warn_epoch_before | = | .true. |
Flag to warn if requested epoch is before data start |
|
| logical, | private | :: | warn_epoch_after | = | .true. |
Flag to warn if requested epoch is after data end |
Initialize the space weather module by reading a CSSI file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sw_data_type), | intent(inout) | :: | me | |||
| character(len=*), | intent(in) | :: | filename |
Path to CSSI space weather file |
||
| integer(kind=ip), | intent(out) | :: | status |
Output status (0=success, non-zero=error) |
Get space weather data for a given Modified Julian Date. Uses direct indexing for daily data and record selection for monthly data
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sw_data_type), | intent(inout) | :: | me | |||
| real(kind=dp), | intent(in) | :: | mjd |
Modified Julian Date |
||
| type(flux_data_type), | intent(out) | :: | flux_data |
Output flux data structure |
||
| logical, | intent(out) | :: | status |
Output status (true=success, false=not initialized) |
Clean up allocated memory
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sw_data_type), | intent(inout) | :: | me |
Copy a single record from the space weather data
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sw_data_type), | intent(in) | :: | me | |||
| integer(kind=ip), | intent(in) | :: | idx |
Index of the record to copy |
Output flux data structure
type,public :: sw_data_type !! Space weather data management type private integer(ip) :: n_records = 0 !! Number of valid records loaded real(dp), allocatable :: mjd(:) !! Modified Julian Dates for each record real(dp), allocatable :: f107_obs(:) !! Observed F10.7 solar flux for each record real(dp), allocatable :: f107_adj(:) !! Adjusted F10.7 solar flux for each record real(dp), allocatable :: f107a_obs_ctr(:) !! Observed F10.7 81-day centered average for each record real(dp), allocatable :: f107a_adj_ctr(:) !! Adjusted F10.7 81-day centered average for each record real(dp), allocatable :: kp(:,:) !! Kp indices for 8 3-hour periods (8, n_records) real(dp), allocatable :: ap_avg(:) !! Average Ap for each record logical :: initialized = .false. !! Flag to indicate if data has been loaded real(dp) :: historic_start = -1.0_dp !! First epoch in data real(dp) :: historic_end = -1.0_dp !! Last daily epoch + 1 real(dp) :: historic_daily_end = -1.0_dp !! Last contiguous daily data epoch logical :: warn_epoch_before = .true. !! Flag to warn if requested epoch is before data start logical :: warn_epoch_after = .true. !! Flag to warn if requested epoch is after data end contains private procedure,public :: initialize => sw_init procedure,public :: get_flux_data => sw_get_flux_data procedure,public :: destroy => sw_cleanup procedure :: get_record => copy_record end type sw_data_type