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

Move procedures from smod files into main modules #2966

Open
wants to merge 1 commit into
base: release/MAPL-v3
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
12 changes: 4 additions & 8 deletions generic3g/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,12 @@ esma_add_fortran_submodules(
SOURCES SetServices.F90 add_child_by_name.F90 new_outer_meta.F90 init_meta.F90
get_child_by_name.F90 run_child_by_name.F90 run_children.F90
get_outer_meta_from_outer_gc.F90 attach_outer_meta.F90 free_outer_meta.F90
get_phases.F90 set_hconfig.F90 get_hconfig.F90 get_geom.F90
initialize_advertise_geom.F90 initialize_realize_geom.F90
initialize_advertise.F90 initialize_post_advertise.F90
initialize_realize.F90 recurse.F90 apply_to_children_custom.F90
initialize_user.F90 run_custom.F90 run_user.F90 run_clock_advance.F90
read_restart.F90 write_restart.F90 get_name.F90 get_gridcomp.F90
set_geom.F90 set_vertical_grid.F90 get_registry.F90
get_component_spec.F90 get_internal_state.F90 get_lgr.F90
get_user_gc_driver.F90 connect_all.F90 set_entry_point.F90
read_restart.F90 write_restart.F90
connect_all.F90 set_entry_point.F90
finalize.F90)

esma_add_fortran_submodules(
Expand All @@ -98,10 +95,9 @@ esma_add_fortran_submodules(
esma_add_fortran_submodules(
TARGET MAPL.generic3g
SUBDIRECTORY GriddedComponentDriver
SOURCES initialize.F90 run.F90 finalize.F90 get_states.F90
get_clock.F90 set_clock.F90 run_export_couplers.F90
SOURCES initialize.F90 run.F90 finalize.F90 run_export_couplers.F90
run_import_couplers.F90 clock_advance.F90 new_GriddedComponentDriver.F90
get_gridcomp.F90 get_name.F90 add_export_coupler.F90
add_export_coupler.F90
add_import_coupler.F90 read_restart.F90 write_restart.F90)

target_include_directories (${this} PUBLIC
Expand Down
73 changes: 44 additions & 29 deletions generic3g/GriddedComponentDriver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,6 @@ module recursive subroutine write_restart(this, unusable, phase_idx, rc)
integer, optional, intent(out) :: rc
end subroutine write_restart

module function get_states(this) result(states)
type(MultiState) :: states
class(GriddedComponentDriver), intent(in) :: this
end function get_states

module function get_clock(this) result(clock)
use esmf, only: ESMF_Clock
type(ESMF_Clock) :: clock
class(GriddedComponentDriver), intent(in) :: this
end function get_clock

module subroutine set_clock(this, clock)
use esmf, only: ESMF_Clock
class(GriddedComponentDriver), intent(inout) :: this
type(ESMF_Clock), intent(in) :: clock
end subroutine set_clock

recursive module subroutine run_export_couplers(this, unusable, phase_idx, rc)
class(GriddedComponentDriver), intent(inout) :: this
class(KE), optional, intent(in) :: unusable
Expand All @@ -125,18 +108,6 @@ module function new_GriddedComponentDriver(gridcomp, clock, states) result(child
type(MultiState), intent(in) :: states
end function new_GriddedComponentDriver

module function get_gridcomp(this) result(gridcomp)
use esmf, only: ESMF_GridComp
type(ESMF_GridComp) :: gridcomp
class(GriddedComponentDriver), intent(in) :: this
end function get_gridcomp

module function get_name(this, rc) result(name)
character(:), allocatable :: name
class(GriddedComponentDriver), intent(in) :: this
integer, optional, intent(out) :: rc
end function get_name

module subroutine add_export_coupler(this, driver)
class(GriddedComponentDriver), intent(inout) :: this
type(GriddedComponentDriver), intent(in) :: driver
Expand All @@ -149,4 +120,48 @@ end subroutine add_import_coupler

end interface

CONTAINS

function get_clock(this) result(clock)
type(ESMF_Clock) :: clock
class(GriddedComponentDriver), intent(in) :: this

clock = this%clock
end function get_clock

function get_gridcomp(this) result(gridcomp)
use esmf, only: ESMF_GridComp
type(ESMF_GridComp) :: gridcomp
class(GriddedComponentDriver), intent(in) :: this
gridcomp = this%gridcomp
end function get_gridcomp

function get_name(this, rc) result(name)
character(:), allocatable :: name
class(GriddedComponentDriver), intent(in) :: this
integer, optional, intent(out) :: rc

integer :: status
character(len=ESMF_MAXSTR) :: buffer

call ESMF_GridCompGet(this%gridcomp, name=buffer, _RC)
name = trim(buffer)

_RETURN(ESMF_SUCCESS)
end function get_name

function get_states(this) result(states)
type(MultiState) :: states
class(GriddedComponentDriver), intent(in) :: this

states = this%states
end function get_states

subroutine set_clock(this, clock)
class(GriddedComponentDriver), intent(inout) :: this
type(ESMF_Clock), intent(in) :: clock

this%clock = clock
end subroutine set_clock

end module mapl3g_GriddedComponentDriver
19 changes: 0 additions & 19 deletions generic3g/GriddedComponentDriver/get_clock.F90

This file was deleted.

15 changes: 0 additions & 15 deletions generic3g/GriddedComponentDriver/get_gridcomp.F90

This file was deleted.

22 changes: 0 additions & 22 deletions generic3g/GriddedComponentDriver/get_name.F90

This file was deleted.

20 changes: 0 additions & 20 deletions generic3g/GriddedComponentDriver/get_states.F90

This file was deleted.

19 changes: 0 additions & 19 deletions generic3g/GriddedComponentDriver/set_clock.F90

This file was deleted.

Loading