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

Feature/wdboggs/mapl3 freq aspect ts reftime 3358 #3404

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
e7dbf6a
Make module private default.
darianboggs Feb 7, 2025
63516f3
Initial impl of freq aspect compatibility
darianboggs Feb 7, 2025
539127d
Successfully compiles
darianboggs Feb 7, 2025
cc2a5bb
Fix failing FrequencyAspect tests
darianboggs Feb 10, 2025
0018085
Change FrequencyAspect test to different reference times
darianboggs Feb 10, 2025
c9de6c1
Facilitate merge with release/MAPLv3
darianboggs Feb 11, 2025
cf6adc6
Merge branch 'release/MAPL-v3' into feature/wdboggs/mapl3_freq_aspect…
darianboggs Feb 11, 2025
8754b1e
Use setters in constructor; update set_reference_time()
darianboggs Feb 11, 2025
7f4b271
Update test to use updated constructor
darianboggs Feb 11, 2025
7465456
Update fail test
darianboggs Feb 11, 2025
063e97d
Merge branch 'release/MAPL-v3' into feature/wdboggs/mapl3_freq_aspect…
darianboggs Feb 11, 2025
d026f41
Remove 2 setters in constructor
darianboggs Feb 11, 2025
89cf54e
Move contents of check_compatibility into supports_conversion_specific
darianboggs Feb 11, 2025
d200d8b
Clean up argument names
darianboggs Feb 11, 2025
4246c45
Correct check on accumulation type: should be src
darianboggs Feb 12, 2025
bf844f6
Hand merge release/MAPL-v3 changes in
darianboggs Feb 12, 2025
64c1ef9
Merge branch 'release/MAPL-v3' into feature/wdboggs/mapl3_freq_aspect…
darianboggs Feb 12, 2025
9f3c3e1
Reverse src and dst in times_and_intervals_are_compatible
darianboggs Feb 13, 2025
ef99af4
Merge branch 'release/MAPL-v3' into feature/wdboggs/mapl3_freq_aspect…
darianboggs Feb 13, 2025
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
21 changes: 10 additions & 11 deletions generic3g/specs/FrequencyAspect.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ function new_FrequencyAspect(timeStep, refTime, accumulation_type) result(aspect
call aspect%set_time_dependent(.FALSE.)
call aspect%set_accumulation_type(INSTANTANEOUS)
call aspect%zero_timestep()
if(present(timestep)) aspect%timestep_ = timestep
if(present(refTime)) aspect%refTime_ = refTime
if(present(accumulation_type)) aspect%accumulation_type_ = accumulation_type
if(present(timestep)) call aspect%set_timestep(timestep)
if(present(refTime)) call aspect%set_reference_time(refTime)
if(present(accumulation_type)) call aspect%set_accumulation_type(accumulation_type)

end function new_FrequencyAspect

Expand All @@ -77,19 +77,19 @@ subroutine set_timestep(this, timestep)

end subroutine set_timestep

function get_reference_time(this) result(rf)
type(ESMF_Time) :: rf
function get_reference_time(this) result(time)
type(ESMF_Time) :: time
class(FrequencyAspect), intent(in) :: this

rf = this%reference_time_
time = this%refTime_

end function get_reference_time

subroutine set_reference_time(this, reference_time)
subroutine set_reference_time(this, time)
class(FrequencyAspect), intent(inout) :: this
type(ESMF_Time), intent(in) :: reference_time
type(ESMF_Time), intent(in) :: time

this%reference_time_ = reference_time
this%refTime_ = time

end subroutine set_reference_time

Expand Down Expand Up @@ -134,8 +134,7 @@ logical function matches(src, dst) result(does_match)
dst_timestep = dst%get_timestep()
if(dst_timestep == zero) return
if(.not. accumulation_type_is_valid(dst%get_accumulation_type())) return
does_match = dst_timestep == src_timestep .and. &
& src%get_reference_time() == dst%get_reference_time()
does_match = dst_timestep == src_timestep
end select

end function matches
Expand Down
16 changes: 5 additions & 11 deletions generic3g/tests/Test_Aspects.pf
Original file line number Diff line number Diff line change
Expand Up @@ -285,21 +285,15 @@ contains
type(FrequencyAspect) :: import, export

type(ESMF_TimeInterval) :: dt1, dt2
type(ESMF_Time) :: ref1, ref2
type(ESMF_Time) :: time1, time2

integer :: status
call ESMF_TimeIntervalSet(dt1, s=4)
call ESMF_TimeIntervalSet(dt2, s=2) ! commensurate
call ESMF_TimeSet(time1, s=0)
call ESMF_TimeSet(time2, m=0)

import = FrequencyAspect(dt1, accumulation_type='mean')
call ESMF_TimeSet(ref1, s=0, rc=status)
@assertEqual(0, status, 'Nonzero status')
call import%set_reference_time(ref1)
export = FrequencyAspect(dt2)
call ESMF_TimeSet(ref2, m=0, rc=status)
@assertEqual(0, status, 'Nonzero status')
call export%set_reference_time(ref2)

import = FrequencyAspect(dt1, time1, accumulation_type='mean')
export = FrequencyAspect(dt2, time2)
@assert_that(export%can_connect_to(import), is(true()))

end subroutine test_can_connect_accum_mean
Expand Down
Loading