Mcnp source subroutine linking trouble

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
7 replies · 8K views
sushildhakal
Messages
2
Reaction score
0
Hi,
I have written a source subroutine and I am trying to link it with mcnp6. When I run my input file it says you need a source subroutine. My input file and the source subroutine(written in fortran) are in the same directory. Where do I have to keep the subroutine to link with mcnp? Any help would be appreciated.
 
Physics news on Phys.org
sushildhakal, I have not used mcnp but will try to help.
You wrote a Fortran source subroutine that you want to compile and link with the mcnp6 library into an executable program? Are you running a command that compiles and links in one step and then runs in another step? Or does the command compile, link, and run all together?
What operating system are you using: Windows, Linux, MacOS? What operating system version?
Are you using a development environment, or are you compiling from the command line?
What command are you using to compile and link?
Is the mcnp6 library a Fortran library?
Is your input file a text file of commands for mcnp to execute at runtime?
Can you copy and paste the error message here?
Do you have the user manual for mcnp? Have you seen: https://laws.lanl.gov/vhosts/mcnp.lanl.gov/mcnp_faq.shtml
 
Hi vulcantaylor,
I think the command compile and run together. I also thought it would link the subroutine at the same time according to their manual. I am using Linux(fedora 13). I am doing from the command line. I just have the executable file from RSICC. It works if I don't use the source subroutine and write the source definition card in my input file. I use mcnp6 N=input file name to run it. Input is a text file which has to be written in the format given in the mcnp6 manual. I have the user manual and it says "when there is no SDEF card mcnp6 will automatically look for source subroutine". There error message is as follows:

Expire parameter is you need a source subroutine.
bad trouble in subroutine source of mcrun
you need a source subroutine.
 
sushildhakal, I could help more with a generic Fortran problem but this is specific to mcnp6.
It works if I don't use the source subroutine and write the source definition card in my input file.
What is a source definition card?

Is mcnp6 a shell script you could examine? It appears to be calling the executable mcrun.

Here are ways mcnp6 could find out about your Fortran source file:
1. mcnp6 could automatically search for your Fortran file. It might look for any file in your current directory with a suffix like .f .f90 .F .F90 Maybe it looks for a file with the same name as your N={input-file-name} but with a .f suffix.
Maybe it looks for a hard-coded filename. Maybe you need to manually compile your Fortran file into a .o file before running mcnp6.
Maybe mcnp6 looks for a file in your home directory, or a directory listed in your path/PATH shell environment variable. There is a small chance the source file needs execute permission set using chmod.
2. mcnp6 may have a command line parameter for specifying the Fortran source file. To get command usage options, type mcnp6 with no parameters or mcnp6 -help
3. The Fortran source file may need to be specified in the mcnp6 input file.

If I run out of ideas, https://rsicc.ornl.gov/codes/ccc/ccc8/ccc-810.html says you could send mail to mcnp6@lanl.gov
There is a forum at https://laws.lanl.gov/vhosts/mcnp.lanl.gov/mcnp_forum.shtml
 
Hello everyone,

How shall I get the MCNP6 source code for Linux. I've sent a message to RSICC and they sent me a link to a webpage but there isn't too much information in there. As you guys can see I have never worked with MCNP6 and now I need it in order to carry on with my further studies.
 
Emerson da Mota said:
Hello everyone,

How shall I get the MCNP6 source code for Linux. I've sent a message to RSICC and they sent me a link to a webpage but there isn't too much information in there. As you guys can see I have never worked with MCNP6 and now I need it in order to carry on with my further studies.

From this site:
Go to the RSICC website to request a copy of the latest MCNP distribution. Two versions are available -- one with the source coding included, and one without the source coding. Both distributions include executables and documentation. Non-US citizens should note that requests for the distribution that includes source coding can take up to several months, since approval from DOE is required; the executable-only distribution can be obtained much faster.
From your IP address I can see that you are posting from a location outside the US, so I am assuming that you are not a US citizen.
 
Mark44 said:
From this site:
From your IP address I can see that you are posting from a location outside the US, so I am assuming that you are not a US citizen.

Okay I'll try once more if I'm not succeed I'll ask for help again. Thanks for now.