From 19994ab90b35b9285d69f416092030260d23e988 Mon Sep 17 00:00:00 2001 From: Hunter Belanger Date: Thu, 19 Oct 2023 16:21:20 -0400 Subject: [PATCH] Fix bug to have enough space for MF1 comment cards in leapr scratch. --- src/leapr.f90 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/leapr.f90 b/src/leapr.f90 index ac7b8aee..8452dd4a 100644 --- a/src/leapr.f90 +++ b/src/leapr.f90 @@ -423,7 +423,13 @@ subroutine leapr isym=0 if (ncold.ne.0) isym=1 if (isabt.eq.1) isym=isym+2 - mscr = max(8 + 2*nalpha, 8 + 2*nedge) ! Max needed length of scr based on endout + + ! Based on endout, to write the actual TSL data, the max number of entries + ! needed in scr is either 8+2*nalpha, or 8+2*nedge. However, we have no way + ! of knowing how many comment lines were added to the leaper input. The + ! previous hard coded limit of 4000 is also used as a possible max as this + ! has apparently been sufficient to hold all comments in the past. + mscr = max(8 + 2*nalpha, 8 + 2*nedge, 4000) allocate(scr(mscr)) call endout(ntempr,bragg,nedge,maxb,scr,mscr,isym,ilog)