Sets up communicator groups and component ID's.
A component ID (CID) is an integer identifying each component in the coupled system. Valid values are 1 to the total number of models (including the Coupler). Declaring an integer for each model is a requirement of using MCT.
Use MPH to define the communicator groups and component ID's.
This module also declares and defines handy data wrt number of pe's, PID's, CID's relative to world and component communicator groups.
REVISION HISTORY:
2001-Aug-20 - B. Kauffman - new naming convention
2001-Mar-20 - T. Craig, B. Kauffman, R. Jacob - first prototype
INTERFACE:
module cpl_comm_modUSES:
use cpl_kind_mod ! kinds use shr_sys_mod ! system calls use shr_mpi_mod ! mpi layer implicit none private ! exceptPUBLIC TYPES:
! nonePUBLIC MEMBER FUNCTIONS:
public :: cpl_comm_init
PUBLIC DATA MEMBERS:
integer(IN),public :: cpl_comm_wrld ! = MPI_COMM_WORLD, global comm grp
integer(IN),public :: cpl_comm_wrld_npe ! number of pe's in MPI_COMM_WORLD
integer(IN),public :: cpl_comm_wrld_pid ! this comp pid in MPI_COMM_WORLD
integer(IN),public :: cpl_comm_comp ! this comp communicator group
integer(IN),public :: cpl_comm_comp_npe ! number of pe's in comp comm group
integer(IN),public :: cpl_comm_comp_pid ! this comp's pid in comp comm group
integer(IN),public :: cpl_comm_mph_cid ! MPH component ID, this component
integer(IN),public :: cpl_comm_mph_cid_atm ! MPH component ID, atm
integer(IN),public :: cpl_comm_mph_cid_ice ! MPH component ID, ice
integer(IN),public :: cpl_comm_mph_cid_lnd ! MPH component ID, lnd
integer(IN),public :: cpl_comm_mph_cid_ocn ! MPH component ID, ocn
integer(IN),public :: cpl_comm_mph_cid_cpl ! MPH component ID, cpl
integer(IN),public :: cpl_comm_wrld_pe0 ! comm world pe0, this component
integer(IN),public :: cpl_comm_wrld_pe0_atm ! comm world pe0, atm
integer(IN),public :: cpl_comm_wrld_pe0_ice ! comm world pe0, ice
integer(IN),public :: cpl_comm_wrld_pe0_lnd ! comm world pe0, lnd
integer(IN),public :: cpl_comm_wrld_pe0_ocn ! comm world pe0, ocn
integer(IN),public :: cpl_comm_wrld_pe0_cpl ! comm world pe0, cpl
This routine calls MPI_init for the model with name name and returns an MPI_Communicator comm for use in the calling model. This also sets component ids, and processor ranks relative to world and component communicator groups.
REMARKS:
Use cpl_interface_init which calls this routine.REVISION HISTORY:
2001-Mar-20 - T. Craig, B. Kauffman, R. Jacob -- first prototype
2001-Dec-10 - R. Jacob -- switch arguments in cpl_mct_world_init to
to match new version
INTERFACE:
subroutine cpl_comm_init(name,comm)USES:
use cpl_fields_mod ! contains valid component name strings
use mph_module,only : mph_components
use mph_module,only : mph_global_proc_id
use mph_module,only : mph_local_proc_id
use mph_module,only : mph_total_components
use mph_module,only : mph_comp_id
use mph_module,only : mph_local_totprocs
use mph_module,only : mph_global_totprocs
use mph_module,only : mph_global_id
use mph_module,only : mph_comp_name
use mph_module,only : mph_global_world
use m_MCTWorld ,only : cpl_mct_world_init => init
implicit none
INPUT/OUTPUT PARAMETERS:
character(*),intent(in) :: name ! name of component name
integer(IN) ,intent(out) :: comm ! communicator group for component