TABLE OF CONTENTS


ABINIT/wvl_wfs_free [ Functions ]

[ Top ] [ Functions ]

NAME

 wvl_wfs_free

FUNCTION

 Freeing routine.

COPYRIGHT

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

INPUTS

OUTPUT

SIDE EFFECTS

  wfs <type(wvl_wf_type)>=wavefunctions informations in a wavelet basis.

PARENTS

      gstate,wvl_wfsinp_reformat

CHILDREN

      deallocate_comms,deallocate_lr,deallocate_lzd_except_glr
      deallocate_orbs,f_free_ptr

SOURCE

33 #if defined HAVE_CONFIG_H
34 #include "config.h"
35 #endif
36 
37 #include "abi_common.h"
38 
39 subroutine wvl_wfs_free(wfs)
40 
41  use defs_basis
42  use defs_wvltypes
43  use m_profiling_abi
44  use m_errors
45 #if defined HAVE_BIGDFT
46  use BigDFT_API, only: deallocate_Lzd_except_Glr, deallocate_lr, &
47       & deallocate_orbs, deallocate_comms
48  use dynamic_memory
49 #endif
50 
51 !This section has been created automatically by the script Abilint (TD).
52 !Do not modify the following lines by hand.
53 #undef ABI_FUNC
54 #define ABI_FUNC 'wvl_wfs_free'
55 !End of the abilint section
56 
57  implicit none
58 
59 !Arguments ------------------------------------
60 !scalars
61  type(wvl_wf_type),intent(inout) :: wfs
62 
63 !Local variables -------------------------
64 
65 ! *********************************************************************
66 
67 #if defined HAVE_BIGDFT
68  call deallocate_Lzd_except_Glr(wfs%ks%lzd)
69  call deallocate_lr(wfs%ks%lzd%Glr)
70  call deallocate_orbs(wfs%ks%orbs)
71  call deallocate_comms(wfs%ks%comms)
72  if (associated(wfs%ks%orbs%eval))  then
73    ABI_DEALLOCATE(wfs%ks%orbs%eval)
74  end if
75  ABI_DATATYPE_DEALLOCATE(wfs%ks%confdatarr)
76 
77  if (associated(wfs%ks%psi)) then
78    call f_free_ptr(wfs%ks%psi)
79  end if
80  if (associated(wfs%ks%hpsi)) then
81    call f_free_ptr(wfs%ks%hpsi)
82  end if
83  if (associated(wfs%ks%psit)) then
84    call f_free_ptr(wfs%ks%psit)
85  end if
86 
87 #else
88  BIGDFT_NOTENABLED_ERROR()
89  if (.false.) write(std_out,*) wfs%ks
90 #endif
91 
92 end subroutine wvl_wfs_free