standard_001 fails on arm64

This was turned up during Debian CI: https://ci.debian.net/data/autopkgtest/unstable/arm64/o/openmolcas/5574750/log.gz https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961704

This is the bottom of the output:

++ Convergence information
                               UHF B3LYP      iterations: Energy and convergence statistics

Iter     Tot. B3LYP      One-elec.       Two-elec.     Energy      Max Dij or  Max Fij      DNorm      TNorm      AccCon     Time
         Energy          Energy          Energy        Change      Delta Norm                                                in Sec.
 !!! WARNING !!!
 NANs encountered

  The numbers in the array will now be checked.
  There are                     3  elements.
  Element nr.                    1  is                        NaN
  Element nr.                    2  is                        NaN
  Element nr.                    3  is                        NaN
 There were a total of                     3  NANs
--- Stop Module: scf at Mon Jun  1 12:11:07 2020 /rc=_RC_INTERNAL_ERROR_ ---

>>> END FOREACH

    Timing: Wall=26.07 User=21.23 System=4.77

This is standard__001.err (with the debugging symbols package installed):

Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG IEEE_DIVIDE_BY_ZERO IEEE_UNDERFLOW_FLAG
Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG
Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG
Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG
Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG IEEE_DIVIDE_BY_ZERO IEEE_UNDERFLOW_FLAG
Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG
[ process      0]: xquit (rc =    128): _INTERNAL_ERROR_

Program aborted. Backtrace:
#0  0xffff840adc07 in ???
#1  0xffff840ae7d3 in ???
#2  0xffff841a520b in ???
#3  0xaaaac269c053 in xabort_
        at ./src/system_util/xabort.f:34
#4  0xaaaac25b8787 in xquit_
        at ./src/system_util/xquit.f:52
#5  0xaaaac25b4147 in abend_
        at ./src/system_util/abend.f:20
#6  0xaaaac253bd7b in jacob_
        at ./src/misc_util/jacob.f:40
#7  0xaaaac253a24b in diag_driver_
        at ./src/misc_util/diag_driver.f:136
#8  0xaaaac24a6a5f in neworb_scf_
        at ./src/scf/neworb_scf.f:415
#9  0xaaaac24c6dff in wfctl_scf__
        at ./src/scf/wfctl_scf.f:449
#10  0xaaaac24c8067 in wfctl_scf_
        at ./src/scf/wfctl_scf.f:44
#11  0xaaaac24b6f6f in scf_
        at ./src/scf/scf.f:106
#12  0xaaaac248b27f in MAIN__
        at ./src/scf/main.f:24
#13  0xaaaac248b27f in main
        at ./src/scf/main.f:28

This is the backtrace when I run scf.exe again in the directory:

#0  0x0000fffff6beed08 in raise () from /lib/aarch64-linux-gnu/libc.so.6
#1  0x0000fffff6bdbea8 in abort () from /lib/aarch64-linux-gnu/libc.so.6
#2  0x0000fffff6e6b7e4 in ?? () from /usr/lib/aarch64-linux-gnu/libgfortran.so.5
#3  0x0000fffff6f6220c in _gfortran_abort () from /usr/lib/aarch64-linux-gnu/libgfortran.so.5
#4  0x0000aaaaaacc1054 in xabort (rc=128) at ./src/system_util/xabort.f:34
#5  0x0000aaaaaabdd788 in xquit (rc=128) at ./src/system_util/xquit.f:52
#6  0x0000aaaaaabd9148 in abend () at ./src/system_util/abend.f:20
#7  0x0000aaaaaab60d7c in jacob (array=..., vecs=..., ndim=2, lenvec=2) at ./src/misc_util/jacob.f:40
#8  0x0000aaaaaab5f24c in diag_driver (jobz=..., range=..., uplo=..., ndim=2, triangular=..., aux=..., ldimaux=2, vlower=0, vupper=0, ilower=0, iupper=0, eigval=..., eigvec=..., 
    ldimvec=2, iunit_matrix=0, isort=-1, method=..., nfound=-70606776093700352, ierr=0, _jobz=_jobz@entry=1, _range=_range@entry=1, _uplo=_uplo@entry=1, _method=_method@entry=1)
    at ./src/misc_util/diag_driver.f:136
#9  0x0000aaaaaaacba60 in neworb_scf (fock=..., nfock=<optimized out>, cmo=..., ncmo=<optimized out>, fovmax=0, eorb=..., neorb=<optimized out>, ovlp=..., nfo=4096, allowflip=.TRUE., 
    scram=.FALSE., nd=2) at ./src/scf/neworb_scf.f:415
#10 0x0000aaaaaaaebe00 in wfctl_scf_ (iterm=0, meth=<error reading variable: Asked for position 0 of stack, stack only has 0 elements on it.>, fstitr=.TRUE., sintth=0, oneham=..., 
    twoham=..., dens=..., ovrlp=..., fock=..., trdh=..., trdp=..., trdd=..., cmo=..., cinter=..., eorb=..., occno=..., hdiag=..., vxc=..., trm=..., mbt=3, mdens=6, nd=2, ntr=400, 
    mbb=4, nci=6, mmb=2, mov=2, _meth=_meth@entry=16) at ./src/scf/wfctl_scf.f:449
#11 0x0000aaaaaaaed068 in wfctl_scf (iterm=0, meth=..., fstitr=.TRUE., sintth=0, _meth=_meth@entry=16) at ./src/scf/wfctl_scf.f:44
#12 0x0000aaaaaaadbf70 in scf (ireturn=187649987084280) at ./src/scf/scf.f:106
#13 0x0000aaaaaaab0280 in MAIN__ () at ./src/scf/main.f:24
#14 main (argc=<optimized out>, argv=<optimized out>) at ./src/scf/main.f:28
#15 0x0000fffff6bdc2ec in __libc_start_main () from /lib/aarch64-linux-gnu/libc.so.6
#16 0x0000aaaaaaab02e0 in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

The full backtrace is pretty big, so I've attached it: backtrace_full.txt.gz

Edited by Michael Banck