Bugfix in export_upf.f90: allocate use%r and use%rab

This commit is contained in:
h-mori4 2021-07-02 18:05:16 +09:00
parent 8c4271e712
commit d43d3f2f08
1 changed files with 19 additions and 2 deletions

View File

@ -112,8 +112,25 @@ SUBROUTINE export_upf(filename, unit_loc)
upf%zmesh = grid%zmesh
upf%rmax = grid%rmax
!
upf%r = grid%r
upf%rab = grid%rab
!
! subroutine allocate_radial_grid can be used only for type(radial_grid_type)
! but upf is type(pseudo_upf)
!
allocate( &
upf%r (upf%mesh), &
upf%rab(upf%mesh) ) ! d r(x) / d x where x is the linear grid
!
!allocate( &
! upf%r2 (upf%mesh), & ! the square of the radial mesh
! upf%sqr(upf%mesh), & ! the square root of the radial mesh
! upf%rm1(upf%mesh), & ! 1 / r
! upf%rm2(upf%mesh), & ! 1 / r**2
! upf%rm3(upf%mesh) ) ! 1 / r**3
!
upf%r(1:upf%mesh) = grid%r(1:upf%mesh)
upf%rab(1:upf%mesh) = grid%rab(1:upf%mesh)
!upf%r2(1:upf%mesh) = upf%r(1:upf%mesh)**2
!upf%sqr(1:upf%mesh) = sqrt(upf%r(1:upf%mesh))
!
! when possible, write semilocal PP's in the UPF file - may be
! useful if one wants to use PPs in the UPF format in other codes