25–30 Sept 2022
The Cosener's House
Europe/London timezone

Software for the FFA School

Learning to operate simulation codes to model FFAs will be a significant part of the FFA school. In order to participate in these classes you must install the software before the class.

Two software tools will be studied:

  • OPAL
  • Zgoubi

To install OPAL

Linux and Mac users should follow the instructions here. We will be using OPAL-2021.1.0 for the school. The direct download links for the latest OPAL version are here.

Windows users must install the Windows Services for Linux (WSL) windows package. You can find instructions here. For the school, I will assume the default linux distro, which is ubuntu linux. Once you have started WSL, OPAL can be downloaded using wget:

wget http://amas.web.psi.ch/Downloads/OPAL/package/OPAL-2021.1-1-x86_64-linux.tar.xz

Then you can install OPAL as per the linux instructions.

You can check that OPAL is installed okay by doing

opal --version

which should produce the output

2021-1.0

Python environment

We will be using python (version 3) to plot the output from OPAL. In order to install the python environment, you will need the python "standard" plotting package, which is called matplotlib.

Check whether you have it installed

python3 -c 'import matplotlib'

If you get an error message like

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'scipy'

Then you need to install matplotlib. On ubuntu-derivative linux or WSL you can do this using

sudo apt update

sudo apt-get install python3-matplotlib

For other OSes, please refer to your OS documentation or system administrator. Try checking that matplotlib exists and you should not get the error message now.

Contact for questions and technical support for OPAL is Chris Rogers


To install Zgoubi

A – Downloading zgoubi package from sourceforge:

1/ on any browser:   ‘sourceforge zgoubi’

2/ Once there, on the bar:


click on ‘Code’.  That takes you here:

 

Click on ‘trunk’, that takes you here:

 

 


That’s the download you want!  

Click on Download Snapshot.
Be patient, you’re downloading zgoubi package which includes ~1GB of examples, from LHC to light sources, to FFAGs and cyclotrons, that takes some time (the code itself is peanuts, ~1MB)

That will get you    zgoubi-code-r1805-trunk.zip
You may get ‘r1806’, or ‘r1807’ or higher, instead, if updates have occurred recently, that’s ok, doesn’t matter.

3/ Unzip zgoubi-code-r1805-trunk.zip.  

In order to ease communication and file exchanges during the class, you’re encouraged to unzip in a dedicated folder, with name ‘zgoubi’.

You’ll then be facing that zgoubi-code folder content:

4/ Making zgoubi executable:

In there, just ‘make’  
(this is a short for ‘make -f Makefile, it assumes Makefile is present here).  
This requires gfortran. If you have some other Fortran compiler then substitute in Makefile. Otherwise download one on internet.

You’re done.  zgoubi exec  is   ./zgoubi/zgoubi
Its full address, when used from an arbitrary folder, is  [pathTo]/zgoubi-code/zgoubi/zgoubi


B- Testing your install

That’s just a matter of trying an example:

Go in /zgoubi-code/exemples/FFAG/KEK150MeV/analyticalModel/matrix   

In there, do     [pathTo]/zgoubi-code/zgoubi/zgoubi  -in   SFFAGCell_MATRIX.dat

That will run the example, results of the execution are (always!) found in the listing zgoubi.res.

Try the following:

diff zgoubi.res SFFAGCell_MATRIX.res

If no difference (or may be just ‘date’), then your install is ok, you’re done, it works.

BTW: you can go through zgoubi.res, find the tansport matrix at the bottom, and figure out (using Zgoubi Users’ Guide and its INDEX) what zgoubi did from top to bottom.