Skip to content

Commit

Permalink
test_diag_integral: Avoid I/O unit 100
Browse files Browse the repository at this point in the history
The Cray compiler reserves I/O unit 100 for STDIN, which causes
`read_diag_integral_file` to fail. This is fixed by using `newunit` instead of
specifying `unit=100`.
  • Loading branch information
Jesse Lentz authored and Jesse Lentz committed Oct 23, 2024
1 parent 95cd7b0 commit ea6f92a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test_fms/diag_integral/test_diag_integral.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ea6f92a

Please sign in to comment.