TABLE OF CONTENTS


ABINIT/m_pawtab [ Modules ]

[ Top ] [ Modules ]

NAME

  m_pawtab

FUNCTION

  This module contains the definition of the pawtab_type structured datatype,
  as well as related functions and methods.
  pawtab_type variables define TABulated data for PAW (from pseudopotential)

COPYRIGHT

 Copyright (C) 2013-2018 ABINIT group (MT)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .

NOTES

  FOR DEVELOPPERS: in order to preserve the portability of libPAW library,
  please consult ~abinit/src/??_libpaw/libpaw-coding-rules.txt

SOURCE

23 #include "libpaw.h"
24 
25 MODULE m_pawtab
26 
27  USE_DEFS
28  USE_MSG_HANDLING
29  USE_MPI_WRAPPERS
30  USE_MEMORY_PROFILING
31 
32  implicit none
33 
34  private

m_pawtab/pawtab_bcast [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

 pawtab_bcast

FUNCTION

 Communicate pawtab data to all processors

INPUTS

 comm_mpi= communicator used to broadcast data
 [only_from_file]= (optional, default=FALSE)
    If true, only data obtained at the level of the reading
    of the PAW dataset file are broadcasted

SIDE EFFECTS

  pawtab=<type pawtab_type>=a pawtab datastructure

PARENTS

      m_pawpsp

CHILDREN

SOURCE

1437 subroutine pawtab_bcast(pawtab,comm_mpi,only_from_file)
1438 
1439 
1440 !This section has been created automatically by the script Abilint (TD).
1441 !Do not modify the following lines by hand.
1442 #undef ABI_FUNC
1443 #define ABI_FUNC 'pawtab_bcast'
1444 !End of the abilint section
1445 
1446  implicit none
1447 
1448 !Arguments ------------------------------------
1449 !scalars
1450  integer,intent(in) :: comm_mpi
1451  logical,optional,intent(in) :: only_from_file
1452  type(pawtab_type),intent(inout) :: pawtab
1453 
1454 !Local variables-------------------------------
1455 !scalars
1456  integer :: ierr,ii,me,nn_dpr,nn_dpr_arr,nn_int,nn_int_arr
1457  integer :: siz_indklmn,siz_indlmn,siz_klmntomn,siz_kmix,siz_lnproju,siz_orbitals
1458  integer :: siz_coredens,siz_dij0,siz_dltij,siz_dshpfunc,siz_eijkl,siz_eijkl_sr,siz_euijkl,siz_euij_fll,siz_fk,siz_gammaij
1459  integer :: siz_gnorm,siz_fock,siz_kij,siz_nabla_ij,siz_phi,siz_phiphj,siz_phiphjint,siz_ph0phiint
1460  integer :: siz_qgrid_shp,siz_qijl,siz_rad_for_spline,siz_rhoij0,siz_shape_alpha
1461  integer :: siz_shape_q,siz_shapefunc,siz_shapefncg,siz_sij,siz_tcoredens,siz_tcorespl
1462  integer :: siz_tphi,siz_tphitphj,siz_tproj,siz_tvalespl,siz_vee,siz_vex,siz_vhtnzc
1463  integer :: siz_vhnzc,siz_vminushalf,siz_zioneff
1464  integer :: siz_wvlpaw,siz_wvl_pngau,siz_wvl_parg,siz_wvl_pfac
1465  integer :: siz_wvl_rholoc_rad,siz_wvl_rholoc_d,sz1,sz2
1466  logical :: full_broadcast
1467  character (len=500) :: msg,msg0
1468 !arrays
1469  integer :: nn(4)
1470  integer,allocatable :: list_int(:)
1471  real(dp),allocatable :: list_dpr(:)
1472 
1473 !*************************************************************************
1474 
1475  me=xmpi_comm_rank(comm_mpi)
1476  full_broadcast=.true.;if (present(only_from_file)) full_broadcast=(.not.only_from_file)
1477 
1478  nn_int=0 ; nn_int_arr=0 ; nn_dpr=0 ; nn_dpr_arr=0
1479 
1480 !=========================================================================
1481 !Compute the amount of data to communicate
1482 !=========================================================================
1483 
1484  if (me==0) then
1485    msg=''
1486 
1487 !Integers (read from psp file)
1488 !-------------------------------------------------------------------------
1489 !  basis_size,has_fock,has_kij,has_shapefncg,has_nabla,has_tproj,has_tvale,has_vhtnzc,has_vhnzc,has_vminushalf
1490 !  has_wvl,ij_size,l_size,lmn_size,lmn2_size,mesh_size,partialwave_mesh_size,core_mesh_size, vminus_mesh_size
1491 !  tnvale_mesh_size,mqgrid,shape_lambda,shape_type,usetcore,usexcnhat
1492    nn_int=nn_int+25
1493 
1494 !Integers (depending on the parameters of the calculation)
1495 !-------------------------------------------------------------------------
1496 !  ij_proj,lcut_size,lexexch,lmnmix_sz,lpawu,mqgrid_shp,nproju,useexexch,usepawu,usepotzero,usespnorb
1497    if (full_broadcast) nn_int=nn_int+11
1498 
1499 !Reals (read from psp file)
1500 !-------------------------------------------------------------------------
1501 !  beta,dncdq0,d2ncdq0,dnvdq0,ex_cc,exccore,rpaw,rshp,rcore,shape_sigma
1502    nn_dpr=nn_dpr+10
1503 
1504 !Reals (depending on the parameters of the calculation)
1505 !-------------------------------------------------------------------------
1506 !  exchmix,f4of2_sla,f6of2_sla,jpawu,upawu
1507    if (full_broadcast) nn_dpr=nn_dpr+5
1508 
1509 !Integers arrays (read from psp file)
1510 !-------------------------------------------------------------------------
1511    siz_indlmn=0 ; siz_orbitals=0
1512    nn_int=nn_int+2
1513    if (allocated(pawtab%indlmn)) then
1514      siz_indlmn=size(pawtab%indlmn)                  !(6,lmn_size)
1515      if (siz_indlmn/=6*pawtab%lmn_size) msg=trim(msg)//' indlmn'
1516      nn_int_arr=nn_int_arr+siz_indlmn
1517    end if
1518    if (allocated(pawtab%orbitals)) then
1519      siz_orbitals=size(pawtab%orbitals)              !(basis_size)
1520      if (siz_orbitals/=pawtab%basis_size) msg=trim(msg)//' orbitals'
1521      nn_int_arr=nn_int_arr+siz_orbitals
1522    end if
1523 
1524 !Integers arrays (depending on the parameters of the calculation)
1525 !-------------------------------------------------------------------------
1526    siz_indklmn=0 ; siz_klmntomn=0 ; siz_kmix=0 ; siz_lnproju=0
1527    if (full_broadcast) then
1528      nn_int=nn_int+4
1529      if (allocated(pawtab%indklmn)) then
1530        siz_indklmn=size(pawtab%indklmn)             !(6,lmn2_size)
1531        if (siz_indklmn/=8*pawtab%lmn2_size) msg=trim(msg)//' indklmn'
1532        nn_int_arr=nn_int_arr+siz_indklmn
1533      end if
1534      if (allocated(pawtab%klmntomn)) then
1535        siz_klmntomn=size(pawtab%klmntomn)           !(4,lmn2_size)
1536        if (siz_klmntomn/=4*pawtab%lmn2_size) msg=trim(msg)//' klmntomn'
1537        nn_int_arr=nn_int_arr+siz_klmntomn
1538      end if
1539      if (allocated(pawtab%kmix)) then
1540        siz_kmix=size(pawtab%kmix)                   !(lmnmix_sz)
1541        if (siz_kmix/=6*pawtab%lmnmix_sz) msg=trim(msg)//' kmix'
1542        nn_int_arr=nn_int_arr+siz_kmix
1543      end if
1544      if (allocated(pawtab%lnproju)) then
1545        siz_lnproju=size(pawtab%lnproju)             !(nproju)
1546        if (siz_lnproju/=pawtab%nproju) msg=trim(msg)//' lnproju'
1547        nn_int_arr=nn_int_arr+siz_lnproju
1548      end if
1549    end if ! full_broadcast
1550 
1551 !Reals arrays (read from psp file)
1552 !-------------------------------------------------------------------------
1553    siz_coredens=0 ; siz_dij0=0     ; siz_kij=0  ; siz_fock=0
1554    siz_phi=0      ; siz_rhoij0=0   ; siz_shape_alpha=0
1555    siz_shape_q=0  ; siz_shapefunc=0; siz_tcoredens=0
1556    siz_tcorespl=0 ; siz_tphi=0     ; siz_tproj=0
1557    siz_tvalespl=0 ; siz_vhtnzc=0   ; siz_vhnzc=0
1558    siz_vminushalf=0
1559    nn_int=nn_int+17
1560 
1561    if (allocated(pawtab%coredens)) then
1562      siz_coredens=size(pawtab%coredens)             !(core_mesh_size)
1563      if (siz_coredens/=pawtab%core_mesh_size) &
1564 &      msg=trim(msg)//' coredens'
1565      nn_dpr=nn_dpr+siz_coredens
1566    end if
1567    if (allocated(pawtab%dij0)) then
1568      siz_dij0=size(pawtab%dij0)                     !(lmn2_size)
1569      if (siz_dij0/=pawtab%lmn2_size) msg=trim(msg)//' dij0'
1570      nn_dpr=nn_dpr+siz_dij0
1571    end if
1572    if (allocated(pawtab%ex_cvij)) then
1573      siz_fock=size(pawtab%ex_cvij)                  !(lmn2_size)
1574      if (siz_fock/=pawtab%lmn2_size) msg=trim(msg)//' fock'
1575      nn_dpr=nn_dpr+siz_fock
1576    end if
1577    if (allocated(pawtab%kij)) then
1578      siz_kij=size(pawtab%kij)                       !(lmn2_size)
1579      if (siz_kij/=pawtab%lmn2_size) msg=trim(msg)//' kij'
1580      nn_dpr=nn_dpr+siz_kij
1581    end if
1582    if (allocated(pawtab%phi)) then
1583      siz_phi=size(pawtab%phi)                       !(partialwave_mesh_size, basis_size)
1584      if (siz_phi/=pawtab%partialwave_mesh_size*pawtab%basis_size) msg=trim(msg)//' phi'
1585      nn_dpr=nn_dpr+siz_phi
1586    end if
1587    if (allocated(pawtab%rhoij0)) then
1588      siz_rhoij0=size(pawtab%rhoij0)                 !(lmn2_size)
1589      if (siz_rhoij0/=pawtab%lmn2_size) msg=trim(msg)//' rhoij0'
1590      nn_dpr=nn_dpr+siz_rhoij0
1591    end if
1592    if (allocated(pawtab%shape_alpha)) then
1593      siz_shape_alpha=size(pawtab%shape_alpha)       !(2,l_size)
1594      if (siz_shape_alpha/=pawtab%l_size*2) msg=trim(msg)//' shape_alpha'
1595      nn_dpr=nn_dpr+siz_shape_alpha
1596    end if
1597    if (allocated(pawtab%shape_q)) then
1598      siz_shape_q=size(pawtab%shape_q)               !(2,l_size)
1599      if (siz_shape_q/=pawtab%l_size*2) msg=trim(msg)//' shape_q'
1600      nn_dpr=nn_dpr+siz_shape_q
1601    end if
1602    if (allocated(pawtab%shapefunc)) then
1603      siz_shapefunc=size(pawtab%shapefunc)           !(mesh_size,l_size)
1604      if (siz_shapefunc/=pawtab%mesh_size*pawtab%l_size) msg=trim(msg)//' shapefunc'
1605      nn_dpr=nn_dpr+siz_shapefunc
1606    end if
1607    if (allocated(pawtab%tcoredens)) then
1608      siz_tcoredens=size(pawtab%tcoredens)           !(core_mesh_size,1 or 6)
1609      if (siz_tcoredens/=pawtab%core_mesh_size.and.siz_tcoredens/=6*pawtab%core_mesh_size) &
1610 &      msg=trim(msg)//' tcoredens'
1611      nn_dpr=nn_dpr+siz_tcoredens
1612    end if
1613    if (allocated(pawtab%tcorespl)) then
1614      siz_tcorespl=size(pawtab%tcorespl)             !(mqgrid,2)
1615      if (siz_tcorespl/=pawtab%mqgrid*2) msg=trim(msg)//' tcorespl'
1616      nn_dpr=nn_dpr+siz_tcorespl
1617    end if
1618    if (allocated(pawtab%tphi)) then
1619      siz_tphi=size(pawtab%tphi)                     !(partialwave_mesh_size, basis_size)
1620      if (siz_tphi/=pawtab%partialwave_mesh_size*pawtab%basis_size) msg=trim(msg)//' tphi'
1621      nn_dpr=nn_dpr+siz_tphi
1622    end if
1623    if (allocated(pawtab%tproj)) then
1624      siz_tproj=size(pawtab%tproj)                   !(???,basis_size)
1625     if (mod(siz_tproj,pawtab%basis_size)/=0) msg=trim(msg)//' tproj'
1626      nn_dpr=nn_dpr+siz_tproj
1627    end if
1628    if (allocated(pawtab%tvalespl)) then
1629      siz_tvalespl=size(pawtab%tvalespl)             !(mqgrid or mesh_size or tnvale_mesh_size,2)
1630      if (siz_tvalespl/=2*pawtab%mqgrid.and.siz_tvalespl/=2*pawtab%mesh_size.and. &
1631 &        siz_tvalespl/=2*pawtab%tnvale_mesh_size) msg=trim(msg)//' tvalespl'
1632      nn_dpr=nn_dpr+siz_tvalespl
1633    end if
1634    if (allocated(pawtab%vhtnzc)) then
1635      siz_vhtnzc=size(pawtab%vhtnzc)                 !(mesh_size)
1636      if (siz_vhtnzc/=pawtab%mesh_size) msg=trim(msg)//' vhtnzc'
1637      nn_dpr=nn_dpr+siz_vhtnzc
1638    end if
1639    if (allocated(pawtab%vhnzc)) then
1640      siz_vhnzc=size(pawtab%vhnzc)                   !(mesh_size)
1641      if (siz_vhnzc/=pawtab%mesh_size) msg=trim(msg)//' vhnzc'
1642      nn_dpr=nn_dpr+siz_vhnzc
1643    end if
1644    if (allocated(pawtab%vminushalf)) then
1645      siz_vminushalf=size(pawtab%vminushalf)                 !(mesh_size)
1646      if (siz_vminushalf/=pawtab%vminus_mesh_size) msg=trim(msg)//' vvminushalf'
1647      nn_dpr=nn_dpr+siz_vminushalf
1648    end if
1649 
1650 !Reals arrays (depending on the parameters of the calculation)
1651 !-------------------------------------------------------------------------
1652    siz_dltij=0    ; siz_dshpfunc=0
1653    siz_eijkl=0    ; siz_eijkl_sr=0 ; siz_euijkl=0   ; siz_euij_fll=0
1654    siz_fk=0       ; siz_gammaij=0  ; siz_gnorm=0    ; siz_nabla_ij=0
1655    siz_phiphj=0   ; siz_phiphjint=0; siz_ph0phiint=0
1656    siz_qgrid_shp=0; siz_qijl=0     ; siz_rad_for_spline=0
1657    siz_shapefncg=0; siz_sij=0      ; siz_tphitphj=0
1658    siz_vee=0      ; siz_vex=0      ; siz_zioneff=0
1659    if (full_broadcast) then
1660      nn_int=nn_int+22
1661      if (allocated(pawtab%dltij)) then
1662        siz_dltij=size(pawtab%dltij)                   !(lmn2_size)
1663        if (siz_dltij/=pawtab%lmn2_size) msg=trim(msg)//' dltij'
1664        nn_dpr=nn_dpr+siz_dltij
1665      end if
1666      if (allocated(pawtab%dshpfunc)) then
1667        siz_dshpfunc=size(pawtab%dshpfunc)             !(mesh_size,l_size,4)
1668        if (siz_dshpfunc/=pawtab%mesh_size*pawtab%l_size*4) msg=trim(msg)//' dshpfunc'
1669        nn_dpr=nn_dpr+siz_dshpfunc
1670      end if
1671      if (allocated(pawtab%eijkl)) then
1672        siz_eijkl=size(pawtab%eijkl)                   !(lmn2_size,lmn2_size)
1673        if (siz_eijkl/=pawtab%lmn2_size*pawtab%lmn2_size) msg=trim(msg)//' eijkl'
1674        nn_dpr=nn_dpr+siz_eijkl
1675      end if
1676      if (allocated(pawtab%eijkl_sr)) then
1677        siz_eijkl_sr=size(pawtab%eijkl_sr)             !(lmn2_size,lmn2_size)
1678        if (siz_eijkl_sr/=pawtab%lmn2_size*pawtab%lmn2_size) msg=trim(msg)//' eijkl_sr'
1679        nn_dpr=nn_dpr+siz_eijkl_sr
1680      end if
1681      if (allocated(pawtab%euijkl)) then
1682        siz_euijkl=size(pawtab%euijkl)                 !(2,2,lmn_size,lmn_size,lmn_size,lmn_size)
1683        if (siz_euijkl/=4*pawtab%lmn_size*pawtab%lmn_size*pawtab%lmn_size*pawtab%lmn_size) msg=trim(msg)//' euijkl'
1684        nn_dpr=nn_dpr+siz_euijkl
1685      end if
1686      if (allocated(pawtab%euij_fll)) then
1687        siz_euij_fll=size(pawtab%euij_fll)             !(2,2,lmn_size,lmn_size,lmn_size,lmn_size)
1688        if (siz_euij_fll/=4*pawtab%lmn_size*pawtab%lmn_size*pawtab%lmn_size*pawtab%lmn_size) msg=trim(msg)//' euij_fll'
1689        nn_dpr=nn_dpr+siz_euij_fll
1690      end if
1691      if (allocated(pawtab%fk)) then
1692        siz_fk=size(pawtab%fk)                         !(6,4)
1693        if (siz_fk/=24) msg=trim(msg)//' fk'
1694        nn_dpr=nn_dpr+siz_fk
1695      end if
1696      if (allocated(pawtab%gammaij)) then
1697        siz_gammaij=size(pawtab%gammaij)               !(l_size)
1698        if (siz_gammaij/=pawtab%l_size) msg=trim(msg)//' gammaij'
1699        nn_dpr=nn_dpr+siz_gammaij
1700      end if
1701      if (allocated(pawtab%gnorm)) then
1702        siz_gnorm=size(pawtab%gnorm)                   !(l_size)
1703        if (siz_gnorm/=pawtab%l_size) msg=trim(msg)//' gnorm'
1704        nn_dpr=nn_dpr+siz_gnorm
1705      end if
1706      if (allocated(pawtab%nabla_ij)) then
1707        siz_nabla_ij=size(pawtab%nabla_ij)             !(3,lmn_size,lmn_size)
1708        if (siz_nabla_ij/=pawtab%lmn_size) msg=trim(msg)//' nabla_ij'
1709        nn_dpr=nn_dpr+siz_nabla_ij
1710      end if
1711      if (allocated(pawtab%phiphj)) then
1712        siz_phiphj=size(pawtab%phiphj)                 !(mesh_size,ij_size)
1713        if (siz_phiphj/=pawtab%mesh_size*pawtab%ij_size) msg=trim(msg)//' phiphj'
1714        nn_dpr=nn_dpr+siz_phiphj
1715      end if
1716      if (allocated(pawtab%phiphjint)) then
1717        siz_phiphjint=size(pawtab%phiphjint)           !(ij_proj)
1718        if (siz_phiphjint/=pawtab%ij_proj) msg=trim(msg)//' phiphjint'
1719        nn_dpr=nn_dpr+siz_phiphjint
1720      end if
1721      if (allocated(pawtab%ph0phiint)) then
1722        siz_ph0phiint=size(pawtab%ph0phiint)           !(ij_proj)
1723        if (siz_ph0phiint/=pawtab%ij_proj) msg=trim(msg)//' ph0phiint'
1724        nn_dpr=nn_dpr+siz_ph0phiint
1725      end if
1726      if (allocated(pawtab%qgrid_shp)) then
1727        siz_qgrid_shp=size(pawtab%qgrid_shp)           !(mqgrid_shp)
1728        if (siz_qgrid_shp/=pawtab%mqgrid_shp) msg=trim(msg)//' qgrid_shp'
1729        nn_dpr=nn_dpr+siz_qgrid_shp
1730      end if
1731      if (allocated(pawtab%qijl)) then
1732        siz_qijl=size(pawtab%qijl)                     !(l_size**2,lmn2_size)
1733        if (siz_qijl/=pawtab%l_size**2*pawtab%lmn2_size) msg=trim(msg)//' qijl'
1734        nn_dpr=nn_dpr+siz_qijl
1735      end if
1736      if (allocated(pawtab%rad_for_spline)) then
1737        siz_rad_for_spline=size(pawtab%rad_for_spline) !(mesh_size)
1738        if (siz_rad_for_spline/=pawtab%mesh_size) msg=trim(msg)//' rad_for_spline'
1739        nn_dpr=nn_dpr+siz_rad_for_spline
1740      end if
1741      if (allocated(pawtab%shapefncg)) then
1742        siz_shapefncg=size(pawtab%shapefncg)           !(mqgrid_shp,2,l_size)
1743        if (siz_shapefncg/=2*pawtab%mqgrid_shp*pawtab%l_size) msg=trim(msg)//' shapefncg'
1744        nn_dpr=nn_dpr+siz_shapefncg
1745      end if
1746      if (allocated(pawtab%sij)) then
1747        siz_sij=size(pawtab%sij)                       !(lmn2_size)
1748        if (siz_sij/=pawtab%lmn2_size) msg=trim(msg)//' sij'
1749        nn_dpr=nn_dpr+siz_sij
1750      end if
1751      if (allocated(pawtab%tphitphj)) then
1752        siz_tphitphj=size(pawtab%tphitphj)             !(mesh_size,ij_size)
1753        if (siz_tphitphj/=pawtab%mesh_size*pawtab%ij_size) msg=trim(msg)//' tphitphj'
1754        nn_dpr=nn_dpr+siz_tphitphj
1755      end if
1756      if (allocated(pawtab%vee)) then
1757        siz_vee=size(pawtab%vee)                       !(2*lpawu+1,2*lpawu+1,2*lpawu+1,2*lpawu+1)
1758        if (siz_vee/=(2*pawtab%lpawu+1)**4) msg=trim(msg)//' vee'
1759        nn_dpr=nn_dpr+siz_vee
1760      end if
1761      if (allocated(pawtab%vex)) then
1762        siz_vex=size(pawtab%vex)                       !(2*lexexch+1,2*lexexch+1,2*lexexch+1,2*lexexch+1,4)
1763        if (siz_vex/=4*(2*pawtab%lpawu+1)**4) msg=trim(msg)//' vex'
1764        nn_dpr=nn_dpr+siz_vex
1765      end if
1766      if (allocated(pawtab%zioneff)) then
1767        siz_zioneff=size(pawtab%zioneff)               !(ij_proj)
1768        if (siz_zioneff/=pawtab%ij_proj) msg=trim(msg)//' zioneff'
1769        nn_dpr=nn_dpr+siz_zioneff
1770      end if
1771    end if ! full_broadcast
1772 
1773 !Datastructures (read from psp file)
1774 !-------------------------------------------------------------------------
1775    siz_wvl_pngau=0 ; siz_wvl_parg=0 ; siz_wvl_pfac=0
1776    siz_wvl_rholoc_rad=0 ; siz_wvl_rholoc_d=0
1777    siz_wvlpaw=0
1778    nn_int=nn_int+1
1779    if (associated(pawtab%wvl)) then
1780      siz_wvlpaw=1
1781      nn_int=nn_int+3
1782 !    wvl%npspcode_init_guess,wvl%ptotgau
1783      nn_int=nn_int+2
1784      if (allocated(pawtab%wvl%pngau)) then
1785        siz_wvl_pngau=size(pawtab%wvl%pngau)         !(basis_size)
1786        if (siz_wvl_pngau/=pawtab%basis_size) msg=trim(msg)//' wvl_pngau'
1787        nn_int_arr=nn_int_arr+siz_wvl_pngau
1788      end if
1789      if (allocated(pawtab%wvl%parg)) then
1790        siz_wvl_parg=size(pawtab%wvl%parg)          !(2,ptotgau)
1791        if (siz_wvl_parg/=2*pawtab%wvl%ptotgau) msg=trim(msg)//' wvl_parg'
1792        nn_dpr_arr=nn_dpr_arr+siz_wvl_parg
1793      end if
1794      if (allocated(pawtab%wvl%pfac)) then
1795        siz_wvl_pfac=size(pawtab%wvl%pfac )         !(2,ptotgau)
1796        if (siz_wvl_pfac/=2*pawtab%wvl%ptotgau) msg=trim(msg)//' wvl_pfac'
1797        nn_dpr_arr=nn_dpr_arr+siz_wvl_pfac
1798      end if
1799 !    wvl%rholoc%msz
1800      nn_int=nn_int+3
1801      if (pawtab%wvl%rholoc%msz>0) then
1802        if (allocated(pawtab%wvl%rholoc%rad)) then
1803          siz_wvl_rholoc_rad=size(pawtab%wvl%rholoc%rad) !(msz)
1804          if (siz_wvl_rholoc_rad/=pawtab%wvl%rholoc%msz) msg=trim(msg)//' wvl_rholoc_rad'
1805          nn_dpr_arr=nn_dpr_arr+siz_wvl_rholoc_rad
1806        end if
1807        if (allocated(pawtab%wvl%rholoc%d)) then
1808          siz_wvl_rholoc_d=size(pawtab%wvl%rholoc%d)     !(msz,4)
1809          if (siz_wvl_rholoc_d/=4*pawtab%wvl%rholoc%msz) msg=trim(msg)//' wvl_rholoc_d'
1810          nn_dpr_arr=nn_dpr_arr+siz_wvl_rholoc_d
1811        end if
1812      end if
1813    end if
1814 
1815 !Datastructures (depending on the parameters of the calculation)
1816 !-------------------------------------------------------------------------
1817 !  Nothing
1818 
1819 !  Are the sizes OK ?
1820    if (trim(msg)/='') then
1821      write(msg0,'(3a)') &
1822 &     'There is a problem with the size of the following array(s):',ch10,trim(msg)
1823      MSG_BUG(msg0)
1824    end if
1825 
1826  end if ! me=0
1827 
1828 !Broadcast the sizes of buffers
1829 !=========================================================================
1830 
1831  if (me==0) then
1832    nn(1)=nn_int ; nn(2)=nn_int_arr
1833    nn(3)=nn_dpr ; nn(4)=nn_dpr_arr
1834  end if
1835  call xmpi_bcast(nn,0,comm_mpi,ierr)
1836  if (me/=0) then
1837    nn_int=nn(1) ; nn_int_arr=nn(2)
1838    nn_dpr=nn(3) ; nn_dpr_arr=nn(4)
1839  end if
1840 
1841 !Broadcast all the integer: sizes, integer scalars, integer arrays
1842 !=========================================================================
1843 
1844  LIBPAW_ALLOCATE(list_int,(nn_int+nn_int_arr))
1845 
1846 !Fill the buffer of the sender
1847 !-------------------------------------------------------------------------
1848  if (me==0) then
1849    ii=1
1850 
1851 !First the data read from a psp file
1852 !...................................
1853 
1854 !Sizes of arrays (read from psp file)
1855    list_int(ii)=siz_indlmn  ;ii=ii+1
1856    list_int(ii)=siz_orbitals  ;ii=ii+1
1857    list_int(ii)=siz_coredens  ;ii=ii+1
1858    list_int(ii)=siz_dij0  ;ii=ii+1
1859    list_int(ii)=siz_fock  ;ii=ii+1
1860    list_int(ii)=siz_kij  ;ii=ii+1
1861    list_int(ii)=siz_phi  ;ii=ii+1
1862    list_int(ii)=siz_rhoij0  ;ii=ii+1
1863    list_int(ii)=siz_shape_alpha  ;ii=ii+1
1864    list_int(ii)=siz_shape_q  ;ii=ii+1
1865    list_int(ii)=siz_shapefunc  ;ii=ii+1
1866    list_int(ii)=siz_tcoredens  ;ii=ii+1
1867    list_int(ii)=siz_tcorespl  ;ii=ii+1
1868    list_int(ii)=siz_tphi  ;ii=ii+1
1869    list_int(ii)=siz_tproj  ;ii=ii+1
1870    list_int(ii)=siz_tvalespl  ;ii=ii+1
1871    list_int(ii)=siz_vhtnzc  ;ii=ii+1
1872    list_int(ii)=siz_vhnzc  ;ii=ii+1
1873    list_int(ii)=siz_vminushalf  ;ii=ii+1
1874    list_int(ii)=siz_wvlpaw  ;ii=ii+1
1875 !Integers (read from psp file)
1876    list_int(ii)=pawtab%basis_size  ;ii=ii+1
1877    list_int(ii)=pawtab%has_fock  ;ii=ii+1
1878    list_int(ii)=pawtab%has_kij  ;ii=ii+1
1879    list_int(ii)=pawtab%has_shapefncg  ;ii=ii+1
1880    list_int(ii)=pawtab%has_nabla  ;ii=ii+1
1881    list_int(ii)=pawtab%has_tproj  ;ii=ii+1
1882    list_int(ii)=pawtab%has_tvale  ;ii=ii+1
1883    list_int(ii)=pawtab%has_vhtnzc  ;ii=ii+1
1884    list_int(ii)=pawtab%has_vhnzc  ;ii=ii+1
1885    list_int(ii)=pawtab%has_vminushalf  ;ii=ii+1
1886    list_int(ii)=pawtab%has_wvl  ;ii=ii+1
1887    list_int(ii)=pawtab%ij_size  ;ii=ii+1
1888    list_int(ii)=pawtab%l_size  ;ii=ii+1
1889    list_int(ii)=pawtab%lmn_size  ;ii=ii+1
1890    list_int(ii)=pawtab%lmn2_size  ;ii=ii+1
1891    list_int(ii)=pawtab%mesh_size  ;ii=ii+1
1892    list_int(ii)=pawtab%partialwave_mesh_size  ;ii=ii+1
1893    list_int(ii)=pawtab%core_mesh_size  ;ii=ii+1
1894    list_int(ii)=pawtab%vminus_mesh_size  ;ii=ii+1
1895    list_int(ii)=pawtab%tnvale_mesh_size  ;ii=ii+1
1896    list_int(ii)=pawtab%mqgrid  ;ii=ii+1
1897    list_int(ii)=pawtab%shape_lambda  ;ii=ii+1
1898    list_int(ii)=pawtab%shape_type  ;ii=ii+1
1899    list_int(ii)=pawtab%usetcore  ;ii=ii+1
1900    list_int(ii)=pawtab%usexcnhat  ;ii=ii+1
1901 !Integer arrays (read from psp file)
1902    if (siz_indlmn>0) then
1903      list_int(ii:ii+siz_indlmn-1)=reshape(pawtab%indlmn,(/siz_indlmn/))
1904      ii=ii+siz_indlmn
1905    end if
1906    if (siz_orbitals>0) then
1907      list_int(ii:ii+siz_orbitals-1)=pawtab%orbitals(1:siz_orbitals)
1908      ii=ii+siz_orbitals
1909    end if
1910 !Integers in datastructures (read from psp file)
1911    if (siz_wvlpaw==1) then
1912      list_int(ii)=siz_wvl_pngau  ;ii=ii+1
1913      list_int(ii)=siz_wvl_parg  ;ii=ii+1
1914      list_int(ii)=siz_wvl_pfac  ;ii=ii+1
1915      list_int(ii)=pawtab%wvl%npspcode_init_guess  ;ii=ii+1
1916      list_int(ii)=pawtab%wvl%ptotgau  ;ii=ii+1
1917      if (siz_wvl_pngau>0) then
1918        list_int(ii:ii+siz_wvl_pngau-1)=pawtab%wvl%pngau(1:siz_wvl_pngau)
1919        ii=ii+siz_wvl_pngau
1920      end if
1921      list_int(ii)=siz_wvl_rholoc_rad  ;ii=ii+1
1922      list_int(ii)=siz_wvl_rholoc_d  ;ii=ii+1
1923      list_int(ii)=pawtab%wvl%rholoc%msz  ;ii=ii+1
1924    end if
1925 
1926 !Then the data initialized later
1927 !...................................
1928    if (full_broadcast) then
1929 
1930 !Sizes of arrays
1931      list_int(ii)=siz_indklmn  ;ii=ii+1
1932      list_int(ii)=siz_klmntomn  ;ii=ii+1
1933      list_int(ii)=siz_kmix  ;ii=ii+1
1934      list_int(ii)=siz_lnproju  ;ii=ii+1
1935      list_int(ii)=siz_dltij  ;ii=ii+1
1936      list_int(ii)=siz_dshpfunc  ;ii=ii+1
1937      list_int(ii)=siz_eijkl  ;ii=ii+1
1938      list_int(ii)=siz_eijkl_sr  ;ii=ii+1
1939      list_int(ii)=siz_euijkl  ;ii=ii+1
1940      list_int(ii)=siz_euij_fll  ;ii=ii+1
1941      list_int(ii)=siz_fk  ;ii=ii+1
1942      list_int(ii)=siz_gammaij ;ii=ii+1
1943      list_int(ii)=siz_gnorm  ;ii=ii+1
1944      list_int(ii)=siz_nabla_ij  ;ii=ii+1
1945      list_int(ii)=siz_phiphj  ;ii=ii+1
1946      list_int(ii)=siz_phiphjint  ;ii=ii+1
1947      list_int(ii)=siz_ph0phiint  ;ii=ii+1
1948      list_int(ii)=siz_qgrid_shp  ;ii=ii+1
1949      list_int(ii)=siz_qijl  ;ii=ii+1
1950      list_int(ii)=siz_rad_for_spline  ;ii=ii+1
1951      list_int(ii)=siz_shapefncg  ;ii=ii+1
1952      list_int(ii)=siz_sij  ;ii=ii+1
1953      list_int(ii)=siz_tphitphj  ;ii=ii+1
1954      list_int(ii)=siz_vee  ;ii=ii+1
1955      list_int(ii)=siz_vex  ;ii=ii+1
1956      list_int(ii)=siz_zioneff  ;ii=ii+1
1957 !Integers
1958      list_int(ii)=pawtab%ij_proj  ;ii=ii+1
1959      list_int(ii)=pawtab%lcut_size  ;ii=ii+1
1960      list_int(ii)=pawtab%lexexch  ;ii=ii+1
1961      list_int(ii)=pawtab%lmnmix_sz  ;ii=ii+1
1962      list_int(ii)=pawtab%lpawu  ;ii=ii+1
1963      list_int(ii)=pawtab%mqgrid_shp  ;ii=ii+1
1964      list_int(ii)=pawtab%nproju  ;ii=ii+1
1965      list_int(ii)=pawtab%useexexch  ;ii=ii+1
1966      list_int(ii)=pawtab%usepawu  ;ii=ii+1
1967      list_int(ii)=pawtab%usepotzero ;ii=ii+1
1968      list_int(ii)=pawtab%usespnorb ;ii=ii+1
1969 !Integer arrays
1970      if (siz_indklmn>0) then
1971        list_int(ii:ii+siz_indklmn-1)=reshape(pawtab%indklmn,(/siz_indklmn/))
1972        ii=ii+siz_indklmn
1973      end if
1974      if (siz_klmntomn>0) then
1975        list_int(ii:ii+siz_klmntomn-1)=reshape(pawtab%klmntomn,(/siz_klmntomn/))
1976        ii=ii+siz_klmntomn
1977      end if
1978      if (siz_kmix>0) then
1979        list_int(ii:ii+siz_kmix-1)=pawtab%kmix(1:siz_kmix)
1980        ii=ii+siz_kmix
1981      end if
1982      if (siz_lnproju>0) then
1983        list_int(ii:ii+siz_lnproju-1)=pawtab%lnproju(1:siz_lnproju)
1984        ii=ii+siz_lnproju
1985      end if
1986    end if ! full_broadcast
1987    ii=ii-1
1988 
1989    if (ii/=nn_int+nn_int_arr) then
1990      msg='the number of loaded integers is not correct!'
1991      MSG_BUG(msg)
1992    end if
1993 
1994  end if ! me=0
1995 
1996 !Perfom the communication
1997 !-------------------------------------------------------------------------
1998 
1999  call xmpi_bcast(list_int,0,comm_mpi,ierr)
2000 
2001 !Fill the receiver from the buffer
2002 !-------------------------------------------------------------------------
2003  if (me/=0) then
2004    ii=1
2005 
2006 !First the data read from a psp file
2007 !...................................
2008 
2009 !Sizes of arrays (read from psp file)
2010    siz_indlmn=list_int(ii)  ;ii=ii+1
2011    siz_orbitals=list_int(ii)  ;ii=ii+1
2012    siz_coredens=list_int(ii)  ;ii=ii+1
2013    siz_dij0=list_int(ii)  ;ii=ii+1
2014    siz_fock=list_int(ii)  ;ii=ii+1
2015    siz_kij=list_int(ii)  ;ii=ii+1
2016    siz_phi=list_int(ii)  ;ii=ii+1
2017    siz_rhoij0=list_int(ii)  ;ii=ii+1
2018    siz_shape_alpha=list_int(ii)  ;ii=ii+1
2019    siz_shape_q=list_int(ii)  ;ii=ii+1
2020    siz_shapefunc=list_int(ii)  ;ii=ii+1
2021    siz_tcoredens=list_int(ii)  ;ii=ii+1
2022    siz_tcorespl=list_int(ii)  ;ii=ii+1
2023    siz_tphi=list_int(ii)  ;ii=ii+1
2024    siz_tproj=list_int(ii)  ;ii=ii+1
2025    siz_tvalespl=list_int(ii)  ;ii=ii+1
2026    siz_vhtnzc=list_int(ii)  ;ii=ii+1
2027    siz_vhnzc=list_int(ii)  ;ii=ii+1
2028    siz_vminushalf=list_int(ii)  ;ii=ii+1
2029    siz_wvlpaw=list_int(ii)  ;ii=ii+1
2030 !Integers (read from psp file)
2031    pawtab%basis_size=list_int(ii)  ;ii=ii+1
2032    pawtab%has_fock=list_int(ii)  ;ii=ii+1
2033    pawtab%has_kij=list_int(ii)  ;ii=ii+1
2034    pawtab%has_shapefncg=list_int(ii)  ;ii=ii+1
2035    pawtab%has_nabla=list_int(ii)  ;ii=ii+1
2036    pawtab%has_tproj=list_int(ii)  ;ii=ii+1
2037    pawtab%has_tvale=list_int(ii)  ;ii=ii+1
2038    pawtab%has_vhtnzc=list_int(ii)  ;ii=ii+1
2039    pawtab%has_vhnzc=list_int(ii)  ;ii=ii+1
2040    pawtab%has_vminushalf=list_int(ii)  ;ii=ii+1
2041    pawtab%has_wvl=list_int(ii)  ;ii=ii+1
2042    pawtab%ij_size=list_int(ii)  ;ii=ii+1
2043    pawtab%l_size=list_int(ii)  ;ii=ii+1
2044    pawtab%lmn_size=list_int(ii)  ;ii=ii+1
2045    pawtab%lmn2_size=list_int(ii)  ;ii=ii+1
2046    pawtab%mesh_size=list_int(ii)  ;ii=ii+1
2047    pawtab%partialwave_mesh_size=list_int(ii)  ;ii=ii+1
2048    pawtab%core_mesh_size=list_int(ii)  ;ii=ii+1
2049    pawtab%vminus_mesh_size=list_int(ii)  ;ii=ii+1
2050    pawtab%tnvale_mesh_size=list_int(ii)  ;ii=ii+1
2051    pawtab%mqgrid=list_int(ii)  ;ii=ii+1
2052    pawtab%shape_lambda=list_int(ii)  ;ii=ii+1
2053    pawtab%shape_type=list_int(ii)  ;ii=ii+1
2054    pawtab%usetcore=list_int(ii)  ;ii=ii+1
2055    pawtab%usexcnhat=list_int(ii)  ;ii=ii+1
2056 !Integer arrays (read from psp file)
2057    if (allocated(pawtab%indlmn)) then
2058      LIBPAW_DEALLOCATE(pawtab%indlmn)
2059    end if
2060    if (siz_indlmn>0) then
2061      LIBPAW_ALLOCATE(pawtab%indlmn,(6,pawtab%lmn_size))
2062      pawtab%indlmn=reshape(list_int(ii:ii+siz_indlmn-1),(/6,pawtab%lmn_size/))
2063      ii=ii+siz_indlmn
2064    end if
2065    if (allocated(pawtab%orbitals)) then
2066      LIBPAW_DEALLOCATE(pawtab%orbitals)
2067    end if
2068    if (siz_orbitals>0) then
2069      LIBPAW_ALLOCATE(pawtab%orbitals,(pawtab%basis_size))
2070      pawtab%orbitals=list_int(ii:ii+pawtab%basis_size-1)
2071      ii=ii+siz_orbitals
2072    end if
2073 !Integers in datastructures (read from psp file)
2074    if (siz_wvlpaw==1) then
2075      call wvlpaw_allocate(pawtab%wvl)
2076      siz_wvl_pngau=list_int(ii)  ;ii=ii+1
2077      siz_wvl_parg=list_int(ii)  ;ii=ii+1
2078      siz_wvl_pfac=list_int(ii)  ;ii=ii+1
2079      pawtab%wvl%npspcode_init_guess=list_int(ii)  ;ii=ii+1
2080      pawtab%wvl%ptotgau=list_int(ii)  ;ii=ii+1
2081      if (allocated(pawtab%wvl%pngau)) then
2082        LIBPAW_DEALLOCATE(pawtab%wvl%pngau)
2083      end if
2084      if (siz_wvl_pngau>0) then
2085        LIBPAW_ALLOCATE(pawtab%wvl%pngau,(pawtab%basis_size))
2086        pawtab%wvl%pngau=list_int(ii:ii+pawtab%basis_size-1)
2087        ii=ii+siz_wvl_pngau
2088      end if
2089      siz_wvl_rholoc_rad=list_int(ii)  ;ii=ii+1
2090      siz_wvl_rholoc_d=list_int(ii)  ;ii=ii+1
2091      pawtab%wvl%rholoc%msz=list_int(ii)  ;ii=ii+1
2092    end if
2093 
2094 !Then the data initialized later
2095 !...................................
2096    if (full_broadcast) then
2097 
2098 !Sizes of arrays
2099      siz_indklmn=list_int(ii)  ;ii=ii+1
2100      siz_klmntomn=list_int(ii)  ;ii=ii+1
2101      siz_kmix=list_int(ii)  ;ii=ii+1
2102      siz_lnproju=list_int(ii)  ;ii=ii+1
2103      siz_dltij=list_int(ii)  ;ii=ii+1
2104      siz_dshpfunc=list_int(ii)  ;ii=ii+1
2105      siz_eijkl=list_int(ii)  ;ii=ii+1
2106      siz_eijkl_sr=list_int(ii)  ;ii=ii+1
2107      siz_euijkl=list_int(ii)  ;ii=ii+1
2108      siz_euij_fll=list_int(ii)  ;ii=ii+1
2109      siz_fk=list_int(ii)  ;ii=ii+1
2110      siz_gammaij=list_int(ii)  ;ii=ii+1
2111      siz_gnorm=list_int(ii)  ;ii=ii+1
2112      siz_nabla_ij=list_int(ii)  ;ii=ii+1
2113      siz_phiphj=list_int(ii)  ;ii=ii+1
2114      siz_phiphjint=list_int(ii)  ;ii=ii+1
2115      siz_ph0phiint=list_int(ii)  ;ii=ii+1
2116      siz_qgrid_shp=list_int(ii)  ;ii=ii+1
2117      siz_qijl=list_int(ii)  ;ii=ii+1
2118      siz_rad_for_spline=list_int(ii)  ;ii=ii+1
2119      siz_shapefncg=list_int(ii)  ;ii=ii+1
2120      siz_sij=list_int(ii)  ;ii=ii+1
2121      siz_tphitphj=list_int(ii)  ;ii=ii+1
2122      siz_vee=list_int(ii)  ;ii=ii+1
2123      siz_vex=list_int(ii)  ;ii=ii+1
2124      siz_zioneff=list_int(ii)  ;ii=ii+1
2125 !Integers
2126      pawtab%ij_proj=list_int(ii)  ;ii=ii+1
2127      pawtab%lcut_size=list_int(ii)  ;ii=ii+1
2128      pawtab%lexexch=list_int(ii)  ;ii=ii+1
2129      pawtab%lmnmix_sz=list_int(ii)  ;ii=ii+1
2130      pawtab%lpawu=list_int(ii)  ;ii=ii+1
2131      pawtab%mqgrid_shp=list_int(ii)  ;ii=ii+1
2132      pawtab%nproju=list_int(ii)  ;ii=ii+1
2133      pawtab%useexexch=list_int(ii)  ;ii=ii+1
2134      pawtab%usepawu=list_int(ii)  ;ii=ii+1
2135      pawtab%usepotzero=list_int(ii) ;ii=ii+1
2136      pawtab%usespnorb=list_int(ii) ;ii=ii+1
2137 !Integer arrays
2138      if (allocated(pawtab%indklmn)) then
2139        LIBPAW_DEALLOCATE(pawtab%indklmn)
2140      end if
2141      if (siz_indklmn>0) then
2142        LIBPAW_ALLOCATE(pawtab%indklmn,(8,pawtab%lmn2_size))
2143        pawtab%indklmn=reshape(list_int(ii:ii+siz_indklmn-1),(/8,pawtab%lmn2_size/))
2144        ii=ii+siz_indklmn
2145      end if
2146      if (allocated(pawtab%klmntomn)) then
2147        LIBPAW_DEALLOCATE(pawtab%klmntomn)
2148      end if
2149      if (siz_klmntomn>0) then
2150        LIBPAW_ALLOCATE(pawtab%klmntomn,(4,pawtab%lmn2_size))
2151        pawtab%klmntomn=reshape(list_int(ii:ii+siz_klmntomn-1),(/4,pawtab%lmn2_size/))
2152        ii=ii+siz_klmntomn
2153      end if
2154      if (allocated(pawtab%kmix)) then
2155        LIBPAW_DEALLOCATE(pawtab%kmix)
2156      end if
2157      if (siz_kmix>0) then
2158        LIBPAW_ALLOCATE(pawtab%kmix,(pawtab%lmnmix_sz))
2159        pawtab%kmix=list_int(ii:ii+pawtab%lmnmix_sz-1)
2160        ii=ii+siz_kmix
2161      end if
2162      if (allocated(pawtab%lnproju)) then
2163        LIBPAW_DEALLOCATE(pawtab%lnproju)
2164      end if
2165      if (siz_lnproju>0) then
2166        LIBPAW_ALLOCATE(pawtab%lnproju,(pawtab%nproju))
2167        pawtab%lnproju=list_int(ii:ii+pawtab%nproju-1)
2168        ii=ii+siz_lnproju
2169      end if
2170    end if ! full_broadcast
2171    ii=ii-1
2172 
2173    if (ii/=nn_int+nn_int_arr) then
2174      msg='the number of broadcasted integers is not correct!'
2175      MSG_BUG(msg)
2176    end if
2177 
2178  end if ! me/=0
2179  LIBPAW_DEALLOCATE(list_int)
2180 
2181 !Broadcast all the reals
2182 !=========================================================================
2183 
2184  LIBPAW_ALLOCATE(list_dpr,(nn_dpr+nn_dpr_arr))
2185 
2186 !Fill the buffer of the sender
2187 !-------------------------------------------------------------------------
2188  if (me==0) then
2189    ii=1
2190 
2191 !First the data read from a psp file
2192 !...................................
2193 
2194 !Reals (read from psp file)
2195    list_dpr(ii)=pawtab%beta    ;ii=ii+1
2196    list_dpr(ii)=pawtab%dncdq0  ;ii=ii+1
2197    list_dpr(ii)=pawtab%d2ncdq0  ;ii=ii+1
2198    list_dpr(ii)=pawtab%dnvdq0  ;ii=ii+1
2199    list_dpr(ii)=pawtab%ex_cc   ;ii=ii+1
2200    list_dpr(ii)=pawtab%exccore  ;ii=ii+1
2201    list_dpr(ii)=pawtab%rpaw  ;ii=ii+1
2202    list_dpr(ii)=pawtab%rshp  ;ii=ii+1
2203    list_dpr(ii)=pawtab%rcore  ;ii=ii+1
2204    list_dpr(ii)=pawtab%shape_sigma  ;ii=ii+1
2205 !Reals arrays (read from psp file)
2206    if (siz_coredens>0) then
2207      list_dpr(ii:ii+siz_coredens-1)=pawtab%coredens(1:siz_coredens)
2208      ii=ii+siz_coredens
2209    end if
2210    if (siz_dij0>0) then
2211      list_dpr(ii:ii+siz_dij0-1)=pawtab%dij0(1:siz_dij0)
2212      ii=ii+siz_dij0
2213    end if
2214    if (siz_fock>0) then
2215      list_dpr(ii:ii+siz_fock-1)=pawtab%ex_cvij(1:siz_fock)
2216      ii=ii+siz_fock
2217    end if
2218    if (siz_kij>0) then
2219      list_dpr(ii:ii+siz_kij-1)=pawtab%kij(1:siz_kij)
2220      ii=ii+siz_kij
2221    end if
2222    if (siz_phi>0) then
2223      list_dpr(ii:ii+siz_phi-1)=reshape(pawtab%phi,(/siz_phi/))
2224      ii=ii+siz_phi
2225    end if
2226    if (siz_rhoij0>0) then
2227      list_dpr(ii:ii+siz_rhoij0-1)=pawtab%rhoij0(1:siz_rhoij0)
2228      ii=ii+siz_rhoij0
2229    end if
2230    if (siz_shape_alpha>0) then
2231      list_dpr(ii:ii+siz_shape_alpha-1)=reshape(pawtab%shape_alpha,(/siz_shape_alpha/))
2232      ii=ii+siz_shape_alpha
2233    end if
2234    if (siz_shape_q>0) then
2235      list_dpr(ii:ii+siz_shape_q-1)=reshape(pawtab%shape_q,(/siz_shape_q/))
2236      ii=ii+siz_shape_q
2237    end if
2238    if (siz_shapefunc>0) then
2239      list_dpr(ii:ii+siz_shapefunc-1)=reshape(pawtab%shapefunc,(/siz_shapefunc/))
2240      ii=ii+siz_shapefunc
2241    end if
2242    if (siz_tcoredens>0) then
2243      list_dpr(ii:ii+siz_tcoredens-1)=reshape(pawtab%tcoredens,(/siz_tcoredens/))
2244      ii=ii+siz_tcoredens
2245    end if
2246    if (siz_tcorespl>0) then
2247      list_dpr(ii:ii+siz_tcorespl-1)=reshape(pawtab%tcorespl,(/siz_tcorespl/))
2248      ii=ii+siz_tcorespl
2249    end if
2250    if (siz_tphi>0) then
2251      list_dpr(ii:ii+siz_tphi-1)=reshape(pawtab%tphi,(/siz_tphi/))
2252      ii=ii+siz_tphi
2253    end if
2254    if (siz_tproj>0) then
2255      list_dpr(ii:ii+siz_tproj-1)=reshape(pawtab%tproj,(/siz_tproj/))
2256      ii=ii+siz_tproj
2257    end if
2258    if (siz_tvalespl>0) then
2259      list_dpr(ii:ii+siz_tvalespl-1)=reshape(pawtab%tvalespl,(/siz_tvalespl/))
2260      ii=ii+siz_tvalespl
2261    end if
2262    if (siz_vhtnzc>0) then
2263      list_dpr(ii:ii+siz_vhtnzc-1)=pawtab%vhtnzc(1:siz_vhtnzc)
2264      ii=ii+siz_vhtnzc
2265    end if
2266    if (siz_vhnzc>0) then
2267      list_dpr(ii:ii+siz_vhnzc-1)=pawtab%vhnzc(1:siz_vhnzc)
2268      ii=ii+siz_vhnzc
2269    end if
2270    if (siz_vminushalf>0) then
2271      list_dpr(ii:ii+siz_vminushalf-1)=pawtab%vminushalf(1:siz_vminushalf)
2272      ii=ii+siz_vminushalf
2273    end if
2274 !Reals in datastructures (read from psp file)
2275    if (siz_wvlpaw==1) then
2276      if (siz_wvl_parg>0) then
2277        list_dpr(ii:ii+siz_wvl_parg-1)=reshape(pawtab%wvl%parg,(/siz_wvl_parg/))
2278        ii=ii+siz_wvl_parg
2279      end if
2280      if (siz_wvl_pfac>0) then
2281        list_dpr(ii:ii+siz_wvl_pfac-1)=reshape(pawtab%wvl%pfac,(/siz_wvl_pfac/))
2282        ii=ii+siz_wvl_pfac
2283      end if
2284      if (siz_wvl_rholoc_rad>0) then
2285         list_dpr(ii:ii+siz_wvl_rholoc_rad-1)=pawtab%wvl%rholoc%rad(1:siz_wvl_rholoc_rad)
2286         ii=ii+siz_wvl_rholoc_rad
2287      end if
2288      if (siz_wvl_rholoc_d>0) then
2289         list_dpr(ii:ii+siz_wvl_rholoc_d-1)=reshape(pawtab%wvl%rholoc%d,(/siz_wvl_rholoc_d/))
2290         ii=ii+siz_wvl_rholoc_d
2291      end if
2292    end if
2293 
2294 !Then the data initialized later
2295 !...................................
2296    if (full_broadcast) then
2297 
2298 !Reals
2299      list_dpr(ii)=pawtab%exchmix  ;ii=ii+1
2300      list_dpr(ii)=pawtab%f4of2_sla  ;ii=ii+1
2301      list_dpr(ii)=pawtab%f6of2_sla  ;ii=ii+1
2302      list_dpr(ii)=pawtab%jpawu  ;ii=ii+1
2303      list_dpr(ii)=pawtab%upawu  ;ii=ii+1
2304 !Reals arrays
2305      if (siz_dltij>0) then
2306        list_dpr(ii:ii+siz_dltij-1)=pawtab%dltij(1:siz_dltij)
2307        ii=ii+siz_dltij
2308      end if
2309      if (siz_dshpfunc>0) then
2310        list_dpr(ii:ii+siz_dshpfunc-1)=reshape(pawtab%dshpfunc,(/siz_dshpfunc/))
2311        ii=ii+siz_dshpfunc
2312      end if
2313      if (siz_eijkl>0) then
2314        list_dpr(ii:ii+siz_eijkl-1)=reshape(pawtab%eijkl,(/siz_eijkl/))
2315        ii=ii+siz_eijkl
2316      end if
2317      if (siz_eijkl_sr>0) then
2318        list_dpr(ii:ii+siz_eijkl_sr-1)=reshape(pawtab%eijkl_sr,(/siz_eijkl_sr/))
2319        ii=ii+siz_eijkl_sr
2320      end if
2321      if (siz_euijkl>0) then
2322        list_dpr(ii:ii+siz_euijkl-1)=reshape(pawtab%euijkl,(/siz_euijkl/))
2323        ii=ii+siz_euijkl
2324      end if
2325      if (siz_euij_fll>0) then
2326        list_dpr(ii:ii+siz_euij_fll-1)=reshape(pawtab%euij_fll,(/siz_euij_fll/))
2327        ii=ii+siz_euij_fll
2328      end if
2329      if (siz_fk>0) then
2330        list_dpr(ii:ii+siz_fk-1)=reshape(pawtab%fk,(/siz_fk/))
2331        ii=ii+siz_fk
2332      end if
2333      if (siz_gammaij>0) then
2334        list_dpr(ii:ii+siz_gammaij-1)=pawtab%gammaij(1:siz_gammaij)
2335        ii=ii+siz_gammaij
2336      end if
2337      if (siz_gnorm>0) then
2338        list_dpr(ii:ii+siz_gnorm-1)=pawtab%gnorm(1:siz_gnorm)
2339        ii=ii+siz_gnorm
2340      end if
2341      if (siz_nabla_ij>0) then
2342        list_dpr(ii:ii+siz_nabla_ij-1)=reshape(pawtab%nabla_ij,(/siz_nabla_ij/))
2343        ii=ii+siz_nabla_ij
2344      end if
2345      if (siz_phiphj>0) then
2346        list_dpr(ii:ii+siz_phiphj-1)=reshape(pawtab%phiphj,(/siz_phiphj/))
2347        ii=ii+siz_phiphj
2348      end if
2349      if (siz_phiphjint>0) then
2350        list_dpr(ii:ii+siz_phiphjint-1)=pawtab%phiphjint(1:siz_phiphjint)
2351        ii=ii+siz_phiphjint
2352      end if
2353      if (siz_ph0phiint>0) then
2354        list_dpr(ii:ii+siz_ph0phiint-1)=pawtab%ph0phiint(1:siz_ph0phiint)
2355        ii=ii+siz_ph0phiint
2356      end if
2357      if (siz_qgrid_shp>0) then
2358        list_dpr(ii:ii+siz_qgrid_shp-1)=pawtab%qgrid_shp(1:siz_qgrid_shp)
2359        ii=ii+siz_qgrid_shp
2360      end if
2361      if (siz_qijl>0) then
2362        list_dpr(ii:ii+siz_qijl-1)=reshape(pawtab%qijl,(/siz_qijl/))
2363        ii=ii+siz_qijl
2364      end if
2365      if (siz_rad_for_spline>0) then
2366        list_dpr(ii:ii+siz_rad_for_spline-1)=pawtab%rad_for_spline(1:siz_rad_for_spline)
2367        ii=ii+siz_rad_for_spline
2368      end if
2369      if (siz_shapefncg>0) then
2370        list_dpr(ii:ii+siz_shapefncg-1)=reshape(pawtab%shapefncg,(/siz_shapefncg/))
2371        ii=ii+siz_shapefncg
2372      end if
2373      if (siz_sij>0) then
2374        list_dpr(ii:ii+siz_sij-1)=pawtab%sij(1:siz_sij)
2375        ii=ii+siz_sij
2376      end if
2377      if (siz_tphitphj>0) then
2378        list_dpr(ii:ii+siz_tphitphj-1)=reshape(pawtab%tphitphj,(/siz_tphitphj/))
2379        ii=ii+siz_tphitphj
2380      end if
2381      if (siz_vee>0) then
2382        list_dpr(ii:ii+siz_vee-1)=reshape(pawtab%vee,(/siz_vee/))
2383        ii=ii+siz_vee
2384      end if
2385      if (siz_vex>0) then
2386        list_dpr(ii:ii+siz_vex-1)=reshape(pawtab%vex,(/siz_vex/))
2387        ii=ii+siz_vex
2388      end if
2389      if (siz_zioneff>0) then
2390        list_dpr(ii:ii+siz_zioneff-1)=pawtab%zioneff(1:siz_zioneff)
2391        ii=ii+siz_zioneff
2392      end if
2393 
2394    end if ! full_broadcast
2395    ii=ii-1
2396    if (ii/=nn_dpr+nn_dpr_arr) then
2397      msg='the number of loaded reals is not correct!'
2398      MSG_BUG(msg)
2399    end if
2400 
2401  end if ! me=0
2402 
2403 !Perfom the communication
2404 !-------------------------------------------------------------------------
2405 
2406  call xmpi_bcast(list_dpr,0,comm_mpi,ierr)
2407 
2408 !Fill the receiver from the buffer
2409 !-------------------------------------------------------------------------
2410  if (me/=0) then
2411    ii=1
2412 
2413 !First the data read from a psp file
2414 !...................................
2415 
2416 !Reals (read from psp file)
2417    pawtab%beta=list_dpr(ii)    ;ii=ii+1
2418    pawtab%dncdq0=list_dpr(ii)  ;ii=ii+1
2419    pawtab%d2ncdq0=list_dpr(ii)  ;ii=ii+1
2420    pawtab%dnvdq0=list_dpr(ii)  ;ii=ii+1
2421    pawtab%ex_cc=list_dpr(ii)  ;ii=ii+1
2422    pawtab%exccore=list_dpr(ii)  ;ii=ii+1
2423    pawtab%rpaw=list_dpr(ii)  ;ii=ii+1
2424    pawtab%rshp=list_dpr(ii)  ;ii=ii+1
2425    pawtab%rcore=list_dpr(ii)  ;ii=ii+1
2426    pawtab%shape_sigma=list_dpr(ii)  ;ii=ii+1
2427 !Reals arrays (read from psp file)
2428    if (allocated(pawtab%coredens)) then
2429      LIBPAW_DEALLOCATE(pawtab%coredens)
2430    end if
2431    if (siz_coredens>0) then
2432      LIBPAW_ALLOCATE(pawtab%coredens,(pawtab%core_mesh_size))
2433      pawtab%coredens=list_dpr(ii:ii+pawtab%core_mesh_size-1)
2434      ii=ii+siz_coredens
2435    end if
2436    if (allocated(pawtab%dij0)) then
2437      LIBPAW_DEALLOCATE(pawtab%dij0)
2438    end if
2439    if (siz_dij0>0) then
2440      LIBPAW_ALLOCATE(pawtab%dij0,(pawtab%lmn2_size))
2441      pawtab%dij0=list_dpr(ii:ii+pawtab%lmn2_size-1)
2442      ii=ii+siz_dij0
2443    end if
2444    if (allocated(pawtab%ex_cvij)) then
2445      LIBPAW_DEALLOCATE(pawtab%ex_cvij)
2446    end if
2447    if (siz_fock>0) then
2448      LIBPAW_ALLOCATE(pawtab%ex_cvij,(pawtab%lmn2_size))
2449      pawtab%ex_cvij=list_dpr(ii:ii+pawtab%lmn2_size-1)
2450      ii=ii+siz_fock
2451    end if
2452    if (allocated(pawtab%kij)) then
2453      LIBPAW_DEALLOCATE(pawtab%kij)
2454    end if
2455    if (siz_kij>0) then
2456      LIBPAW_ALLOCATE(pawtab%kij,(pawtab%lmn2_size))
2457      pawtab%kij=list_dpr(ii:ii+pawtab%lmn2_size-1)
2458      ii=ii+siz_kij
2459    end if
2460    if (allocated(pawtab%phi)) then
2461      LIBPAW_DEALLOCATE(pawtab%phi)
2462    end if
2463    if (siz_phi>0) then
2464      LIBPAW_ALLOCATE(pawtab%phi,(pawtab%partialwave_mesh_size,pawtab%basis_size))
2465      pawtab%phi=reshape(list_dpr(ii:ii+siz_phi-1),(/pawtab%partialwave_mesh_size,pawtab%basis_size/))
2466      ii=ii+siz_phi
2467    end if
2468    if (allocated(pawtab%rhoij0)) then
2469      LIBPAW_DEALLOCATE(pawtab%rhoij0)
2470    end if
2471    if (siz_rhoij0>0) then
2472      LIBPAW_ALLOCATE(pawtab%rhoij0,(pawtab%lmn2_size))
2473      pawtab%rhoij0=list_dpr(ii:ii+pawtab%lmn2_size-1)
2474      ii=ii+siz_rhoij0
2475    end if
2476    if (allocated(pawtab%shape_alpha)) then
2477      LIBPAW_DEALLOCATE(pawtab%shape_alpha)
2478    end if
2479    if (siz_shape_alpha>0) then
2480      LIBPAW_ALLOCATE(pawtab%shape_alpha,(2,pawtab%l_size))
2481      pawtab%shape_alpha=reshape(list_dpr(ii:ii+siz_shape_alpha-1),(/2,pawtab%l_size/))
2482      ii=ii+siz_shape_alpha
2483    end if
2484    if (allocated(pawtab%shape_q)) then
2485      LIBPAW_DEALLOCATE(pawtab%shape_q)
2486    end if
2487    if (siz_shape_q>0) then
2488      LIBPAW_ALLOCATE(pawtab%shape_q,(2,pawtab%l_size))
2489      pawtab%shape_q=reshape(list_dpr(ii:ii+siz_shape_q-1),(/2,pawtab%l_size/))
2490      ii=ii+siz_shape_q
2491    end if
2492    if (allocated(pawtab%shapefunc)) then
2493      LIBPAW_DEALLOCATE(pawtab%shapefunc)
2494    end if
2495    if (siz_shapefunc>0) then
2496      LIBPAW_ALLOCATE(pawtab%shapefunc,(pawtab%mesh_size,pawtab%l_size))
2497      pawtab%shapefunc=reshape(list_dpr(ii:ii+siz_shapefunc-1),(/pawtab%mesh_size,pawtab%l_size/))
2498      ii=ii+siz_shapefunc
2499    end if
2500    if (allocated(pawtab%tcoredens)) then
2501      LIBPAW_DEALLOCATE(pawtab%tcoredens)
2502    end if
2503    if (siz_tcoredens>0) then
2504      sz2=siz_tcoredens/pawtab%core_mesh_size
2505      LIBPAW_ALLOCATE(pawtab%tcoredens,(pawtab%core_mesh_size,sz2))
2506      pawtab%tcoredens=reshape(list_dpr(ii:ii+siz_tcoredens-1),(/pawtab%core_mesh_size,sz2/))
2507      ii=ii+siz_tcoredens
2508    end if
2509    if (allocated(pawtab%tcorespl)) then
2510      LIBPAW_DEALLOCATE(pawtab%tcorespl)
2511    end if
2512    if (siz_tcorespl>0) then
2513      LIBPAW_ALLOCATE(pawtab%tcorespl,(pawtab%mqgrid,2))
2514      pawtab%tcorespl=reshape(list_dpr(ii:ii+siz_tcorespl-1),(/pawtab%mqgrid,2/))
2515      ii=ii+siz_tcorespl
2516    end if
2517    if (allocated(pawtab%tphi)) then
2518      LIBPAW_DEALLOCATE(pawtab%tphi)
2519    end if
2520    if (siz_tphi>0) then
2521      LIBPAW_ALLOCATE(pawtab%tphi,(pawtab%partialwave_mesh_size,pawtab%basis_size))
2522      pawtab%tphi=reshape(list_dpr(ii:ii+siz_tphi-1),(/pawtab%partialwave_mesh_size,pawtab%basis_size/))
2523      ii=ii+siz_tphi
2524    end if
2525    if (allocated(pawtab%tproj)) then
2526      LIBPAW_DEALLOCATE(pawtab%tproj)
2527    end if
2528    if (siz_tproj>0) then
2529      sz1=siz_tproj/pawtab%basis_size
2530      LIBPAW_ALLOCATE(pawtab%tproj,(sz1,pawtab%basis_size))
2531      pawtab%tproj=reshape(list_dpr(ii:ii+siz_tproj-1),(/sz1,pawtab%basis_size/))
2532      ii=ii+siz_tproj
2533    end if
2534    if (allocated(pawtab%tvalespl)) then
2535      LIBPAW_DEALLOCATE(pawtab%tvalespl)
2536    end if
2537    if (siz_tvalespl>0) then
2538      sz1=siz_tvalespl/2
2539      LIBPAW_ALLOCATE(pawtab%tvalespl,(sz1,2))
2540      pawtab%tvalespl=reshape(list_dpr(ii:ii+siz_tvalespl-1),(/sz1,2/))
2541      ii=ii+siz_tvalespl
2542    end if
2543    if (allocated(pawtab%vhtnzc)) then
2544      LIBPAW_DEALLOCATE(pawtab%vhtnzc)
2545    end if
2546    if (siz_vhtnzc>0) then
2547      LIBPAW_ALLOCATE(pawtab%vhtnzc,(pawtab%mesh_size))
2548      pawtab%vhtnzc=list_dpr(ii:ii+pawtab%mesh_size-1)
2549      ii=ii+siz_vhtnzc
2550    end if
2551    if (allocated(pawtab%vhnzc)) then
2552      LIBPAW_DEALLOCATE(pawtab%vhnzc)
2553    end if
2554    if (siz_vhnzc>0) then
2555      LIBPAW_ALLOCATE(pawtab%vhnzc,(pawtab%mesh_size))
2556      pawtab%vhnzc=list_dpr(ii:ii+pawtab%mesh_size-1)
2557      ii=ii+siz_vhnzc
2558    end if
2559    if (allocated(pawtab%vminushalf)) then
2560      LIBPAW_DEALLOCATE(pawtab%vminushalf)
2561    end if
2562    if (siz_vminushalf>0) then
2563      LIBPAW_ALLOCATE(pawtab%vminushalf,(pawtab%mesh_size))
2564      pawtab%vminushalf=list_dpr(ii:ii+pawtab%mesh_size-1)
2565      ii=ii+siz_vminushalf
2566    end if
2567 !Reals in datastructures (read from psp file)
2568    if (siz_wvlpaw==1) then
2569      if (allocated(pawtab%wvl%parg)) then
2570        LIBPAW_DEALLOCATE(pawtab%wvl%parg)
2571      end if
2572      if (siz_wvl_parg>0) then
2573        LIBPAW_ALLOCATE(pawtab%wvl%parg,(2,pawtab%wvl%ptotgau))
2574        pawtab%wvl%parg=reshape(list_dpr(ii:ii+siz_wvl_parg-1),(/2,pawtab%wvl%ptotgau/))
2575        ii=ii+siz_wvl_parg
2576      end if
2577      if (allocated(pawtab%wvl%pfac)) then
2578        LIBPAW_DEALLOCATE(pawtab%wvl%pfac)
2579      end if
2580      if (siz_wvl_pfac>0) then
2581        LIBPAW_ALLOCATE(pawtab%wvl%pfac,(2,pawtab%wvl%ptotgau))
2582        pawtab%wvl%pfac=reshape(list_dpr(ii:ii+siz_wvl_pfac-1),(/2,pawtab%wvl%ptotgau/))
2583        ii=ii+siz_wvl_pfac
2584      end if
2585      if (allocated(pawtab%wvl%rholoc%rad)) then
2586         LIBPAW_DEALLOCATE(pawtab%wvl%rholoc%rad)
2587      end if
2588      if (siz_wvl_rholoc_rad>0) then
2589         sz1=pawtab%wvl%rholoc%msz
2590         LIBPAW_ALLOCATE(pawtab%wvl%rholoc%rad,(sz1))
2591         pawtab%wvl%rholoc%rad=list_dpr(ii:ii+sz1-1)
2592         ii=ii+siz_wvl_rholoc_rad
2593      end if
2594      if (allocated(pawtab%wvl%rholoc%d)) then
2595         LIBPAW_DEALLOCATE(pawtab%wvl%rholoc%d)
2596      end if
2597      if (siz_wvl_rholoc_d>0) then
2598         sz1=pawtab%wvl%rholoc%msz
2599         LIBPAW_ALLOCATE(pawtab%wvl%rholoc%d,(sz1,4))
2600         pawtab%wvl%rholoc%d=reshape(list_dpr(ii:ii+siz_wvl_rholoc_d-1),(/sz1,4/))
2601         ii=ii+siz_wvl_rholoc_d
2602      end if
2603    end if
2604 
2605 !Then the data initialized later
2606 !...................................
2607    if (full_broadcast) then
2608 
2609 !Reals
2610      pawtab%exchmix=list_dpr(ii)  ;ii=ii+1
2611      pawtab%f4of2_sla=list_dpr(ii)  ;ii=ii+1
2612      pawtab%f6of2_sla=list_dpr(ii)  ;ii=ii+1
2613      pawtab%jpawu=list_dpr(ii)  ;ii=ii+1
2614      pawtab%upawu=list_dpr(ii)  ;ii=ii+1
2615 !Reals arrays
2616      if (allocated(pawtab%dltij)) then
2617        LIBPAW_DEALLOCATE(pawtab%dltij)
2618      end if
2619      if (siz_dltij>0) then
2620        LIBPAW_ALLOCATE(pawtab%dltij,(pawtab%lmn2_size))
2621        pawtab%dltij=list_dpr(ii:ii+pawtab%lmn2_size-1)
2622        ii=ii+siz_dltij
2623      end if
2624      if (allocated(pawtab%dshpfunc)) then
2625        LIBPAW_DEALLOCATE(pawtab%dshpfunc)
2626      end if
2627      if (siz_dshpfunc>0) then
2628        LIBPAW_ALLOCATE(pawtab%dshpfunc,(pawtab%mesh_size,pawtab%l_size,4))
2629        pawtab%dshpfunc=reshape(list_dpr(ii:ii+siz_dshpfunc-1),(/pawtab%mesh_size,pawtab%l_size,4/))
2630        ii=ii+siz_dshpfunc
2631      end if
2632      if (allocated(pawtab%eijkl)) then
2633        LIBPAW_DEALLOCATE(pawtab%eijkl)
2634      end if
2635      if (siz_eijkl>0) then
2636        LIBPAW_ALLOCATE(pawtab%eijkl,(pawtab%lmn2_size,pawtab%lmn2_size))
2637        pawtab%eijkl=reshape(list_dpr(ii:ii+siz_eijkl-1),(/pawtab%lmn2_size,pawtab%lmn2_size/))
2638        ii=ii+siz_eijkl
2639      end if
2640      if (allocated(pawtab%eijkl_sr)) then
2641        LIBPAW_DEALLOCATE(pawtab%eijkl_sr)
2642      end if
2643      if (siz_eijkl_sr>0) then
2644        LIBPAW_ALLOCATE(pawtab%eijkl_sr,(pawtab%lmn2_size,pawtab%lmn2_size))
2645        pawtab%eijkl_sr=reshape(list_dpr(ii:ii+siz_eijkl_sr-1),(/pawtab%lmn2_size,pawtab%lmn2_size/))
2646        ii=ii+siz_eijkl_sr
2647      end if
2648      if (allocated(pawtab%euijkl)) then
2649        LIBPAW_DEALLOCATE(pawtab%euijkl)
2650      end if
2651      if (siz_euijkl>0) then
2652        LIBPAW_ALLOCATE(pawtab%euijkl,(2,2,pawtab%lmn_size,pawtab%lmn_size,pawtab%lmn_size,pawtab%lmn_size))
2653        pawtab%euijkl=reshape(list_dpr(ii:ii+siz_euijkl-1),(/2,2,pawtab%lmn_size,pawtab%lmn_size,pawtab%lmn_size,pawtab%lmn_size/))
2654        ii=ii+siz_euijkl
2655      end if
2656      if (allocated(pawtab%euij_fll)) then
2657        LIBPAW_DEALLOCATE(pawtab%euij_fll)
2658      end if
2659      if (siz_euij_fll>0) then
2660        LIBPAW_ALLOCATE(pawtab%euij_fll,(pawtab%lmn2_size))
2661        pawtab%euij_fll=reshape(list_dpr(ii:ii+siz_euij_fll-1),(/pawtab%lmn2_size/))
2662        ii=ii+siz_euij_fll
2663      end if
2664      if (allocated(pawtab%fk)) then
2665        LIBPAW_DEALLOCATE(pawtab%fk)
2666      end if
2667      if (siz_fk>0) then
2668        LIBPAW_ALLOCATE(pawtab%fk,(6,4))
2669        pawtab%fk=reshape(list_dpr(ii:ii+siz_fk-1),(/6,4/))
2670        ii=ii+siz_fk
2671      end if
2672      if (allocated(pawtab%gammaij)) then
2673        LIBPAW_DEALLOCATE(pawtab%gammaij)
2674      end if
2675      if (siz_gammaij>0) then
2676        LIBPAW_ALLOCATE(pawtab%gammaij,(pawtab%l_size))
2677        pawtab%gammaij=list_dpr(ii:ii+pawtab%l_size-1)
2678        ii=ii+siz_gammaij
2679      end if
2680      if (allocated(pawtab%gnorm)) then
2681        LIBPAW_DEALLOCATE(pawtab%gnorm)
2682      end if
2683      if (siz_gnorm>0) then
2684        LIBPAW_ALLOCATE(pawtab%gnorm,(pawtab%l_size))
2685        pawtab%gnorm=list_dpr(ii:ii+pawtab%l_size-1)
2686        ii=ii+siz_gnorm
2687      end if
2688      if (allocated(pawtab%nabla_ij)) then
2689        LIBPAW_DEALLOCATE(pawtab%nabla_ij)
2690      end if
2691      if (siz_nabla_ij>0) then
2692        LIBPAW_ALLOCATE(pawtab%nabla_ij,(3,pawtab%lmn_size,pawtab%lmn_size))
2693        pawtab%nabla_ij=reshape(list_dpr(ii:ii+siz_nabla_ij-1),(/3,pawtab%lmn_size,pawtab%lmn_size/))
2694        ii=ii+siz_nabla_ij
2695      end if
2696      if (allocated(pawtab%phiphj)) then
2697        LIBPAW_DEALLOCATE(pawtab%phiphj)
2698      end if
2699      if (siz_phiphj>0) then
2700        LIBPAW_ALLOCATE(pawtab%phiphj,(pawtab%mesh_size,pawtab%ij_size))
2701        pawtab%phiphj=reshape(list_dpr(ii:ii+siz_phiphj-1),(/pawtab%mesh_size,pawtab%ij_size/))
2702        ii=ii+siz_phiphj
2703      end if
2704      if (allocated(pawtab%phiphjint)) then
2705        LIBPAW_DEALLOCATE(pawtab%phiphjint)
2706      end if
2707      if (siz_phiphjint>0) then
2708        LIBPAW_ALLOCATE(pawtab%phiphjint,(pawtab%ij_proj))
2709        pawtab%phiphjint=list_dpr(ii:ii+pawtab%ij_proj-1)
2710        ii=ii+siz_phiphjint
2711      end if
2712      if (allocated(pawtab%ph0phiint)) then
2713        LIBPAW_DEALLOCATE(pawtab%ph0phiint)
2714      end if
2715      if (siz_ph0phiint>0) then
2716        LIBPAW_ALLOCATE(pawtab%ph0phiint,(pawtab%ij_proj))
2717        pawtab%ph0phiint=list_dpr(ii:ii+pawtab%ij_proj-1)
2718        ii=ii+siz_ph0phiint
2719      end if
2720      if (allocated(pawtab%qgrid_shp)) then
2721        LIBPAW_DEALLOCATE(pawtab%qgrid_shp)
2722      end if
2723      if (siz_qgrid_shp>0) then
2724        LIBPAW_ALLOCATE(pawtab%qgrid_shp,(pawtab%mqgrid_shp))
2725        pawtab%qgrid_shp=list_dpr(ii:ii+pawtab%mqgrid_shp-1)
2726        ii=ii+siz_qgrid_shp
2727      end if
2728      if (allocated(pawtab%qijl)) then
2729        LIBPAW_DEALLOCATE(pawtab%qijl)
2730      end if
2731      if (siz_qijl>0) then
2732        LIBPAW_ALLOCATE(pawtab%qijl,(pawtab%l_size**2,pawtab%lmn2_size))
2733        pawtab%qijl=reshape(list_dpr(ii:ii+siz_qijl-1),(/pawtab%l_size**2,pawtab%lmn2_size/))
2734        ii=ii+siz_qijl
2735      end if
2736      if (allocated(pawtab%rad_for_spline)) then
2737        LIBPAW_DEALLOCATE(pawtab%rad_for_spline)
2738      end if
2739      if (siz_rad_for_spline>0) then
2740        LIBPAW_ALLOCATE(pawtab%rad_for_spline,(pawtab%mesh_size))
2741        pawtab%rad_for_spline=list_dpr(ii:ii+pawtab%mesh_size-1)
2742        ii=ii+siz_rad_for_spline
2743      end if
2744      if (allocated(pawtab%shapefncg)) then
2745        LIBPAW_DEALLOCATE(pawtab%shapefncg)
2746      end if
2747      if (siz_shapefncg>0) then
2748        LIBPAW_ALLOCATE(pawtab%shapefncg,(pawtab%mqgrid_shp,2,pawtab%l_size))
2749        pawtab%shapefncg=reshape(list_dpr(ii:ii+siz_shapefncg-1),(/pawtab%mqgrid_shp,2,pawtab%l_size/))
2750        ii=ii+siz_shapefncg
2751      end if
2752      if (allocated(pawtab%sij)) then
2753        LIBPAW_DEALLOCATE(pawtab%sij)
2754      end if
2755      if (siz_sij>0) then
2756        LIBPAW_ALLOCATE(pawtab%sij,(pawtab%lmn2_size))
2757        pawtab%sij=list_dpr(ii:ii+pawtab%lmn2_size-1)
2758        ii=ii+siz_sij
2759      end if
2760      if (allocated(pawtab%tphitphj)) then
2761        LIBPAW_DEALLOCATE(pawtab%tphitphj)
2762      end if
2763      if (siz_tphitphj>0) then
2764        LIBPAW_ALLOCATE(pawtab%tphitphj,(pawtab%mesh_size,pawtab%ij_size))
2765        pawtab%tphitphj=reshape(list_dpr(ii:ii+siz_tphitphj-1),(/pawtab%mesh_size,pawtab%ij_size/))
2766        ii=ii+siz_tphitphj
2767      end if
2768      if (allocated(pawtab%vee)) then
2769        LIBPAW_DEALLOCATE(pawtab%vee)
2770      end if
2771      if (siz_vee>0) then
2772        sz1=2*pawtab%lpawu+1
2773        LIBPAW_ALLOCATE(pawtab%vee,(sz1,sz1,sz1,sz1))
2774        pawtab%vee=reshape(list_dpr(ii:ii+siz_vee-1),(/sz1,sz1,sz1,sz1/))
2775        ii=ii+siz_vee
2776      end if
2777      if (allocated(pawtab%vex)) then
2778        LIBPAW_DEALLOCATE(pawtab%vex)
2779      end if
2780      if (siz_vex>0) then
2781        sz1=2*pawtab%lexexch+1
2782        LIBPAW_ALLOCATE(pawtab%vex,(sz1,sz1,sz1,sz1,4))
2783        pawtab%vex=reshape(list_dpr(ii:ii+siz_vex-1),(/sz1,sz1,sz1,sz1,4/))
2784        ii=ii+siz_vex
2785      end if
2786      if (allocated(pawtab%zioneff)) then
2787        LIBPAW_DEALLOCATE(pawtab%zioneff)
2788      end if
2789      if (siz_zioneff>0) then
2790        LIBPAW_ALLOCATE(pawtab%zioneff,(pawtab%ij_proj))
2791        pawtab%zioneff=list_dpr(ii:ii+pawtab%ij_proj-1)
2792        ii=ii+siz_zioneff
2793      end if
2794 
2795    end if ! full_broadcast
2796    ii=ii-1
2797 
2798    if (ii/=nn_dpr+nn_dpr_arr) then
2799      msg='the number of broadcasted reals is not correct!'
2800      MSG_BUG(msg)
2801    end if
2802 
2803  end if ! me/=0
2804  LIBPAW_DEALLOCATE(list_dpr)
2805 
2806 end subroutine pawtab_bcast

m_pawtab/pawtab_free_0D [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

  pawtab_free_0D

FUNCTION

  Deallocate pointers and nullify flags in a pawtab structure

SIDE EFFECTS

  Pawtab<type(pawtab_type)>=PAW arrays tabulated.
  All allocated arrays in Pawtab are deallocated

PARENTS

      m_pawtab

CHILDREN

SOURCE

737 subroutine pawtab_free_0D(Pawtab)
738 
739 
740 !This section has been created automatically by the script Abilint (TD).
741 !Do not modify the following lines by hand.
742 #undef ABI_FUNC
743 #define ABI_FUNC 'pawtab_free_0D'
744 !End of the abilint section
745 
746  implicit none
747 
748 !Arguments ------------------------------------
749 !arrays
750  type(Pawtab_type),intent(inout) :: Pawtab
751 
752 !Local variables-------------------------------
753 
754 ! *************************************************************************
755 
756  !@Pawtab_type
757 
758  if (allocated(Pawtab%indklmn))  then
759   LIBPAW_DEALLOCATE(Pawtab%indklmn)
760  end if
761  if (allocated(Pawtab%indlmn))  then
762   LIBPAW_DEALLOCATE(Pawtab%indlmn)
763  end if
764  if (allocated(Pawtab%klmntomn))  then
765    LIBPAW_DEALLOCATE(Pawtab%klmntomn)
766  end if
767  if (allocated(Pawtab%kmix))  then
768    LIBPAW_DEALLOCATE(Pawtab%kmix)
769  end if
770  if (allocated(Pawtab%lnproju))  then
771    LIBPAW_DEALLOCATE(Pawtab%lnproju)
772  end if
773  if (allocated(Pawtab%coredens))  then
774    LIBPAW_DEALLOCATE(Pawtab%coredens)
775  end if
776  if (allocated(Pawtab%dij0))  then
777    LIBPAW_DEALLOCATE(Pawtab%dij0)
778  end if
779  if (allocated(Pawtab%dltij))  then
780    LIBPAW_DEALLOCATE(Pawtab%dltij)
781  end if
782  if (allocated(Pawtab%dshpfunc))  then
783    LIBPAW_DEALLOCATE(Pawtab%dshpfunc)
784  end if
785  if (allocated(Pawtab%eijkl))  then
786    LIBPAW_DEALLOCATE(Pawtab%eijkl)
787  end if
788  if (allocated(Pawtab%eijkl_sr))  then
789    LIBPAW_DEALLOCATE(Pawtab%eijkl_sr)
790  end if
791  if (allocated(Pawtab%euijkl))  then
792    LIBPAW_DEALLOCATE(Pawtab%euijkl)
793  end if
794  if (allocated(Pawtab%euij_fll))  then
795    LIBPAW_DEALLOCATE(Pawtab%euij_fll)
796  end if
797  if (allocated(Pawtab%fk))  then
798    LIBPAW_DEALLOCATE(Pawtab%fk)
799  end if
800  if (allocated(Pawtab%gammaij))  then
801    LIBPAW_DEALLOCATE(Pawtab%gammaij)
802  end if
803  if (allocated(Pawtab%gnorm))  then
804    LIBPAW_DEALLOCATE(Pawtab%gnorm)
805  end if
806  if (allocated(Pawtab%ex_cvij))  then
807    LIBPAW_DEALLOCATE(Pawtab%ex_cvij)
808  end if
809  if (allocated(Pawtab%kij))  then
810    LIBPAW_DEALLOCATE(Pawtab%kij)
811  end if
812  if (allocated(Pawtab%nabla_ij))  then
813    LIBPAW_DEALLOCATE(Pawtab%nabla_ij)
814  end if
815  if (allocated(Pawtab%orbitals)) then
816    LIBPAW_DEALLOCATE(Pawtab%orbitals)
817  end if
818  if (allocated(Pawtab%phi))  then
819    LIBPAW_DEALLOCATE(Pawtab%phi)
820  end if
821  if (allocated(Pawtab%phiphj))  then
822    LIBPAW_DEALLOCATE(Pawtab%phiphj)
823  end if
824  if (allocated(Pawtab%phiphjint))  then
825    LIBPAW_DEALLOCATE(Pawtab%phiphjint)
826  end if
827  if (allocated(Pawtab%ph0phiint))  then
828    LIBPAW_DEALLOCATE(Pawtab%ph0phiint)
829  end if
830  if (allocated(Pawtab%qgrid_shp))  then
831    LIBPAW_DEALLOCATE(Pawtab%qgrid_shp)
832  end if
833  if (allocated(Pawtab%qijl))  then
834    LIBPAW_DEALLOCATE(Pawtab%qijl)
835  end if
836  if (allocated(Pawtab%rad_for_spline))  then
837    LIBPAW_DEALLOCATE(Pawtab%rad_for_spline)
838  end if
839  if (allocated(Pawtab%rhoij0))  then
840    LIBPAW_DEALLOCATE(Pawtab%rhoij0)
841  end if
842  if (allocated(Pawtab%shape_alpha))  then
843    LIBPAW_DEALLOCATE(Pawtab%shape_alpha)
844  end if
845  if (allocated(Pawtab%shape_q))  then
846    LIBPAW_DEALLOCATE(Pawtab%shape_q)
847  end if
848  if (allocated(Pawtab%shapefunc))  then
849    LIBPAW_DEALLOCATE(Pawtab%shapefunc)
850  end if
851  if (allocated(Pawtab%shapefncg))  then
852    LIBPAW_DEALLOCATE(Pawtab%shapefncg)
853  end if
854  if (allocated(Pawtab%sij))  then
855    LIBPAW_DEALLOCATE(Pawtab%sij)
856  end if
857  if (allocated(Pawtab%tcoredens))  then
858    LIBPAW_DEALLOCATE(Pawtab%tcoredens)
859  end if
860  if (allocated(Pawtab%tcorespl))  then
861    LIBPAW_DEALLOCATE(Pawtab%tcorespl)
862  end if
863  if (allocated(Pawtab%tphi))  then
864    LIBPAW_DEALLOCATE(Pawtab%tphi)
865  end if
866  if (allocated(Pawtab%tphitphj))  then
867    LIBPAW_DEALLOCATE(Pawtab%tphitphj)
868  end if
869  if (allocated(Pawtab%tproj)) then
870    LIBPAW_DEALLOCATE(Pawtab%tproj)
871  end if
872  if (allocated(Pawtab%tvalespl))  then
873    LIBPAW_DEALLOCATE(Pawtab%tvalespl)
874  end if
875  if (allocated(Pawtab%vee))  then
876    LIBPAW_DEALLOCATE(Pawtab%vee)
877  end if
878  if (allocated(Pawtab%Vex))  then
879    LIBPAW_DEALLOCATE(Pawtab%Vex)
880  end if
881  if (allocated(Pawtab%vhtnzc))  then
882    LIBPAW_DEALLOCATE(Pawtab%vhtnzc)
883  end if
884  if (allocated(Pawtab%VHnZC))  then
885    LIBPAW_DEALLOCATE(Pawtab%VHnZC)
886  end if
887  if (allocated(Pawtab%vminushalf))  then
888    LIBPAW_DEALLOCATE(Pawtab%vminushalf)
889  end if
890  if (allocated(Pawtab%zioneff))  then
891    LIBPAW_DEALLOCATE(Pawtab%zioneff)
892  end if
893 
894  call wvlpaw_free(Pawtab%wvl)
895 
896  ! === Reset all flags and sizes ===
897 
898 !CAUTION: do not reset these flags
899 !They are set from input data and must be kept
900 !Pawtab%has_kij=0
901 !Pawtab%has_tproj=0
902 !Pawtab%has_tvale=0
903 !Pawtab%has_vhtnzc=0
904 !Pawtab%has_vhnzc=0
905 !Pawtab%has_vminushalf=0
906 !Pawtab%has_nabla=0
907 !Pawtab%has_shapefncg=0
908 !Pawtab%has_wvl=0
909 
910  Pawtab%usetcore=0
911  Pawtab%usexcnhat=0
912  Pawtab%useexexch=0
913  Pawtab%usepawu=0
914  Pawtab%usepotzero=0
915  Pawtab%usespnorb=0
916  Pawtab%mqgrid=0
917  Pawtab%mqgrid_shp=0
918 
919  Pawtab%basis_size=0
920  Pawtab%ij_proj=0
921  Pawtab%ij_size=0
922  Pawtab%lcut_size=0
923  Pawtab%l_size=0
924  Pawtab%lexexch=-1
925  Pawtab%lmn_size=0
926  Pawtab%lmn2_size=0
927  Pawtab%lmnmix_sz=0
928  Pawtab%lpawu=-1
929  Pawtab%nproju=0
930  Pawtab%mesh_size=0
931  Pawtab%partialwave_mesh_size=0
932  Pawtab%core_mesh_size=0
933  Pawtab%vminus_mesh_size=0
934  Pawtab%tnvale_mesh_size=0
935  Pawtab%shape_type=-10
936 
937 end subroutine pawtab_free_0D

m_pawtab/pawtab_free_1D [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

  pawtab_free_1D

FUNCTION

  Destroy (deallocate) all pointers in an array of pawtab data structures

PARENTS

CHILDREN

SOURCE

955 subroutine pawtab_free_1D(Pawtab)
956 
957 
958 !This section has been created automatically by the script Abilint (TD).
959 !Do not modify the following lines by hand.
960 #undef ABI_FUNC
961 #define ABI_FUNC 'pawtab_free_1D'
962 !End of the abilint section
963 
964  implicit none
965 
966 !Arguments ------------------------------------
967  type(pawtab_type),intent(inout) :: Pawtab(:)
968 
969 !Local variables-------------------------------
970  integer :: ii,nn
971 
972 ! *************************************************************************
973 
974  !@pawtab_type
975 
976  nn=size(Pawtab)
977  if (nn==0) return
978 
979  do ii=1,nn
980    call pawtab_free_0D(Pawtab(ii))
981  end do
982 
983 end subroutine pawtab_free_1D

m_pawtab/pawtab_nullify_0D [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

  pawtab_nullify_0D

FUNCTION

  Nullify pointers and flags in a pawtab structure

SIDE EFFECTS

  Pawtab<type(pawtab_type)>=PAW arrays tabulated.
                            Nullified in output

PARENTS

      m_pawtab

CHILDREN

SOURCE

605 subroutine pawtab_nullify_0D(Pawtab)
606 
607 
608 !This section has been created automatically by the script Abilint (TD).
609 !Do not modify the following lines by hand.
610 #undef ABI_FUNC
611 #define ABI_FUNC 'pawtab_nullify_0D'
612 !End of the abilint section
613 
614  implicit none
615 
616 !Arguments ------------------------------------
617 !arrays
618  type(Pawtab_type),intent(inout) :: Pawtab
619 
620 !Local variables-------------------------------
621 
622 ! *************************************************************************
623 
624  !@Pawtab_type
625  nullify(Pawtab%wvl)
626 
627  ! === Reset all flags and sizes ===
628 
629 !Flags controlling optional arrays
630  Pawtab%has_fock=0
631  Pawtab%has_kij=0
632  Pawtab%has_tproj=0
633  Pawtab%has_tvale=0
634  Pawtab%has_vhtnzc=0
635  Pawtab%has_vhnzc=0
636  Pawtab%has_vminushalf=0
637  Pawtab%has_nabla=0
638  Pawtab%has_shapefncg=0
639  Pawtab%has_wvl=0
640 
641  Pawtab%usetcore=0
642  Pawtab%usexcnhat=0
643  Pawtab%useexexch=0
644  Pawtab%usepawu=0
645  Pawtab%usepotzero=0
646  Pawtab%usespnorb=0
647  Pawtab%mqgrid=0
648  Pawtab%mqgrid_shp=0
649 
650  Pawtab%basis_size=0
651  Pawtab%ij_proj=0
652  Pawtab%ij_size=0
653  Pawtab%lcut_size=0
654  Pawtab%l_size=0
655  Pawtab%lexexch=-1
656  Pawtab%lmn_size=0
657  Pawtab%lmn2_size=0
658  Pawtab%lmnmix_sz=0
659  Pawtab%lpawu=-1
660  Pawtab%nproju=0
661  Pawtab%mesh_size=0
662  Pawtab%partialwave_mesh_size=0
663  Pawtab%core_mesh_size=0
664  Pawtab%vminus_mesh_size=0
665  Pawtab%tnvale_mesh_size=0
666  Pawtab%shape_type=-10
667 
668 end subroutine pawtab_nullify_0D

m_pawtab/pawtab_nullify_1D [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

  pawtab_nullify_1D

FUNCTION

  Nullify all pointers in an array of pawtab data structures

PARENTS

CHILDREN

SOURCE

686 subroutine pawtab_nullify_1D(Pawtab)
687 
688 
689 !This section has been created automatically by the script Abilint (TD).
690 !Do not modify the following lines by hand.
691 #undef ABI_FUNC
692 #define ABI_FUNC 'pawtab_nullify_1D'
693 !End of the abilint section
694 
695  implicit none
696 
697 !Arguments ------------------------------------
698  type(pawtab_type),intent(inout) :: Pawtab(:)
699 
700 !Local variables-------------------------------
701  integer :: ii,nn
702 
703 ! *************************************************************************
704 
705  !@pawtab_type
706 
707  nn=size(Pawtab)
708  if (nn==0) return
709 
710  do ii=1,nn
711    call pawtab_nullify_0D(Pawtab(ii))
712  end do
713 
714 end subroutine pawtab_nullify_1D

m_pawtab/pawtab_print [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

 pawtab_print

FUNCTION

  Print out the content of a pawtab datastructure

INPUTS

  Pawtab<pawtab_type> Only for PAW, TABulated data initialized at start

OUTPUT

  Only writing

PARENTS

      bethe_salpeter,screening,sigma,wfk_analyze

CHILDREN

SOURCE

1134 subroutine pawtab_print(Pawtab,header,unit,prtvol,mode_paral)
1135 
1136 
1137 !This section has been created automatically by the script Abilint (TD).
1138 !Do not modify the following lines by hand.
1139 #undef ABI_FUNC
1140 #define ABI_FUNC 'pawtab_print'
1141 !End of the abilint section
1142 
1143  implicit none
1144 
1145 !Arguments ------------------------------------
1146 !scalars
1147  integer,optional,intent(in) :: unit,prtvol
1148  character(len=4),optional,intent(in) :: mode_paral
1149  character(len=*),optional,intent(in) :: header
1150 !arrays
1151  type(Pawtab_type) :: Pawtab(:)
1152 
1153 !Local variables-------------------------------
1154 !scalars
1155  integer :: ityp,ntypat,my_unt,my_prtvol
1156  character(len=4) :: my_mode
1157  character(len=500) :: msg
1158 
1159 ! *************************************************************************
1160 
1161  my_unt   =ab_out ; if (PRESENT(unit      )) my_unt   =unit
1162  my_prtvol=0      ; if (PRESENT(prtvol    )) my_prtvol=prtvol
1163  my_mode  ='COLL' ; if (PRESENT(mode_paral)) my_mode  =mode_paral
1164 
1165  write(msg,'(6a)')&
1166 &  ' ==================================== ',ch10,&
1167 &  ' ==== Info on PAW TABulated data ==== ',ch10,&
1168 &  ' ==================================== ',ch10
1169  if (PRESENT(header)) msg=' ==== '//TRIM(ADJUSTL(header))//' ==== '
1170  call wrtout(my_unt,msg,my_mode)
1171 
1172  ntypat=SIZE(Pawtab(:))
1173 
1174  do ityp=1,ntypat
1175 
1176   ! Print out integer values (dimensions)
1177   write(msg,'(a)')'                                 '
1178   call wrtout(my_unt,msg,my_mode)
1179   write(msg,'(a)')'  ****************************** '
1180   call wrtout(my_unt,msg,my_mode)
1181   write(msg,'(a,i4,a)')'  **** Atom type ',ityp,' ****   '
1182   call wrtout(my_unt,msg,my_mode)
1183   write(msg,'(a)')'  ****************************** '
1184   call wrtout(my_unt,msg,my_mode)
1185   write(msg,'(a,i4)')'  Number of (n,l) elements ....................... ',Pawtab(ityp)%basis_size
1186   call wrtout(my_unt,msg,my_mode)
1187   write(msg,'(a,i4)')'  Number of (l,m,n) elements ..................... ',Pawtab(ityp)%lmn_size
1188   call wrtout(my_unt,msg,my_mode)
1189   write(msg,'(a,i4)')'  Number of (i,j) elements (packed form) ......... ',Pawtab(ityp)%ij_size
1190   call wrtout(my_unt,msg,my_mode)
1191   write(msg,'(a,i4)')'  Max L+1 leading to non-zero Gaunt .............. ',Pawtab(ityp)%l_size
1192   call wrtout(my_unt,msg,my_mode)
1193   write(msg,'(a,i4)')'  Max L+1 leading to non-zero Gaunt (pawlcutd) ... ',Pawtab(ityp)%lcut_size
1194   call wrtout(my_unt,msg,my_mode)
1195   write(msg,'(a,i4)')'  lmn2_size ...................................... ',Pawtab(ityp)%lmn2_size
1196   call wrtout(my_unt,msg,my_mode)
1197   write(msg,'(a,i4)')'  lmnmix_sz ...................................... ',Pawtab(ityp)%lmnmix_sz
1198   call wrtout(my_unt,msg,my_mode)
1199   write(msg,'(a,i4)')'  Size of radial mesh ............................ ',Pawtab(ityp)%mesh_size
1200   call wrtout(my_unt,msg,my_mode)
1201   write(msg,'(a,i4)')'  Size of radial mesh for partial waves........... ',Pawtab(ityp)%partialwave_mesh_size
1202   call wrtout(my_unt,msg,my_mode)
1203   write(msg,'(a,i4)')'  Size of radial mesh for [pseudo] core density... ',Pawtab(ityp)%core_mesh_size
1204   call wrtout(my_unt,msg,my_mode)
1205   write(msg,'(a,i4)')'  Size of radial mesh for pseudo valence density.. ',Pawtab(ityp)%tnvale_mesh_size
1206   call wrtout(my_unt,msg,my_mode)
1207   write(msg,'(a,i4)')'  No of Q-points for tcorespl and tvalespl ....... ',Pawtab(ityp)%mqgrid
1208   call wrtout(my_unt,msg,my_mode)
1209   write(msg,'(a,i4)')'  No of Q-points for the radial shape functions .. ',Pawtab(ityp)%mqgrid_shp
1210   call wrtout(my_unt,msg,my_mode)
1211   write(msg,'(a,i4)')'  Radial shape function type ..................... ',Pawtab(ityp)%shape_type
1212   call wrtout(my_unt,msg,my_mode)
1213   write(msg,'(a,i4)')'  shape_lambda ................................... ',Pawtab(ityp)%shape_lambda
1214   call wrtout(my_unt,msg,my_mode)
1215   write(msg,'(a,i4)')'  Use pseudized core density ..................... ',Pawtab(ityp)%usetcore
1216   call wrtout(my_unt,msg,my_mode)
1217   write(msg,'(a,i4)')'  Option for the use of hat density in XC terms .. ',Pawtab(ityp)%usexcnhat
1218   call wrtout(my_unt,msg,my_mode)
1219   write(msg,'(a,i4)')'  Use LDA+U ...................................... ',Pawtab(ityp)%usepawu
1220   call wrtout(my_unt,msg,my_mode)
1221   if (Pawtab(ityp)%usepawu/=0) then
1222     write(msg,'(a,i4)')'  L on which U is applied ........................ ',Pawtab(ityp)%lpawu
1223     call wrtout(my_unt,msg,my_mode)
1224   end if
1225   write(msg,'(a,i4)')'  Use Local Exact exchange ....................... ',Pawtab(ityp)%useexexch
1226   call wrtout(my_unt,msg,my_mode)
1227   if (Pawtab(ityp)%useexexch/=0) then
1228     write(msg,'(a,i4)')'  L on which local exact-exchange is applied ..... ',Pawtab(ityp)%lexexch
1229     call wrtout(my_unt,msg,my_mode)
1230   end if
1231   if (Pawtab(ityp)%usepawu/=0.or.Pawtab(ityp)%useexexch/=0) then
1232     write(msg,'(a,i4)')'  Number of (i,j) elements for PAW+U or EXX ..... ',Pawtab(ityp)%ij_proj
1233     call wrtout(my_unt,msg,my_mode)
1234     write(msg,'(a,i4)')'  Number of projectors on which U or EXX acts .... ',Pawtab(ityp)%nproju
1235     call wrtout(my_unt,msg,my_mode)
1236   end if
1237   write(msg,'(a,i4)')'  Use potential zero ............................. ',Pawtab(ityp)%usepotzero
1238   call wrtout(my_unt,msg,my_mode)
1239   write(msg,'(a,i4)')'  Use spin-orbit coupling ........................ ',Pawtab(ityp)%usespnorb
1240   call wrtout(my_unt,msg,my_mode)
1241 
1242   ! "Has" flags
1243   if (Pawtab(ityp)%has_fock/=0) then
1244     write(msg,'(a,i4)')'  Has Fock   ..................................... ',Pawtab(ityp)%has_fock
1245     call wrtout(my_unt,msg,my_mode)
1246   end if
1247   write(msg,'(a,i4)')'  Has kij   ...................................... ',Pawtab(ityp)%has_kij
1248   call wrtout(my_unt,msg,my_mode)
1249   write(msg,'(a,i4)')'  Has tproj ...................................... ',Pawtab(ityp)%has_tproj
1250   call wrtout(my_unt,msg,my_mode)
1251   write(msg,'(a,i4)')'  Has tvale ...................................... ',Pawtab(ityp)%has_tvale
1252   call wrtout(my_unt,msg,my_mode)
1253   write(msg,'(a,i4)')'  Has vhtnzc ..................................... ',Pawtab(ityp)%has_vhtnzc
1254   call wrtout(my_unt,msg,my_mode)
1255   write(msg,'(a,i4)')'  Has vhnzc ...................................... ',Pawtab(ityp)%has_vhnzc
1256   call wrtout(my_unt,msg,my_mode)
1257   write(msg,'(a,i4)')'  Has vminushalf ................................. ',Pawtab(ityp)%has_vminushalf
1258   call wrtout(my_unt,msg,my_mode)
1259   write(msg,'(a,i4)')'  Has nabla ...................................... ',Pawtab(ityp)%has_nabla
1260   call wrtout(my_unt,msg,my_mode)
1261   write(msg,'(a,i4)')'  Has shapefuncg ................................. ',Pawtab(ityp)%has_shapefncg
1262   call wrtout(my_unt,msg,my_mode)
1263   write(msg,'(a,i4)')'  Has wvl ........................................ ',Pawtab(ityp)%has_wvl
1264   call wrtout(my_unt,msg,my_mode)
1265   !
1266   ! Real scalars
1267   write(msg,'(a,es16.8)')'  beta ............................................',Pawtab(ityp)%beta
1268   call wrtout(my_unt,msg,my_mode)
1269   write(msg,'(a,es16.8)')'  1/q d(tNcore(q))/dq for q=0 .....................',Pawtab(ityp)%dncdq0
1270   call wrtout(my_unt,msg,my_mode)
1271   write(msg,'(a,es16.8)')'  d^2(tNcore(q))/dq^2 for q=0 .....................',Pawtab(ityp)%d2ncdq0
1272   call wrtout(my_unt,msg,my_mode)
1273   write(msg,'(a,es16.8)')'  1/q d(tNvale(q))/dq for q=0 .....................',Pawtab(ityp)%dnvdq0
1274   call wrtout(my_unt,msg,my_mode)
1275   if (Pawtab(ityp)%has_fock/=0) then
1276     write(msg,'(a,es16.8)')'  Core-core Fock energy  ..........................',Pawtab(ityp)%ex_cc
1277     call wrtout(my_unt,msg,my_mode)
1278   end if
1279   write(msg,'(a,es16.8)')'  XC energy for the core density ..................',Pawtab(ityp)%exccore
1280   call wrtout(my_unt,msg,my_mode)
1281   write(msg,'(a,es16.8)')'  Radius of the PAW sphere ........................',Pawtab(ityp)%rpaw
1282   call wrtout(my_unt,msg,my_mode)
1283   write(msg,'(a,es16.8)')'  Compensation charge radius (if >rshp, g(r)=0) ...',Pawtab(ityp)%rshp !(if r>rshp, g(r)=zero)
1284   call wrtout(my_unt,msg,my_mode)
1285   if (Pawtab(ityp)%shape_type==2) then
1286    write(msg,'(a,es16.8)')'  Sigma parameter in gaussian shape function ......',Pawtab(ityp)%shape_sigma !(shape_type=2)
1287    call wrtout(my_unt,msg,my_mode)
1288   end if
1289   if (Pawtab(ityp)%usepawu/=0) then
1290    write(msg,'(a,es16.8)')'  Value of the U parameter [eV] ...................',Pawtab(ityp)%upawu*Ha_eV
1291    call wrtout(my_unt,msg,my_mode)
1292    write(msg,'(a,es16.8)')'  Value of the J parameter [eV] ...................',Pawtab(ityp)%jpawu*Ha_eV
1293    call wrtout(my_unt,msg,my_mode)
1294   end if
1295   if (Pawtab(ityp)%useexexch/=0) then
1296     write(msg,'(a,es16.8)')'  Mixing of exact exchange (PBE0) .................',Pawtab(ityp)%exchmix
1297     call wrtout(my_unt,msg,my_mode)
1298   end if
1299  if (associated(Pawtab(ityp)%wvl)) then
1300    write(msg,'(a,es16.8)')'  WARNING: This Pawtab structure contains WVL data.'
1301    call wrtout(my_unt,msg,my_mode)
1302  end if
1303 
1304  end do ! ityp
1305 
1306  ! The other (huge) arrays are not reported..
1307 
1308 end subroutine pawtab_print

m_pawtab/pawtab_set_flags_0D [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

  pawtab_set_flags_0D

FUNCTION

  Set flags controlling optional arrays in a pawtab datastructure

PARENTS

CHILDREN

SOURCE

1001 subroutine pawtab_set_flags_0D(Pawtab,has_fock,has_kij,has_tproj,has_tvale,has_vhnzc,&
1002 &                              has_vhtnzc,has_nabla,has_shapefncg,has_wvl)
1003 
1004 
1005 !This section has been created automatically by the script Abilint (TD).
1006 !Do not modify the following lines by hand.
1007 #undef ABI_FUNC
1008 #define ABI_FUNC 'pawtab_set_flags_0D'
1009 !End of the abilint section
1010 
1011  implicit none
1012 
1013 !Arguments ------------------------------------
1014  integer,intent(in),optional :: has_fock,has_kij,has_tproj,has_tvale,has_vhnzc,has_vhtnzc
1015  integer,intent(in),optional :: has_nabla,has_shapefncg,has_wvl
1016  type(pawtab_type),intent(inout) :: Pawtab
1017 
1018 !Local variables-------------------------------
1019 
1020 ! *************************************************************************
1021 
1022  !@pawtab_type
1023 
1024  Pawtab%has_fock      =0
1025  Pawtab%has_kij      =0
1026  Pawtab%has_tproj    =0
1027  Pawtab%has_tvale    =0
1028  Pawtab%has_vhnzc    =0
1029  Pawtab%has_vhtnzc   =0
1030  Pawtab%has_nabla    =0
1031  Pawtab%has_shapefncg=0
1032  Pawtab%has_wvl      =0
1033  if (present(has_fock))     Pawtab%has_fock=has_fock
1034  if (present(has_kij))      Pawtab%has_kij=has_kij
1035  if (present(has_tproj))    Pawtab%has_tproj=has_tproj
1036  if (present(has_tvale))    Pawtab%has_tvale=has_tvale
1037  if (present(has_vhnzc))    Pawtab%has_vhnzc=has_vhnzc
1038  if (present(has_vhtnzc))   Pawtab%has_vhtnzc=has_vhtnzc
1039  if (present(has_nabla))    Pawtab%has_nabla=has_nabla
1040  if (present(has_shapefncg))Pawtab%has_shapefncg=has_shapefncg
1041  if (present(has_wvl))      Pawtab%has_wvl=has_wvl
1042 
1043 end subroutine pawtab_set_flags_0D

m_pawtab/pawtab_set_flags_1D [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

  pawtab_set_flags_1D

FUNCTION

  Set flags controlling optional arrays in an array of pawtab datastructures

PARENTS

CHILDREN

SOURCE

1061 subroutine pawtab_set_flags_1D(Pawtab,has_fock,has_kij,has_tproj,has_tvale,has_vhnzc,&
1062 &                              has_vhtnzc,has_nabla,has_shapefncg,has_wvl)
1063 
1064 
1065 !This section has been created automatically by the script Abilint (TD).
1066 !Do not modify the following lines by hand.
1067 #undef ABI_FUNC
1068 #define ABI_FUNC 'pawtab_set_flags_1D'
1069 !End of the abilint section
1070 
1071  implicit none
1072 
1073 !Arguments ------------------------------------
1074  integer,intent(in),optional :: has_fock,has_kij,has_tproj,has_tvale,has_vhnzc,has_vhtnzc
1075  integer,intent(in),optional :: has_nabla,has_shapefncg,has_wvl
1076  type(pawtab_type),intent(inout) :: Pawtab(:)
1077 
1078 !Local variables-------------------------------
1079  integer :: ii,nn
1080 
1081 ! *************************************************************************
1082 
1083  !@pawtab_type
1084 
1085  nn=size(Pawtab)
1086  if (nn==0) return
1087 
1088  do ii=1,nn
1089    Pawtab(ii)%has_fock      =0
1090    Pawtab(ii)%has_kij      =0
1091    Pawtab(ii)%has_tproj    =0
1092    Pawtab(ii)%has_tvale    =0
1093    Pawtab(ii)%has_vhnzc    =0
1094    Pawtab(ii)%has_vhtnzc   =0
1095    Pawtab(ii)%has_nabla    =0
1096    Pawtab(ii)%has_shapefncg=0
1097    Pawtab(ii)%has_wvl          =0
1098    if (present(has_fock))     Pawtab(ii)%has_fock=has_fock
1099    if (present(has_kij))      Pawtab(ii)%has_kij=has_kij
1100    if (present(has_tproj))    Pawtab(ii)%has_tproj=has_tproj
1101    if (present(has_tvale))    Pawtab(ii)%has_tvale=has_tvale
1102    if (present(has_vhnzc))    Pawtab(ii)%has_vhnzc=has_vhnzc
1103    if (present(has_vhtnzc))   Pawtab(ii)%has_vhtnzc=has_vhtnzc
1104    if (present(has_nabla))    Pawtab(ii)%has_nabla=has_nabla
1105    if (present(has_shapefncg))Pawtab(ii)%has_shapefncg=has_shapefncg
1106    if (present(has_wvl))      Pawtab(ii)%has_wvl=has_wvl
1107  end do
1108 
1109 end subroutine pawtab_set_flags_1D

m_pawtab/pawtab_type [ Types ]

[ Top ] [ m_pawtab ] [ Types ]

NAME

 pawtab_type

FUNCTION

 This structured datatype contains TABulated data for PAW (from pseudopotential)
 used in PAW calculations.

SOURCE

130  type,public :: pawtab_type
131 
132 ! WARNING : if you modify this datatype, please check whether there might be creation/destruction/copy routines,
133 ! declared in another part of ABINIT, that might need to take into account your modification.
134 
135 !Integer scalars
136 
137   integer :: basis_size
138    ! Number of elements for the paw nl basis on the considered atom type
139 
140   integer :: has_fock
141    ! if 1, onsite matrix elements of the core-valence Fock operator are allocated
142    ! if 2, onsite matrix elements of the core-valence Fock operator are computed and stored
143 
144   integer :: has_kij
145    ! if 1, onsite matrix elements of the kinetic operator are allocated
146    ! if 2, onsite matrix elements of the kinetic operator are computed and stored
147 
148 
149   integer :: has_shapefncg
150    ! if 1, the spherical Fourier transforms of the radial shape functions are allocated
151    ! if 2, the spherical Fourier transforms of the radial shape functions are computed and stored
152 
153   integer :: has_nabla
154    ! if 1, onsite matrix elements of the nabla operator are allocated.
155    ! if 2, onsite matrix elements of the nabla operator are computed and stored.
156 
157   integer :: has_tproj
158    ! Flag controling use of projectors in real space (0 if tnval is unknown)
159    ! if 1, tproj() is allocated.
160    ! if 2, tproj() is computed and stored.
161 
162   integer :: has_tvale
163    ! Flag controling use of pseudized valence density (0 if tnval is unknown)
164    ! if 1, tvalespl() is allocated.
165    ! if 2, tvalespl() is computed and stored.
166 
167   integer :: has_vhtnzc
168    ! if 1, space for vhtnzc is allocated
169    ! if 2, vhtnzc has been read from PAW file and stored
170 
171   integer :: has_vhnzc
172    ! if 1, space for vhnzc is allocated
173    ! if 2, vhnzc has been computed and stored
174 
175   integer :: has_vminushalf
176    ! has_vminushalf=0 ; vminushal is not allocated
177    ! has_vminushalf=1 ; vminushal is not allocated and stored
178 
179   integer :: has_wvl
180    ! if 1, data for wavelets (pawwvl) are allocated
181    ! if 2, data for wavelets (pawwvl) are computed and stored
182 
183   integer :: ij_proj
184    ! Number of (i,j) elements for the orbitals on which U acts (PAW+U only)
185    ! on the considered atom type (ij_proj=1 (1 projector), 3 (2 projectors)...)
186    ! Also used for local exact-exchange
187 
188   integer :: ij_size
189    ! Number of (i,j) elements for the symetric paw basis
190    ! on the considered atom type (ij_size=basis_size*(basis_size+1)/2)
191 
192   integer :: lcut_size
193    ! Maximum value of l+1 leading to non zero Gaunt coeffs
194    ! modified by dtset%pawlcutd
195    ! lcut_size=min(2*l_max,dtset%pawlcutd)+1
196 
197   integer :: l_size
198    ! Maximum value of l+1 leading to non zero Gaunt coeffs
199    ! l_size=2*l_max-1
200 
201   integer :: lexexch
202    ! lexexch gives l on which local exact-exchange is applied for a given type of atom.
203 
204   integer :: lmn_size
205    ! Number of (l,m,n) elements for the paw basis
206 
207   integer :: lmn2_size
208    ! lmn2_size=lmn_size*(lmn_size+1)/2
209    ! where lmn_size is the number of (l,m,n) elements for the paw basis
210 
211   integer :: lmnmix_sz
212    ! lmnmix_sz=number of klmn=(lmn,lmn_prime) verifying l<=lmix and l_prime<=lmix
213 
214   integer :: lpawu
215    ! lpawu gives l on which U is applied for a given type of atom.
216 
217   integer :: nproju
218    ! nproju is the number of projectors for orbitals on which paw+u acts.
219    ! Also used for local exact-exchange
220 
221   integer :: mesh_size
222    ! Dimension of radial mesh for generic arrays contained in this pawtab datastructure
223    ! The mesh is usually defined up to the PAW augmentation region boundary
224    ! (+ a few additional points). May be different from pawrad%mesh_size
225 
226   integer :: core_mesh_size
227    ! Dimension of radial mesh for core density
228 
229   integer :: vminus_mesh_size
230    ! Dimension of radial mesh for vminushalf
231 
232   integer :: partialwave_mesh_size
233    ! Dimension of radial mesh for partial waves (phi, tphi)
234    ! May be different from pawrad%mesh_size and pawtab%mesh_size
235 
236   integer :: tnvale_mesh_size
237    ! Dimension of radial mesh for tnvale
238 
239   integer :: mqgrid
240    ! Number of points in the reciprocal space grid on which
241    ! the radial functions (tcorespl, tvalespl...) are specified
242    ! Same as psps%mqgrid_vl
243 
244   integer :: mqgrid_shp
245    ! Number of points in the reciprocal space grid on which
246    ! the radial shape functions (shapefncg) are given
247 
248   integer :: usespnorb
249    ! usespnorb=0 ; no spin-orbit coupling
250    ! usespnorb=1 ; spin-orbit coupling
251 
252   integer :: shape_lambda
253    ! Lambda parameter in gaussian shapefunction (shape_type=2)
254 
255   integer :: shape_type
256    ! Radial shape function type
257    ! shape_type=-1 ; g(r)=numeric (read from psp file)
258    ! shape_type= 1 ; g(r)=[sin(pi*r/rshp)/(pi*r/rshp)]**2 if r<=rshp, zero if r>rshp
259    ! shape_type= 2 ; g(r)=exp[-(r/sigma)**lambda]
260    ! shape_type= 3 ; gl(r)=Alpha(1,l)*jl(q(1,l)*r)+Alpha(2,l)*jl(q(2,l)*r) for each l
261 
262   integer :: useexexch
263    ! useexexch=0 ; do not use local exact-exchange
264    ! useexexch=1 ; use local exact-exchange
265 
266   integer :: usepawu
267    ! usepawu=0 ; do not use PAW+U formalism
268    ! usepawu=1 ; use PAW+U formalism (Full localized limit)
269    ! usepawu=2 ; use PAW+U formalism (Around Mean Field)
270 
271   integer :: usepotzero
272    ! usepotzero=0 if it is the Kresse-Joubert convention
273    ! usepotzero=1 if it is the new convention
274    ! usepotzero=2 if it is the PWscf convention
275 
276   integer :: usetcore
277    ! Flag controling use of pseudized core density (0 if tncore=zero)
278 
279   integer :: usexcnhat
280    ! 0 if compensation charge density is not included in XC terms
281    ! 1 if compensation charge density is included in XC terms
282 
283 !Real (real(dp)) scalars
284 
285   real(dp) :: beta
286    ! contains the integral of the difference between vH[nZc] and vH[tnZc]
287 
288   real(dp) :: dncdq0
289    ! Gives 1/q d(tNcore(q))/dq for q=0
290    ! (tNcore(q) = FT of pseudo core density)
291 
292   real(dp) :: d2ncdq0
293    ! Gives contribution of d2(tNcore(q))/d2q for q=0
294    ! \int{(16/15)*pi^5*n(r)*r^6* dr}
295    ! (tNcore(q) = FT of pseudo core density)
296 
297   real(dp) :: dnvdq0
298    ! Gives 1/q d(tNvale(q))/dq for q=0
299    ! (tNvale(q) = FT of pseudo valence density)
300 
301   real(dp) :: ex_cc
302    ! Exchange energy for the core-core interaction of the Fock operator
303 
304   real(dp) :: exccore
305    ! Exchange-correlation energy for the core density
306 
307   real(dp) :: exchmix
308    ! mixing of exact exchange; default is 0.25 (PBE0)
309 
310   real(dp) :: f4of2_sla
311    ! Ratio of Slater Integrals F4 and F2
312 
313   real(dp) :: f6of2_sla
314    ! Ratio of Slater Integrals F6 and F4
315 
316   real(dp) :: jpawu
317    ! jpawu
318    ! Value of J parameter for paw+u for a given type.
319 
320   real(dp) :: rpaw
321    ! Radius of PAW sphere
322 
323   real(dp) :: rshp
324    ! Compensation charge radius (if r>rshp, g(r)=zero)
325 
326   real(dp) :: rcore
327    ! Radius of core corrections (rcore >= rpaw)
328 
329   real(dp) :: shape_sigma
330    ! Sigma parameter in gaussian shapefunction (shape_type=2)
331 
332   real(dp) :: upawu
333    ! upawu
334    ! Value of U parameter for paw+u for a given type.
335 
336 !Objects
337   type(wvlpaw_type), pointer :: wvl
338    !variable containing objects needed
339    !for wvl+paw implementation
340    !Warning: it is a pointer; it has to be allocated before use
341 
342 !Integer arrays
343 
344   integer, allocatable :: indklmn(:,:)
345    ! indklmn(8,lmn2_size)
346    ! Array giving klm, kln, abs(il-jl), (il+jl), ilm and jlm, ilmn and jlmn for each klmn=(ilmn,jlmn)
347    ! Note: ilmn=(il,im,in) and ilmn<=jlmn
348 
349   integer, allocatable :: indlmn(:,:)
350    ! indlmn(6,lmn_size)
351    ! For each type of psp,
352    ! array giving l,m,n,lm,ln,spin for i=lmn (if useylm=1)
353 
354   integer, allocatable :: klmntomn(:,:)
355    ! klmntomn(4,lmn2_size)
356    ! Array giving im, jm ,in, and jn for each klmn=(ilmn,jlmn)
357    ! Note: ilmn=(il,im,in) and ilmn<=jlmn
358    ! NB: klmntomn is an application and not a bijection
359 
360   integer, allocatable :: kmix(:)
361    ! kmix(lmnmix_sz)
362    ! Indirect array selecting the klmn=(lmn,lmn_prime) verifying l<=lmix and l_prime<=lmix
363 
364   integer, allocatable :: lnproju(:)
365    ! lnproju(nproju) gives ln (index for phi) for each projectors on which U acts (PAW+U only)
366    ! nproju is 1 or 2 and  is the number of projectors for correlated orbitals
367    ! Also used for local exact-exchange
368 
369   integer, allocatable :: orbitals(:)
370    ! gives the l quantum number per basis element
371 
372 !Real (real(dp)) arrays
373 
374   real(dp), allocatable :: coredens(:)
375    ! coredens(mesh_size)
376    ! Gives the core density of the atom
377 
378   real(dp), allocatable :: dij0(:)
379    ! dij0(lmn2_size)
380    ! Part of the Dij term (non-local operator) completely
381    ! calculated in the atomic data part
382 
383   real(dp), allocatable :: dltij(:)
384    ! dltij(lmn2_size)
385    ! Factor used to compute sums over klmn=(ilmn,jlmn)
386    ! ((ilmn,ilmn) term has to be added once)
387    ! dltij(klmn)=1 if ilmn=jlmn, else dltij(klmn)=2
388 
389   real(dp), allocatable :: dshpfunc(:,:,:)
390    ! shapefunc(mesh_size,l_size,4)
391    ! Gives the 4 first derivatives of  radial shape function
392    ! for each l component; used only if shape_type=-1
393 
394   real(dp), allocatable :: eijkl(:,:)
395    ! eijkl(lmn2_size,lmn2_size)
396    ! Hartree kernel for the on-site terms (E_hartree=Sum_ijkl[rho_ij rho_kl e_ijkl])
397    ! Used for Hartree and/or Fock contributions
398 
399   real(dp), allocatable :: eijkl_sr(:,:)
400    ! eijkl_sr(lmn2_size,lmn2_size)
401    ! Screened Hartree kernel for the on-site terms (E_hartree=Sum_ijkl[rho_ij rho_kl e_ijkl_sr])
402    ! Used for screened Fock contributions
403 
404   real(dp), allocatable :: euijkl(:,:,:,:,:,:)
405    ! euijkl(2,2,lmn_size,lmn_size,lmn_size,lmn_size)
406    ! PAW+U kernel for the on-site terms ( E_PAW+U = 0.5 * Sum_s1s2 Sum_ijkl [rho_ij^s1 rho_kl^s2 euijkl^s1s2] )
407    ! Contrary to eijkl and eijkl_sr, euijkl is not invariant with respect to the permutations i <--> j or k <--> l
408    ! However, it is still invariant with respect to the permutation i,k <--> j,l, see pawpuxinit.F90
409    ! Also, it depends on two spin indexes
410    ! Used for PAW+U contributions
411 
412   real(dp), allocatable :: euij_fll(:)
413    ! euij_fll(lmn2_size)
414    ! Double counting part of the PAW+U kernel in the "fully localized limit".This term is only linear with respect to rho_ij,
415    ! while euijkl is quadratic.
416    ! Used for PAW+U contributions
417 
418   real(dp), allocatable :: ex_cvij(:)
419   ! ex_cvij(lmn2_size))
420   ! Onsite exact_exchange matrix elements for core-valence interactions of the Fock operator
421 
422   real(dp), allocatable :: fk(:,:)
423    ! fk(6,4)
424    ! Slater integrals used for local exact exchange
425 
426   real(dp), allocatable :: gammaij(:)
427    ! gammaij(lmn2_size)
428    ! background contribution from the densities
429 
430   real(dp), allocatable :: gnorm(:)
431    ! gnorm(l_size)
432    ! Give the the normalization factor of each radial shape function
433 
434   real(dp), allocatable :: kij(:)
435   ! kij(lmn2_size))
436   ! Onsite matrix elements <phi|\kinetic|phj>-<tphi|\kinetic|tphj>
437 
438   real(dp), allocatable :: nabla_ij(:,:,:)
439    ! nabla_ij(3,lmn_size,lmn_size)
440    ! Onsite matrix elements <phi|\nabla|phj>-<tphi|\nabla|tphj>
441 
442   real(dp), allocatable :: phi(:,:)
443    ! phi(partialwave_mesh_size, basis_size)
444    ! Gives the paw electron wavefunctions on the radial grid
445 
446   real(dp), allocatable :: phiphj(:,:)
447    ! phiphj(mesh_size,ij_size)
448    ! Useful product Phi(:,i)*Phi(:,j)
449 
450   real(dp), allocatable :: phiphjint(:)
451    ! phiphjint(ij_proj)
452    ! Integration of Phi(:,i)*Phi(:,j) for LDA+U/local exact-exchange occupation matrix
453 
454   real(dp), allocatable :: ph0phiint(:)
455    ! ph0phjint(ij_proj)
456    ! Integration of Phi(:,1)*Phi(:,j) for LDA+DMFT projections
457 
458   real(dp), allocatable :: qgrid_shp(:)
459    ! qgrid_shp(mqgrid_shp)
460    ! Grid of points in reciprocal space on which the shape functions are given
461 
462   real(dp), allocatable :: qijl(:,:)
463    ! qijl(l_size**2,lmn2_size)
464    ! The qijl are the moments of the charge density difference between
465    ! the AE and PS partial wave for each channel (i,j). They take part
466    ! to the building of the compensation charge
467 
468   real(dp), allocatable :: rad_for_spline(:)
469    ! rad_for_spline(mesh_size)
470    ! Radial mesh used to spline quantities on radial mesh;
471    ! Allocated and used only when
472    !     shape_type=-1 (numerical shape function)
473    !  or usedvloc=1 (use of vloc derivative)
474 
475   real(dp), allocatable :: rhoij0(:)
476    ! rhoij0(lmn2_size)
477    ! Initial guess for rhoij
478 
479   real(dp), allocatable :: shape_alpha(:,:)
480    ! shape_alpha(2,l_size)
481    ! Alpha_i parameters in Bessel shapefunctions (shape_type=3)
482 
483   real(dp), allocatable :: shape_q(:,:)
484    ! shape_q(2,l_size)
485    ! Q_i parameters in Bessel shapefunctions (shape_type=3)
486 
487   real(dp), allocatable :: shapefunc(:,:)
488    ! shapefunc(mesh_size,l_size)
489    ! Gives the normalized radial shape function for each l component
490 
491   real(dp), allocatable :: shapefncg(:,:,:)
492    ! shapefncg(mqgrid_shp,2,l_size)
493    ! Gives the spherical Fourier transform of the radial shape function
494    ! for each l component (for each qgrid_shp(i)) + second derivative
495 
496   real(dp), allocatable :: sij(:)
497    ! sij(lmn2_size)
498    ! Nonlocal part of the overlap operator
499 
500   real(dp), allocatable :: tcoredens(:,:)
501    ! tcoredens(core_mesh_size,1)
502    ! Gives the pseudo core density of the atom
503    ! In PAW+WVL:
504    !  tcoredens(core_mesh_size,2:6)
505    !  are the first to the fifth derivatives of the pseudo core density.
506 
507   real(dp), allocatable :: tcorespl(:,:)
508    ! tcorespl(mqgrid,2)
509    ! Gives the pseudo core density in reciprocal space on a regular grid
510 
511   real(dp), allocatable :: tphi(:,:)
512    ! tphi(partialwave_mesh_size,basis_size)
513    ! Gives, on the radial grid, the paw atomic pseudowavefunctions
514 
515   real(dp), allocatable :: tphitphj(:,:)
516    ! tphitphj(mesh_size,ij_size)
517    ! Useful product tPhi(:,i)*tPhi(:,j)
518 
519   real(dp), allocatable :: tproj(:,:)
520    ! non-local projectors
521 
522   real(dp), allocatable :: tvalespl(:,:)
523    ! tvalespl(mqgrid,2)
524    ! Gives the pseudo valence density in reciprocal space on a regular grid
525 
526   real(dp), allocatable :: Vee(:,:,:,:)
527    ! PAW+U:
528    ! Screened interaction matrix deduced from U and J parameters
529    ! computed on the basis of orbitals on which U acts.
530 
531   real(dp), allocatable :: Vex(:,:,:,:,:)
532    ! Local exact-exchange:
533    ! Screened interaction matrix deduced from calculation of Slater integrals
534    ! computed on the basis of orbitals on which local exact exchange acts.
535 
536   real(dp), allocatable :: vhtnzc(:)
537    ! vhtnzc(mesh_size)
538    ! Hartree potential for pseudized Zc density, v_H[\tilde{n}_{Zc}]
539    ! read in from PAW file
540 
541   real(dp), allocatable :: VHnZC(:)
542    ! VHnZC(mesh_size)
543    ! Hartree potential for Zc density, v_H[n_{Zc}]
544    ! constructed from core density in PAW file (see psp7in.F90)
545 
546   real(dp), allocatable :: vminushalf(:)
547    ! vminushalf(mesh_size)
548    ! External potential for LDA minus half calculation
549    ! read in from PAW file
550 
551   real(dp), allocatable :: zioneff(:)
552    ! zioneff(ij_proj)
553    ! "Effective charge"*n "seen" at r_paw, deduced from Phi at r_paw, n:
554    ! pricipal quantum number
555    ! good approximation to model wave function outside PAW-sphere through
556 
557  end type pawtab_type
558 
559  public :: pawtab_free         ! Free memory
560  public :: pawtab_nullify      ! Nullify content
561  public :: pawtab_get_lsize    ! Get the max. l for a product of 2 partial waves
562  public :: pawtab_set_flags    ! Set the value of the internal flags
563  public :: pawtab_print        ! Printout of the object.
564  public :: pawtab_bcast        ! MPI broadcast the object
565 
566  interface pawtab_nullify
567    module procedure pawtab_nullify_0D
568    module procedure pawtab_nullify_1D
569  end interface pawtab_nullify
570 
571  interface pawtab_free
572    module procedure pawtab_free_0D
573    module procedure pawtab_free_1D
574  end interface pawtab_free
575 
576  interface pawtab_set_flags
577    module procedure pawtab_set_flags_0D
578    module procedure pawtab_set_flags_1D
579  end interface pawtab_set_flags

m_pawtab/wvlpaw_allocate [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

  wvlpaw_allocate

FUNCTION

  Allocate (if necessary) and nullify content of a wvlpaw pointer

SIDE EFFECTS

  wvlpaw<type(wvlpaw_type)>=datastructure to be allocated.

PARENTS

      m_pawpsp,m_pawtab

CHILDREN

SOURCE

2828 subroutine wvlpaw_allocate(wvlpaw)
2829 
2830 
2831 !This section has been created automatically by the script Abilint (TD).
2832 !Do not modify the following lines by hand.
2833 #undef ABI_FUNC
2834 #define ABI_FUNC 'wvlpaw_allocate'
2835 !End of the abilint section
2836 
2837  implicit none
2838 
2839 !Arguments ------------------------------------
2840  type(wvlpaw_type),pointer :: wvlpaw
2841 
2842 ! *************************************************************************
2843 
2844  !@wvlpaw_type
2845 
2846  if (.not.associated(wvlpaw)) then
2847    LIBPAW_DATATYPE_ALLOCATE(wvlpaw,)
2848    call wvlpaw_nullify(wvlpaw)
2849  end if
2850 
2851  wvlpaw%npspcode_init_guess=10
2852 
2853 end subroutine wvlpaw_allocate

m_pawtab/wvlpaw_free [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

  wvlpaw_free

FUNCTION

  Deallocate arrays and nullify flags in a wvlpaw structure

SIDE EFFECTS

  wvlpaw<type(wvlpaw_type)>=datastructure to be destroyed.
  All allocated arrays are deallocated.

PARENTS

      m_pawpsp,m_pawtab

CHILDREN

SOURCE

2876 subroutine wvlpaw_free(wvlpaw)
2877 
2878 
2879 !This section has been created automatically by the script Abilint (TD).
2880 !Do not modify the following lines by hand.
2881 #undef ABI_FUNC
2882 #define ABI_FUNC 'wvlpaw_free'
2883 !End of the abilint section
2884 
2885  implicit none
2886 
2887 !Arguments ------------------------------------
2888  type(wvlpaw_type),pointer :: wvlpaw
2889 
2890 ! *************************************************************************
2891 
2892  !@wvlpaw_type
2893 
2894  if (.not.associated(wvlpaw)) return
2895 
2896  if(allocated(wvlpaw%pngau)) then
2897    LIBPAW_DEALLOCATE(wvlpaw%pngau)
2898  end if
2899  if(allocated(wvlpaw%parg)) then
2900    LIBPAW_DEALLOCATE(wvlpaw%parg)
2901  end if
2902  if(allocated(wvlpaw%pfac)) then
2903    LIBPAW_DEALLOCATE(wvlpaw%pfac)
2904  end if
2905 
2906  wvlpaw%npspcode_init_guess=0
2907  wvlpaw%ptotgau=0
2908 
2909  call wvlpaw_rholoc_free(wvlpaw%rholoc)
2910 
2911  LIBPAW_DATATYPE_DEALLOCATE(wvlpaw)
2912 
2913 end subroutine wvlpaw_free

m_pawtab/wvlpaw_nullify [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

  wvlpaw_nullify

FUNCTION

  Nullify flags in a wvlpaw structure

SIDE EFFECTS

  wvlpaw=datastructure to be nullified

PARENTS

      m_pawtab

CHILDREN

SOURCE

2935 subroutine wvlpaw_nullify(wvlpaw)
2936 
2937 
2938 !This section has been created automatically by the script Abilint (TD).
2939 !Do not modify the following lines by hand.
2940 #undef ABI_FUNC
2941 #define ABI_FUNC 'wvlpaw_nullify'
2942 !End of the abilint section
2943 
2944  implicit none
2945 
2946 !Arguments ------------------------------------
2947  type(wvlpaw_type),pointer :: wvlpaw
2948 
2949 ! *************************************************************************
2950 
2951  !@wvlpaw_type
2952  if (.not.associated(wvlpaw)) return
2953 
2954  wvlpaw%npspcode_init_guess=0
2955  wvlpaw%ptotgau=0
2956 
2957  call wvlpaw_rholoc_nullify(wvlpaw%rholoc)
2958 
2959 end subroutine wvlpaw_nullify

m_pawtab/wvlpaw_rholoc_free [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

  wvlpaw_rholoc_free

FUNCTION

  Deallocate arrays and nullify flags in a wvlpaw%rholoc structure

SIDE EFFECTS

  wvlpaw_rholoc<type(wvlpaw_rholoc_type)>=datastructure to be destroyed.
  All allocated arrays are deallocated.

PARENTS

      m_pawpsp,m_pawtab

CHILDREN

SOURCE

2982 subroutine wvlpaw_rholoc_free(wvlpaw_rholoc)
2983 
2984 
2985 !This section has been created automatically by the script Abilint (TD).
2986 !Do not modify the following lines by hand.
2987 #undef ABI_FUNC
2988 #define ABI_FUNC 'wvlpaw_rholoc_free'
2989 !End of the abilint section
2990 
2991  implicit none
2992 
2993 !Arguments ------------------------------------
2994  type(wvlpaw_rholoc_type),intent(inout) :: wvlpaw_rholoc
2995 
2996 ! *************************************************************************
2997 
2998  !@wvlpaw_rholoc_type
2999 
3000  if(allocated(wvlpaw_rholoc%d)) then
3001    LIBPAW_DEALLOCATE(wvlpaw_rholoc%d)
3002  end if
3003  if(allocated(wvlpaw_rholoc%rad)) then
3004    LIBPAW_DEALLOCATE(wvlpaw_rholoc%rad)
3005  end if
3006 
3007  wvlpaw_rholoc%msz=0
3008 
3009 end subroutine wvlpaw_rholoc_free

m_pawtab/wvlpaw_rholoc_nullify [ Functions ]

[ Top ] [ m_pawtab ] [ Functions ]

NAME

  wvlpaw_rholoc_nullify

FUNCTION

  Nullify flags in a wvlpaw%rholoc structure

SIDE EFFECTS

  wvlpaw_rholoc<type(wvlpaw_rholoc_type)>=datastructure to be nullified.

PARENTS

      m_pawpsp,m_pawtab

CHILDREN

SOURCE

3031 subroutine wvlpaw_rholoc_nullify(wvlpaw_rholoc)
3032 
3033 
3034 !This section has been created automatically by the script Abilint (TD).
3035 !Do not modify the following lines by hand.
3036 #undef ABI_FUNC
3037 #define ABI_FUNC 'wvlpaw_rholoc_nullify'
3038 !End of the abilint section
3039 
3040  implicit none
3041 
3042 !Arguments ------------------------------------
3043  type(wvlpaw_rholoc_type),intent(inout) :: wvlpaw_rholoc
3044 
3045 ! *************************************************************************
3046 
3047  !@wvlpaw_rholoc_type
3048 
3049  wvlpaw_rholoc%msz=0
3050 
3051 end subroutine wvlpaw_rholoc_nullify

m_pawtab/wvlpaw_rholoc_type [ Types ]

[ Top ] [ m_pawtab ] [ Types ]

NAME

 wvlpaw_rholoc_type

FUNCTION

 Objects for WVL+PAW

SOURCE

48  type,public :: wvlpaw_rholoc_type
49 
50   integer :: msz
51 ! mesh size
52 
53   real(dp),allocatable :: d(:,:)
54 ! local rho and derivatives
55 
56   real(dp),allocatable :: rad(:)
57 ! radial mesh
58 
59  end type wvlpaw_rholoc_type
60 
61  public :: wvlpaw_rholoc_free    ! Free memory
62  public :: wvlpaw_rholoc_nullify ! Nullify content

m_pawtab/wvlpaw_type [ Types ]

[ Top ] [ m_pawtab ] [ Types ]

NAME

 wvlpaw_type

FUNCTION

 Objects for WVL+PAW

SOURCE

 76  type,public :: wvlpaw_type
 77 
 78 ! WARNING : if you modify this datatype, please check whether there might be creation/destruction/copy routines,
 79 ! declared in another part of ABINIT, that might need to take into account your modification.
 80 
 81 !Integer scalars
 82 
 83   integer :: npspcode_init_guess
 84    ! This is for the PAW-WVL case, only for the initial guess
 85 
 86   integer :: ptotgau
 87    ! total number of complex gaussians
 88    ! for tproj
 89 
 90   integer,allocatable :: pngau(:)
 91    ! number of complex gaussians per basis element
 92    ! for tproj
 93 
 94 !Real pointers
 95 
 96   real(dp),allocatable :: parg(:,:)
 97    !argument of Gaussians
 98 
 99   real(dp),allocatable :: pfac(:,:)
100    !factors of Gaussians
101 
102 !Other scalars
103 
104   type(wvlpaw_rholoc_type) :: rholoc
105    ! local density
106    !   d(:,1): local rho
107    !   d(:,2): local rho 2nd-derivative
108    !   d(:,3): local pot
109    !   d(:,4): local pot 2nd-derivative
110 
111  end type wvlpaw_type
112 
113  public :: wvlpaw_allocate  ! Allocate memory
114  public :: wvlpaw_free   ! Free memory
115  public :: wvlpaw_nullify

m_pawtap/pawtab_get_lsize [ Functions ]

[ Top ] [ Functions ]

NAME

  pawtab_get_lsize

FUNCTION

  From an array of pawtab datastructures, get, for each atom, the value
  of "l_size" parameter.
  l_size is the maximum value of l accessible by a product of 2 partial waves;
  it may be cut by dtset%pawlcutd parameter

INPUTS

   [mpi_atmtab(:)]=--optional-- indexes of the atoms treated by current proc
   natom= number of atoms (may be a local or absolute number of atoms)
   typat(:)= list of atom types

OUTPUT

   l_size_atm(natom)=output array of l_size values (for each atom)

PARENTS

      bethe_salpeter,classify_bands,d2frnl,denfgr,exc_plot,m_wfd,pawmkaewf
      respfn,scfcv,screening,sigma,wfk_analyze

CHILDREN

NOTES

  This function returns an allocatable integer array which may be allocated
  on the fly.

SOURCE

1343 subroutine pawtab_get_lsize(Pawtab,l_size_atm,natom,typat, &
1344 &                           mpi_atmtab) ! Optional argument
1345 
1346 
1347 !This section has been created automatically by the script Abilint (TD).
1348 !Do not modify the following lines by hand.
1349 #undef ABI_FUNC
1350 #define ABI_FUNC 'pawtab_get_lsize'
1351 !End of the abilint section
1352 
1353  implicit none
1354 
1355 !Arguments ------------------------------------
1356 !scalars
1357  integer,intent(in) :: natom
1358 !arrays
1359  integer,intent(in) :: typat(:)
1360  integer,optional,intent(in) :: mpi_atmtab(:)
1361  integer,allocatable,intent(inout) :: l_size_atm(:)
1362  type(pawtab_type),intent(in) :: pawtab(:)
1363 
1364 !Local variables-------------------------------
1365  integer :: ia,ityp,natom_typat
1366  character(len=100) :: msg
1367 
1368 ! *************************************************************************
1369 
1370  !@pawtab_type
1371 
1372  natom_typat=count(typat>0)
1373  if (size(pawtab)<maxval(typat)) then
1374    msg='error on pawtab size!'
1375    MSG_BUG(msg)
1376  end if
1377 
1378  if (.not.allocated(l_size_atm)) then
1379    LIBPAW_ALLOCATE(l_size_atm,(natom))
1380  else if (size(l_size_atm)/=natom) then
1381    LIBPAW_DEALLOCATE(l_size_atm)
1382    LIBPAW_ALLOCATE(l_size_atm,(natom))
1383  end if
1384 
1385  if (natom==0) return
1386 
1387  if (natom==natom_typat) then
1388 
1389 !First case: sequential mode
1390    do ia=1,natom
1391      ityp=typat(ia)
1392      l_size_atm(ia)=pawtab(ityp)%lcut_size
1393    end do
1394 
1395  else
1396 
1397 !2nd case: parallel mode
1398    if (.not.present(mpi_atmtab)) then
1399      msg='optional args error!'
1400      MSG_BUG(msg)
1401    end if
1402    do ia=1,natom
1403      ityp=typat(mpi_atmtab(ia))
1404      l_size_atm(ia)=pawtab(ityp)%lcut_size
1405    end do
1406 
1407  end if
1408 
1409 end subroutine pawtab_get_lsize