Skip to content

Commit

Permalink
fix for flang open error
Browse files Browse the repository at this point in the history
  • Loading branch information
edoapra committed Nov 16, 2024
1 parent 0779ca2 commit 8e95d44
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/stepper/stpr_gen_aux.F
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,13 @@ subroutine stpr_put_genat_restart(rank,hess,grad0,
logical dipole_okay !< [Input] Should the dipole derivative be
!< stored?
logical lopen !< Is the file open?
logical does_it_exist !< Does the file exist
c
integer iatom_start, ixyz_start
integer iflag_grad0
integer dipole_there
integer iostat
character*256 io_errmsg
c
if (ga_nodeid().ne.0) then
write(luout,*)' non-master node called me ',ga_nodeid()
Expand Down Expand Up @@ -432,6 +435,18 @@ subroutine stpr_put_genat_restart(rank,hess,grad0,
inquire(unit=69,opened=lopen)
if (lopen) call errquit("stpr_put_genat_restart: unit 69 should "
& //"be closed at this point",0,UERR)
inquire(file=FILEATR,exist=does_it_exist)
if(.not.does_it_exist) then
open(unit=69, file=FILEATR,
I iostat=iostat,
& iomsg=io_errmsg)
if(iostat.ne.0)
W write(6,*) ga_nodeid(),' open iomsg WARNING: ',io_errmsg
close(unit=69,iostat=iostat,
& iomsg=io_errmsg)
if(iostat.ne.0)
W write(6,*) ga_nodeid(),' close iomsg WARNING: ',io_errmsg
endif
open(unit=69,file=FILEATR,
& form='unformatted',
& access='sequential',
Expand Down

0 comments on commit 8e95d44

Please sign in to comment.