Using UPF files with a large number of mesh points
Posted: Sat Sep 11, 2010 3:35 am
I was testing a UPF pseudopotential with 2000 mesh points and I noticed it would cause abinit to exit when it tried to read the projector section.
It seems that the section that reads the number of mesh points for the projector is read with the format '(i6)'. Since UPF files seem to usually have 3 leading spaces here it only reads the first 3 digits of the number - so in my case it reads 200 instead of 2000.
This could be fixed pretty easily with the following patch:
My concern is that I assume there was a reason '(i6)' was used here in the first place, since it's one of the only places where the format is specified, though I don't know what this might be.
It seems that the section that reads the number of mesh points for the projector is read with the format '(i6)'. Since UPF files seem to usually have 3 leading spaces here it only reads the first 3 digits of the number - so in my case it reads 200 instead of 2000.
This could be fixed pretty easily with the following patch:
Code: Select all
--- old/read_upf_pwscf.F90 2010-09-10 17:51:24.986995185 -0700
+++ new/read_upf_pwscf.F90 2010-09-10 18:19:02.303994978 -0700
@@ -265,7 +265,7 @@
do nb = 1, nbeta (is)
call scan_begin (iunps, "BETA", .false.)
read (iunps, *, err = 100, iostat = ios) idum, lll(nb,is), dummy
- read (iunps, '(i6)', err = 100, iostat = ios) ikk2(nb,is)
+ read (iunps, *, err = 100, iostat = ios) ikk2(nb,is)
read (iunps, *, err = 100, iostat = ios) &
(betar(ir,nb,is), ir=1,ikk2(nb,is))
do ir = ikk2(nb,is) + 1, mesh (is)
My concern is that I assume there was a reason '(i6)' was used here in the first place, since it's one of the only places where the format is specified, though I don't know what this might be.