Skip to content

Remove unused variables, fix uninitilaized read in do_hf, minor improvements

Tibor Győri requested to merge TiborGY/mokit:master into master

This PR has a lot of small changes, mostly not visible to the user under normal operation, the sole exception to that is the read of the uninitialized variable, which can cause unpredictable errors.

  1. Most of the compiler warnings about unused variables have been solved by removing the variable. Some of the variables may be used in code that is currently commented out. Let me know if that is a problem.
  2. Some of the string literals that are broken into multiple lines were missing the '&' character at the beginning of the line. This has been fixed.
  3. Minor improvements were made to the read_na_and_nb_from_fch and check_uhf_in_fch subroutines. More IO error checking was added and a couple unnecessary lines removed. Note that ERROR STOP is a feature from Fortran 2008. While I think it is a more appropriate way to perform an error exit, it probably would not work with the current minimum gfortran(>=4.8.5).
  4. This is probably the most important change. There was an error in do_hf, where the program checked if a variable is zero, but neglected to pass that variable to the read subroutine that sets it.

Build passed with gfortran 9.3.0 on Ubuntu 20.04 LTS. I do not have any .fchk files to test with, so I cannot verify correct execution, but the changes should be relatively safe.

Merge request reports