It is about Fortran (ifc compiler and lam-MPI) Redhat Linux 8 or 9
I am trying to use the file /dev/null as many times as possible. Current
fortran routines open several files to read and/or write. Especially, for
the files to be opened for write, I do not want for slave nodes to write
data to the same files which have assigned with unit numbers. That is,
openning/redirecting those files for write to the file '/dev/null' more
than once in a routine or in many routines with different unit numbers
cause problems in fortran:
For example,
if (my_id .eq. 0) then
open(13, file='abc.dat', .......)
open(14, file='xyz.dat', .......)
else
open(13, file='/dev/null', .......)
open(14, file='/dev/null', .......)
endif
The reason I am doing the way above is that so many routines(hundreds)
have been written with the following writestatements (thousand times):
write(13, .......)
write(14, .......) (most files should be opened entire run time)
and I do not want to rewrite them all in the following way,
if (my_id .eq. 0) then
write(13, .......)
write(14, .......)
endif
Does anyone know about a better solution to handle this sort of issues? By
the way, IRIX compilers do not cause such problems openning '/dev/null'
file several times with different unit numbers without closing the
'/dev/null' file.
Thanks,
Hwanho Kim
|