LCOV - code coverage report
Current view: top level - types - types_force.f90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 45 53 84.9 %
Date: 2019-09-08 04:53:50 Functions: 3 5 60.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2018 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
       3             : ! This file is part of FLEUR and available as free software under the conditions
       4             : ! of the MIT license as expressed in the LICENSE file in more detail.
       5             : !--------------------------------------------------------------------------------
       6             : 
       7             : MODULE m_types_force
       8             : 
       9             : IMPLICIT NONE
      10             : 
      11             : PRIVATE
      12             : 
      13             :    TYPE t_force
      14             :       COMPLEX, ALLOCATABLE :: f_a12(:,:)
      15             :       COMPLEX, ALLOCATABLE :: f_a21(:,:)
      16             :       COMPLEX, ALLOCATABLE :: f_b4(:,:)
      17             :       COMPLEX, ALLOCATABLE :: f_b8(:,:)
      18             : 
      19             :       COMPLEX, ALLOCATABLE :: e1cof(:,:,:)
      20             :       COMPLEX, ALLOCATABLE :: e2cof(:,:,:)
      21             :       COMPLEX, ALLOCATABLE :: aveccof(:,:,:,:)
      22             :       COMPLEX, ALLOCATABLE :: bveccof(:,:,:,:)
      23             :       COMPLEX, ALLOCATABLE :: cveccof(:,:,:,:,:)
      24             : 
      25             :       COMPLEX, ALLOCATABLE :: acoflo(:,:,:,:)
      26             :       COMPLEX, ALLOCATABLE :: bcoflo(:,:,:,:)
      27             : 
      28             :       CONTAINS
      29             :          PROCEDURE,PASS :: init1 => force_init1
      30             :          PROCEDURE,PASS :: init2 => force_init2
      31             :          PROCEDURE      :: addContribsA21A12
      32             :    END TYPE t_force
      33             : 
      34             : PUBLIC t_force
      35             : 
      36             : CONTAINS
      37             : 
      38         608 : SUBROUTINE force_init1(thisForce,input,atoms)
      39             : 
      40             :    USE m_types_setup
      41             : 
      42             :    IMPLICIT NONE
      43             : 
      44             :    CLASS(t_force),     INTENT(INOUT) :: thisForce
      45             :    TYPE(t_input),      INTENT(IN)    :: input
      46             :    TYPE(t_atoms),      INTENT(IN)    :: atoms
      47             : 
      48         608 :    IF (input%l_f) THEN
      49           4 :       ALLOCATE (thisForce%f_a12(3,atoms%ntype))
      50           4 :       ALLOCATE (thisForce%f_a21(3,atoms%ntype))
      51           4 :       ALLOCATE (thisForce%f_b4(3,atoms%ntype))
      52           4 :       ALLOCATE (thisForce%f_b8(3,atoms%ntype))
      53             :    ELSE
      54         604 :       ALLOCATE (thisForce%f_a12(1,1))
      55         604 :       ALLOCATE (thisForce%f_a21(1,1))
      56         604 :       ALLOCATE (thisForce%f_b4(1,1))
      57         604 :       ALLOCATE (thisForce%f_b8(1,1))
      58             :    END IF
      59             : 
      60         608 :    thisForce%f_a12 = CMPLX(0.0,0.0)
      61         608 :    thisForce%f_a21 = CMPLX(0.0,0.0)
      62         608 :    thisForce%f_b4 = CMPLX(0.0,0.0)
      63         608 :    thisForce%f_b8 = CMPLX(0.0,0.0)
      64             : 
      65         608 : END SUBROUTINE force_init1
      66             : 
      67          12 : SUBROUTINE force_init2(thisForce,noccbd,input,atoms)
      68             : 
      69             :    USE m_types_setup
      70             : 
      71             :    IMPLICIT NONE
      72             : 
      73             :    CLASS(t_force),     INTENT(INOUT) :: thisForce
      74             :    TYPE(t_input),      INTENT(IN)    :: input
      75             :    TYPE(t_atoms),      INTENT(IN)    :: atoms
      76             :    INTEGER,            INTENT(IN)    :: noccbd
      77             : 
      78          12 :    IF (ALLOCATED(thisForce%e1cof)) DEALLOCATE(thisForce%e1cof)
      79          12 :    IF (ALLOCATED(thisForce%e2cof)) DEALLOCATE(thisForce%e2cof)
      80          12 :    IF (ALLOCATED(thisForce%acoflo)) DEALLOCATE(thisForce%acoflo)
      81          12 :    IF (ALLOCATED(thisForce%bcoflo)) DEALLOCATE(thisForce%bcoflo)
      82          12 :    IF (ALLOCATED(thisForce%aveccof)) DEALLOCATE(thisForce%aveccof)
      83          12 :    IF (ALLOCATED(thisForce%bveccof)) DEALLOCATE(thisForce%bveccof)
      84          12 :    IF (ALLOCATED(thisForce%cveccof)) DEALLOCATE(thisForce%cveccof)
      85             : 
      86          12 :    IF (input%l_f) THEN
      87          12 :       ALLOCATE (thisForce%e1cof(noccbd,0:atoms%lmaxd*(atoms%lmaxd+2),atoms%nat))
      88          12 :       ALLOCATE (thisForce%e2cof(noccbd,0:atoms%lmaxd*(atoms%lmaxd+2),atoms%nat))
      89          12 :       ALLOCATE (thisForce%acoflo(-atoms%llod:atoms%llod,noccbd,atoms%nlod,atoms%nat))
      90          12 :       ALLOCATE (thisForce%bcoflo(-atoms%llod:atoms%llod,noccbd,atoms%nlod,atoms%nat))
      91          12 :       ALLOCATE (thisForce%aveccof(3,noccbd,0:atoms%lmaxd*(atoms%lmaxd+2),atoms%nat))
      92          12 :       ALLOCATE (thisForce%bveccof(3,noccbd,0:atoms%lmaxd*(atoms%lmaxd+2),atoms%nat))
      93          12 :       ALLOCATE (thisForce%cveccof(3,-atoms%llod:atoms%llod,noccbd,atoms%nlod,atoms%nat))
      94             :    ELSE
      95           0 :       ALLOCATE (thisForce%e1cof(1,1,1))
      96           0 :       ALLOCATE (thisForce%e2cof(1,1,1))
      97           0 :       ALLOCATE (thisForce%acoflo(1,1,1,1))
      98           0 :       ALLOCATE (thisForce%bcoflo(1,1,1,1))
      99           0 :       ALLOCATE (thisForce%aveccof(1,1,1,1))
     100           0 :       ALLOCATE (thisForce%bveccof(1,1,1,1))
     101           0 :       ALLOCATE (thisForce%cveccof(1,1,1,1,1))
     102             :    END IF
     103             : 
     104          12 :    thisForce%e1cof = CMPLX(0.0,0.0)
     105          12 :    thisForce%e2cof = CMPLX(0.0,0.0)
     106          12 :    thisForce%acoflo = CMPLX(0.0,0.0)
     107          12 :    thisForce%bcoflo = CMPLX(0.0,0.0)
     108          12 :    thisForce%aveccof = CMPLX(0.0,0.0)
     109          12 :    thisForce%bveccof = CMPLX(0.0,0.0)
     110          12 :    thisForce%cveccof = CMPLX(0.0,0.0)
     111             : 
     112          12 : END SUBROUTINE force_init2
     113             : 
     114          12 : SUBROUTINE addContribsA21A12(thisForce,input,atoms,dimension,sym,cell,oneD,enpara,&
     115          12 :                              usdus,eigVecCoeffs,noccbd,ispin,eig,we,results)
     116             : 
     117             :    USE m_types_setup
     118             :    USE m_types_usdus
     119             :    USE m_types_enpara
     120             :    USE m_types_cdnval, ONLY: t_eigVecCoeffs
     121             :    USE m_types_misc
     122             :    USE m_forcea12
     123             :    USE m_forcea21
     124             : 
     125             :    IMPLICIT NONE
     126             : 
     127             :    CLASS(t_force),       INTENT(INOUT) :: thisForce
     128             :    TYPE(t_input),        INTENT(IN)    :: input
     129             :    TYPE(t_atoms),        INTENT(IN)    :: atoms
     130             :    TYPE(t_dimension),    INTENT(IN)    :: dimension
     131             :    TYPE(t_sym),          INTENT(IN)    :: sym
     132             :    TYPE(t_cell),         INTENT(IN)    :: cell
     133             :    TYPE(t_oneD),         INTENT(IN)    :: oneD
     134             :    TYPE(t_enpara),       INTENT(IN)    :: enpara
     135             :    TYPE(t_usdus),        INTENT(IN)    :: usdus
     136             :    TYPE(t_eigVecCoeffs), INTENT(IN)    :: eigVecCoeffs
     137             :    TYPE(t_results),      INTENT(INOUT) :: results
     138             : 
     139             :    INTEGER,              INTENT(IN)    :: noccbd
     140             :    INTEGER,              INTENT(IN)    :: ispin
     141             : 
     142             :    REAL,                 INTENT(IN)    :: eig(noccbd)
     143             :    REAL,                 INTENT(IN)    :: we(noccbd)
     144             : 
     145          12 :    IF (.NOT.input%l_useapw) THEN
     146             :       CALL force_a12(atoms,noccbd,sym,dimension,cell,oneD,&
     147             :                      we,ispin,noccbd,usdus,eigVecCoeffs,thisForce%acoflo,thisForce%bcoflo,&
     148          12 :                      thisForce%e1cof,thisForce%e2cof,thisForce%f_a12,results)
     149             :    END IF
     150             :    CALL force_a21(input,atoms,dimension,sym,oneD,cell,we,ispin,&
     151             :                   enpara%el0(0:,:,ispin),noccbd,eig,usdus,eigVecCoeffs,&
     152             :                   thisForce%aveccof,thisForce%bveccof,thisForce%cveccof,&
     153          12 :                   thisForce%f_a21,thisForce%f_b4,results)
     154             : 
     155          12 : END SUBROUTINE addContribsA21A12
     156             : 
     157           0 : END MODULE m_types_force

Generated by: LCOV version 1.13