Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POT/broydn.f #31

Open
bruceravel opened this issue Jul 8, 2015 · 1 comment
Open

POT/broydn.f #31

bruceravel opened this issue Jul 8, 2015 · 1 comment

Comments

@bruceravel
Copy link
Contributor

rhoold is used at line 88, set at line 102, and preserved by a save statement at line 35.

I presume that this is depending on rhoold getting initialized to 0s on the first call. With save, this is usually defined. But the first time broydn is called, rhoold is ill-defined.

@newville
Copy link
Member

newville commented Jul 8, 2015

Ugh, SAVE statements are the yuck. But it looks like maybe iscmt .eq. 1 is used to signal "first time called" to fill the saved arrays, so that rhoold is never actually used uninitialized (but starts out as edenvl (which is clearly short for "Eden Valhalla". iscmt most likely means "Index of Self-Consistent Muffin-Tin" but I read as "Is Computed Tomography". Yes, there are too many TLA and even too many sxchvn [six character-long variable names]). Anyway, since iscmt is simply incremented (starting at 1) in pot.f, it looks like maybe this is ugly, but actually never uses uninitialized values.

It might be worth considering pulling out the saved arrays (ri05, wt, etc) into scmt.f and scmtmp.f and passing them in, just to avoid the SAVE statement. Well, "consider" doing that. SAVE is not pure evil like COMMON, but we should view them with suspicion.

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

No branches or pull requests

2 participants