Using UPF files with a large number of mesh points

Documentation, Web site and code modifications

Moderators: baguetl, routerov

Locked
emurray
Posts: 3
Joined: Sat Sep 11, 2010 2:54 am

Using UPF files with a large number of mesh points

Post by emurray » 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:

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.

mverstra
Posts: 655
Joined: Wed Aug 19, 2009 12:01 pm

Re: Using UPF files with a large number of mesh points

Post by mverstra » Wed Sep 22, 2010 4:17 pm

Hi,

this code has been copied verbatim from pwscf, so you should ask them why. Normally for I6 you can read up to 6 digits, so it's probably enough for you to remove leading white space to get it to read all the 2000

I have added your patch to 6.4.0, and if it passes tests it will be included in the soon to be released versions of abinit 6.4.x

Cheers

matthieu
Matthieu Verstraete
University of Liege, Belgium

Locked