McStas logo McStas - A neutron ray-trace simulation package ILL; PSI; ESS Niels Bohr Institute DTU Physics NEXMAP


About McStas
 Conditions of use
 Project funding

 Other Downloads (share)

Mailing list

Search web/mailinglist

 Wiki (GitHub)
 McStas manual


Report bugs (GitHub)

Code-repository (GitHub)

McStas: Test_SSW_SSR_Guide

[ Identification | Description | Input parameters | Links ]

The Test_SSW_SSR_Guide Instrument

Test instrument for SSW/SSR interface between McStas and MCNP



This instrument draws neutron events from a Source Surface file created using the
MCNP Monte Carlo code and converts them to make them suitable for a McStas simulation.
Assumes a file called 'rssa' is present in the run dir (or a symbolic link to a file).
To produce 'rssa' file a MCNP simualtion must by run, using a SSW card. See 'MCNP_test_write'
in the /examples
After passing a slit at z=2m, events are written to the same format

Note that axes orientation may be different between MCNP and McStas!
Note also that the conversion of between McStas and MCNP units and parameters
is done automatically by this component - but the user must ensure that
geometry description matches between the two Monte Carlo codes.

The verbose mode is highly recommended as it displays lots of useful informations.

This interface uses the MCNP Source Surface Read/Write format (SSW/SSR).
Infomation transfer from(to) SSW files proceeds via a set of Fortran modules
and subroutines collected in "subs.f"
For succesful compilation, it is required that these subroutines are compiled
and linked to the instrument file:


"mcstas Test_SSR_SSW_Guide.instr" gives: Test_SSR_SSW_Guide.c
"gfortran -c subs.f" gives:  subs.f
"gcc -o runme.out Test_SSR_SSW_Guide.c subs.o -lm -lgfortran" gives: runme.out
"./runme.out" runs the simulation example

Note that this requires a fortran compiler (here gfortran) and gcc.

Input parameters

Parameters in boldface are required; the others are optional.


  • Source code for Test_SSR_SSW_Guide.instr.
  • A reference/HTML link for more information

[ Identification | Description | Input parameters | Links ]

Generated on 2024-01-03 11:47:43

Last Modified: Wednesday, 03-Jan-2024 19:59:11 CET
Search website mailinglist archive GitHub repos