Skip to content

Commit

Permalink
FMS2: New interface to set/nullify_domain
Browse files Browse the repository at this point in the history
This patch adds wrappers to the set_domain and nullify_domain functions
used in FMS1 for internal FMS IO operations.  These are not used in
FMS2, so the wrapper functions are empty.

This is required to eliminate FMS1 IO dependencies in SIS2.
  • Loading branch information
marshallward authored and Hallberg-NOAA committed Jun 30, 2023
1 parent b0289fe commit d44c228
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
16 changes: 16 additions & 0 deletions config_src/infra/FMS1/MOM_domain_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ module MOM_domain_infra
use mpp_domains_mod, only : To_North => SUPDATE, To_South => NUPDATE
use mpp_domains_mod, only : CENTER, CORNER, NORTH_FACE => NORTH, EAST_FACE => EAST
use fms_io_mod, only : file_exist, parse_mask_table
use fms_io_mod, only : fms_set_domain => set_domain
use fms_io_mod, only : fms_nullify_domain => nullify_domain
use fms_affinity_mod, only : fms_affinity_init, fms_affinity_set, fms_affinity_get

! This subroutine is not in MOM6/src but may be required by legacy drivers
Expand All @@ -49,6 +51,7 @@ module MOM_domain_infra
public :: To_East, To_West, To_North, To_South, To_All, Omit_Corners
public :: AGRID, BGRID_NE, CGRID_NE, SCALAR_PAIR
public :: CORNER, CENTER, NORTH_FACE, EAST_FACE
public :: set_domain, nullify_domain
! These are no longer used by MOM6 because the reproducing sum works so well, but they are
! still referenced by some of the non-GFDL couplers.
! public :: global_field_sum, BITWISE_EXACT_SUM
Expand Down Expand Up @@ -1998,4 +2001,17 @@ subroutine get_layout_extents(Domain, extent_i, extent_j)
call mpp_get_domain_extents(domain%mpp_domain, extent_i, extent_j)
end subroutine get_layout_extents

!> Set the associated domain for internal FMS I/O operations.
subroutine set_domain(Domain)
type(MOM_domain_type), intent(in) :: Domain
!< MOM domain to be designated as the internal FMS I/O domain

call fms_set_domain(Domain%mpp_domain)
end subroutine set_domain

!> Free the associated domain for internal FMS I/O operations.
subroutine nullify_domain
call fms_nullify_domain
end subroutine nullify_domain

end module MOM_domain_infra
14 changes: 14 additions & 0 deletions config_src/infra/FMS2/MOM_domain_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ module MOM_domain_infra
public :: To_East, To_West, To_North, To_South, To_All, Omit_Corners
public :: AGRID, BGRID_NE, CGRID_NE, SCALAR_PAIR
public :: CORNER, CENTER, NORTH_FACE, EAST_FACE
public :: set_domain, nullify_domain
! These are no longer used by MOM6 because the reproducing sum works so well, but they are
! still referenced by some of the non-GFDL couplers.
! public :: global_field_sum, BITWISE_EXACT_SUM
Expand Down Expand Up @@ -2002,4 +2003,17 @@ subroutine get_layout_extents(Domain, extent_i, extent_j)
call mpp_get_domain_extents(domain%mpp_domain, extent_i, extent_j)
end subroutine get_layout_extents

!> Set the associated domain for internal FMS I/O operations.
subroutine set_domain(Domain)
type(MOM_domain_type), intent(in) :: Domain
!< MOM domain to be designated as the internal FMS I/O domain

! FMS2 does not have domain-based internal FMS I/O operations, so this
! function does nothing.
end subroutine set_domain

subroutine nullify_domain
! No internal FMS I/O domain can be assigned, so this function does nothing.
end subroutine nullify_domain

end module MOM_domain_infra

0 comments on commit d44c228

Please sign in to comment.