Skip to content

Commit 6d5aaff

Browse files
committed
Removed superfluous lines; don't close stdout
1 parent 26d4c6e commit 6d5aaff

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

src/snopt_wrapper.f90

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,6 @@ subroutine f_sninit(name, len, summOn, iw, leniw, rw, lenrw) &
228228
file(j:j) = name(j)
229229
end do
230230
iPrt = newunit()
231-
!close (iPrt)
232-
!open (iPrt, file=trim(file), status='unknown', position='append')
233231
call snFileOpenAppend(iPrt, trim(file))
234232
end if
235233
end if
@@ -267,8 +265,6 @@ subroutine f_snsetprint(name, len, iw, leniw, rw, lenrw) &
267265
end do
268266

269267
if (prtfile /= '') then
270-
!close (iPrint)
271-
!open (iPrint, file=trim(prtfile), status='unknown', position='append')
272268
iPrt = newunit()
273269
call snFileOpenAppend(iPrt,trim(prtfile))
274270
call snSeti('Print file', iPrt, 0, 0, Errors, &
@@ -306,8 +302,6 @@ subroutine f_snspec(name, len, inform, iw, leniw, rw, lenrw) &
306302

307303
! If we have a file, try to read it.
308304
if (spcfile /= '') then
309-
!close(iSpec)
310-
!open(unit=iSpec, file=trim(spcfile), status='old')
311305
call snFileOpenRead(iSpec,trim(spcfile))
312306
call snSpec(iSpec, inform, cw, lencw, iw, leniw, rw, lenrw)
313307
close(iSpec)
@@ -972,7 +966,7 @@ subroutine f_snend(iw, leniw, rw, lenrw) bind(C,name="f_snend")
972966
! Finish up.
973967
!===========================================================================
974968
close(iw(12)) ! print file
975-
close(iw(13)) ! summary file
969+
if (iw(13) /= 6) close(iw(13)) ! summary file
976970

977971
end subroutine f_snend
978972

src/sqopt_wrapper.f90

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ subroutine f_sqinit(name, len, summOn, iw, leniw, rw, lenrw) &
9494
file(j:j) = name(j)
9595
end do
9696
iPrt = newunit()
97-
!close (iPrt)
98-
!open (iPrt, file=trim(file), status='unknown', position='append')
9997
call snFileOpenAppend(iPrt, trim(file))
10098
end if
10199
end if
@@ -133,8 +131,6 @@ subroutine f_sqsetprint(name, len, iw, leniw, rw, lenrw) &
133131
end do
134132

135133
if (prtfile /= '') then
136-
!close (iPrint)
137-
!open (iPrint, file=trim(prtfile), status='unknown', position='append')
138134
iPrt = newunit()
139135
call snFileOpenAppend(iPrt,trim(prtfile))
140136
call sqSeti('Print file', iPrt, 0, 0, Errors, &
@@ -172,8 +168,6 @@ subroutine f_sqspec(name, len, inform, iw, leniw, rw, lenrw) &
172168

173169
! If we have a file, try to read it.
174170
if (spcfile /= '') then
175-
!close(iSpec)
176-
!open(unit=iSpec, file=trim(spcfile), status='old')
177171
call snFileOpenRead(iSpec,trim(spcfile))
178172
call sqSpec(iSpec, inform, cw, lencw, iw, leniw, rw, lenrw)
179173
close(iSpec)
@@ -356,7 +350,7 @@ subroutine f_sqend(iw, leniw, rw, lenrw) bind(C,name="f_sqend")
356350
! Finish up.
357351
!===========================================================================
358352
close(iw(12)) ! print file
359-
close(iw(13)) ! summary file
353+
if (iw(13) /= 6) close(iw(13)) ! summary file
360354

361355
end subroutine f_sqend
362356

0 commit comments

Comments
 (0)