Changeset 4727 for LMDZ6/branches/LMDZ_ECRad/libf/phy_common
- Timestamp:
- Oct 19, 2023, 4:02:57 PM (15 months ago)
- Location:
- LMDZ6/branches/LMDZ_ECRad
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/LMDZ_ECRad
- Property svn:mergeinfo changed
-
LMDZ6/branches/LMDZ_ECRad/libf/phy_common/abort_physic.F90
r4482 r4727 38 38 if (ierr .eq. 0) then 39 39 write(lunout,*) 'Everything is cool' 40 #ifdef CPP_MPI 41 !$OMP CRITICAL (MPI_ABORT_PHYSIC)42 call MPI_ABORT(COMM_LMDZ_PHY, 0, ierror_mpi)43 !$OMP END CRITICAL (MPI_ABORT_PHYSIC)44 #else45 stop 046 #endif40 if (using_mpi) then 41 !$OMP CRITICAL (MPI_ABORT_PHYSIC) 42 call MPI_ABORT(COMM_LMDZ_PHY, 0, ierror_mpi) 43 !$OMP END CRITICAL (MPI_ABORT_PHYSIC) 44 else 45 stop 0 46 endif 47 47 else 48 48 write(lunout,*) 'Houston, we have a problem, ierr = ', ierr 49 #ifdef CPP_MPI 50 !$OMP CRITICAL (MPI_ABORT_PHYSIC)51 call MPI_ABORT(COMM_LMDZ_PHY, 1, ierror_mpi)52 !$OMP END CRITICAL (MPI_ABORT_PHYSIC)53 #else54 stop 155 #endif49 if (using_mpi) then 50 !$OMP CRITICAL (MPI_ABORT_PHYSIC) 51 call MPI_ABORT(COMM_LMDZ_PHY, 1, ierror_mpi) 52 !$OMP END CRITICAL (MPI_ABORT_PHYSIC) 53 else 54 stop 1 55 endif 56 56 endif 57 57 END -
LMDZ6/branches/LMDZ_ECRad/libf/phy_common/mod_phys_lmdz_mpi_data.F90
r4127 r4727 3 3 ! 4 4 MODULE mod_phys_lmdz_mpi_data 5 5 USE lmdz_mpi 6 6 7 INTEGER,SAVE :: ii_begin 7 8 INTEGER,SAVE :: ii_end … … 47 48 48 49 SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, nbp_lev, grid_type, nvertex, communicator) 49 50 USE lmdz_mpi 50 51 IMPLICIT NONE 51 #ifdef CPP_MPI52 INCLUDE 'mpif.h'53 #endif54 52 INTEGER,INTENT(IN) :: nbp 55 53 INTEGER,INTENT(IN) :: nbp_lon … … 65 63 INTEGER :: i 66 64 67 #ifdef CPP_MPI 68 is_using_mpi=.TRUE. 69 #else 70 is_using_mpi=.FALSE. 71 #endif 65 is_using_mpi = using_mpi 72 66 73 67 if ((nbp_lon.eq.1).and.(nbp_lat.eq.1)) then ! running 1D column model … … 82 76 83 77 IF (is_using_mpi) THEN 84 #ifdef CPP_MPI85 78 MPI_REAL_LMDZ=MPI_REAL8 86 79 CALL MPI_COMM_SIZE(COMM_LMDZ_PHY,mpi_size,ierr) 87 80 CALL MPI_COMM_RANK(COMM_LMDZ_PHY,mpi_rank,ierr) 88 #endif89 81 ELSE 90 82 mpi_size=1 … … 95 87 96 88 IF (is_using_mpi) THEN 97 #ifdef CPP_MPI 98 CALL MPI_ALLGATHER(nbp,1,MPI_INTEGER,distrib,1,MPI_INTEGER,COMM_LMDZ_PHY,ierr) 99 #endif 89 CALL MPI_ALLGATHER(nbp,1,MPI_INTEGER,distrib,1,MPI_INTEGER,COMM_LMDZ_PHY,ierr) 100 90 ELSE 101 91 distrib(:)=nbp -
LMDZ6/branches/LMDZ_ECRad/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90
r3465 r4727 1367 1367 SUBROUTINE bcast_mpi_cgen(var,nb) 1368 1368 USE mod_phys_lmdz_mpi_data 1369 USE lmdz_mpi 1369 1370 IMPLICIT NONE 1370 1371 … … 1372 1373 INTEGER,INTENT(IN) :: nb 1373 1374 1374 #ifdef CPP_MPI1375 INCLUDE 'mpif.h'1376 #endif1377 1375 INTEGER :: ierr 1378 1376 1379 1377 IF (.not.is_using_mpi) RETURN 1380 1378 1381 #ifdef CPP_MPI1382 1379 CALL MPI_BCAST(Var,nb,MPI_CHARACTER,mpi_master,COMM_LMDZ_PHY,ierr) 1383 #endif1384 1380 1385 1381 END SUBROUTINE bcast_mpi_cgen … … 1389 1385 SUBROUTINE bcast_mpi_igen(var,nb) 1390 1386 USE mod_phys_lmdz_mpi_data 1387 USE lmdz_mpi 1391 1388 IMPLICIT NONE 1392 1389 … … 1394 1391 INTEGER,DIMENSION(nb),INTENT(INOUT) :: Var 1395 1392 1396 #ifdef CPP_MPI1397 INCLUDE 'mpif.h'1398 #endif1399 1393 INTEGER :: ierr 1400 1394 1401 1395 IF (.not.is_using_mpi) RETURN 1402 1396 1403 #ifdef CPP_MPI1404 1397 CALL MPI_BCAST(Var,nb,MPI_INTEGER,mpi_master,COMM_LMDZ_PHY,ierr) 1405 #endif1406 1398 1407 1399 END SUBROUTINE bcast_mpi_igen … … 1412 1404 SUBROUTINE bcast_mpi_rgen(var,nb) 1413 1405 USE mod_phys_lmdz_mpi_data 1406 USE lmdz_mpi 1414 1407 IMPLICIT NONE 1415 1408 … … 1417 1410 REAL,DIMENSION(nb),INTENT(INOUT) :: Var 1418 1411 1419 #ifdef CPP_MPI1420 INCLUDE 'mpif.h'1421 #endif1422 1412 INTEGER :: ierr 1423 1413 1424 1414 IF (.not.is_using_mpi) RETURN 1425 1415 1426 #ifdef CPP_MPI1427 1416 CALL MPI_BCAST(Var,nb,MPI_REAL_LMDZ,mpi_master,COMM_LMDZ_PHY,ierr) 1428 #endif1429 1417 1430 1418 END SUBROUTINE bcast_mpi_rgen … … 1435 1423 SUBROUTINE bcast_mpi_lgen(var,nb) 1436 1424 USE mod_phys_lmdz_mpi_data 1425 USE lmdz_mpi 1437 1426 IMPLICIT NONE 1438 1427 … … 1440 1429 LOGICAL,DIMENSION(nb),INTENT(INOUT) :: Var 1441 1430 1442 #ifdef CPP_MPI1443 INCLUDE 'mpif.h'1444 #endif1445 1431 INTEGER :: ierr 1446 1432 1447 1433 IF (.not.is_using_mpi) RETURN 1448 1434 1449 #ifdef CPP_MPI1450 1435 CALL MPI_BCAST(Var,nb,MPI_LOGICAL,mpi_master,COMM_LMDZ_PHY,ierr) 1451 #endif1452 1436 1453 1437 END SUBROUTINE bcast_mpi_lgen … … 1458 1442 USE mod_phys_lmdz_mpi_data 1459 1443 USE mod_grid_phy_lmdz 1444 USE lmdz_mpi 1460 1445 IMPLICIT NONE 1461 1446 … … 1464 1449 INTEGER,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut 1465 1450 1466 #ifdef CPP_MPI1467 INCLUDE 'mpif.h'1468 #endif1469 1451 INTEGER,DIMENSION(0:mpi_size-1) :: displs 1470 1452 INTEGER,DIMENSION(0:mpi_size-1) :: counts … … 1493 1475 ENDIF 1494 1476 1495 #ifdef CPP_MPI1496 1477 CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_INTEGER,VarOut,klon_mpi*dimsize, & 1497 1478 MPI_INTEGER,mpi_master, COMM_LMDZ_PHY,ierr) 1498 #endif1499 1479 1500 1480 END SUBROUTINE scatter_mpi_igen … … 1503 1483 USE mod_phys_lmdz_mpi_data 1504 1484 USE mod_grid_phy_lmdz 1485 USE lmdz_mpi 1505 1486 IMPLICIT NONE 1506 1487 … … 1508 1489 REAL,INTENT(IN),DIMENSION(klon_glo,dimsize) :: VarIn 1509 1490 REAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut 1510 1511 #ifdef CPP_MPI1512 INCLUDE 'mpif.h'1513 #endif1514 1491 1515 1492 INTEGER,DIMENSION(0:mpi_size-1) :: displs … … 1537 1514 ENDIF 1538 1515 1539 #ifdef CPP_MPI1540 1516 CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_REAL_LMDZ,VarOut,klon_mpi*dimsize, & 1541 1517 MPI_REAL_LMDZ,mpi_master, COMM_LMDZ_PHY,ierr) 1542 1518 1543 #endif1544 1545 1519 END SUBROUTINE scatter_mpi_rgen 1546 1520 … … 1549 1523 USE mod_phys_lmdz_mpi_data 1550 1524 USE mod_grid_phy_lmdz 1525 USE lmdz_mpi 1551 1526 IMPLICIT NONE 1552 1527 … … 1555 1530 LOGICAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut 1556 1531 1557 #ifdef CPP_MPI1558 INCLUDE 'mpif.h'1559 #endif1560 1532 1561 1533 INTEGER,DIMENSION(0:mpi_size-1) :: displs … … 1583 1555 ENDIF 1584 1556 1585 #ifdef CPP_MPI1586 1557 CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_LOGICAL,VarOut,klon_mpi*dimsize, & 1587 1558 MPI_LOGICAL,mpi_master, COMM_LMDZ_PHY,ierr) 1588 #endif1589 1559 1590 1560 END SUBROUTINE scatter_mpi_lgen … … 1596 1566 USE mod_phys_lmdz_mpi_data 1597 1567 USE mod_grid_phy_lmdz 1598 IMPLICIT NONE 1599 1600 #ifdef CPP_MPI 1601 INCLUDE 'mpif.h' 1602 #endif 1603 1568 USE lmdz_mpi 1569 IMPLICIT NONE 1570 1604 1571 INTEGER,INTENT(IN) :: dimsize 1605 1572 INTEGER,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn … … 1628 1595 ENDIF 1629 1596 1630 #ifdef CPP_MPI1631 1597 CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_INTEGER,VarTmp,counts,displs, & 1632 1598 MPI_INTEGER,mpi_master, COMM_LMDZ_PHY,ierr) 1633 #endif1634 1599 1635 1600 … … 1650 1615 USE mod_phys_lmdz_mpi_data 1651 1616 USE mod_grid_phy_lmdz 1652 IMPLICIT NONE 1653 1654 #ifdef CPP_MPI 1655 INCLUDE 'mpif.h' 1656 #endif 1657 1617 USE lmdz_mpi 1618 IMPLICIT NONE 1619 1658 1620 INTEGER,INTENT(IN) :: dimsize 1659 1621 REAL,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn … … 1681 1643 ENDIF 1682 1644 1683 #ifdef CPP_MPI1684 1645 CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_REAL_LMDZ,VarTmp,counts,displs, & 1685 1646 MPI_REAL_LMDZ,mpi_master, COMM_LMDZ_PHY,ierr) 1686 #endif1687 1647 1688 1648 IF (is_mpi_root) THEN … … 1702 1662 USE mod_phys_lmdz_mpi_data 1703 1663 USE mod_grid_phy_lmdz 1664 USE lmdz_mpi 1704 1665 IMPLICIT NONE 1705 1666 … … 1707 1668 LOGICAL,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn 1708 1669 LOGICAL,INTENT(OUT),DIMENSION(klon_glo,dimsize) :: VarOut 1709 1710 #ifdef CPP_MPI1711 INCLUDE 'mpif.h'1712 #endif1713 1670 1714 1671 INTEGER,DIMENSION(0:mpi_size-1) :: displs … … 1734 1691 1735 1692 1736 #ifdef CPP_MPI1737 1693 CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_LOGICAL,VarTmp,counts,displs, & 1738 1694 MPI_LOGICAL,mpi_master, COMM_LMDZ_PHY,ierr) 1739 #endif1740 1695 1741 1696 IF (is_mpi_root) THEN … … 1757 1712 USE mod_phys_lmdz_mpi_data 1758 1713 USE mod_grid_phy_lmdz 1759 IMPLICIT NONE 1760 1761 #ifdef CPP_MPI 1762 INCLUDE 'mpif.h' 1763 #endif 1714 USE lmdz_mpi 1715 IMPLICIT NONE 1764 1716 1765 1717 INTEGER,INTENT(IN) :: nb … … 1774 1726 1775 1727 1776 #ifdef CPP_MPI1777 1728 CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_INTEGER,MPI_SUM,mpi_master,COMM_LMDZ_PHY,ierr) 1778 #endif1779 1729 1780 1730 END SUBROUTINE reduce_sum_mpi_igen … … 1783 1733 USE mod_phys_lmdz_mpi_data 1784 1734 USE mod_grid_phy_lmdz 1785 1786 IMPLICIT NONE 1787 1788 #ifdef CPP_MPI 1789 INCLUDE 'mpif.h' 1790 #endif 1791 1735 USE lmdz_mpi 1736 IMPLICIT NONE 1737 1792 1738 INTEGER,INTENT(IN) :: nb 1793 1739 REAL,DIMENSION(nb),INTENT(IN) :: VarIn … … 1800 1746 ENDIF 1801 1747 1802 #ifdef CPP_MPI1803 1748 CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_REAL_LMDZ,MPI_SUM,mpi_master,COMM_LMDZ_PHY,ierr) 1804 #endif1805 1749 1806 1750 END SUBROUTINE reduce_sum_mpi_rgen … … 1811 1755 USE mod_phys_lmdz_mpi_data 1812 1756 USE mod_grid_phy_lmdz 1813 IMPLICIT NONE 1814 1815 #ifdef CPP_MPI 1816 INCLUDE 'mpif.h' 1817 #endif 1818 1757 USE lmdz_mpi 1758 IMPLICIT NONE 1759 1819 1760 INTEGER,INTENT(IN) :: nb 1820 1761 INTEGER,DIMENSION(nb),INTENT(IN) :: VarIn … … 1828 1769 1829 1770 1830 #ifdef CPP_MPI1831 1771 CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_INTEGER,MPI_MIN,mpi_master,COMM_LMDZ_PHY,ierr) 1832 #endif1833 1772 1834 1773 END SUBROUTINE reduce_min_mpi_igen … … 1837 1776 USE mod_phys_lmdz_mpi_data 1838 1777 USE mod_grid_phy_lmdz 1839 1840 IMPLICIT NONE 1841 1842 #ifdef CPP_MPI 1843 INCLUDE 'mpif.h' 1844 #endif 1845 1778 USE lmdz_mpi 1779 1780 IMPLICIT NONE 1781 1846 1782 INTEGER,INTENT(IN) :: nb 1847 1783 REAL,DIMENSION(nb),INTENT(IN) :: VarIn … … 1854 1790 ENDIF 1855 1791 1856 #ifdef CPP_MPI1857 1792 CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_REAL_LMDZ,MPI_MIN,mpi_master,COMM_LMDZ_PHY,ierr) 1858 #endif1859 1793 1860 1794 END SUBROUTINE reduce_min_mpi_rgen
Note: See TracChangeset
for help on using the changeset viewer.