Error: Bad Trouble in IMCN - Unexpected EOF

  • Thread starter Thread starter NuclearEng12
  • Start date Start date
  • Tags Tags
    Error
AI Thread Summary
The error message "bad trouble in imcn in routine pass1 unexpected eof in file" likely stems from incorrect formatting in the input file, particularly with the SDEF, SI, and SP cards. The SDEF card should not have leading spaces, as this can cause the program to misinterpret the following SI and SP cards as continuations of the SDEF card. Each SI and SP card must have the same number of entries, and if SP2 is omitted, it may lead to an unexpected EOF error. It's important to ensure that there are no tab characters and that the overall formatting adheres to the expected structure outlined in the documentation. Properly annotating the input deck and checking for line breaks between sections can also help resolve the issue.
NuclearEng12
Messages
11
Reaction score
0
I am getting an error which reads as follows:


"bad trouble in imcn in routine pass1
unexpected eof in file ****** "

I just added a sdef and nps card to my input file, so I assumed the error was with one of those.

SDEF AXS=0 0 1 ERG=D1 RAD=D2 WGT=1 TME=0 PAR=1
SI1 0 .4 .8 1.2 1.6 2 2.4 2.8 3.2 3.6 4 4.4 4.8 5.2 5.6 6 6.4
6.8 7.2 7.6 8 8.4 8.8 9.2 9.6 10 10.4 10.8 11.2 11.6 12 12.4
12.8 13.2 13.6 14 14.4 14.8 15.2 15.6 16 16.4 16.8 17.2 17.6
18 18.4 18.8 19.2 19.6 20
SP1 0 .8718 .0320 .0181 .0145 .0121 .0113 .009 .007 .0044 .0035
.0035 .0028 .0028 .0023 .0011 .0011 .0007 .0005 .0002 .0004
.0002 .0002 .000026 .000081 .0002 .000089 .0001 .000077
.000018 .000018 .000026 0 0 .000017 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0
SI2 -21 0

But I just can not figure out what is the problem. Would appreciate any suggestions.
 
Engineering news on Phys.org
Without any specification of software and OS used it classifies for random thoughts thread, not technical question.
 
The format of your input file does not comply with what is expected by the program.
Apparently you cannot add sdef or nps to it, or at least not in the way you have done it.

To fix it, you need to use a document specifying the format of the file, if it exists.

Or contact the author of the code and ask him.

Or you would need to analyse the code that tries to read the input file.
Assuming of course that you have access to the source code.
It seems to be in some module named "imcn" that contains a routine named "pass1".
Search for the error message in the source code.
I expect the code to be fairly straight forward, so you may be able to deduce what it expects.
 
I'm not familiar with MCNP, but one should check one's syntax.

I believe that SI1 should be followed by an A to indicate an array.

SP1 should have the same number of entries as SI1.

SI2 needs a corresponding SP2 with the same number of entries. If SP2 is omitted, that is probably where the program encounters and unexpected EOF since it would be looking for a SP2 vector.


I nice simple reference - http://www.mne.ksu.edu/~jks/MCNPprmr.pdf


I would also urge one to annotate (write comments in) the input deck in order to explain the model and the logic behind the model (see page 30 (33 of 45 in pdf) of the document cited).
 
Last edited:
The first distribution needs equal numbers on the SI and SP cards
You need to fix the second distribution defining the radius of your source. it needs an si and sp line,

Also check you have not removed the line break between the surface cards and data cards
 
NuclearEng12 said:
I am getting an error which reads as follows:


"bad trouble in imcn in routine pass1
unexpected eof in file ****** "

I just added a sdef and nps card to my input file, so I assumed the error was with one of those.

SDEF AXS=0 0 1 ERG=D1 RAD=D2 WGT=1 TME=0 PAR=1
SI1 0 .4 .8 1.2 1.6 2 2.4 2.8 3.2 3.6 4 4.4 4.8 5.2 5.6 6 6.4
6.8 7.2 7.6 8 8.4 8.8 9.2 9.6 10 10.4 10.8 11.2 11.6 12 12.4
12.8 13.2 13.6 14 14.4 14.8 15.2 15.6 16 16.4 16.8 17.2 17.6
18 18.4 18.8 19.2 19.6 20
SP1 0 .8718 .0320 .0181 .0145 .0121 .0113 .009 .007 .0044 .0035
.0035 .0028 .0028 .0023 .0011 .0011 .0007 .0005 .0002 .0004
.0002 .0002 .000026 .000081 .0002 .000089 .0001 .000077
.000018 .000018 .000026 0 0 .000017 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0
SI2 -21 0

But I just can not figure out what is the problem. Would appreciate any suggestions.

Ok, that's odd. In the quote screen the continuation of the SI card and SP card are shown indented, but not when I read your post directly. And when I preview there are no leading blanks either. PF has some quirks.

When your SDEF uses ERG=D1, then you add cards to provide the information. Those cards are cards, not continuations of the SDEF. You hook them up through the number, D1 goes with SI1 and SP1. You don't hook them up with indenting.

So in the first two lines

SDEF AXS=0 0 1 ERG=D1 RAD=D2 WGT=1 TME=0 PAR=1
__________SI1 0 .4 .8 1.2 1.6 2 2.4 2.8 3.2 3.6 4 4.4 4.8 5.2 5

I put in _ characters indicating the leading blanks I found. Don't use _ in MCNP, use blank.

You have blank characters in front of SI1. The first line of the SI1 card does not get indented. It's a card. The extra lines of the SI1 card get indented. (With spaces, not a tab. Don't use the tab character.) MCNP probably thinks the various SI and SP cards are part of the SDEF card. (Indenting 5 or more spaces indicates a continuation of a card.)

So it's looking for the SI and SP cards to match ERG=D1 and RAD=D2, and does not find them before the end of the file, because it has not parsed the entire (incorrect) SDEF card yet.

Other than that, round up the usual suspects:

Cells then surfaces then data, exactly one blank line between.

No tab characters.

Look to your line lengths, nothing longer than 72 characters.

Number of entries in SI1 and SP1 have to agree.

Hope this helps.
Dan
 
I concur with evrything the previous writer said with one important addition.

If there is an continuation to a previuos card you cannot have a digit within the first 5 spaces of the new line. MCNP then interprets this as a new card. Just an important note to think of when writing your input deck.
 
Back
Top