I have some legacy programs that I am using to test ftn95. I'm having trouble getting the combination of subroutine entry points and Namelist data inputs working. I get a runtime error 112.
Below is a simple test program that generates the error. If I use subroutines instead of entry points, it works. I am far from an experienced programmer and would like to know what the issue is. Any insight would be appreciated - i'm sure it's something silly on my part.
Thanks
program test
include 'all.inc'
namelist /STEP/ D1
open(1, file='six.at2')
rewind (1)
read (1, nml=STEP)
print*, d1
call printsubinit
call myprint
print*,d1
end program test
subroutine myprint
include 'all.inc'
namelist /prt/ xy
print*, \'test output\'
return
cc end
entry printsubinit
cc subroutine printsubinit cc include 'all.inc' cc namelist /prt/ xy print*,'herehere' rewind (1) print*,'hereherehere' read (1, nml=prt) print*,'999',5d1 print,xy return end
COMMON /ALL/ d1,xy !include file
&STEP !DATA FILE D1=.0025 d1=9. /
&prt xy=120. /