Mcnp source subroutine linking trouble

Click For Summary

Discussion Overview

The discussion revolves around linking a Fortran source subroutine with the MCNP6 software. Participants are addressing issues related to compiling and running the subroutine in conjunction with MCNP6, including error messages encountered and the process for obtaining the MCNP6 source code for Linux.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant is attempting to link a Fortran source subroutine with MCNP6 but encounters an error stating that a source subroutine is needed.
  • Another participant questions whether the command used compiles and links in one step or separately, and asks for details about the operating system and commands being used.
  • A participant mentions that the executable works without the source subroutine and provides the error message received when attempting to run the input file without it.
  • Suggestions are made regarding how MCNP6 might locate the Fortran source file, including potential file naming conventions and directory locations.
  • One participant expresses a need for the MCNP6 source code for Linux and shares their experience with RSICC regarding obtaining it.
  • Another participant asks for clarification on the webpage provided by RSICC and the implications of being a non-US citizen in the context of obtaining the source code.

Areas of Agreement / Disagreement

Participants express uncertainty regarding the linking process and the specific requirements for the source subroutine. There are multiple viewpoints on how to resolve the linking issue, and the discussion remains unresolved.

Contextual Notes

Participants mention various assumptions about file locations, naming conventions, and the need for permissions, but these points remain unverified and are dependent on specific configurations and setups.

Who May Find This Useful

This discussion may be useful for users of MCNP6, particularly those working with Fortran source subroutines, as well as individuals seeking guidance on obtaining MCNP6 source code for Linux.

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.
 
Technology 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.
 
Emerson da Mota said:
they sent me a link to a webpage

Which webpage? Can you share the link with us?
 
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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 59 ·
2
Replies
59
Views
12K
Replies
2
Views
7K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 10 ·
Replies
10
Views
10K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K