# forrtl: severe <157> : program exception -access violation MCNP6

#### khary23

Hello all,

Starting yesterday I have been intermittently getting a " forrtl: severe <157> : program exception -access violation" and my runs stopping . Does anyone have any ideas as to what could be causing this ?

I have attached a screen shot of the entire error message

thanks

#### Attachments

• 5.7 KB Views: 29
Related Nuclear Engineering News on Phys.org

#### khary23

I wanted to add that now when I try to run anything I get
'MNCP' is not a reconized internal or external command, operable program or batch file.

#### WWGD

Gold Member
I wanted to add that now when I try to run anything I get
'MNCP' is not a reconized internal or external command, operable program or batch file.
Have you tried searching in edit:Stack Overflow? They keep track of a large number and variety of error messages.

Last edited:

#### Mark44

Mentor
Starting yesterday I have been intermittently getting a " forrtl: severe <157> : program exception -access violation" and my runs stopping . Does anyone have any ideas as to what could be causing this ?
I have attached a screen shot of the entire error message
You haven't provided much information for us to go on. From the cryptic error message, my guess is that it is short for Fortran Run-time library. Here's a link to a stack exchange question about this error - https://stackoverflow.com/questions/13391267/forrtl-severe-157-program-exception-access-violation

Does your problem stem from a program you wrote? If so, the program could be trying to read from or write to a memory location that it should not be using. Or, an argument of a subroutine call isn't right. If this error comes from some code you wrote, show us the code, especially the part that is generating this error.

#### Mark44

Mentor
'MNCP' is not a reconized internal or external command, operable program or batch file.
You have to spell it correctly. In your thread title you have MCNP6 (Monte Carlo N-Particle Transport Code)

#### khary23

The title is correct. MCNP6

#### khary23

You haven't provided much information for us to go on. From the cryptic error message, my guess is that it is short for Fortran Run-time library. Here's a link to a stack exchange question about this error - https://stackoverflow.com/questions/13391267/forrtl-severe-157-program-exception-access-violation

Does your problem stem from a program you wrote? If so, the program could be trying to read from or write to a memory location that it should not be using. Or, an argument of a subroutine call isn't right. If this error comes from some code you wrote, show us the code, especially the part that is generating this error.
I tried another simpler code with the same result. I think I will back up my codes and reinstall

#### Mark44

Mentor
The title is correct. MCNP6
Right, but you're apparently typing MNCP. From post #2:
'MNCP' is not a reconized internal or external command, operable program or batch file.

#### khary23

Right, but you're apparently typing MNCP. From post #2:
When I ran the code I double checked that it was typed correctly as that was my first thought when it didn't run.

#### Mark44

Mentor
When I ran the code I double checked that it was typed correctly as that was my first thought when it didn't run.
I was just going by what you wrote in post #2.

Based on the output you included as a screen shot, the last line of output was this:
Code:
cp0 = 0.02
So the exception comes after this point in the code.

Is this code you wrote, and hence have access to the source, or is it just some program you are running? I asked this back in post #4, but you didn't respond to that question.

If this is your code, it looks like some debugging is in order.

#### khary23

You haven't provided much information for us to go on. From the cryptic error message, my guess is that it is short for Fortran Run-time library. Here's a link to a stack exchange question about this error - https://stackoverflow.com/questions/13391267/forrtl-severe-157-program-exception-access-violation

Does your problem stem from a program you wrote? If so, the program could be trying to read from or write to a memory location that it should not be using. Or, an argument of a subroutine call isn't right. If this error comes from some code you wrote, show us the code, especially the part that is generating this error.
yes it is a program I wrote. I do not think that it is the program because it was running fine until Friday , unless something was inadvertently changed that I did not catch.

#### khary23

I was just going by what you wrote in post #2.

Based on the output you included as a screen shot, the last line of output was this:
Code:
cp0 = 0.02
So the exception comes after this point in the code.

Is this code you wrote, and hence have access to the source, or is it just some program you are running? I asked this back in post #4, but you didn't respond to that question.

If this is your code, it looks like some debugging is in order.
How do I find where the cp0=0.02 point is ? I ask because I am new to MCNP and do not know what cp0 even means.

#### Mark44

Mentor
yes it is a program I wrote.
How do I find where the cp0=0.02 point is ?
Is there somewhere in your code where it displays a value for cp0? It would help if you included the code you wrote.

#### Mark44

Mentor
The screen shot you uploaded in post #1 has this information:
Code:
warning. material      4 has been set to a conductor.

ctm =  0.00  nrn = 0
dump   1 on file runtpi   nps = 0        coll = 0
xact   is done

cp0 = 0.02
forrtl: severe (157): Program Exception - access violation
This information is followed by a list of DLLS, that might be a stack trace.

The last line above before the exception gives a value for cp0, but the first line, which mentions material 4, whatever that is, could be the start of the problem.

Again, show us the code you wrote, and maybe we can figure out where things are going wrong.

#### khary23

The screen shot you uploaded in post #1 has this information:
Code:
warning. material      4 has been set to a conductor.

ctm =  0.00  nrn = 0
dump   1 on file runtpi   nps = 0        coll = 0
xact   is done

cp0 = 0.02
forrtl: severe (157): Program Exception - access violation
This information is followed by a list of DLLS, that might be a stack trace.

The last line above before the exception gives a value for cp0, but the first line, which mentions material 4, whatever that is, could be the start of the problem.

Again, show us the code you wrote, and maybe we can figure out where things are going wrong.

I searched through the file by eye and with EmEditor, but did not find a cp0=0.02. What I did find was that at the start of a run with a simple code, that I know works, one of the cp0= 0.01 was printed underneath ctm etc. So I don't think the 0.02 was the issue.
I have attached the code if you have time to look over it.

#### Attachments

• 4 KB Views: 16

#### Mark44

Mentor
Caveat: I've never used MCNP. Everything I know about it has come from looking at some documentation about the input files.

The first warning on your screen shot in post #1 refers to material 4, so I looked at the input file you posted, in the material card section.

In your input file, in the materials card, you have same materials listed in M3 and M4, which looks to me like it's a mistake. M3 and M4 both list manganese, silicon, chromium, nickel, and iron.

There's what I believe is a comment (a line starting with C) that lists oxygen and hydrogen, with what appear to be incorrect fractional amounts of about 89% and about 11%. If this is supposed to be water, the fractions should be -0.333 and -0.667 for oxygen and hydrogen, respectively.

Should what you have as m4 really be what you have in the commented line referring to M3?
C Define Materials
C Ir-192
M1 077192 1
M2 6000 -0.00012 7000 -0.75527 8000 -0.23178 18000 -0.01283 GAS=1
C Stainless Steel
M3 025000 -0.02 014000 -0.01 024000 -0.17 028000 -0.12 026000 -0.68 <--- same
C M3 8000 -0.888 1000 -.112
m4 025000 -0.02 014000 -0.01 024000 -0.17 028000 -0.12 026000 -0.68 <--- same

#### DEvens

Gold Member
The path in your original error screen cap seems to indicate Windows. I have tried to run your input on my desktop install and it finishes with no weird error messages.

If you get " 'MNCP' is not a reconized " or similar error, you need to check spelling and paths and so on. You have spelled MCNP wrong, left off the 6, and even mis-spelled recognized. If you really did spell it correctly, then be sure you have run the correct bat file before starting. On my Windows install I have a special shortcut that runs the setup bat and leaves a DOS window open for work.

Then check that you actually have got MCNP installed on your system. Check that the installation test bat file will run, for example.

When you get weird error messages like the dreaded "severe exception" kind of thing, you need to round up the usual suspects. This is what happens when MCNP realizes it is in trouble, but is not smart enough to get itself out.

First check you have enough disk space. And that you have the appropriate permissions to read/write/execute everything. You can check that last pretty easily by making a bat file that copies a text file to a new file and running it in the dir you are working in. Also, take a look at the task manager and see how much memory is being used when you run. Have you got enough memory?

Then look to your input file. Did MCNP produce any kind of output file? If MCNP won't produce any useful error messages, you may have to fall back on "brute force" debugging. Make a debug copy of everything and start hacking. Remove about half the input file and see if the error goes away. And so on.

Sometimes the plotter will be useful. Have you got VisEd installed? Though often it is just a big frustration device.

#### khary23

Caveat: I've never used MCNP. Everything I know about it has come from looking at some documentation about the input files.

The first warning on your screen shot in post #1 refers to material 4, so I looked at the input file you posted, in the material card section.

In your input file, in the materials card, you have same materials listed in M3 and M4, which looks to me like it's a mistake. M3 and M4 both list manganese, silicon, chromium, nickel, and iron.

There's what I believe is a comment (a line starting with C) that lists oxygen and hydrogen, with what appear to be incorrect fractional amounts of about 89% and about 11%. If this is supposed to be water, the fractions should be -0.333 and -0.667 for oxygen and hydrogen, respectively.

Should what you have as m4 really be what you have in the commented line referring to M3?
They are the same material

Wow! How did I not catch that, thank you! The problem still persisted

#### khary23

Well I reinstalled MCNP6 and it is now running fine, though my results are not what
I expect.

#### Mark44

Mentor
This is what I copied from the file you uploaded:
C Define Materials
C Ir-192
M1 077192 1
M2 6000 -0.00012 7000 -0.75527 8000 -0.23178 18000 -0.01283 GAS=1
C Stainless Steel
M3 025000 -0.02 014000 -0.01 024000 -0.17 028000 -0.12 026000 -0.68 <--- same
C M3 8000 -0.888 1000 -.112
m4 025000 -0.02 014000 -0.01 024000 -0.17 028000 -0.12 026000 -0.68 <--- same
Should it be like this instead:
Code:
C Define Materials
C Ir-192
M1 077192 1
M2 6000 -0.00012 7000 -0.75527 8000 -0.23178 18000 -0.01283 GAS=1
C Stainless Steel
M3 025000 -0.02 014000 -0.01 024000 -0.17 028000 -0.12 026000 -0.68
C Water ??
M4 8000 -0.888 1000 -.112
Again, the fractional amounts of oxygen and hydrogen don't seem right to me, with twice as many hydrogen atoms as oxygen atoms.

#### khary23

This is what I copied from the file you uploaded:

Should it be like this instead:
Code:
C Define Materials
C Ir-192
M1 077192 1
M2 6000 -0.00012 7000 -0.75527 8000 -0.23178 18000 -0.01283 GAS=1
C Stainless Steel
M3 025000 -0.02 014000 -0.01 024000 -0.17 028000 -0.12 026000 -0.68
C Water ??
M4 8000 -0.888 1000 -.112
Again, the fractional amounts of oxygen and hydrogen don't seem right to me, with twice as many hydrogen atoms as oxygen atoms.
In this code it is the mass fraction of water with oxygen composing of 88.8% of the mass and hydrogen 11.2%.
There are twice as many hydrogen atoms, but they have a mass of only 1.00784 u compared to oxygen at~ 16.0 u

Last edited:

#### Mark44

Mentor
OK, but my main point was that you had the same materials for both M3 and M4, and there was no materials card for water.

#### khary23

The water card is commented out as the DE/Df cards convert the energy deposited to dose to water. Thank you for catching the M3/M4 mistake.

#### khary23

Okay so the reinstall did not fix it. I checked the memory and cpu usage and I have more than enough memory and the run is using 17% of the cpu.
I also wanted to add that initial plot (ip) works and a window opens that shows problem and tally geometry.

#### Mark44

Mentor
The water card is commented out as the DE/Df cards convert the energy deposited to dose to water.
What does "to dose to water" mean? Is this a typo?

In post #11 you wrote
yes it is a program I wrote.
Actually you wrote a script that was the input to the program, MCNP6, just to clear up that misconception on your part.
Okay so the reinstall did not fix it. I checked the memory and cpu usage and I have more than enough memory and the run is using 17% of the cpu.
17% of CPU may or may not be excessive. I'm not familiar with the program, but I'm reasonably sure the program is doing a huge number of floating point calculations.
I also wanted to add that initial plot (ip) works and a window opens that shows problem and tally geometry.
What is the program not doing that you believe it should be doing? Are the results it's producing near to or far from what it should be getting?