Allocate memory for the data communication between processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(controltype), | intent(in) | :: | control | Control parameters: n_var |
||
type(extent), | intent(in) | :: | dims | Extent of the domain:imx,jmx,kmx |
subroutine setup_interface(control, dims)
!< Allocate memory for the data communication between processors
implicit none
type(controltype), intent(in) :: control
!< Control parameters: n_var
type(extent), intent(in) :: dims
!< Extent of the domain:imx,jmx,kmx
integer :: imx, jmx, kmx, n_var
character(len=*), parameter ::errmsg="module: interface, subrouinte setup"
!< Error message
imx = dims%imx
jmx = dims%jmx
kmx = dims%kmx
n_var = control%n_var
ibuf_size = (jmx-1)*(kmx-1)*n_var*layers
jbuf_size = (imx-1)*(kmx-1)*n_var*layers
kbuf_size = (imx-1)*(jmx-1)*n_var*layers
call alloc(imin_send_buf,1,ibuf_size, errmsg)
call alloc(jmin_send_buf,1,jbuf_size, errmsg)
call alloc(kmin_send_buf,1,kbuf_size, errmsg)
call alloc(imin_recv_buf,1,ibuf_size, errmsg)
call alloc(jmin_recv_buf,1,jbuf_size, errmsg)
call alloc(kmin_recv_buf,1,kbuf_size, errmsg)
call alloc(imax_send_buf,1,ibuf_size, errmsg)
call alloc(jmax_send_buf,1,jbuf_size, errmsg)
call alloc(kmax_send_buf,1,kbuf_size, errmsg)
call alloc(imax_recv_buf,1,ibuf_size, errmsg)
call alloc(jmax_recv_buf,1,jbuf_size, errmsg)
call alloc(kmax_recv_buf,1,kbuf_size, errmsg)
end subroutine setup_interface