The domain data type is a fundamental coupler data type. A domain contains both physical information about a grid such as latitude and longitude values for the points as well as information about the decomposition. The decomposition is described by an MCT GlobalSegMap (gsMap).
NOTE: Currently there is no initialization routine in the module. domains are initialized during the contract initialization in cpl_contract_init.
REVISION HISTORY:
2001-aug-15 - B. Kauffman - created moduleINTERFACE:
module cpl_domain_modUSES:
use shr_sys_mod ! shared system call wrappers
use cpl_kind_mod ! kinds
use cpl_mct_mod ! MCT API
use cpl_comm_mod ! communicator groups, pids, etc.
use cpl_control_mod, only: dbug=>cpl_control_infoDBug
implicit none
private ! except
PUBLIC TYPES:
public :: cpl_domain
type cpl_domain
!--- decomposition-independant data ---
character(80) :: name ! = "null" ! name of domain (eg. "ocean")
character(80) :: suffix ! = "null" ! netCDF domain suffix (eg. "o")
integer(IN) :: n ! n = ni*nj ~ total number of grid pts (global)
integer(IN) :: ni ! number of 2d array i indicies (global)
integer(IN) :: nj ! number of 2d array j indicies (global)
!--- decomposition-dependant data ---
type(cpl_mct_aVect) :: lGrid ! grid data
type(cpl_mct_gsMap) :: gsMap ! global seg map (defines decomp)
end type cpl_domain
PUBLIC MEMBER FUNCTIONS:
public cpl_domain_info ! print some info about a domain
public cpl_domain_clean ! clean/dealloc a domain
public cpl_domain_compare ! compare two domains for consistency
PUBLIC DATA MEMBERS:
! no public data members
Write basic information about the input domain cpl_domain_x to stdout. This information is useful for debugging.
REVISION HISTORY:
2001-Dec-20 - B. Kauffman -- first prototypeINTERFACE:
subroutine cpl_domain_info(cpl_domain_x)USES:
implicit none
INPUT/OUTPUT PARAMETERS:
type(cpl_domain) ,target,intent(in) :: cpl_domain_x ! domain
Thie routine deallocates the allocated memory associated with the input/ouput dom argument.
REVISION HISTORY:
2002-Jan-20 - T. Craig -- first prototypeINTERFACE:
subroutine cpl_domain_clean(dom)USES:
implicit none
INPUT/OUTPUT PARAMETERS:
type(cpl_domain) ,intent(inout) :: dom ! domain
Compares two domains and summmarizes the differences. It compares the size, and also checks that the mask, and both model and mapping area are identical to within a eps factor defined below.
The various enforce_* optional arguments will, if present and true, force this routine to abort if the desired test fails.
REVISION HISTORY:
2004-May-21 - B. Kauffman, initial versionINTERFACE:
subroutine cpl_domain_compare(dom1,dom2,enforce_mask,enforce_grid, &
& enforce_area,enforce_aream, enforce_all)
USES:
implicit none
INPUT/OUTPUT PARAMETERS:
type(cpl_domain),intent(in) :: dom1 ! domain #1
type(cpl_domain),intent(in) :: dom2 ! domain #2
logical,optional,intent(in) :: enforce_mask ! abort if masks differ wrt zero/nonzero
logical,optional,intent(in) :: enforce_grid ! abort if grids differ by eps_grid
logical,optional,intent(in) :: enforce_area ! abort if area differ by eps_area
logical,optional,intent(in) :: enforce_aream ! abort if aream differ by eps_area
logical,optional,intent(in) :: enforce_all ! abort for all of the above