yambo-code / yambo

This is the official GPL repository of the yambo code
http://www.yambo-code.eu/
GNU General Public License v2.0
98 stars 38 forks source link

Issue 75 #77

Closed palful closed 5 months ago

palful commented 5 months ago

Fix for issue #75.

Introduced additional cutoff_ng variable in order to avoid overwriting wf_ng when reading an existing ndb.cutoff.

wf_ng is read from WF_G_COMPONENTS in ns.db1, while cutoff_ng is read from PARS (it is also a dimension of CUT_BARE_QPG) in ndb.cutoff.

The two values could be different if, for example, the user has previously calculated the cutoff with decreased FFTGvecs value. Despite this, during setup, io_COL_CUT is always called and thus the value of wf_ng was always overwritten if an existing database was found.

This could create issues when working with WF_load in susbsequent runs, because it can lead to the case where the number of wavefunction components wf_ncx is larger than the overwritten wf_ng.

NB: I changed only io_COL_CUT by introducing cutoff_ng. The Coulomb driver and all the geometry subroutines that compute the various cutoffed potentials still use wf_ng. In principle I don't see any obvious problems since during writing, cutoff_ng is set to wf_ng by default.