Skip to content

Unknown keywords in seedname.win are not reliably detected #709

Description

@giovannipizzi

Bug report obtained via Claude Opus:

Typos get through, and at least one valid keyword is refused. Three causes,
all reproduced with wannier90.x -pp:

  1. w90_readwrite_get_keyword_vector (src/readwrite.F90:2999) matches on a
    bare prefix, without the =/:/space check that
    w90_readwrite_get_keyword does at :2888. So berry_kmesh_nonsense = 7,
    spin_kmesh_rubbish = 7 and dos_kmesh_xyzzy = 7 are all silently
    accepted, while totally_bogus_keyword = 7 is correctly rejected.
  2. w90_readwrite_clear_keywords never checks error after any of its ~258
    calls, so each discards the previous one's report. A second kmesh* line
    makes the kmesh read raise "found more than once" and return before
    blanking the line; the error is dropped and the user is told
    "Unrecognised keyword(s)" instead.
  3. search_supcell_size is missing from the recognised-keyword list, so any
    valid value stops the run as unrecognised. It is read and validated normally
    (src/readwrite.F90:974), so = -1 gives the proper error but = 5 does
    not. The keyword is unusable today.

parameters.xml already holds the full keyword list under a pre-commit check,
so generating the recognised list from it, or adding a test comparing the two,
would close this off. The comment in w90_readwrite_clear_keywords already
warns that the hand-maintained list "is not an ideal solution".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions