-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2999 from GEOS-ESM/mapl3/tclune/init-phase-refact…
…oring Mapl3/tclune/init phase refactoring
- Loading branch information
Showing
27 changed files
with
395 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
generic3g/OuterMetaComponent/initialize_advertise_geom.F90
This file was deleted.
Oops, something went wrong.
89 changes: 89 additions & 0 deletions
89
generic3g/OuterMetaComponent/initialize_modify_advertised.F90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#include "MAPL_Generic.h" | ||
|
||
submodule (mapl3g_OuterMetaComponent) initialize_modify_advertised_smod | ||
implicit none | ||
|
||
contains | ||
|
||
module recursive subroutine initialize_modify_advertised(this, importState, exportState, clock, unusable, rc) | ||
class(OuterMetaComponent), target, intent(inout) :: this | ||
! optional arguments | ||
type(ESMF_State) :: importState | ||
type(ESMF_State) :: exportState | ||
type(ESMF_Clock) :: clock | ||
class(KE), optional, intent(in) :: unusable | ||
integer, optional, intent(out) :: rc | ||
|
||
integer :: status | ||
character(*), parameter :: PHASE_NAME = 'GENERIC::INIT_MODIFY_ADVERTISED' | ||
type(MultiState) :: outer_states, user_states | ||
|
||
call apply_to_children(this, set_child_geom, _RC) | ||
call this%run_custom(ESMF_METHOD_INITIALIZE, PHASE_NAME, _RC) | ||
call recurse(this, phase_idx=GENERIC_INIT_MODIFY_ADVERTISED, _RC) | ||
|
||
call self_advertise(this, _RC) | ||
call process_connections(this, _RC) | ||
|
||
_RETURN(_SUCCESS) | ||
_UNUSED_DUMMY(unusable) | ||
contains | ||
|
||
subroutine set_child_geom(this, child_meta, rc) | ||
class(OuterMetaComponent), target, intent(inout) :: this | ||
type(OuterMetaComponent), target, intent(inout) :: child_meta | ||
integer, optional, intent(out) :: rc | ||
|
||
integer :: status | ||
|
||
associate(kind => child_meta%component_spec%geometry_spec%kind) | ||
_RETURN_IF(kind /= GEOMETRY_FROM_PARENT) | ||
|
||
if (allocated(this%geom)) then | ||
call child_meta%set_geom(this%geom) | ||
end if | ||
if (allocated(this%vertical_grid)) then | ||
call child_meta%set_vertical_grid(this%vertical_grid) | ||
end if | ||
end associate | ||
|
||
_RETURN(ESMF_SUCCESS) | ||
end subroutine set_child_geom | ||
|
||
end subroutine initialize_modify_advertised | ||
|
||
|
||
subroutine self_advertise(this, unusable, rc) | ||
class(OuterMetaComponent), target, intent(inout) :: this | ||
class(KE), optional, intent(in) :: unusable | ||
integer, optional, intent(out) :: rc | ||
|
||
integer :: status | ||
|
||
call this%registry%initialize_specs(this%geom, this%vertical_grid, _RC) | ||
|
||
_RETURN(_SUCCESS) | ||
_UNUSED_DUMMY(unusable) | ||
end subroutine self_advertise | ||
|
||
subroutine process_connections(this, rc) | ||
class(OuterMetaComponent), intent(inout) :: this | ||
integer, optional, intent(out) :: rc | ||
|
||
integer :: status | ||
type(ConnectionVectorIterator) :: iter | ||
class(Connection), pointer :: c | ||
|
||
associate (e => this%component_spec%connections%end()) | ||
iter = this%component_spec%connections%begin() | ||
do while (iter /= e) | ||
c => iter%of() | ||
call c%connect(this%registry, _RC) | ||
call iter%next() | ||
end do | ||
end associate | ||
|
||
_RETURN(_SUCCESS) | ||
end subroutine process_connections | ||
|
||
end submodule initialize_modify_advertised_smod |
Oops, something went wrong.