Error: Bad Trouble in IMCN - Unexpected EOF

  • Thread starter NuclearEng12
  • Start date
  • Tags
    Error
In summary, the conversation discusses an error encountered while using the MCNP program due to incorrect formatting of an input file. The error message indicates an unexpected end of file and points to a specific routine and file in the code. The conversation also suggests checking the syntax and format of the input file, as well as consulting a reference guide or contacting the author of the code for assistance. Additionally, the conversation highlights the importance of properly formatting the input file, including avoiding indentation and ensuring consistent line lengths and number of entries in certain cards.
  • #1
NuclearEng12
11
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
  • #2
Without any specification of software and OS used it classifies for random thoughts thread, not technical question.
 
  • #3
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.
 
  • #4
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:
  • #5
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
 
  • #6
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
 
  • #7
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.
 

What does the error "Error: Bad Trouble in IMCN - Unexpected EOF" mean?

This error typically means that the program has encountered an unexpected end of file while trying to read or write data. This could be due to a corrupted or incomplete file, or an error in processing the data.

How can I fix the "Error: Bad Trouble in IMCN - Unexpected EOF" error?

The first step in fixing this error is to check the file that is causing the error. Make sure it is complete and not corrupted. If the file is fine, then the error may be due to a bug or issue with the program itself. Try updating the program or contacting the developer for assistance.

Can this error be caused by a lack of memory or resources?

Yes, it is possible for this error to occur if the program does not have enough memory or resources to properly process the data. Check your system's resources and try closing any unnecessary programs or files to free up space.

Is there a way to prevent this error from happening?

To prevent this error, it is important to ensure that all files being used by the program are complete and not corrupted. It is also helpful to regularly check for updates to the program and keep your system's resources in check.

What should I do if I continue to encounter this error?

If you continue to encounter this error, even after checking for a complete and uncorrupted file and ensuring your system has enough resources, it may be helpful to contact the developer of the program for further assistance. They may be able to provide more specific troubleshooting steps or address any potential bugs in the program.

Similar threads

Replies
6
Views
1K
Back
Top