29
« Last post by BjornG on February 21, 2025, 03:11:06 PM »
I placed it in the include directory:
bjorn@bjorn-ThinkCentre-M82:~/Feappv/feappv-5.1.2e/include$ ls -l iofile.h iofile2.h
-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
bjorn@bjorn-ThinkCentre-M82:~/Feappv/feappv-5.1.2e/include$ cat iofile.h iofile2.h
integer ior,iow
common /iofile/ ior,iow
logical keepfl,fmtlong
common /iofile2/ keepfl,fmtlong
So I can't understand why iofile2.h can not be opened.
I was skeptical to having two different common blocks with the same name (I have never seen it before).
So I wrote a tiny program test.f which made include of the original iofile.h,
compiled and run it all it worked fine:
bjorn@bjorn-ThinkCentre-M82:~/Feappv/iofile$ cat iofile.h test.f
integer ior,iow
common /iofile/ ior,iow
logical keepfl,fmt_long
common /iofile/ keepfl,fmt_long
include "iofile.h"
iow = 6
ior = 5
keepfl = .true.
fmt_long = .false.
write(6,*)'ior,iow ',ior,iow
write(6,*)'keepfl,fmt_long ',keepfl,fmt_long
end
bjorn@bjorn-ThinkCentre-M82:~/Feappv/iofile$ gfortran -o test test.f
bjorn@bjorn-ThinkCentre-M82:~/Feappv/iofile$ ./test
ior,iow 5 6
keepfl,fmt_long T F