From bd395604845ff06ca76e51850d5932dd86556913 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 5 Sep 2012 16:07:42 -0400 Subject: [PATCH] Don't keep ACE file open during entire read_ace_table subroutine. --- src/ace.F90 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ace.F90 b/src/ace.F90 index 01449b34bc..da7322b662 100644 --- a/src/ace.F90 +++ b/src/ace.F90 @@ -217,10 +217,14 @@ contains ! Read XSS array read(UNIT=in, FMT='(4E20.0)') XSS + ! Close ACE file + close(UNIT=in) + elseif (filetype == BINARY) then ! ======================================================================= ! READ ACE TABLE IN BINARY FORMAT + ! Open ACE file open(UNIT=in, FILE=filename, STATUS='old', ACTION='read', & ACCESS='direct', RECL=record_length) @@ -238,6 +242,9 @@ contains j2 = min(length, j1 + entries - 1) read(UNIT=IN, REC=location + i) (XSS(j), j=j1,j2) end do + + ! Close ACE file + close(UNIT=in) end if ! ========================================================================== @@ -287,8 +294,6 @@ contains if(associated(nuc)) nullify(nuc) if(associated(sab)) nullify(sab) - close(UNIT=in) - end subroutine read_ace_table !===============================================================================