From bd9cbebd9efd1f94207a141cf43ee65cd0d041cd Mon Sep 17 00:00:00 2001 From: Jesse Lentz <42011922+J-Lentz@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:18:41 -0400 Subject: [PATCH] fix: replace hardcoded unit number with newunit in test_diag_integral (#1605) --- test_fms/diag_integral/test_diag_integral.F90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test_fms/diag_integral/test_diag_integral.F90 b/test_fms/diag_integral/test_diag_integral.F90 index af21fac6c2..cd4fe4c80e 100644 --- a/test_fms/diag_integral/test_diag_integral.F90 +++ b/test_fms/diag_integral/test_diag_integral.F90 @@ -175,13 +175,12 @@ end subroutine test_sum_diag_integral_field !------------------------------------- subroutine read_diag_integral_file - character(17), parameter :: di_file='diag_integral.out' - integer, parameter :: iunit=100 - + character(*), parameter :: di_file='diag_integral.out' + integer :: iunit character(100) :: cline1, cline2, cline3, cline4, cline5, clin6 !> read in computed values - open(unit=iunit,file=trim(di_file)) + open(newunit=iunit, file=di_file) read(iunit,*) cline1, cline2, cline3, cline4, cline5, clin6 read(iunit,*) itime, field_avg2, field_avg3, field_avgw, field_avgh close(iunit)