-
Notifications
You must be signed in to change notification settings - Fork 17
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 #2837 from GEOS-ESM/MAPL-v3/smods/generic3g/v3
Submodule files for GriddedComponentDriver.F90
- Loading branch information
Showing
12 changed files
with
274 additions
and
165 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
target_sources(MAPL.generic3g PRIVATE | ||
|
||
initialize.F90 | ||
run.F90 | ||
finalize.F90 | ||
get_states.F90 | ||
get_clock.F90 | ||
set_clock.F90 | ||
run_export_couplers.F90 | ||
run_import_couplers.F90 | ||
clock_advance.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,23 @@ | ||
#include "MAPL_ErrLog.h" | ||
|
||
submodule(mapl3g_GriddedComponentDriver) clock_advance_smod | ||
use :: mapl_ErrorHandling | ||
use :: mapl3g_OuterMetaComponent | ||
use :: mapl3g_MethodPhasesMapUtils | ||
use mapl3g_CouplerMetaComponent, only: GENERIC_COUPLER_INVALIDATE, GENERIC_COUPLER_UPDATE | ||
implicit none | ||
|
||
contains | ||
|
||
module subroutine clock_advance(this, rc) | ||
class(GriddedComponentDriver), intent(inout) :: this | ||
integer, optional, intent(out) :: rc | ||
|
||
integer :: status | ||
|
||
call ESMF_ClockAdvance(this%clock, _RC) | ||
|
||
_RETURN(_SUCCESS) | ||
end subroutine clock_advance | ||
|
||
end submodule clock_advance_smod |
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,36 @@ | ||
#include "MAPL_ErrLog.h" | ||
|
||
submodule(mapl3g_GriddedComponentDriver) finalize_smod | ||
use :: mapl_ErrorHandling | ||
use :: mapl3g_OuterMetaComponent | ||
use :: mapl3g_MethodPhasesMapUtils | ||
use mapl3g_CouplerMetaComponent, only: GENERIC_COUPLER_INVALIDATE, GENERIC_COUPLER_UPDATE | ||
implicit none | ||
|
||
contains | ||
|
||
module recursive subroutine finalize(this, unusable, phase_idx, rc) | ||
class(GriddedComponentDriver), intent(inout) :: this | ||
class(KE), optional, intent(in) :: unusable | ||
integer, optional, intent(in) :: phase_idx | ||
integer, optional, intent(out) :: rc | ||
|
||
integer :: status, user_status | ||
|
||
associate ( & | ||
importState => this%states%importState, & | ||
exportState => this%states%exportState) | ||
|
||
call ESMF_GridCompFinalize(this%gridcomp, & | ||
importState=importState, exportState=exportState, clock=this%clock, & | ||
phase=phase_idx, _USERRC) | ||
|
||
end associate | ||
|
||
call ESMF_GridCompDestroy(this%gridcomp, _RC) | ||
|
||
_RETURN(_SUCCESS) | ||
_UNUSED_DUMMY(unusable) | ||
end subroutine finalize | ||
|
||
end submodule finalize_smod |
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,19 @@ | ||
#include "MAPL_ErrLog.h" | ||
|
||
submodule(mapl3g_GriddedComponentDriver) get_clock_smod | ||
use :: mapl_ErrorHandling | ||
use :: mapl3g_OuterMetaComponent | ||
use :: mapl3g_MethodPhasesMapUtils | ||
use mapl3g_CouplerMetaComponent, only: GENERIC_COUPLER_INVALIDATE, GENERIC_COUPLER_UPDATE | ||
implicit none | ||
|
||
contains | ||
|
||
module function get_clock(this) result(clock) | ||
type(ESMF_Clock) :: clock | ||
class(GriddedComponentDriver), intent(in) :: this | ||
|
||
clock = this%clock | ||
end function get_clock | ||
|
||
end submodule get_clock_smod |
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,20 @@ | ||
#include "MAPL_ErrLog.h" | ||
|
||
submodule(mapl3g_GriddedComponentDriver) get_states_smod | ||
use :: mapl_ErrorHandling | ||
use :: mapl3g_OuterMetaComponent | ||
use :: mapl3g_MethodPhasesMapUtils | ||
use mapl3g_CouplerMetaComponent, only: GENERIC_COUPLER_INVALIDATE, GENERIC_COUPLER_UPDATE | ||
implicit none | ||
|
||
contains | ||
|
||
module function get_states(this) result(states) | ||
type(MultiState) :: states | ||
class(GriddedComponentDriver), intent(in) :: this | ||
|
||
states = this%states | ||
end function get_states | ||
|
||
|
||
end submodule get_states_smod |
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,35 @@ | ||
#include "MAPL_ErrLog.h" | ||
|
||
submodule(mapl3g_GriddedComponentDriver) initialize_smod | ||
use :: mapl_ErrorHandling | ||
use :: mapl3g_OuterMetaComponent | ||
use :: mapl3g_MethodPhasesMapUtils | ||
use mapl3g_CouplerMetaComponent, only: GENERIC_COUPLER_INVALIDATE, GENERIC_COUPLER_UPDATE | ||
implicit none | ||
|
||
contains | ||
|
||
|
||
recursive module subroutine initialize(this, unusable, phase_idx, rc) | ||
class(GriddedComponentDriver), intent(inout) :: this | ||
class(KE), optional, intent(in) :: unusable | ||
integer, optional, intent(in) :: phase_idx | ||
integer, optional, intent(out) :: rc | ||
|
||
integer :: status, user_status | ||
|
||
associate ( & | ||
importState => this%states%importState, & | ||
exportState => this%states%exportState) | ||
|
||
call ESMF_GridCompInitialize(this%gridcomp, & | ||
importState=importState, exportState=exportState, clock=this%clock, & | ||
phase=phase_idx, _USERRC) | ||
|
||
end associate | ||
|
||
_RETURN(_SUCCESS) | ||
_UNUSED_DUMMY(unusable) | ||
end subroutine initialize | ||
|
||
end submodule initialize_smod |
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,41 @@ | ||
#include "MAPL_ErrLog.h" | ||
|
||
submodule(mapl3g_GriddedComponentDriver) run_smod | ||
use :: mapl_ErrorHandling | ||
use :: mapl3g_OuterMetaComponent | ||
use :: mapl3g_MethodPhasesMapUtils | ||
use mapl3g_CouplerMetaComponent, only: GENERIC_COUPLER_INVALIDATE, GENERIC_COUPLER_UPDATE | ||
implicit none | ||
|
||
contains | ||
|
||
module recursive subroutine run(this, unusable, phase_idx, rc) | ||
class(GriddedComponentDriver), intent(inout) :: this | ||
class(KE), optional, intent(in) :: unusable | ||
integer, optional, intent(in) :: phase_idx | ||
integer, optional, intent(out) :: rc | ||
|
||
integer :: status, user_status | ||
|
||
_ASSERT(present(phase_idx), 'until made not optional') | ||
call this%run_import_couplers(_RC) | ||
|
||
associate ( & | ||
importState => this%states%importState, & | ||
exportState => this%states%exportState) | ||
|
||
call ESMF_GridCompRun(this%gridcomp, & | ||
importState=importState, & | ||
exportState=exportState, & | ||
clock=this%clock, & | ||
phase=phase_idx, _USERRC) | ||
|
||
end associate | ||
|
||
call this%run_export_couplers(phase_idx=phase_idx, _RC) | ||
|
||
_RETURN(_SUCCESS) | ||
_UNUSED_DUMMY(unusable) | ||
end subroutine run | ||
|
||
end submodule run_smod |
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,35 @@ | ||
#include "MAPL_ErrLog.h" | ||
|
||
submodule(mapl3g_GriddedComponentDriver) run_export_couplers_smod | ||
use :: mapl_ErrorHandling | ||
use :: mapl3g_OuterMetaComponent | ||
use :: mapl3g_MethodPhasesMapUtils | ||
use mapl3g_CouplerMetaComponent, only: GENERIC_COUPLER_INVALIDATE, GENERIC_COUPLER_UPDATE | ||
implicit none | ||
|
||
contains | ||
|
||
recursive module subroutine run_export_couplers(this, unusable, phase_idx, rc) | ||
class(GriddedComponentDriver), intent(inout) :: this | ||
class(KE), optional, intent(in) :: unusable | ||
integer, optional, intent(in) :: phase_idx | ||
integer, optional, intent(out) :: rc | ||
|
||
integer :: status | ||
type(ComponentDriverVectorIterator) :: iter | ||
class(ComponentDriver), pointer :: driver | ||
|
||
associate (e => this%export_couplers%ftn_end() ) | ||
iter = this%export_couplers%ftn_begin() | ||
do while (iter /= e) | ||
call iter%next() | ||
driver => iter%of() | ||
call driver%run(phase_idx=GENERIC_COUPLER_INVALIDATE, _RC) | ||
end do | ||
end associate | ||
|
||
_RETURN(_SUCCESS) | ||
_UNUSED_DUMMY(unusable) | ||
end subroutine run_export_couplers | ||
|
||
end submodule run_export_couplers_smod |
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,32 @@ | ||
#include "MAPL_ErrLog.h" | ||
|
||
submodule(mapl3g_GriddedComponentDriver) run_import_couplers_smod | ||
use :: mapl_ErrorHandling | ||
use :: mapl3g_OuterMetaComponent | ||
use :: mapl3g_MethodPhasesMapUtils | ||
use mapl3g_CouplerMetaComponent, only: GENERIC_COUPLER_INVALIDATE, GENERIC_COUPLER_UPDATE | ||
implicit none | ||
|
||
contains | ||
|
||
recursive module subroutine run_import_couplers(this, rc) | ||
class(GriddedComponentDriver), intent(inout) :: this | ||
integer, optional, intent(out) :: rc | ||
|
||
integer :: status | ||
type(ComponentDriverVectorIterator) :: iter | ||
class(ComponentDriver), pointer :: driver | ||
|
||
associate (e => this%import_couplers%ftn_end() ) | ||
iter = this%import_couplers%ftn_begin() | ||
do while (iter /= e) | ||
call iter%next() | ||
driver => iter%of() | ||
call driver%run(phase_idx=GENERIC_COUPLER_UPDATE, _RC) | ||
end do | ||
end associate | ||
|
||
_RETURN(_SUCCESS) | ||
end subroutine run_import_couplers | ||
|
||
end submodule run_import_couplers_smod |
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,19 @@ | ||
#include "MAPL_ErrLog.h" | ||
|
||
submodule(mapl3g_GriddedComponentDriver) set_clock_smod | ||
use :: mapl_ErrorHandling | ||
use :: mapl3g_OuterMetaComponent | ||
use :: mapl3g_MethodPhasesMapUtils | ||
use mapl3g_CouplerMetaComponent, only: GENERIC_COUPLER_INVALIDATE, GENERIC_COUPLER_UPDATE | ||
implicit none | ||
|
||
contains | ||
|
||
module subroutine set_clock(this, clock) | ||
class(GriddedComponentDriver), intent(inout) :: this | ||
type(ESMF_Clock), intent(in) :: clock | ||
|
||
this%clock = clock | ||
end subroutine set_clock | ||
|
||
end submodule set_clock_smod |
Oops, something went wrong.