ROMS
Loading...
Searching...
No Matches
distribute_mod::mp_bcasts Interface Reference

Public Member Functions

subroutine mp_bcasts_0d (ng, model, a, inpcomm)
 
subroutine mp_bcasts_1d (ng, model, a, inpcomm)
 
subroutine mp_bcasts_2d (ng, model, a, inpcomm)
 
subroutine mp_bcasts_3d (ng, model, a, inpcomm)
 

Detailed Description

Definition at line 101 of file distribute.F.

Member Function/Subroutine Documentation

◆ mp_bcasts_0d()

subroutine distribute_mod::mp_bcasts::mp_bcasts_0d ( integer, intent(in) ng,
integer, intent(in) model,
character (len=*), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 1560 of file distribute.F.

1561!
1562!***********************************************************************
1563! !
1564! This routine broadcasts a string scalar variable to all processors !
1565! in the communicator. It is called by all the members in the group. !
1566! !
1567! On Input: !
1568! !
1569! ng Nested grid number. !
1570! model Calling model identifier. !
1571! A Variable to broadcast (string). !
1572! InpComm Communicator handle (integer, OPTIONAL). !
1573! !
1574! On Output: !
1575! !
1576! A Broadcasted variable. !
1577! !
1578!***********************************************************************
1579!
1580! Imported variable declarations.
1581!
1582 integer, intent(in) :: ng, model
1583
1584 integer, intent(in), optional :: InpComm
1585!
1586 character (len=*), intent(inout) :: A
1587!
1588! Local variable declarations
1589!
1590 integer :: Lstr, MyCOMM, MyError, Nchars, Serror
1591!
1592 character (len=MPI_MAX_ERROR_STRING) :: string
1593
1594 character (len=*), parameter :: MyFile = &
1595 & __FILE__//", mp_bcasts_0d"
1596
1597# ifdef PROFILE
1598!
1599!-----------------------------------------------------------------------
1600! Turn on time clocks.
1601!-----------------------------------------------------------------------
1602!
1603 IF (lwclock) THEN
1604 CALL wclock_on (ng, model, 64, __line__, myfile)
1605 END IF
1606# endif
1607# ifdef MPI
1608!
1609!-----------------------------------------------------------------------
1610! Set distributed-memory communicator handle (context ID).
1611!-----------------------------------------------------------------------
1612!
1613 IF (PRESENT(inpcomm)) THEN
1614 mycomm=inpcomm
1615 ELSE
1616 mycomm=ocn_comm_world
1617 END IF
1618# endif
1619!
1620!-----------------------------------------------------------------------
1621! Broadcast requested variable.
1622!-----------------------------------------------------------------------
1623!
1624 nchars=len(a)
1625# ifdef MPI
1626 CALL mpi_bcast (a, nchars, mpi_byte, mymaster, mycomm, myerror)
1627 IF (myerror.ne.mpi_success) THEN
1628 CALL mpi_error_string (myerror, string, lstr, serror)
1629 lstr=len_trim(string)
1630 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
1631 10 FORMAT (/,' MP_BCASTS_0D - error during ',a,' call, Task = ', &
1632 & i3.3,' Error = ',i3,/,13x,a)
1633 exit_flag=2
1634 RETURN
1635 END IF
1636# endif
1637# ifdef PROFILE
1638!
1639!-----------------------------------------------------------------------
1640! Turn off time clocks.
1641!-----------------------------------------------------------------------
1642!
1643 IF (lwclock) THEN
1644 CALL wclock_off (ng, model, 64, __line__, myfile)
1645 END IF
1646# endif
1647!
1648 RETURN
recursive subroutine wclock_off(ng, model, region, line, routine)
Definition timers.F:148
recursive subroutine wclock_on(ng, model, region, line, routine)
Definition timers.F:3

References mod_scalars::exit_flag, mod_parallel::lwclock, mod_parallel::mymaster, mod_parallel::myrank, mod_parallel::ocn_comm_world, mod_iounits::stdout, wclock_off(), and wclock_on().

Here is the call graph for this function:

◆ mp_bcasts_1d()

subroutine distribute_mod::mp_bcasts::mp_bcasts_1d ( integer, intent(in) ng,
integer, intent(in) model,
character (len=*), dimension(:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 1651 of file distribute.F.

1652!
1653!***********************************************************************
1654! !
1655! This routine broadcasts a 1D string array to all processors in the !
1656! communicator. It is called by all the members in the group. !
1657! !
1658! On Input: !
1659! !
1660! ng Nested grid number. !
1661! model Calling model identifier. !
1662! A 1D array to broadcast (string). !
1663! InpComm Communicator handle (integer, OPTIONAL). !
1664! !
1665! On Output: !
1666! !
1667! A Broadcasted 1D array. !
1668! !
1669!***********************************************************************
1670!
1671! Imported variable declarations.
1672!
1673 integer, intent(in) :: ng, model
1674
1675 integer, intent(in), optional :: InpComm
1676!
1677 character (len=*), intent(inout) :: A(:)
1678!
1679! Local variable declarations
1680!
1681 integer :: Asize, Lstr, MyCOMM, MyError, Nchars, Serror
1682!
1683 character (len=MPI_MAX_ERROR_STRING) :: string
1684
1685 character (len=*), parameter :: MyFile = &
1686 & __FILE__//", mp_bcasts_1d"
1687
1688# ifdef PROFILE
1689!
1690!-----------------------------------------------------------------------
1691! Turn on time clocks.
1692!-----------------------------------------------------------------------
1693!
1694 CALL wclock_on (ng, model, 64, __line__, myfile)
1695# endif
1696# ifdef MPI
1697!
1698!-----------------------------------------------------------------------
1699! Set distributed-memory communicator handle (context ID).
1700!-----------------------------------------------------------------------
1701!
1702 IF (PRESENT(inpcomm)) THEN
1703 mycomm=inpcomm
1704 ELSE
1705 mycomm=ocn_comm_world
1706 END IF
1707# endif
1708!
1709!-----------------------------------------------------------------------
1710! Broadcast requested variable.
1711!-----------------------------------------------------------------------
1712!
1713 asize=ubound(a, dim=1)
1714 nchars=len(a(1))*asize
1715
1716# ifdef MPI
1717 CALL mpi_bcast (a, nchars, mpi_byte, mymaster, mycomm, myerror)
1718 IF (myerror.ne.mpi_success) THEN
1719 CALL mpi_error_string (myerror, string, lstr, serror)
1720 lstr=len_trim(string)
1721 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
1722 10 FORMAT (/,' MP_BCASTS_1D - error during ',a,' call, Task = ', &
1723 & i3.3,' Error = ',i3,/,13x,a)
1724 exit_flag=2
1725 RETURN
1726 END IF
1727# endif
1728# ifdef PROFILE
1729!
1730!-----------------------------------------------------------------------
1731! Turn off time clocks.
1732!-----------------------------------------------------------------------
1733!
1734 CALL wclock_off (ng, model, 64, __line__, myfile)
1735# endif
1736!
1737 RETURN

References mod_scalars::exit_flag, mod_parallel::mymaster, mod_parallel::myrank, mod_parallel::ocn_comm_world, mod_iounits::stdout, wclock_off(), and wclock_on().

Here is the call graph for this function:

◆ mp_bcasts_2d()

subroutine distribute_mod::mp_bcasts::mp_bcasts_2d ( integer, intent(in) ng,
integer, intent(in) model,
character (len=*), dimension(:,:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 1740 of file distribute.F.

1741!
1742!***********************************************************************
1743! !
1744! This routine broadcasts a 2D string array to all processors in the !
1745! communicator. It is called by all the members in the group. !
1746! !
1747! On Input: !
1748! !
1749! ng Nested grid number. !
1750! model Calling model identifier. !
1751! A 2D array to broadcast (string). !
1752! InpComm Communicator handle (integer, OPTIONAL). !
1753! !
1754! On Output: !
1755! !
1756! A Broadcasted 2D array. !
1757! !
1758!***********************************************************************
1759!
1760! Imported variable declarations.
1761!
1762 integer, intent(in) :: ng, model
1763
1764 integer, intent(in), optional :: InpComm
1765!
1766 character (len=*), intent(inout) :: A(:,:)
1767!
1768! Local variable declarations
1769!
1770 integer :: Lstr, MyCOMM, MyError, Nchars, Serror
1771 integer :: Asize(2)
1772!
1773 character (len=MPI_MAX_ERROR_STRING) :: string
1774
1775 character (len=*), parameter :: MyFile = &
1776 & __FILE__//", mp_bcasts_2d"
1777
1778# ifdef PROFILE
1779!
1780!-----------------------------------------------------------------------
1781! Turn on time clocks.
1782!-----------------------------------------------------------------------
1783!
1784 CALL wclock_on (ng, model, 64, __line__, myfile)
1785# endif
1786# ifdef MPI
1787!
1788!-----------------------------------------------------------------------
1789! Set distributed-memory communicator handle (context ID).
1790!-----------------------------------------------------------------------
1791!
1792 IF (PRESENT(inpcomm)) THEN
1793 mycomm=inpcomm
1794 ELSE
1795 mycomm=ocn_comm_world
1796 END IF
1797# endif
1798!
1799!-----------------------------------------------------------------------
1800! Broadcast requested variable.
1801!-----------------------------------------------------------------------
1802!
1803 asize(1)=ubound(a, dim=1)
1804 asize(2)=ubound(a, dim=2)
1805 nchars=len(a(1,1))*asize(1)*asize(2)
1806
1807# ifdef MPI
1808 CALL mpi_bcast (a, nchars, mpi_byte, mymaster, mycomm, myerror)
1809 IF (myerror.ne.mpi_success) THEN
1810 CALL mpi_error_string (myerror, string, lstr, serror)
1811 lstr=len_trim(string)
1812 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
1813 10 FORMAT (/,' MP_BCASTS_2D - error during ',a,' call, Task = ', &
1814 & i3.3,' Error = ',i3,/,13x,a)
1815 exit_flag=2
1816 RETURN
1817 END IF
1818# endif
1819# ifdef PROFILE
1820!
1821!-----------------------------------------------------------------------
1822! Turn off time clocks.
1823!-----------------------------------------------------------------------
1824!
1825 CALL wclock_off (ng, model, 64, __line__, myfile)
1826# endif
1827!
1828 RETURN

References mod_scalars::exit_flag, mod_parallel::mymaster, mod_parallel::myrank, mod_parallel::ocn_comm_world, mod_iounits::stdout, wclock_off(), and wclock_on().

Here is the call graph for this function:

◆ mp_bcasts_3d()

subroutine distribute_mod::mp_bcasts::mp_bcasts_3d ( integer, intent(in) ng,
integer, intent(in) model,
character (len=*), dimension(:,:,:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 1831 of file distribute.F.

1832!
1833!***********************************************************************
1834! !
1835! This routine broadcasts a 3D string array to all processors in the !
1836! communicator. It is called by all the members in the group. !
1837! !
1838! On Input: !
1839! !
1840! ng Nested grid number. !
1841! model Calling model identifier. !
1842! A 3D array to broadcast (string). !
1843! InpComm Communicator handle (integer, OPTIONAL). !
1844! !
1845! On Output: !
1846! !
1847! A Broadcasted 3D array. !
1848! !
1849!***********************************************************************
1850!
1851! Imported variable declarations.
1852!
1853 integer, intent(in) :: ng, model
1854
1855 integer, intent(in), optional :: InpComm
1856!
1857 character (len=*), intent(inout) :: A(:,:,:)
1858!
1859! Local variable declarations
1860!
1861 integer :: Lstr, MyCOMM, MyError, Nchars, Serror
1862 integer :: Asize(3)
1863!
1864 character (len=MPI_MAX_ERROR_STRING) :: string
1865
1866 character (len=*), parameter :: MyFile = &
1867 & __FILE__//", mp_bcasts_3d"
1868
1869# ifdef PROFILE
1870!
1871!-----------------------------------------------------------------------
1872! Turn on time clocks.
1873!-----------------------------------------------------------------------
1874!
1875 CALL wclock_on (ng, model, 64, __line__, myfile)
1876# endif
1877# ifdef MPI
1878!
1879!-----------------------------------------------------------------------
1880! Set distributed-memory communicator handle (context ID).
1881!-----------------------------------------------------------------------
1882!
1883 IF (PRESENT(inpcomm)) THEN
1884 mycomm=inpcomm
1885 ELSE
1886 mycomm=ocn_comm_world
1887 END IF
1888# endif
1889!
1890!-----------------------------------------------------------------------
1891! Broadcast requested variable.
1892!-----------------------------------------------------------------------
1893!
1894 asize(1)=ubound(a, dim=1)
1895 asize(2)=ubound(a, dim=2)
1896 asize(3)=ubound(a, dim=3)
1897 nchars=len(a(1,1,1))*asize(1)*asize(2)*asize(3)
1898
1899# ifdef MPI
1900 CALL mpi_bcast (a, nchars, mpi_byte, mymaster, mycomm, myerror)
1901 IF (myerror.ne.mpi_success) THEN
1902 CALL mpi_error_string (myerror, string, lstr, serror)
1903 lstr=len_trim(string)
1904 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
1905 10 FORMAT (/,' MP_BCASTS_3D - error during ',a,' call, Task = ', &
1906 & i3.3,' Error = ',i3,/,13x,a)
1907 exit_flag=2
1908 RETURN
1909 END IF
1910# endif
1911# ifdef PROFILE
1912!
1913!-----------------------------------------------------------------------
1914! Turn off time clocks.
1915!-----------------------------------------------------------------------
1916!
1917 CALL wclock_off (ng, model, 64, __line__, myfile)
1918# endif
1919!
1920 RETURN

References mod_scalars::exit_flag, mod_parallel::mymaster, mod_parallel::myrank, mod_parallel::ocn_comm_world, mod_iounits::stdout, wclock_off(), and wclock_on().

Here is the call graph for this function:

The documentation for this interface was generated from the following file: