Skip to content

Commit b0c8c8d

Browse files
authored
Remove Frequency Aspect (#4861)
* Remove time-statistics transforms, FrequencyAspect, and related tests from generic3g Removes the accumulator-based transform infrastructure (AccumulatorTransform, MeanTransform, MaxTransform, MinTransform) and the FrequencyAspect from generic3g, along with all associated tests and CMakeLists entries. The replacement mechanism is StatisticsGridComp, which now includes TimeAccumulate.F90 for time-based field accumulation. Users should compose accumulation behavior via StatisticsGridComp rather than the removed transform pipeline. Verified: all 6 MAPL.generic3g.* tests pass with ifx/2025.3 + intelmpi/2021.17. * Remove timeStep/offset from VariableSpec and all call sites These fields/params were dead weight left over from the FrequencyAspect removal. They were accepted by make_VariableSpec, parse_var_specs, parse_component_spec, and make_StateItemSpec/make_aspects but never used to insert any aspect. Remove them entirely from VariableSpec type fields, constructor, parser interfaces, and all call sites in OuterMetaComponent, History3G, and StatisticsGridComp. 66/66 tests pass (ifx).
1 parent 3f9b068 commit b0c8c8d

32 files changed

Lines changed: 21 additions & 2043 deletions

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
MAPL_CapOptions type.
2727
- Remove FLAP support.
2828
- Remove `BUILD_SHARED_MAPL` CMake option. MAPL3 is now always built as a shared library.
29+
- Remove FrequencyAspect, the transforms for time-based statistics, and the references to them in other source or tests.
2930

3031
### Added
3132

@@ -104,7 +105,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
104105
- Update cap restart file with current time at end of run.
105106
- Read/write repeatCount from/to cap restart file at beginning/end of run.
106107
- Added FILL_VALUE with alias to ACG3
107-
108+
- TimeAccumulate to StatisticsGridComp
108109

109110
### Changed
110111

generic3g/ComponentSpecParser.F90

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,18 @@ module mapl3g_ComponentSpecParser
7272
character(*), parameter :: KEY_UNGRIDDED_DIM_EXTENT = 'extent'
7373
character(*), parameter :: KEY_UNGRIDDED_DIM_COORDINATES = 'coordinates'
7474
character(*), parameter :: KEY_VERTICAL_STAGGER = 'vertical_dim_spec'
75-
character(*), parameter :: KEY_ACCUMULATION_TYPE = 'accumulation_type'
7675
character(*), parameter :: KEY_TIMESTEP = 'timestep'
7776
character(*), parameter :: KEY_RUN_TIME_OFFSET = 'run_time_offset'
7877
character(*), parameter :: KEY_VECTOR_COMPONENT_NAMES = 'vector_component_names'
7978

8079
!>
8180
! Submodule declarations
8281
INTERFACE
83-
module function parse_component_spec(hconfig, registry, component_name, timeStep, offset, rc) result(spec)
82+
module function parse_component_spec(hconfig, registry, component_name, rc) result(spec)
8483
type(ComponentSpec) :: spec
8584
type(ESMF_HConfig), target, intent(inout) :: hconfig
8685
type(StateRegistry), target, intent(in) :: registry
8786
character(*), intent(in) :: component_name
88-
type(ESMF_TimeInterval), optional, intent(in) :: timeStep
89-
type(ESMF_TimeInterval), optional, intent(in) :: offset
9087
integer, optional, intent(out) :: rc
9188
end function parse_component_spec
9289

@@ -98,11 +95,9 @@ module function parse_geometry_spec(mapl_cfg, registry, component_name, rc) resu
9895
integer, optional, intent(out) :: rc
9996
end function parse_geometry_spec
10097

101-
module function parse_var_specs(hconfig, timeStep, offset, registry, component_name, rc) result(var_specs)
98+
module function parse_var_specs(hconfig, registry, component_name, rc) result(var_specs)
10299
type(VariableSpecVector) :: var_specs
103100
type(ESMF_HConfig), intent(in) :: hconfig
104-
type(ESMF_TimeInterval), optional, intent(in) :: timeStep
105-
type(ESMF_TimeInterval), optional, intent(in) :: offset
106101
type(StateRegistry), target, intent(in) :: registry
107102
character(*), intent(in) :: component_name
108103
integer, optional, intent(out) :: rc

generic3g/ComponentSpecParser/parse_component_spec.F90

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55

66
contains
77

8-
module function parse_component_spec(hconfig, registry, component_name, timeStep, offset, rc) result(spec)
8+
module function parse_component_spec(hconfig, registry, component_name, rc) result(spec)
99
type(ComponentSpec) :: spec
1010
type(ESMF_HConfig), target, intent(inout) :: hconfig
1111
type(StateRegistry), target, intent(in) :: registry
1212
character(*), intent(in) :: component_name
13-
type(ESMF_TimeInterval), optional, intent(in) :: timeStep
14-
type(ESMF_TimeInterval), optional, intent(in) :: offset
1513
integer, optional, intent(out) :: rc
1614

1715
integer :: status
@@ -23,7 +21,7 @@ module function parse_component_spec(hconfig, registry, component_name, timeStep
2321
mapl_cfg = ESMF_HConfigCreateAt(hconfig, keyString=MAPL_SECTION, _RC)
2422

2523
spec%geometry_spec = parse_geometry_spec(mapl_cfg, registry, component_name, _RC)
26-
spec%var_specs = parse_var_specs(mapl_cfg, timeStep, offset, registry, component_name, _RC)
24+
spec%var_specs = parse_var_specs(mapl_cfg, registry, component_name, _RC)
2725
spec%connections = parse_connections(mapl_cfg, _RC)
2826
spec%children = parse_children(mapl_cfg, _RC)
2927

generic3g/ComponentSpecParser/parse_var_specs.F90

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
! A component is not required to have var_specs. E.g, in theory GCM gridcomp will not
1010
! have var specs in MAPL3, as it does not really have a preferred geom on which to declare
1111
! imports and exports.
12-
module function parse_var_specs(hconfig, timeStep, offset, registry, component_name, rc) result(var_specs)
12+
module function parse_var_specs(hconfig, registry, component_name, rc) result(var_specs)
1313
type(VariableSpecVector) :: var_specs
1414
type(ESMF_HConfig), intent(in) :: hconfig
15-
type(ESMF_TimeInterval), optional, intent(in) :: timeStep
16-
type(ESMF_TimeInterval), optional, intent(in) :: offset
1715
type(StateRegistry), target, intent(in) :: registry
1816
character(*), intent(in) :: component_name
1917
integer, optional, intent(out) :: rc
@@ -27,21 +25,19 @@ module function parse_var_specs(hconfig, timeStep, offset, registry, component_n
2725

2826
subcfg = ESMF_HConfigCreateAt(hconfig,keyString=COMPONENT_STATES_SECTION, _RC)
2927

30-
call parse_state_specs(var_specs, subcfg, COMPONENT_INTERNAL_STATE_SECTION, timeStep, offset, component_name, _RC)
31-
call parse_state_specs(var_specs, subcfg, COMPONENT_EXPORT_STATE_SECTION, timeStep, offset, component_name, _RC)
32-
call parse_state_specs(var_specs, subcfg, COMPONENT_IMPORT_STATE_SECTION, timeStep, offset, component_name, _RC)
28+
call parse_state_specs(var_specs, subcfg, COMPONENT_INTERNAL_STATE_SECTION, component_name, _RC)
29+
call parse_state_specs(var_specs, subcfg, COMPONENT_EXPORT_STATE_SECTION, component_name, _RC)
30+
call parse_state_specs(var_specs, subcfg, COMPONENT_IMPORT_STATE_SECTION, component_name, _RC)
3331

3432
call ESMF_HConfigDestroy(subcfg, _RC)
3533

3634
_RETURN(_SUCCESS)
3735
contains
3836

39-
subroutine parse_state_specs(var_specs, hconfig, state_intent, timeStep, offset, component_name, rc)
37+
subroutine parse_state_specs(var_specs, hconfig, state_intent, component_name, rc)
4038
type(VariableSpecVector), intent(inout) :: var_specs
4139
type(ESMF_HConfig), target, intent(in) :: hconfig
4240
character(*), intent(in) :: state_intent
43-
type(ESMF_TimeInterval), optional, intent(in) :: timeStep
44-
type(ESMF_TimeInterval), optional, intent(in) :: offset
4541
character(*), intent(in) :: component_name
4642
integer, optional, intent(out) :: rc
4743

@@ -57,7 +53,6 @@ subroutine parse_state_specs(var_specs, hconfig, state_intent, timeStep, offset,
5753
character(:), allocatable :: standard_name
5854
character(:), allocatable :: units
5955
character(:), allocatable :: expression
60-
character(len=:), allocatable :: accumulation_type
6156
type(ESMF_StateItem_Flag) :: itemtype
6257
type(ESMF_StateIntent_Flag) :: esmf_state_intent
6358

@@ -67,7 +62,6 @@ subroutine parse_state_specs(var_specs, hconfig, state_intent, timeStep, offset,
6762
logical :: has_standard_name
6863
logical :: has_units
6964
logical :: has_expression
70-
logical :: has_accumulation_type
7165
type(ESMF_HConfig) :: subcfg
7266
type(StringVector) :: dependencies
7367
type(StringVector) :: vector_component_names
@@ -112,11 +106,6 @@ subroutine parse_state_specs(var_specs, hconfig, state_intent, timeStep, offset,
112106
expression = ESMF_HConfigAsString(attributes,keyString='expression', _RC)
113107
end if
114108

115-
has_accumulation_type = ESMF_HConfigIsDefined(attributes, keyString=KEY_ACCUMULATION_TYPE, _RC)
116-
if(has_accumulation_type) then
117-
accumulation_type = ESMF_HConfigAsString(attributes, keyString=KEY_ACCUMULATION_TYPE, _RC)
118-
end if
119-
120109
vector_component_names = get_vector_component_names(attributes, _RC)
121110

122111
itemtype = to_itemtype(attributes, _RC)
@@ -149,14 +138,10 @@ subroutine parse_state_specs(var_specs, hconfig, state_intent, timeStep, offset,
149138
expression=expression, &
150139
geom=geom, &
151140
vertical_grid=vertical_grid, &
152-
accumulation_type=accumulation_type, &
153-
timeStep=timeStep, &
154-
vector_component_names=vector_component_names, &
155-
offset=offset, _RC)
141+
vector_component_names=vector_component_names, _RC)
156142

157143
if (allocated(units)) deallocate(units)
158144
if (allocated(standard_name)) deallocate(standard_name)
159-
if (allocated(accumulation_type)) deallocate(accumulation_type)
160145
call var_specs%push_back(var_spec)
161146

162147
call ESMF_HConfigDestroy(attributes, _RC)

generic3g/OuterMetaComponent/SetServices.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ recursive module subroutine SetServices_(this, rc)
3636
class(logger_t), pointer :: logger
3737

3838
! Note that Parent component should set timestep and offset in outer meta before calling SetServices.
39-
this%component_spec = parse_component_spec(this%hconfig, this%registry, this%user_gc_driver%get_name(), this%user_timeStep, this%user_offset, _RC)
39+
this%component_spec = parse_component_spec(this%hconfig, this%registry, this%user_gc_driver%get_name(), _RC)
4040

4141
user_gridcomp = this%user_gc_driver%get_gridcomp()
4242
call attach_inner_meta(user_gridcomp, this%self_gridcomp, _RC)

generic3g/OuterMetaComponent/advertise_variable.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module subroutine advertise_variable(this, var_spec, rc)
2121
type(VirtualConnectionPt) :: virtual_pt
2222

2323
item_spec = var_spec%make_StateItemSpec(this%registry, &
24-
this%geom, this%vertical_grid, timestep=this%user_timestep, offset=this%user_offset, _RC)
24+
this%geom, this%vertical_grid, _RC)
2525
virtual_pt = var_spec%make_virtualPt()
2626
call this%registry%add_primary_spec(virtual_pt, item_spec)
2727

generic3g/specs/AspectId.F90

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ module mapl3g_AspectId
1515
public :: ATTRIBUTES_ASPECT_ID
1616
public :: UNGRIDDED_DIMS_ASPECT_ID
1717
public :: VERTICAL_GRID_ASPECT_ID
18-
public :: FREQUENCY_ASPECT_ID
1918
public :: TYPEKIND_ASPECT_ID
2019
public :: QUANTITY_TYPE_ASPECT_ID
2120
public :: CONSERVATION_ASPECT_ID
@@ -37,7 +36,6 @@ module mapl3g_AspectId
3736
type(AspectId), parameter :: ATTRIBUTES_ASPECT_ID = AspectId(4)
3837
type(AspectId), parameter :: UNGRIDDED_DIMS_ASPECT_ID = AspectId(5)
3938
type(AspectId), parameter :: VERTICAL_GRID_ASPECT_ID = AspectId(6)
40-
type(AspectId), parameter :: FREQUENCY_ASPECT_ID = AspectId(7)
4139
type(AspectId), parameter :: TYPEKIND_ASPECT_ID = AspectId(8)
4240
type(AspectId), parameter :: QUANTITY_TYPE_ASPECT_ID = AspectId(9)
4341
type(AspectId), parameter :: CONSERVATION_ASPECT_ID = AspectId(10)
@@ -79,8 +77,6 @@ function to_string(this) result(s)
7977
s = "UNGRIDDED_DIMS"
8078
case (VERTICAL_GRID_ASPECT_ID%id)
8179
s = "VERTICAL_GRID"
82-
case (FREQUENCY_ASPECT_ID%id)
83-
s = "FREQUENCY"
8480
case (TYPEKIND_ASPECT_ID%id)
8581
s = "TYPEKIND"
8682
case (QUANTITY_TYPE_ASPECT_ID%id)

generic3g/specs/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ target_sources(MAPL.generic3g PRIVATE
2323
VerticalGridAspect.F90
2424
UngriddedDimsAspect.F90
2525
UnitsAspect.F90
26-
FrequencyAspect.F90
2726
QuantityTypeAspect.F90
2827
ConservationAspect.F90
2928
NormalizationAspect.F90

generic3g/specs/FrequencyAspect.F90

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)