Skip to main content
📋

Overview

Modern Fortran code for nuclear physics calculations

SMOOTHIE is written in Modern Fortran and designed for high-performance nuclear physics calculations. The code implements the Ichimura-Austern-Vincent formalism for non-elastic breakup reactions and uses advanced numerical methods including the Lagrange-mesh R-matrix approach.

High-performance computing optimized
🔬 Advanced IAV formalism implementation
🎯 Lagrange-mesh R-matrix methods
💻

Language

Modern Fortran

Modern standard
🖥️

Platforms

Linux, macOS, Windows

Cross-platform support
📦

Dependencies

LAPACK/BLAS (optional)

For enhanced performance
🔧

Build System

Make

Standard build tools
🏗️

Code Architecture

Modular design for maintainability and extensibility

🎯
smoothie/
Main Engine
⚙️
general_modules/
📐
mesh_modules/
🔋
pot_modules/
🌊
pw_modules/
⚙️

general_modules/

Core

Core modules containing fundamental constants, precision definitions, and system utilities.

constants.F90 Physical constants and parameters
precision.F90 Numerical precision definitions
systems.f System-specific utilities
channels.f Channel coupling definitions
📐

mesh_modules/

Numerical

Numerical mesh and integration routines for wave function calculations.

mesh.f Radial mesh generation
angularmesh.f Angular quadrature points
gauss.F Gaussian integration methods
derivative.f Numerical differentiation
interpolation.f Interpolation routines
🔋

pot_modules/

Physics

Optical potential models and parameterizations for various nuclear systems.

kd02.f Koning-Delaroche global potential
ch89.f Chapel Hill 89 potential
bg69.f Becchetti-Greenlees potential
guopot.f Guo potential models
pot.f Generic potential interface
🌊

pw_modules/

Mathematics

Partial wave analysis and special function libraries.

clebsch.f Clebsch-Gordan coefficients
spharm.f Spherical harmonics
whittaker.f Whittaker functions
coul90.f Coulomb wave functions
🎯

smoothie/

Main

Main calculation engine implementing the IAV formalism.

smoothie.F Main program entry point
iavdwba.f IAV-DWBA calculations
bound.f Bound state wave functions
scatt.f Scattering wave functions
green.f Green's function methods
input.f Input file parsing
🚀

Installation Guide

Step-by-step instructions to get SMOOTHIE running on your system

1

Prerequisites

Essential components for building SMOOTHIE

🛠️
🔧

Fortran Compiler

gfortran (GCC) or ifort (Intel)

⚙️

Build Tools

make utility

📚

Libraries

LAPACK/BLAS (recommended)

Platform-specific Installation Commands

🐧
Ubuntu/Debian
sudo apt update
sudo apt install gfortran make liblapack-dev libblas-dev
🎩
CentOS/RHEL
sudo yum install gcc-gfortran make lapack-devel blas-devel
🍎
macOS (Homebrew)
brew install gcc make openblas lapack
2

Download Source Code

Clone the SMOOTHIE repository from GitHub

📥
📁

SMOOTHIE Public Repository

Complete source code with examples and documentation

Modern Fortran MIT License Open Source
# Clone the source code
git clone https://github.com/jinleiphys/smoothie-public.git
cd smoothie-public
3

Configure Build Environment

Set up compiler and library settings

⚙️

Edit the make.inc file to match your system configuration:

# Copy appropriate template
cp make.inc.gfortran make.inc    # For GCC/gfortran
# OR
cp make.inc.ifort make.inc       # For Intel Fortran

# Edit configuration
vim make.inc

Key Configuration Options

FC Fortran compiler (gfortran, ifort)
FFLAGS Compiler flags for optimization
LIBS Library linking options
4

Compile SMOOTHIE

Build the executable and all modules

🔨
# Build all modules and main program
make

# Clean previous builds if needed
make clean && make

# Build with specific compiler (optional)
make FC=gfortran

Compilation Results

📚
Module Libraries

Compiled libraries in each subdirectory

🎯
Main Executable

smoothie/smoothie

5

Test Installation

Verify everything works correctly

Run the included test case to verify your installation:

# Navigate to test directory
cd smoothie/test/

# Run test calculation
../smoothie < test.in

# Check output files
ls -la *.out
🎉

Success!

You should see output files containing cross-section data. Your SMOOTHIE installation is ready!

⚙️ Compilation Options

🎯 Optimization Levels

-O0 No optimization (debug builds)
-O2 Standard optimization (recommended)
-O3 High optimization (production)
-Ofast Aggressive optimization

🐛 Debug Options

-g Include debug information
-fcheck=all Runtime array bounds checking
-Wall Enable all warnings
-Wextra Extra warning messages

🔗 Linking Libraries

-llapack Linear algebra package
-lblas Basic linear algebra subprograms
-lm Math library functions
-fopenmp OpenMP parallel processing
🔧

Troubleshooting Guide

Common issues and their solutions for smooth SMOOTHIE operations

1

Compilation Errors

Build-time problems and solutions

🚫

Command not found: gfortran

Install Fortran compiler package for your system

🔗

Cannot find -llapack

Install LAPACK development libraries or modify library paths in make.inc

🔄

Module compilation errors

Ensure Modern Fortran or later compiler. Clean and rebuild all modules

2

Runtime Issues

Execution problems and fixes

⚠️
💥

Segmentation fault during execution

Increase stack size or compile with bounds checking for debugging

📊

Numerical instabilities

Adjust mesh parameters or potential model settings in input file

🐌

Slow performance

Link with optimized BLAS/LAPACK libraries and enable compiler optimizations

3

Platform-Specific Issues

OS-specific considerations and solutions

🔍

Platform-specific Solutions

🍎
macOS

Use Homebrew gcc instead of Xcode's compiler for better Fortran support.

🪟
Windows

Use MinGW-w64 or Windows Subsystem for Linux (WSL) for best compatibility.

🖥️
HPC Systems

Load appropriate modules for compiler and mathematical libraries.

🚀

Deployment & Usage

Advanced deployment strategies and usage patterns for production environments

1

Installing SMOOTHIE Globally

Make SMOOTHIE accessible from anywhere on your system

📁
# Create personal bin directory (if it doesn't exist)
mkdir -p ~/bin

# Copy SMOOTHIE executable to personal bin
cp smoothie/smoothie ~/bin/

# Make executable (if needed)
chmod +x ~/bin/smoothie

# Alternative: Install system-wide (requires sudo)
sudo cp smoothie/smoothie /usr/local/bin/
👤

~/bin/

Personal installation, no sudo required

🌐

/usr/local/bin/

System-wide installation, available to all users

🎯

/opt/smoothie/bin/

Dedicated application directory

2

Setting Up PATH Environment

Configure shell environment for global access

🛤️
# For Bash (add to ~/.bashrc or ~/.bash_profile)
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

# For Zsh (add to ~/.zshrc)
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

# For Fish shell (add to ~/.config/fish/config.fish)
echo 'set -gx PATH $HOME/bin $PATH' >> ~/.config/fish/config.fish

# Verify PATH is set correctly
echo $PATH
which smoothie
3

Input/Output Usage

Flexible I/O redirection and background execution

📡
# Read input from file via stdin
smoothie < input.dat

# Redirect output to file
smoothie < input.dat > results.out

# Pipe output to another program
smoothie < input.dat | grep "Cross section"

# Run in background
smoothie < input.dat > output.log &

# Run with nohup to survive terminal disconnect
nohup smoothie < input.dat > output.log 2>&1 &
4

Environment Configuration

Runtime optimization and performance tuning

🔧
# OpenMP thread control
export OMP_NUM_THREADS=4
export OMP_STACKSIZE=64M

# BLAS/LAPACK optimization
export OPENBLAS_NUM_THREADS=4
export MKL_NUM_THREADS=4

# Set stack size for large calculations
ulimit -s unlimited

Performance Optimization

Maximize computational efficiency and reduce execution time

1

Compiler Optimizations

Build-time performance enhancements

🚀
🎯

Production Flags

Use -O3 or -Ofast for production runs

🔄

Vectorization

Enable vectorization with -ftree-vectorize

📊

Architecture Tuning

Use native architecture flags: -march=native

2

Library Optimizations

High-performance mathematical libraries

📚
🔷

Optimized BLAS

Link with Intel MKL, OpenBLAS, or ATLAS

🔀

Parallel Libraries

Use threaded libraries for parallel execution

⚙️

Environment Setup

Set environment variables: OMP_NUM_THREADS

3

Runtime Tuning

Optimize computational parameters

🎛️
🔬

Mesh Parameters

Adjust mesh density for accuracy vs. speed trade-off

🎯

Angular Momentum

Optimize angular momentum cutoffs

💾

Memory Management

Monitor memory usage and adjust accordingly

🎯 Next Steps

Once you have successfully installed SMOOTHIE, explore the following resources to get started with your calculations: