MOM6
mom_domains::clone_mom_domain Interface Reference

Detailed Description

Copy one MOM_domain_type into another.

Definition at line 94 of file MOM_domains.F90.

Private functions

subroutine clone_md_to_md (MD_in, MOM_dom, min_halo, halo_size, symmetric, domain_name)
 clone_MD_to_MD copies one MOM_domain_type into another, while allowing some properties of the new type to differ from the original one. More...
 
subroutine clone_md_to_d2d (MD_in, mpp_domain, min_halo, halo_size, symmetric, domain_name)
 clone_MD_to_d2D uses information from a MOM_domain_type to create a new domain2d type, while allowing some properties of the new type to differ from the original one. More...
 

Functions and subroutines

◆ clone_md_to_d2d()

subroutine mom_domains::clone_mom_domain::clone_md_to_d2d ( type(mom_domain_type), intent(in)  MD_in,
type(domain2d), intent(inout)  mpp_domain,
integer, dimension(2), intent(inout), optional  min_halo,
integer, intent(in), optional  halo_size,
logical, intent(in), optional  symmetric,
character(len=*), intent(in), optional  domain_name 
)
private

clone_MD_to_d2D uses information from a MOM_domain_type to create a new domain2d type, while allowing some properties of the new type to differ from the original one.

Parameters
[in]md_inAn existing MOM_domain to be cloned
[in,out]mpp_domainThe new mpp_domain to be set up
[in,out]min_haloIf present, this sets the
[in]halo_sizeIf present, this sets the halo size for the domian in the i- and j-directions. min_halo and halo_size can not both be present.
[in]symmetricIf present, this specifies whether the new domain is symmetric, regardless of whether the macro SYMMETRIC_MEMORY_ is defined.
[in]domain_nameA name for the new domain, "MOM"

Definition at line 1695 of file MOM_domains.F90.

1695  type(MOM_domain_type), intent(in) :: MD_in !< An existing MOM_domain to be cloned
1696  type(domain2d), intent(inout) :: mpp_domain !< The new mpp_domain to be set up
1697  integer, dimension(2), &
1698  optional, intent(inout) :: min_halo !< If present, this sets the
1699  !! minimum halo size for this domain in the i- and j-
1700  !! directions, and returns the actual halo size used.
1701  integer, optional, intent(in) :: halo_size !< If present, this sets the halo
1702  !! size for the domian in the i- and j-directions.
1703  !! min_halo and halo_size can not both be present.
1704  logical, optional, intent(in) :: symmetric !< If present, this specifies
1705  !! whether the new domain is symmetric, regardless of
1706  !! whether the macro SYMMETRIC_MEMORY_ is defined.
1707  character(len=*), &
1708  optional, intent(in) :: domain_name !< A name for the new domain, "MOM"
1709  !! if missing.
1710 
1711  integer :: global_indices(4), layout(2), io_layout(2)
1712  integer :: X_FLAGS, Y_FLAGS, niglobal, njglobal, nihalo, njhalo
1713  logical :: symmetric_dom
1714  character(len=64) :: dom_name
1715 
1716 ! Save the extra data for creating other domains of different resolution that overlay this domain
1717  niglobal = md_in%niglobal ; njglobal = md_in%njglobal
1718  nihalo = md_in%nihalo ; njhalo = md_in%njhalo
1719 
1720  symmetric_dom = md_in%symmetric
1721 
1722  x_flags = md_in%X_FLAGS ; y_flags = md_in%Y_FLAGS
1723  layout(:) = md_in%layout(:) ; io_layout(:) = md_in%io_layout(:)
1724 
1725  if (present(halo_size) .and. present(min_halo)) call mom_error(fatal, &
1726  "clone_MOM_domain can not have both halo_size and min_halo present.")
1727 
1728  if (present(min_halo)) then
1729  nihalo = max(nihalo, min_halo(1))
1730  njhalo = max(njhalo, min_halo(2))
1731  min_halo(1) = nihalo ; min_halo(2) = njhalo
1732  endif
1733 
1734  if (present(halo_size)) then
1735  nihalo = halo_size ; njhalo = halo_size
1736  endif
1737 
1738  if (present(symmetric)) then ; symmetric_dom = symmetric ; endif
1739 
1740  dom_name = "MOM"
1741  if (present(domain_name)) dom_name = trim(domain_name)
1742 
1743  global_indices(1) = 1 ; global_indices(2) = niglobal
1744  global_indices(3) = 1 ; global_indices(4) = njglobal
1745  if (associated(md_in%maskmap)) then
1746  call mom_define_domain( global_indices, layout, mpp_domain, &
1747  xflags=x_flags, yflags=y_flags, &
1748  xhalo=nihalo, yhalo=njhalo, &
1749  symmetry = symmetric, name=dom_name, &
1750  maskmap=md_in%maskmap )
1751  else
1752  call mom_define_domain( global_indices, layout, mpp_domain, &
1753  xflags=x_flags, yflags=y_flags, &
1754  xhalo=nihalo, yhalo=njhalo, &
1755  symmetry = symmetric, name=dom_name)
1756  endif
1757 
1758  if ((io_layout(1) + io_layout(2) > 0) .and. &
1759  (layout(1)*layout(2) > 1)) then
1760  call mom_define_io_domain(mpp_domain, io_layout)
1761  endif
1762 

◆ clone_md_to_md()

subroutine mom_domains::clone_mom_domain::clone_md_to_md ( type(mom_domain_type), intent(in)  MD_in,
type(mom_domain_type), pointer  MOM_dom,
integer, dimension(2), intent(inout), optional  min_halo,
integer, intent(in), optional  halo_size,
logical, intent(in), optional  symmetric,
character(len=*), intent(in), optional  domain_name 
)
private

clone_MD_to_MD copies one MOM_domain_type into another, while allowing some properties of the new type to differ from the original one.

Parameters
[in]md_inAn existing MOM_domain
mom_domA pointer to a MOM_domain that will be allocated if it is unassociated, and will have data copied from MD_in
[in,out]min_haloIf present, this sets the
[in]halo_sizeIf present, this sets the halo size for the domian in the i- and j-directions. min_halo and halo_size can not both be present.
[in]symmetricIf present, this specifies whether the new domain is symmetric, regardless of whether the macro SYMMETRIC_MEMORY_ is defined.
[in]domain_nameA name for the new domain, "MOM"

Definition at line 1603 of file MOM_domains.F90.

1603  type(MOM_domain_type), intent(in) :: MD_in !< An existing MOM_domain
1604  type(MOM_domain_type), pointer :: MOM_dom !< A pointer to a MOM_domain that will be
1605  !! allocated if it is unassociated, and will have data
1606  !! copied from MD_in
1607  integer, dimension(2), &
1608  optional, intent(inout) :: min_halo !< If present, this sets the
1609  !! minimum halo size for this domain in the i- and j-
1610  !! directions, and returns the actual halo size used.
1611  integer, optional, intent(in) :: halo_size !< If present, this sets the halo
1612  !! size for the domian in the i- and j-directions.
1613  !! min_halo and halo_size can not both be present.
1614  logical, optional, intent(in) :: symmetric !< If present, this specifies
1615  !! whether the new domain is symmetric, regardless of
1616  !! whether the macro SYMMETRIC_MEMORY_ is defined.
1617  character(len=*), &
1618  optional, intent(in) :: domain_name !< A name for the new domain, "MOM"
1619  !! if missing.
1620 
1621  integer :: global_indices(4)
1622  logical :: mask_table_exists
1623  character(len=64) :: dom_name
1624 
1625  if (.not.associated(mom_dom)) then
1626  allocate(mom_dom)
1627  allocate(mom_dom%mpp_domain)
1628  allocate(mom_dom%mpp_domain_d2)
1629  endif
1630 
1631 ! Save the extra data for creating other domains of different resolution that overlay this domain
1632  mom_dom%niglobal = md_in%niglobal ; mom_dom%njglobal = md_in%njglobal
1633  mom_dom%nihalo = md_in%nihalo ; mom_dom%njhalo = md_in%njhalo
1634 
1635  mom_dom%symmetric = md_in%symmetric
1636  mom_dom%nonblocking_updates = md_in%nonblocking_updates
1637 
1638  mom_dom%X_FLAGS = md_in%X_FLAGS ; mom_dom%Y_FLAGS = md_in%Y_FLAGS
1639  mom_dom%layout(:) = md_in%layout(:) ; mom_dom%io_layout(:) = md_in%io_layout(:)
1640 
1641  if (associated(md_in%maskmap)) then
1642  mask_table_exists = .true.
1643  allocate(mom_dom%maskmap(mom_dom%layout(1), mom_dom%layout(2)))
1644  mom_dom%maskmap(:,:) = md_in%maskmap(:,:)
1645  else
1646  mask_table_exists = .false.
1647  endif
1648 
1649  if (present(halo_size) .and. present(min_halo)) call mom_error(fatal, &
1650  "clone_MOM_domain can not have both halo_size and min_halo present.")
1651 
1652  if (present(min_halo)) then
1653  mom_dom%nihalo = max(mom_dom%nihalo, min_halo(1))
1654  min_halo(1) = mom_dom%nihalo
1655  mom_dom%njhalo = max(mom_dom%njhalo, min_halo(2))
1656  min_halo(2) = mom_dom%njhalo
1657  endif
1658 
1659  if (present(halo_size)) then
1660  mom_dom%nihalo = halo_size ; mom_dom%njhalo = halo_size
1661  endif
1662 
1663  if (present(symmetric)) then ; mom_dom%symmetric = symmetric ; endif
1664 
1665  dom_name = "MOM"
1666  if (present(domain_name)) dom_name = trim(domain_name)
1667 
1668  global_indices(1) = 1 ; global_indices(2) = mom_dom%niglobal
1669  global_indices(3) = 1 ; global_indices(4) = mom_dom%njglobal
1670  if (mask_table_exists) then
1671  call mom_define_domain( global_indices, mom_dom%layout, mom_dom%mpp_domain, &
1672  xflags=mom_dom%X_FLAGS, yflags=mom_dom%Y_FLAGS, &
1673  xhalo=mom_dom%nihalo, yhalo=mom_dom%njhalo, &
1674  symmetry = mom_dom%symmetric, name=dom_name, &
1675  maskmap=mom_dom%maskmap )
1676  else
1677  call mom_define_domain( global_indices, mom_dom%layout, mom_dom%mpp_domain, &
1678  xflags=mom_dom%X_FLAGS, yflags=mom_dom%Y_FLAGS, &
1679  xhalo=mom_dom%nihalo, yhalo=mom_dom%njhalo, &
1680  symmetry = mom_dom%symmetric, name=dom_name)
1681  endif
1682 
1683  if ((mom_dom%io_layout(1) + mom_dom%io_layout(2) > 0) .and. &
1684  (mom_dom%layout(1)*mom_dom%layout(2) > 1)) then
1685  call mom_define_io_domain(mom_dom%mpp_domain, mom_dom%io_layout)
1686  endif
1687 

The documentation for this interface was generated from the following file: