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

Bugfix/atrayano/#1252 defer #1253

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Fixed
- exports propagated to parent by "E2E connections" were not properly deferred and were always allocated

### Added

Expand Down
14 changes: 11 additions & 3 deletions generic/MAPL_Generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6368,6 +6368,7 @@ subroutine MAPL_StateCreateFromSpecNew(STATE,SPEC,DEFER,range, RC)

integer :: range_(2)
type(MAPL_VarSpec), pointer :: varspec
character(len=ESMF_MAXSTR) :: fname

if (present(range)) then
range_ = range
Expand Down Expand Up @@ -6496,9 +6497,15 @@ subroutine MAPL_StateCreateFromSpecNew(STATE,SPEC,DEFER,range, RC)
isCreated = ESMF_FieldIsCreated(SPEC_FIELD, rc=status)
_VERIFY(STATUS)
if (isCreated) then
call MAPL_AllocateCoupling( SPEC_FIELD, RC=STATUS ) ! if 'DEFER' this allocates the data
_VERIFY(STATUS)

call ESMF_FieldGet(SPEC_FIELD, name=fname, __RC__)
if (.not. deferAlloc .or. short_name/=fname) then
call MAPL_AllocateCoupling( SPEC_FIELD, RC=STATUS ) ! if 'DEFER' this allocates the data
_VERIFY(STATUS)
else
field = spec_field
goto 20
end if


!ALT we are creating new field so that we can optionally change the name of the field;
! the important thing is that the data (ESMF_Array) is the SAME as the one in SPEC_Field
Expand Down Expand Up @@ -6611,6 +6618,7 @@ subroutine MAPL_StateCreateFromSpecNew(STATE,SPEC,DEFER,range, RC)
_VERIFY(STATUS)
end if
end if
20 continue
else

! Create the appropriate ESMF FIELD
Expand Down