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 ibufINTERFACE:
module cpl_infobuf_modUSES:
use cpl_kind_mod use cpl_fields_mod use shr_timer_mod use shr_sys_mod use shr_mpi_mod implicit none private ! exceptPUBLIC 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_infobufPUBLIC 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 infobufPUBLIC 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
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 noneINPUT/OUTPUT PARAMETERS:
type(cpl_infobuf), intent(out):: infobuf ! info buffer
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 subroutineINTERFACE:
subroutine cpl_infobuf_send(infobuf,pid,tag,comm)USES:
implicit noneINPUT/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
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 subroutineINTERFACE:
subroutine cpl_infobuf_recv(infobuf,pid,tag,comm)USES:
implicit noneINPUT/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
Broadcast infobuf from processor pid to all processors on MPI_Communicator comm.
REVISION HISTORY:
2002-Aug-05 - T. Craig -- abstracted mpi_bcast call into subroutineINTERFACE:
subroutine cpl_infobuf_bcast(infobuf,pid,comm)USES:
implicit noneINPUT/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