Skip to content

Commit b1202f7

Browse files
committed
Refactoring duplicate definitions of halo_exchange_routine
This commit introduces a new include file mpas_halo_interface under src/framework in order to remove the repeated definitions of the generic interface halo_exchange_routine and replace them with an include.
1 parent d163ed6 commit b1202f7

File tree

5 files changed

+23
-60
lines changed

5 files changed

+23
-60
lines changed

src/core_atmosphere/dynamics/mpas_atm_time_integration.F

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,8 @@ module atm_time_integration
3737

3838
use mpas_atm_iau
3939

40-
!
41-
! Abstract interface for routine used to communicate halos of fields
42-
! in a named group
43-
!
44-
abstract interface
45-
subroutine halo_exchange_routine(domain, halo_group, ierr)
46-
47-
use mpas_derived_types, only : domain_type
48-
49-
type (domain_type), intent(inout) :: domain
50-
character(len=*), intent(in) :: halo_group
51-
integer, intent(out), optional :: ierr
52-
53-
end subroutine halo_exchange_routine
54-
end interface
40+
! Provides definition of halo_exchange_routine
41+
#include "mpas_halo_interface.inc"
5542

5643
integer :: timerid, secs, u_secs
5744

src/core_atmosphere/mpas_atm_core.F

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,8 @@ module atm_core
1313
use mpas_log, only : mpas_log_write, mpas_log_info
1414
use mpas_io_units, only : mpas_new_unit, mpas_release_unit
1515

16-
!
17-
! Abstract interface for routine used to communicate halos of fields
18-
! in a named group
19-
!
20-
abstract interface
21-
subroutine halo_exchange_routine(domain, halo_group, ierr)
22-
23-
use mpas_derived_types, only : domain_type
24-
25-
type (domain_type), intent(inout) :: domain
26-
character(len=*), intent(in) :: halo_group
27-
integer, intent(out), optional :: ierr
28-
29-
end subroutine halo_exchange_routine
30-
end interface
16+
! Provides definition of halo_exchange_routine
17+
#include "mpas_halo_interface.inc"
3118

3219
type (MPAS_Clock_type), pointer :: clock
3320

src/core_atmosphere/mpas_atm_halos.F

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,8 @@ module mpas_atm_halos
1010
use mpas_pool_routines
1111
use mpas_log, only : mpas_log_write, mpas_log_info
1212

13-
!
14-
! Abstract interface for routine used to communicate halos of fields
15-
! in a named group
16-
!
17-
abstract interface
18-
subroutine halo_exchange_routine(domain, halo_group, ierr)
19-
20-
use mpas_derived_types, only : domain_type
21-
22-
type (domain_type), intent(inout) :: domain
23-
character(len=*), intent(in) :: halo_group
24-
integer, intent(out), optional :: ierr
25-
26-
end subroutine halo_exchange_routine
27-
end interface
13+
! Provides definition of halo_exchange_routine
14+
#include "mpas_halo_interface.inc"
2815

2916
procedure (halo_exchange_routine), pointer :: exchange_halo_group
3017

src/core_atmosphere/physics/mpas_atmphys_todynamics.F

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,8 @@ module mpas_atmphys_todynamics
4141
! number concentrations due to PBL processes.
4242
! Laura D. Fowler ([email protected]) / 2024-05-16.
4343

44-
!
45-
! Abstract interface for routine used to communicate halos of fields
46-
! in a named group
47-
!
48-
abstract interface
49-
subroutine halo_exchange_routine(domain, halo_group, ierr)
50-
51-
use mpas_derived_types, only : domain_type
52-
53-
type (domain_type), intent(inout) :: domain
54-
character(len=*), intent(in) :: halo_group
55-
integer, intent(out), optional :: ierr
56-
57-
end subroutine halo_exchange_routine
58-
end interface
44+
! Provides definition of halo_exchange_routine
45+
#include "mpas_halo_interface.inc"
5946

6047

6148
contains
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
!
2+
! Abstract interface for routine used to communicate halos of fields
3+
! in a named group
4+
!
5+
abstract interface
6+
subroutine halo_exchange_routine(domain, halo_group, ierr)
7+
8+
use mpas_derived_types, only : domain_type
9+
10+
type (domain_type), intent(inout) :: domain
11+
character(len=*), intent(in) :: halo_group
12+
integer, intent(out), optional :: ierr
13+
14+
end subroutine halo_exchange_routine
15+
end interface

0 commit comments

Comments
 (0)