Skip to content

Commit

Permalink
Fix #121: Remove error when closing IAEA file
Browse files Browse the repository at this point in the history
When transporting particles through a BEAMnrc shared library geometry
in DOSXYZnrc source 20 (or 21) with a BEAMnrc .egsinp file specifying
IAEA format phase space output, the .egslog file from the BEAMnrc run
indicated an error when closing the IAEA phase space file.

This spurious error message was removed by creating a new macro
$BEAM_CLOSE_PHSP which is replaced by null when BEAMnrc is compiled as a
shared library. (Recall that, when using BEAMnrc as a shared library,
although you must specify phase space output, particles are actually
stored in an array and passed directly to DOSXYZnrc.)
  • Loading branch information
blakewalters authored and ftessier committed Aug 17, 2016
1 parent cf8b24d commit d70e11d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
2 changes: 2 additions & 0 deletions HEN_HOUSE/omega/beamnrc/beam_lib.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ REPLACE {$BEAM_PHSP_BUFFER_FLUSH;} WITH {;};

REPLACE {$BEAM_READ_PHSP_FOR_RESTART;} WITH {;};

REPLACE {$BEAM_CLOSE_PHSP;} WITH {;};

REPLACE {$AVAILABLE_UNIT(#,#);} WITH {;
{P1}=egs_get_unit({P1});
IF ({P1}<1) [
Expand Down
13 changes: 2 additions & 11 deletions HEN_HOUSE/omega/beamnrc/beamnrc.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -5345,17 +5345,8 @@ IF(IWATCH=4 | IZLAST=2 )[
close(IOUTGEOM);
]
IF(ISTORE = -1)[ CLOSE(IOUTRN); ]
IF (IO_OPT = 0)|((IO_OPT = 3)&(IHSTRY <= 100000))|(IO_OPT=4) [
"phase-space output"
DO I=1,NSC_PLANES [
IF(IO_OPT=4)[
$IAEA_DESTROY_PHSP_FILE(IOUTFLU(I));
]
ELSE[
CLOSE(IOUTFLU(I));
]
]
]

$BEAM_CLOSE_PHSP;

CALL DATETIME(1);
OUTPUT DATEN,TIMEN;(/' END OF RUN',10X,$DATEN_FORMAT,1X,$TIMEN_FORMAT//);
Expand Down
14 changes: 14 additions & 0 deletions HEN_HOUSE/utils/phsp_macros.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,20 @@ REPLACE {$BEAM_READ_PHSP_FOR_RESTART;} WITH {;
]"end of loop over planes"
};

REPLACE {$BEAM_CLOSE_PHSP;} WITH {;
IF (IO_OPT = 0)|((IO_OPT = 3)&(IHSTRY <= 100000))|(IO_OPT=4) [
"phase-space output"
DO I=1,NSC_PLANES [
IF(IO_OPT=4)[
$IAEA_DESTROY_PHSP_FILE(IOUTFLU(I));
]
ELSE[
CLOSE(IOUTFLU(I));
]
]
]
};

REPLACE {$DOSXYZ_OPEN_PHSP_FOR_WRITE;} WITH {;
"Added by T. popescu and J.Lobo to write phsps in dosxyz."
"only done for IAEAphsps."
Expand Down

0 comments on commit d70e11d

Please sign in to comment.