genMTBasis.f90 2.46 KB
Newer Older
1 2 3 4 5
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
6 7 8 9
MODULE m_genMTBasis

CONTAINS

10 11 12 13 14
  SUBROUTINE genMTBasis(atoms,enpara,vTot,mpi,iType,jspin,usdus,f,g,flo)
    USE m_types
    USE m_radfun
    USE m_radflo
    !$  use omp_lib
15

16
    IMPLICIT NONE
17

18 19 20 21 22
    TYPE(t_atoms),  INTENT(IN)    :: atoms
    TYPE(t_enpara), INTENT(IN)    :: enpara
    TYPE(t_potden), INTENT(IN)    :: vTot
    TYPE(t_mpi),    INTENT(IN)    :: mpi
    TYPE(t_usdus),  INTENT(INOUT) :: usdus
23

24 25
    INTEGER,        INTENT(IN)    :: iType
    INTEGER,        INTENT(IN)    :: jspin
26

27 28 29
    REAL,           INTENT(INOUT) :: f(atoms%jmtd,2,0:atoms%lmaxd)
    REAL,           INTENT(INOUT) :: g(atoms%jmtd,2,0:atoms%lmaxd)
    REAL,           INTENT(INOUT) :: flo(atoms%jmtd,2,atoms%nlod)
30 31


32 33
    INTEGER                       :: l,nodeu,noded
    REAL                          :: wronk
34 35


36
    LOGICAL    :: l_write
37 38
    l_write=mpi%irank==0 
    !$ l_write = l_write .and. omp_get_num_threads()==1
39 40


41
    IF (l_write) WRITE (6,FMT=8000) iType
42

43 44 45 46 47 48 49 50
    DO l = 0,atoms%lmax(iType)
       CALL radfun(l,iType,jspin,enpara%el0(l,iType,jspin),vTot%mt(:,0,iType,jspin),atoms,&
            f(1,1,l),g(1,1,l),usdus,nodeu,noded,wronk)
       IF (l_write) THEN
          WRITE (6,FMT=8010) l,enpara%el0(l,iType,jspin),usdus%us(l,iType,jspin),usdus%dus(l,iType,jspin),&
               nodeu,usdus%uds(l,iType,jspin),usdus%duds(l,iType,jspin),noded,usdus%ddn(l,iType,jspin),wronk
       END IF
    END DO
51

52 53 54 55 56 57 58 59 60 61 62 63 64 65
    ! Generate the extra wavefunctions for the local orbitals, if there are any.
    IF (atoms%nlo(iType).GE.1) THEN
       CALL radflo(atoms,iType,jspin,enpara%ello0(1,1,jspin),vTot%mt(:,0,iType,jspin),f,g,mpi,&
            usdus,usdus%uuilon(1,1,jspin),usdus%duilon(1,1,jspin),usdus%ulouilopn(1,1,1,jspin),flo)
    END IF

8000 FORMAT (1x,/,/,' wavefunction parameters for atom type',i3,':',&
         /,t32,'radial function',t79,'energy derivative',/,t3,&
         'l',t8,'energy',t26,'value',t39,'derivative',t53,&
         'nodes',t68,'value',t81,'derivative',t95,'nodes',t107,&
         'norm',t119,'wronskian')
8010 FORMAT (i3,f10.5,2 (5x,1p,2e16.7,i5),1p,2e16.7)

  END SUBROUTINE genMTBasis
66 67

END MODULE m_genMTBasis