next up previous contents
Next: 4 Contract Up: 1 General Modules and Previous: 2 Bundle   Contents

Subsections

3 InfoBuffer

3.1 Module cpl_infobuf_mod - information buffer module (Source File: cpl_infobuf_mod.F90)

The cpl6 infobuf, or ``information buffer'', is used to exchange control flags and other miscellaneous non-gridded control information that is typically sent/received along with gridded field data.

Currently the infobuf is simply two arrays, one real and one integer.


REMARKS:

       The infobuf is exchanged between a model and component with
       each communication call.
REVISION HISTORY:
       2002-Dec-5  - T. Craig - Moved cpl_coupling_ibuf methods here.
       2003-Jan-10 - R. Jacob - change this module to work with an infobuf type.
       2003-Jan-15 - T. Craig - Renamed this to infobuf from ibuf
INTERFACE:
 
 module cpl_infobuf_mod
USES:
 
    use cpl_kind_mod
    use cpl_fields_mod
    use shr_timer_mod
    use shr_sys_mod
    use shr_mpi_mod
 
    implicit none
 
    private ! except
PUBLIC TYPES:
 
    integer(IN),parameter,public :: cpl_infobuf_ibufSize = cpl_fields_ibuf_total
    integer(IN),parameter,public :: cpl_infobuf_rbufSize = cpl_fields_rbuf_total
 
    public :: cpl_infobuf
 
    type cpl_infobuf
       integer(IN) :: ibuf(cpl_infobuf_ibufSize) ! integer data
       real(R8)    :: rbuf(cpl_infobuf_rbufSize) ! real    data
    end type cpl_infobuf
PUBLIC MEMBER FUNCTIONS:
 
    public :: cpl_infobuf_init   ! initialize infobuf to default values
    public :: cpl_infobuf_send   ! send an infobuf
    public :: cpl_infobuf_recv   ! recv an infobuf
    public :: cpl_infobuf_bcast  ! broadcast an infobuf
PUBLIC DATA MEMBERS:
 
    integer(IN),parameter,public :: cpl_infobuf_iDefault = 0
    integer(IN),parameter,public :: cpl_infobuf_rDefault = 0.0
   !integer(IN),parameter,public :: cpl_infobuf_ibufSize = ! must define above
   !integer(IN),parameter,public :: cpl_infobuf_rbufSize = ! must define above

3.1.1 cpl_infobuf_init - initialize to default values

Initialize the input infobuf to default values. The integers are initialized to cpl_infobuf_iDefault while the reals are intitialized to cpl_infobuf_rDefault


REVISION HISTORY:

       2003-Jan-15 - B. Kauffman -- initial version.
INTERFACE:
 
 subroutine cpl_infobuf_init(infobuf)
USES:
 
    implicit none
INPUT/OUTPUT PARAMETERS:
 
    type(cpl_infobuf), intent(out):: infobuf   ! info buffer

3.1.2 cpl_infobuf_send - Send an infobuf

Send contents of infobuf array to processor pid within the MPI_communicator comm using tag to identify the message.


REVISION HISTORY:

       2002-Aug-05 - T. Craig -- abstracted mpi_send call into subroutine
INTERFACE:
 
 subroutine cpl_infobuf_send(infobuf,pid,tag,comm)
USES:
 
    implicit none
INPUT/OUTPUT PARAMETERS:
 
    type(cpl_infobuf), intent(inout):: infobuf                     ! info buffer
    integer(IN), intent(in)     :: pid                      ! proc id
    integer(IN), intent(in)     :: tag                      ! tag
    integer(IN), intent(in)     :: comm                     ! mpi communicator

3.1.3 cpl_infobuf_recv - Receive an infobuf

Receive contents of infobuf array from processor pid within the MPI_communicator comm using tag to identify the message.


REVISION HISTORY:

       2002-Aug-05 - T. Craig -- abstracted mpi_recv call into subroutine
INTERFACE:
 
 subroutine cpl_infobuf_recv(infobuf,pid,tag,comm)
USES:
 
    implicit none
INPUT/OUTPUT PARAMETERS:
 
    type(cpl_infobuf), intent(out):: infobuf                     ! info buffer
    integer(IN), intent(in)   :: pid                      ! proc id
    integer(IN), intent(in)   :: tag                      ! tag
    integer(IN), intent(in)   :: comm                     ! mpi communicator

3.1.4 cpl_infobuf_bcast - generic bcast of infobuf

Broadcast infobuf from processor pid to all processors on MPI_Communicator comm.


REVISION HISTORY:

       2002-Aug-05 - T. Craig -- abstracted mpi_bcast call into subroutine
INTERFACE:
 
 subroutine cpl_infobuf_bcast(infobuf,pid,comm)
USES:
 
    implicit none
INPUT/OUTPUT PARAMETERS:
 
    type(cpl_infobuf), intent(inout) :: infobuf                 ! integer buffer
    integer(IN), intent(in)      :: pid                  ! proc id
    integer(IN)                  :: tag                  ! tag
    integer(IN), intent(in)      :: comm                 ! mpi communicator



next up previous contents
Next: 4 Contract Up: 1 General Modules and Previous: 2 Bundle   Contents
cesm.ucar.edu