Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/tclune/#3096-action-inva…
Browse files Browse the repository at this point in the history
…lidate_phase' into feature/tclune/#3096-action-invalidate_phase
  • Loading branch information
tclune committed Oct 24, 2024
2 parents 6a53afc + 761ee6f commit 4c4e6a1
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 33 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update `Findudunits.cmake` to link with libdl and look for the `udunits2.xml` file (as some MAPL tests require it)
- Modified `ESMF_GridComp` creation in `GenericGridComp` to use `ESMF_CONTEXT_PARENT_VM` by default.
- Changed `get_fptr_shape` in `FieldCondensedArray*.F90`
- Change name of ExtensionAction%run to ExtensionAction%update in the abstract type and derived types.
- Add invalid method to ExtensionAction with a no-op implementation in the abstract type

### Fixed

Expand All @@ -63,11 +65,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added

- Allow update offsets of ±timestep in ExtData2G

### Changed

- Update ESMF version for Baselibs to match that of Spack for consistency
- Update `components.yaml`
- ESMA_env v4.32.0
- Baselibs 7.27.0
- ESMF 8.7.0
- curl 8.10.1
- NCO 5.2.8
- CDO 2.4.4
- GSL 2.8
- jpeg 9f
- Various build fixes
- ESMA_cmake v3.52.0
- Fixes for using MAPL as a library in spack builds of GEOSgcm
- Various backports from v4

### Fixed

Expand All @@ -77,6 +93,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.50.1] - 2024-10-18

### Fixed

- Fixed unitialized variable bug in ExtData exposed by gfortran

## [2.50.0] - 2024-10-10

### Added
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif ()

project (
MAPL
VERSION 2.50.0
VERSION 2.50.1
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

# Set the possible values of build type for cmake-gui
Expand Down
4 changes: 2 additions & 2 deletions components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ MAPL:
ESMA_env:
local: ./ESMA_env
remote: ../ESMA_env.git
tag: v4.30.1
tag: v4.31.0
develop: main

ESMA_cmake:
local: ./ESMA_cmake
remote: ../ESMA_cmake.git
tag: v3.51.0
tag: v3.52.0
develop: develop

ecbuild:
Expand Down
6 changes: 3 additions & 3 deletions generic3g/actions/ConvertUnitsAction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module mapl3g_ConvertUnitsAction
character(:), allocatable :: src_units, dst_units
contains
procedure :: initialize
procedure :: run
procedure :: update
end type ConvertUnitsAction


Expand Down Expand Up @@ -59,7 +59,7 @@ subroutine initialize(this, importState, exportState, clock, rc)
end subroutine initialize


subroutine run(this, importState, exportState, clock, rc)
subroutine update(this, importState, exportState, clock, rc)
use esmf
class(ConvertUnitsAction), intent(inout) :: this
type(ESMF_State) :: importState
Expand Down Expand Up @@ -95,6 +95,6 @@ subroutine run(this, importState, exportState, clock, rc)

_FAIL('unsupported typekind')
_UNUSED_DUMMY(clock)
end subroutine run
end subroutine update

end module mapl3g_ConvertUnitsAction
6 changes: 3 additions & 3 deletions generic3g/actions/CopyAction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module mapl3g_CopyAction
type(ESMF_Field) :: f_in, f_out
contains
procedure :: initialize
procedure :: run
procedure :: update
end type CopyAction

interface CopyAction
Expand Down Expand Up @@ -65,7 +65,7 @@ subroutine initialize(this, importState, exportState, clock, rc)
_UNUSED_DUMMY(clock)
end subroutine initialize

subroutine run(this, importState, exportState, clock, rc)
subroutine update(this, importState, exportState, clock, rc)
use esmf
class(CopyAction), intent(inout) :: this
type(ESMF_State) :: importState
Expand All @@ -82,7 +82,7 @@ subroutine run(this, importState, exportState, clock, rc)
call FieldCopy(f_in, f_out, _RC)

_RETURN(_SUCCESS)
end subroutine run
end subroutine update


end module mapl3g_CopyAction
21 changes: 20 additions & 1 deletion generic3g/actions/ExtensionAction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module mapl3g_ExtensionAction
type, abstract :: ExtensionAction
contains
procedure(I_run), deferred :: initialize
procedure(I_run), deferred :: run
procedure(I_run), deferred :: update
procedure :: invalidate
end type ExtensionAction


Expand All @@ -26,4 +27,22 @@ subroutine I_run(this, importState, exportState, clock, rc)
end subroutine I_run
end interface

contains

! This is a default no-op implementation of invalidate.
! Types derived from ExtensionAction should overload it
! as needed.
subroutine invalidate(this, importState, exportState, clock, rc)
use ESMF
class(ExtensionAction), intent(inout) :: this
type(ESMF_State) :: importState
type(ESMF_State) :: exportState
type(ESMF_Clock) :: clock
integer, optional, intent(out) :: rc
_UNUSED_DUMMY(this)
_UNUSED_DUMMY(importState)
_UNUSED_DUMMY(exportState)
_UNUSED_DUMMY(clock)
end subroutine invalidate

end module mapl3g_ExtensionAction
6 changes: 3 additions & 3 deletions generic3g/actions/NullAction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module mapl3g_NullAction
type, extends(ExtensionAction) :: NullAction
contains
procedure :: initialize
procedure :: run
procedure :: update
end type NullAction

interface NullAction
Expand All @@ -42,7 +42,7 @@ subroutine initialize(this, importState, exportState, clock, rc)
_UNUSED_DUMMY(clock)
end subroutine initialize

subroutine run(this, importState, exportState, clock, rc)
subroutine update(this, importState, exportState, clock, rc)
use esmf
class(NullAction), intent(inout) :: this
type(ESMF_State) :: importState
Expand All @@ -54,6 +54,6 @@ subroutine run(this, importState, exportState, clock, rc)
_UNUSED_DUMMY(importState)
_UNUSED_DUMMY(exportState)
_UNUSED_DUMMY(clock)
end subroutine run
end subroutine update

end module mapl3g_NullAction
6 changes: 3 additions & 3 deletions generic3g/actions/RegridAction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module mapl3g_RegridAction
class(Regridder), pointer :: regrdr
contains
procedure :: initialize
procedure :: run
procedure :: update
end type ScalarRegridAction

interface RegridAction
Expand Down Expand Up @@ -67,7 +67,7 @@ subroutine initialize(this, importState, exportState, clock, rc)
end subroutine initialize


subroutine run(this, importState, exportState, clock, rc)
subroutine update(this, importState, exportState, clock, rc)
class(ScalarRegridAction), intent(inout) :: this
type(ESMF_State) :: importState
type(ESMF_State) :: exportState
Expand All @@ -84,6 +84,6 @@ subroutine run(this, importState, exportState, clock, rc)

_RETURN(_SUCCESS)
_UNUSED_DUMMY(clock)
end subroutine run
end subroutine update

end module mapl3g_RegridAction
6 changes: 3 additions & 3 deletions generic3g/actions/TimeInterpolateAction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module mapl3g_TimeInterpolateAction
type, extends(ExtensionAction) :: TimeInterpolateAction
contains
procedure :: initialize
procedure :: run
procedure :: update
end type TimeInterpolateAction

interface TimeInterpolateAction
Expand All @@ -42,7 +42,7 @@ subroutine initialize(this, importState, exportState, clock, rc)
_RETURN(_SUCCESS)
end subroutine initialize

subroutine run(this, importState, exportState, clock, rc)
subroutine update(this, importState, exportState, clock, rc)
class(TimeInterpolateAction), intent(inout) :: this
type(ESMF_State) :: importState
type(ESMF_State) :: exportState
Expand Down Expand Up @@ -80,7 +80,7 @@ subroutine run(this, importState, exportState, clock, rc)

_RETURN(_SUCCESS)
_UNUSED_DUMMY(clock)
end subroutine run
end subroutine update


subroutine run_r4(bundle_in, field_out, rc)
Expand Down
6 changes: 3 additions & 3 deletions generic3g/actions/VerticalRegridAction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module mapl3g_VerticalRegridAction
type(VerticalRegridMethod) :: method = VERTICAL_REGRID_UNKNOWN
contains
procedure :: initialize
procedure :: run
procedure :: update
end type VerticalRegridAction

interface VerticalRegridAction
Expand Down Expand Up @@ -72,7 +72,7 @@ subroutine initialize(this, importState, exportState, clock, rc)
_RETURN(_SUCCESS)
end subroutine initialize

subroutine run(this, importState, exportState, clock, rc)
subroutine update(this, importState, exportState, clock, rc)
use esmf
class(VerticalRegridAction), intent(inout) :: this
type(ESMF_State) :: importState
Expand Down Expand Up @@ -117,6 +117,6 @@ subroutine run(this, importState, exportState, clock, rc)
end do

_RETURN(_SUCCESS)
end subroutine run
end subroutine update

end module mapl3g_VerticalRegridAction
2 changes: 1 addition & 1 deletion generic3g/couplers/CouplerMetaComponent.F90
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ recursive subroutine update(this, importState, exportState, clock, rc)
!# call this%propagate_attributes(_RC)
call this%update_sources(_RC)

call this%action%run(importState, exportState, clock, _RC)
call this%action%update(importState, exportState, clock, _RC)
call this%set_up_to_date()

_RETURN(_SUCCESS)
Expand Down
6 changes: 3 additions & 3 deletions generic3g/tests/MockItemSpec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module MockItemSpecMod
character(:), allocatable :: details
contains
procedure :: initialize
procedure :: run
procedure :: update
end type MockAction

interface MockItemSpec
Expand Down Expand Up @@ -215,15 +215,15 @@ subroutine initialize(this, importState, exportState, clock, rc)
_FAIL('This procedure should not be called.')
end subroutine initialize

subroutine run(this, importState, exportState, clock, rc)
subroutine update(this, importState, exportState, clock, rc)
use esmf
class(MockAction), intent(inout) :: this
type(ESMF_State) :: importState
type(ESMF_State) :: exportState
type(ESMF_Clock) :: clock
integer, optional, intent(out) :: rc
_FAIL('This procedure should not be called.')
end subroutine run
end subroutine update

function make_adapters(this, goal_spec, rc) result(adapters)
type(StateItemAdapterWrapper), allocatable :: adapters(:)
Expand Down
6 changes: 3 additions & 3 deletions generic3g/tests/Test_TimeInterpolateAction.pf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contains
call ESMF_FieldEmptyComplete(f, typekind=ESMF_TYPEKIND_R4, _RC)
call ESMF_StateAdd(exportState, [f], _RC)

call action%run(importState, exportState, clock, _RC)
call action%update(importState, exportState, clock, _RC)

call assign_fptr(f, x, _RC)
@assert_that(x, every_item(is(equal_to(7.))))
Expand Down Expand Up @@ -96,7 +96,7 @@ contains
call ESMF_FieldEmptyComplete(f, typekind=ESMF_TYPEKIND_R4, _RC)
call ESMF_StateAdd(exportState, [f], _RC)

call action%run(importState, exportState, clock, _RC)
call action%update(importState, exportState, clock, _RC)

call assign_fptr(f, x, _RC)
@assert_that(x, every_item(is(equal_to(4.))))
Expand Down Expand Up @@ -155,7 +155,7 @@ contains
call ESMF_FieldEmptyComplete(f, typekind=ESMF_TYPEKIND_R4, _RC)
call ESMF_StateAdd(exportState, [f], _RC)

call action%run(importState, exportState, clock, _RC)
call action%update(importState, exportState, clock, _RC)

call assign_fptr(f, x, _RC)
@assert_that(x(1), is(equal_to(4.)))
Expand Down
4 changes: 2 additions & 2 deletions gridcomps/ExtData2G/ExtDataBracket.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ module MAPL_ExtDataBracket
real :: offset = 0.0
logical :: disable_interpolation = .false.
logical :: intermittent_disable = .false.
logical :: new_file_right
logical :: new_file_left
logical :: new_file_right = .false.
logical :: new_file_left = .false.
logical :: exact = .false.
contains
procedure :: interpolate_to_time
Expand Down
1 change: 1 addition & 0 deletions gridcomps/ExtData2G/ExtDataOldTypesCreator.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ subroutine fillin_primary(this,item_name,base_name,primary_item,time,clock,unusa
primary_item%cycling=.true.
else if (trim(time_sample%extrap_outside) == "persist_closest") then
primary_item%persist_closest=.true.
primary_item%cycling=.false.
else if (trim(time_sample%extrap_outside) == "none") then
primary_item%cycling=.false.
primary_item%persist_closest=.false.
Expand Down
4 changes: 2 additions & 2 deletions gridcomps/ExtData2G/ExtDataSample.F90
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ function new_ExtDataTimeSample(config,unusable,rc) result(TimeSample)

call TimeSample%set_defaults()

TimeSample%extrap_outside = "none"
if (ESMF_HConfigIsDefined(config,keyString="extrapolation")) then
TimeSample%extrap_outside=ESMF_HConfigAsString(config,keyString="extrapolation",_RC)
end if

TimeSample%time_interpolation = .true.
if (ESMF_HConfigIsDefined(config,keyString="time_interpolation")) then
TimeSample%time_interpolation = ESMF_HConfigAsLogical(config,keyString="time_interpolation",_RC)
else
TimeSample%time_interpolation = .true.
end if

if (ESMF_HConfigIsDefined(config,keyString="exact")) then
Expand Down

0 comments on commit 4c4e6a1

Please sign in to comment.