From: Carlo Segre <segre@debian.org>
Date: Tue, 6 Aug 2024 12:53:43 +0200
Subject: Patches to the FORTRAN source

  * Enable FEFF to calculate chi
  * Modify array dimensioning for increased capacity
---
 src/feff6/feff.f   | 10 +++++-----
 src/lib/iff_show.f |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/feff6/feff.f b/src/feff6/feff.f
index 3f7497b..0ec0092 100644
--- a/src/feff6/feff.f
+++ b/src/feff6/feff.f
@@ -117,11 +117,11 @@ c        Dump out fbetac for central atom and first pot
          call genfmt (ipr3, critcw, sig2g, iorder)
       endif
 
-c      if (mchi .eq. 1)  then
-c         call echo('Calculating chi...')
-c         call ff2chi (ipr4, critcw, s02, tk, thetad, icsig,
-c     1        vrcorr, vicorr)
-c      endif
+      if (mchi .eq. 1)  then
+         call echo('Calculating chi...')
+         call ff2chi (ipr4, critcw, s02, tk, thetad, icsig,
+     1        vrcorr, vicorr)
+      endif
 
        call echo('Feff done.  Have a nice day.')
        end
diff --git a/src/lib/iff_show.f b/src/lib/iff_show.f
index b628372..f54f7af 100644
--- a/src/lib/iff_show.f
+++ b/src/lib/iff_show.f
@@ -431,8 +431,8 @@ c
        character*(*) s, t , messg*256
        integer k, j, istrln
        external istrln
-       k = max(13, istrln(s))
-       j = max(2, istrln(t))
+       k = min(max(13, istrln(s)),256)
+       j = min(max(2, istrln(t)), 252-k)
        write(messg,11)  s(1:k), ' = ', t(1:j)
        call echo(messg)
  11    format('$',3a)
@@ -443,8 +443,8 @@ c
        character*(*) s, t , messg*256
        integer    k, j, istrln
        external istrln
-       k = max(14, istrln(s))
-       j = max(2, istrln(t))
+       k = min(max(14, istrln(s)), 256)
+       j = min(max(2, istrln(t)), 253-k)
        write(messg,11)  s(1:k), ': ', t(1:j)
        call echo(messg)
  11    format (3a)
