SwapOneEFieldInts Subroutine

public subroutine SwapOneEFieldInts(nBasisFrz, iNum)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nBasisFrz
integer, intent(in) :: iNum

Contents

Source Code


Source Code

    SUBROUTINE SwapOneEFieldInts(nBasisFrz,iNum)

      ! IN: iNum is the number of perturbation operator used in the calculation
      ! During freezing, we need to know the OneEFieldInts arrays both pre- and
      ! post-freezing.  Once freezing is done, clear all the pre-freezing
      ! arrays and point them to the post-freezing arrays, so the code
      ! referencing pre-freezing arrays can be used post-freezing.
      use MemoryManager, only: LogMemDealloc, LogMemAlloc
      use HElem, only: HElement_t_size
      implicit none
      integer, intent(in) :: nBasisFrz,iNum
      integer :: iSize, ierr
      character(*),parameter :: t_r = 'SwapOneEFieldInts'

      Deallocate(OneEFieldInts)
      call LogMemDealloc(t_r,tagOneEFieldInts)
      NULLIFY(OneEFieldInts)

      Allocate(OneEFieldInts(nBasisFrz,nBasisFrz,iNum),STAT=ierr)
      iSize = nBasisFrz*nBasisFrz*iNum
      call LogMemAlloc('OneEFieldInts',iSize,HElement_t_size*8,t_r,tagOneEFieldInts)

      OneEFieldInts => OneEFieldInts2
      write(72,*) 'Swaped the integrals'

      NULLIFY(OneEFieldInts2)

    END SUBROUTINE SwapOneEFieldInts