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

Public Member Functions

subroutine mp_bcastl_0d (ng, model, a, inpcomm)
 
subroutine mp_bcastl_1d (ng, model, a, inpcomm)
 
subroutine mp_bcastl_2d (ng, model, a, inpcomm)
 

Detailed Description

Definition at line 89 of file distribute.F.

Member Function/Subroutine Documentation

◆ mp_bcastl_0d()

subroutine distribute_mod::mp_bcastl::mp_bcastl_0d ( integer, intent(in) ng,
integer, intent(in) model,
logical, intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 1291 of file distribute.F.

1292!
1293!***********************************************************************
1294! !
1295! This routine broadcasts a logical scalar variable to all !
1296! processors in the communicator. It is called by all the !
1297! members in the group. !
1298! !
1299! On Input: !
1300! !
1301! ng Nested grid number. !
1302! model Calling model identifier. !
1303! A Variable to broadcast (logical). !
1304! InpComm Communicator handle (integer, OPTIONAL). !
1305! !
1306! On Output: !
1307! !
1308! A Broadcasted variable. !
1309! !
1310!***********************************************************************
1311!
1312! Imported variable declarations.
1313!
1314 integer, intent(in) :: ng, model
1315
1316 integer, intent(in), optional :: InpComm
1317!
1318 logical, intent(inout) :: A
1319!
1320! Local variable declarations
1321!
1322 integer :: Lstr, MyCOMM, MyError, Npts, Serror
1323!
1324 character (len=MPI_MAX_ERROR_STRING) :: string
1325
1326 character (len=*), parameter :: MyFile = &
1327 & __FILE__//", mp_bcastl_0d"
1328
1329# ifdef PROFILE
1330!
1331!-----------------------------------------------------------------------
1332! Turn on time clocks.
1333!-----------------------------------------------------------------------
1334!
1335 CALL wclock_on (ng, model, 64, __line__, myfile)
1336# endif
1337# ifdef MPI
1338!
1339!-----------------------------------------------------------------------
1340! Set distributed-memory communicator handle (context ID).
1341!-----------------------------------------------------------------------
1342!
1343 IF (PRESENT(inpcomm)) THEN
1344 mycomm=inpcomm
1345 ELSE
1346 mycomm=ocn_comm_world
1347 END IF
1348# endif
1349!
1350!-----------------------------------------------------------------------
1351! Broadcast requested variable.
1352!-----------------------------------------------------------------------
1353!
1354 npts=1
1355# ifdef MPI
1356 CALL mpi_bcast (a, npts, mpi_logical, mymaster, mycomm, myerror)
1357 IF (myerror.ne.mpi_success) THEN
1358 CALL mpi_error_string (myerror, string, lstr, serror)
1359 lstr=len_trim(string)
1360 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
1361 10 FORMAT (/,' MP_BCASTL_0D - error during ',a,' call, Task = ', &
1362 & i3.3,' Error = ',i3,/,13x,a)
1363 exit_flag=2
1364 RETURN
1365 END IF
1366# endif
1367# ifdef PROFILE
1368!
1369!-----------------------------------------------------------------------
1370! Turn off time clocks.
1371!-----------------------------------------------------------------------
1372!
1373 CALL wclock_off (ng, model, 64, __line__, myfile)
1374# endif
1375!
1376 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::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_bcastl_1d()

subroutine distribute_mod::mp_bcastl::mp_bcastl_1d ( integer, intent(in) ng,
integer, intent(in) model,
logical, dimension(:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 1379 of file distribute.F.

1380!
1381!***********************************************************************
1382! !
1383! This routine broadcasts a 1D nontiled, logical array to all !
1384! processors in the communicator. It is called by all the !
1385! members in the group. !
1386! !
1387! On Input: !
1388! !
1389! ng Nested grid number. !
1390! model Calling model identifier. !
1391! A 1D array to broadcast (logical). !
1392! InpComm Communicator handle (integer, OPTIONAL). !
1393! !
1394! On Output: !
1395! !
1396! A Broadcasted 1D array. !
1397! !
1398!***********************************************************************
1399!
1400! Imported variable declarations.
1401!
1402 integer, intent(in) :: ng, model
1403
1404 integer, intent(in), optional :: InpComm
1405!
1406 logical, intent(inout) :: A(:)
1407!
1408! Local variable declarations
1409!
1410 integer :: Lstr, MyCOMM, MyError, Npts, Serror
1411!
1412 character (len=MPI_MAX_ERROR_STRING) :: string
1413
1414 character (len=*), parameter :: MyFile = &
1415 & __FILE__//", mp_bcastl_1d"
1416
1417# ifdef PROFILE
1418!
1419!-----------------------------------------------------------------------
1420! Turn on time clocks.
1421!-----------------------------------------------------------------------
1422!
1423 CALL wclock_on (ng, model, 64, __line__, myfile)
1424# endif
1425# ifdef MPI
1426!
1427!-----------------------------------------------------------------------
1428! Set distributed-memory communicator handle (context ID).
1429!-----------------------------------------------------------------------
1430!
1431 IF (PRESENT(inpcomm)) THEN
1432 mycomm=inpcomm
1433 ELSE
1434 mycomm=ocn_comm_world
1435 END IF
1436# endif
1437!
1438!-----------------------------------------------------------------------
1439! Broadcast requested variable.
1440!-----------------------------------------------------------------------
1441!
1442 npts=ubound(a, dim=1)
1443
1444# ifdef MPI
1445 CALL mpi_bcast (a, npts, mpi_logical, mymaster, mycomm, myerror)
1446 IF (myerror.ne.mpi_success) THEN
1447 CALL mpi_error_string (myerror, string, lstr, serror)
1448 lstr=len_trim(string)
1449 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
1450 10 FORMAT (/,' MP_BCASTL_1D - error during ',a,' call, Task = ', &
1451 & i3.3,' Error = ',i3,/,13x,a)
1452 exit_flag=2
1453 RETURN
1454 END IF
1455# endif
1456# ifdef PROFILE
1457!
1458!-----------------------------------------------------------------------
1459! Turn off time clocks.
1460!-----------------------------------------------------------------------
1461!
1462 CALL wclock_off (ng, model, 64, __line__, myfile)
1463# endif
1464!
1465 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_bcastl_2d()

subroutine distribute_mod::mp_bcastl::mp_bcastl_2d ( integer, intent(in) ng,
integer, intent(in) model,
logical, dimension(:,:), intent(inout) a,
integer, intent(in), optional inpcomm )

Definition at line 1468 of file distribute.F.

1469!
1470!***********************************************************************
1471! !
1472! This routine broadcasts a 2D non-tiled, logical array to all !
1473! processors in the communicator. It is called by all the !
1474! members in the group. !
1475! !
1476! On Input: !
1477! !
1478! ng Nested grid number. !
1479! model Calling model identifier. !
1480! A 2D array to broadcast (logical). !
1481! InpComm Communicator handle (integer, OPTIONAL). !
1482! !
1483! On Output: !
1484! !
1485! A Broadcasted 2D array. !
1486! !
1487!***********************************************************************
1488!
1489! Imported variable declarations.
1490!
1491 integer, intent(in) :: ng, model
1492
1493 integer, intent(in), optional :: InpComm
1494!
1495 logical, intent(inout) :: A(:,:)
1496!
1497! Local variable declarations
1498!
1499 integer :: Lstr, MyCOMM, MyError, Npts, Serror
1500 integer :: Asize(2)
1501!
1502 character (len=MPI_MAX_ERROR_STRING) :: string
1503
1504 character (len=*), parameter :: MyFile = &
1505 & __FILE__//", mp_bcastl_2d"
1506
1507# ifdef PROFILE
1508!
1509!-----------------------------------------------------------------------
1510! Turn on time clocks.
1511!-----------------------------------------------------------------------
1512!
1513 CALL wclock_on (ng, model, 64, __line__, myfile)
1514# endif
1515# ifdef MPI
1516!
1517!-----------------------------------------------------------------------
1518! Set distributed-memory communicator handle (context ID).
1519!-----------------------------------------------------------------------
1520!
1521 IF (PRESENT(inpcomm)) THEN
1522 mycomm=inpcomm
1523 ELSE
1524 mycomm=ocn_comm_world
1525 END IF
1526# endif
1527!
1528!-----------------------------------------------------------------------
1529! Broadcast requested variable.
1530!-----------------------------------------------------------------------
1531!
1532 asize(1)=ubound(a, dim=1)
1533 asize(2)=ubound(a, dim=2)
1534 npts=asize(1)*asize(2)
1535
1536# ifdef MPI
1537 CALL mpi_bcast (a, npts, mpi_logical, mymaster, mycomm, myerror)
1538 IF (myerror.ne.mpi_success) THEN
1539 CALL mpi_error_string (myerror, string, lstr, serror)
1540 lstr=len_trim(string)
1541 WRITE (stdout,10) 'MPI_BCAST', myrank, myerror, string(1:lstr)
1542 10 FORMAT (/,' MP_BCASTL_2D - error during ',a,' call, Task = ', &
1543 & i3.3,' Error = ',i3,/,13x,a)
1544 exit_flag=2
1545 RETURN
1546 END IF
1547# endif
1548# ifdef PROFILE
1549!
1550!-----------------------------------------------------------------------
1551! Turn off time clocks.
1552!-----------------------------------------------------------------------
1553!
1554 CALL wclock_off (ng, model, 64, __line__, myfile)
1555# endif
1556!
1557 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: