Skip to content

Commit

Permalink
update lunrpt and lunerr automatically set by newunit
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoMVale committed Jul 21, 2024
1 parent dd98451 commit 6a27d50
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
5 changes: 2 additions & 3 deletions example/example1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ program example1
real(kind=wp), allocatable :: beta(:), x(:, :), y(:, :)

! Set up report files
lunerr = 9
lunrpt = 9
open (unit=9, file='./example/report1.dat')
open (newunit=lunrpt, file='./example/report1.dat')
lunerr = lunrpt

! Read problem dimensions
open (unit=5, file='./example/data1.dat')
Expand Down
5 changes: 2 additions & 3 deletions example/example2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ program example2
real(kind=wp), allocatable :: beta(:), x(:, :), y(:, :)

! Set up report files
lunerr = 9
lunrpt = 9
open (unit=9, file='./example/report2.dat')
open (newunit=lunrpt, file='./example/report2.dat')
lunerr = lunrpt

! Read problem dimensions
open (unit=5, file='./example/data2.dat')
Expand Down
5 changes: 2 additions & 3 deletions example/example3.f90
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ program example3
delta(:, :)

! Set up report files
lunerr = 9
lunrpt = 9
open (unit=9, file='./example/report3.dat')
open (newunit=lunrpt, file='./example/report3.dat')
lunerr = lunrpt

! Read problem dimensions
open (unit=5, file='./example/data3.dat')
Expand Down
5 changes: 3 additions & 2 deletions example/example4.f90
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ program example4
implicit none

real(kind=wp) :: beta(3) = [1.1E-0_wp, 3.3E+0_wp, 8.7_wp]
integer :: lunrpt
! INTEGER :: I
! REAL (KIND=wp) :: C, M, TOUT

open (9, file="./example/report4.dat")
open (newunit=lunrpt, file="./example/report4.dat")

call odr(fcn, &
n=5, m=1, np=3, nq=1, &
Expand All @@ -122,7 +123,7 @@ program example4
lower=[0.0_wp, 0.0_wp, 0.0_wp], &
upper=[1000.0_wp, 1000.0_wp, 1000.0_wp], &
iprint=2122, &
lunrpt=9, &
lunrpt=lunrpt, &
maxit=20)

close (9)
Expand Down

0 comments on commit 6a27d50

Please sign in to comment.