Bug: Out of Bounds in sternheimer/em_resp_inc

As a consequence of rewriting the GCC presets using -fcheck=all, I caught several of out-of-bounds in app tests, relating to a few specific routines.

Array index in kpoints_path_generate

Affects:

  • tutorials/06-octopus_basics-periodic_systems
  • photo_electron/13-arpes_2d
  • periodic_systems/25-Fe_polarized
  • periodic_systems/15-bandstructure.01-gs.inp
Fortran runtime error: Index '4' of dimension 2 of array 'highsympoints' outside of expected range (1:3)
> kpoints.F90:780 > kpoints.F90:1170 in __kpoints_oct_m_MOD_kpoints_path_generate`

k-Symmetry out-of-bounds error

lda_u/01-nio

line 1170 of file /var/tmp/gitlab-runner/builds/JQ81ht1ZI/0/octopus-code/octopus/src/electrons/kpoints.F90
Fortran runtime error: Index '2' of dimension 2 of array 'highsympoints' outside of expected range (1:1)

Array Index Error in k2_lr of Sternheimer

Affects:

  • periodic_systems/27-Ar
  • periodic_systems/04-silicon > 04-silicon.05-emresp_magn.inp
  • periodic_systems/06-h2o_pol_lr
Fortran runtime error: Index '0' of dimension 1 of array 'k2_lr' outside of expected range (1:3)
Error termination. Backtrace:
#0 0x1522451 in zrun_sternheimer
at /var/tmp/gitlab-runner/builds/JQ81ht1ZI/0/octopus-code/octopus/src/sternheimer/em_resp_inc.F90:461
#1 0x1550239 in em_resp_run_legacy

Array bound mismatch in lasers

Affects:

  • real_time/11-tdmagnetic.test
Fortran runtime error: Array bound mismatch for dimension 2 of array 'this...%a' (3/2)
#0 0xb8cb76 in __lasers_oct_m_MOD_lasers_generate_potentials
at /var/tmp/gitlab-runner/builds/JQ81ht1ZI/0/octopus-code/octopus/src/hamiltonian/lasers.F90:440