MCNP Problem - Bad character in column 2

  • Thread starter Thread starter KOKI
  • Start date Start date
  • Tags Tags
    Error Mcnp
Click For Summary

Discussion Overview

The discussion revolves around an error encountered in MCNP (Monte Carlo N-Particle Transport Code) related to formatting issues in the input file. Participants explore potential causes and solutions for the error message indicating a bad character in column 2 of the cell cards.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant reports an error message related to bad characters in the input file, specifically in the cell cards section.
  • Another participant suggests attaching the input file for further analysis and inquires about the editing method used, hinting at potential formatting issues.
  • Several participants mention that the use of tabs instead of spaces may be causing the error, noting the historical context of the code's development.
  • It is pointed out that specific formatting rules must be followed, such as having a single blank line between the cell cards and surface cards, and between surface cards and the data/source section.
  • One participant expresses continued difficulty despite attempts to correct the formatting, prompting questions about the specific changes made.
  • Another participant warns against using spaces in the input file name, suggesting that this could also lead to errors.

Areas of Agreement / Disagreement

Participants generally agree that formatting issues, particularly the use of tabs and spacing, are likely causes of the error. However, there is no consensus on the effectiveness of the proposed solutions, as some participants continue to experience the same problem.

Contextual Notes

Participants mention that the MCNP code has legacy constraints from its origins in the 1970s, which may affect its flexibility regarding formatting. Specific assumptions about formatting rules and file naming conventions are highlighted but not universally agreed upon.

KOKI
Messages
4
Reaction score
0
TL;DR
hello , I am getting an error that reads as follows:

1 PX 12.5

bad trouble in imcn in routine ckchar

bad character, probably a control character, in column 2
hello , I am getting an error that reads as follows:
1 PX 12.5
bad trouble in imcn in routine ckchar
bad character, probably a control character, in column 2Cell cards
1 0 1 -2 -7 8 10 -9 imp: n=1
2 0 2 -3 -7 8 10 -9 imp: n=0
3 0 3 -4 -7 8 10 -9 imp: n=1
4 0 4 -5 -7 8 10 -9 imp: n=0
5 0 5 -6 -7 8 10 -9 imp: n=1
6 0 -14 #1 #2 #3 #4 #5 #7 imp: n=0
7 0 -11 -12 13 imp: n=1
8 0 14 imp:n=0c Surface cards
1 PX 12.5
2 PX 15
3 PX 15.05
4 PX 16.05
5 PX 16.1
6 PX 21.1
7 PY 5
8 PY -5
9 PZ 5
10 PZ -5
11 CX 0.5
12 PX 0
13 PX -1
14 SO 30
 
Engineering news on Phys.org
Try attaching your input file, you will need to rename it to add .txt at the end.

How are you editing it? With a simple text editor?

This is usually a formatting char problem.
 
bien
 
:
 

Attachments

The error is that you are using tabs instead of spaces. This code is descended from things written in the 1970's, on mainframes, in FORTRAN, by physicists. Some aspects are not very flexible.

A second problem is that the gap between the cell cards and the surface cards needs to be a single blank line. The gap between the surface cards and the data/source section also needs a blank line but more may not matter. The extra blank lines in that section may also be fine, without trying it I'm not sure, but normally that is not done.
 
  • Like
Likes   Reactions: mfb
Alex A said:
The error is that you are using tabs instead of spaces. This code is descended from things written in the 1970's, on mainframes, in FORTRAN, by physicists. Some aspects are not very flexible.

A second problem is that the gap between the cell cards and the surface cards needs to be a single blank line. The gap between the surface cards and the data/source section also needs a blank line but more may not matter. The extra blank lines in that section may also be fine, without trying it I'm not sure, but normally that is not done.
I tried but I find the same problem
 
KOKI said:
I tried but I find the same problem
What does "tried" mean here? Did you replace the tabs with ordinary space characters? Did you make sure there was exactly one blank line between cells and surfaces, exactly one blank line between surfaces and data, and no other blank lines?
 
KOKI said:
I tried but I find the same problem
Sometimes the name of your input file create problems, do not put any space in your input file . such as you can write mcnpcode.txt but you cannot write mcnp code.txt .. The input file that you run dislikes any space between it. And try to make your input file as short as possible. I am a victim of that kind of error .
 

Similar threads

Replies
1
Views
3K
Replies
6
Views
7K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K