From 9d925f81c9accaac7ab6c1f7c51983d535b1b0d0 Mon Sep 17 00:00:00 2001 From: Jatin Agarwal <167195254+Jatinagarwal24@users.noreply.github.com> Date: Fri, 10 Apr 2026 23:36:29 +0530 Subject: [PATCH] fix: allocate lam_tmp before passing to solve_dirac_eigenproblem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The crash was caused by passing an unallocated array (lam_tmp) to solve_dirac_eigenproblem in src/schroed_dirac_solver.f90 (around line 155). LFortran correctly detects this and raises a runtime error: “argument is unallocated”. This fix ensures lam_tmp is properly allocated before the call, preventing the runtime failure. The issue is in featom code and is not a bug in LFortran. --- src/schroed_dirac_solver.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/schroed_dirac_solver.f90 b/src/schroed_dirac_solver.f90 index 376a4ef..00b8256 100644 --- a/src/schroed_dirac_solver.f90 +++ b/src/schroed_dirac_solver.f90 @@ -64,6 +64,7 @@ subroutine total_energy(Z, rmax, Ne, a, p, Nq, DOFs, alpha_int, dirac_int, & allocate(H(DOFS, DOFS), S(DOFS), DSQ(DOFS), uq(Nq,Ne)) allocate(D(DOFS, DOFS), lam2(DOFS), rho(Nq,Ne), fullc(Nn)) + allocate(lam_tmp(DOFS)) if (dirac_int == 1) then allocate(lam(47)) allocate(eigfn(Nq, Ne, 49))