I tried with removing the underscore in fmt_long without success, see attempt 1 below.
The first thing I tried when I got the compile error was to declare fmt_long to be logical in the three files that uses it.
This is of course not a solution to the problem but the compilation finished without errors.
The compiler did not complain about keepfl which is also in iofile.h and used in pnewprob.f
So keepflg and fmt_long (and fmtlong) are treated differentlly for some reason.
pnewprob.f: if(keepfl) then
pnewprob.f: keepfl = .true.
pnewprob.f: fmtlong = .false.
Below is a brief summary of my three attempts and how they fail.
I have no more ideas how to find a solution.
There is a fmt_long on the web
https://linux.die.net/man/3/fmt_longbut I can't see that it has anything to do with my problem.
Yours sincerely
Björn Gustafsson
--------------------------- attempt 1: remove underscore in fmt_long
cat iofile.h
integer ior,iow
common /iofile/ ior,iow
logical keepfl,fmtlong
common /iofile/ keepfl,fmtlong
pmacr1.f:430:15:
430 | fmtlong = .true.
| 1
Error: Symbol ‘fmtlong’ at (1) has no IMPLICIT type
--------------------------- attempt 2: putting all four variables in iofilo.h
cat iofile.h
integer ior,iow
* common /iofile/ ior,iow
logical keepfl,fmtlong
common /iofile/ keepfl,fmtlong,ior,iow
pmacr1.f:430:15:
430 | fmtlong = .true.
| 1
Error: Symbol ‘fmtlong’ at (1) has no IMPLICIT type
--------------------------- splitting iofile.h into two files
cat iofile.h
integer ior,iow
common /iofile/ ior,iow
cat iofile2.h
logical keepfl,fmtlong
common /iofile2/ keepfl,fmtlong
grep iofile2 *.f
pmacr1.f: include 'iofile2.h'
pnewprob.f: include 'iofile2.h'
prtdis.f: include 'iofile2.h'
pmacr1.f:45: Error: Can't open included file 'iofile2.h'
(iofile2.h and iofile.h have he same file permissions:
-rwxr-xr-x 1 bjorn bjorn 76 Feb 20 22:40 iofile2.h
-rwxr-xr-x 1 bjorn bjorn 61 Feb 20 22:40 iofile.h
)
----------------------------