Closed dtabell closed 4 years ago
1) Ensured that
WRITE(NRES, ...) foo
is protected by IF(NRES .GT. 0)
WRITE(ABS(NRES), ...) bar
is protected by IF(NRES .NE. 0)
(Most of the WRITE
s to NRES
were already so protected.)
In addition, in a few cases—specifically, error output—I changed
WRITE(NRES, ...) ...
to WRITE(ABS(NRES), ...)...
.
All told, these changes affected a total of fifty files:
bb.f mcobj.f sbendi.f
binary.f normal.f scalin.f
brevol.f obj3.f separa.f
chxc.f objerr.f spnprt.f
emmac.f option.f srloss.f
endjob.f polmes.f svdoc.f
ffagi.f rcarte.f syntrk.f
fitwda.f rcavit.f toscac.f
histab.f rchang.f toscap.f
ksmap.f rfit.f toserr.f
kstop.f rgoto.f trace.f
lign.f robjet.f track.f
map2d.f rpckup.f twiss.f
matimc.f rrebel.f unduli.f
mat3ca.f rscal.f zgoubi.f
mcdes.f rsvdoc.f zgoubi_main.f
mcdesi.f rtosca.f
2) Some of Zgoubi
’s subroutines write to a generic unit number LUN
,
with LUN
being one of the input arguments. I examined all cases where
such subroutines were called with LUN
set to NRES
. If the call was not
protected, then I added appropriate protection to the WRITE
s inside the
subroutine. This change affected the following two files:
mat3rd.f rebel.f
3) In ksmap.f
, I added INCLUDE "C.CDF.H"
. (Bug fix.)
Zgoubi's
OPTIONS
keyword allows one to turn off (or back on) much of the output to the main output file,zgoubi.res
. Since that filename is “connected” to unit numberNRES
, Zgoubi accomplishes this by(NRES .GT. 0)
before aWRITE(NRES, *) ...
, andWRITE(ABS(NRES), *) ...
whenever it wants to ignore thewrite off
option.The
(NRES .GT. 0)
guard was missing in at least a couple of places. Need to find and fix any remaining.