# fac **Repository Path**: lgjiao/fac ## Basic Information - **Project Name**: fac - **Description**: The powerful FAC programs. - **Primary Language**: FORTRAN - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-06-01 - **Last Updated**: 2026-04-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Flexible Atomic Code [![travis](https://travis-ci.org/flexible-atomic-code/fac.svg?branch=master)](https://travis-ci.org/flexible-atomic-code/fac) A software packge for the calculation of various atomic processes. # Installation There are two interfaces available to the FAC numerical lib. One makes use of the Python scripting language, implemented as a package "pfac". The other interface uses a simple command parser, compiled into executables. The two interfaces are independent. Either one or both can be installed. ## 1. Download Download the latest source packages from [here](https://github.com/flexible-atomic-code/fac), gunzip, and extract it. ## 2. Configure Execute `configure` command. You may need to specify some of the following options depending on your environment. #### 2-1. C/fortran compiler If your C compiler is not gcc, then you need to supply the PIC (position independent code) option with `--enable-cpic=***`. If your F77 compiler is not g77, then you need to supply the PIC option with `--enable-fpic=***` Supply the optimization option for C and F77 compilers with `--enable-copt=***` and `--enable-fopt=***` respectively if desired. #### 2-2. cfortran If your F77 compiler is not g77 or sun's f77, specify the option `--with-cfortran=xxFortran` see [faclib/cfortran.doc](faclib/cfortran.doc) for supported F77 compilers. #### 2-3. Installation directory If the default /usr/local is not what you want, specify `--prefix=my/dir`. This dir only affects the installation of SFAC executables. #### 2-4. Parallel computation Some of the functions have a parallel version using MPI. You can build with MPI enabled using the option `--with-mpi=***`, where `***` is the MPI implementation installed on your machine. You have to supply the compile and link flags to the C compiler with `--with-mpicompile` and `--with-mpilink`. MPI support in FAC is rather limited. The primary mean of parallelization is through shared memory OpenMP directives. configure with --with-mpi=omp to enable OpenMP. ## 3. Install SFAC interface To installs the SFAC interface, do ``` make make install ``` ## 4. Install Python interface If you have Python 2.7 or later installed, then: ``` make pfac make install-pfac ``` This installs the PFAC module into Python's default site-package dir corresponding to the python executable. To install for an alternative python, set env. var. PYTHON to the desired python executable, e.g., /usr/bin/python3, before configure, or invoke configure with ./configure PYTHON=/usr/bin/python3 install-pfac has been updated to use "pip install --prefix=$PYPREFIX", where PYPREFIX is the same as PREFIX=/usr/local by default. This should install python modules under $PYPREFIX/lib/python#.$/site-packages or in some systems dist-packages. PYPREFIX can be set when running configure. An extra option can be set during configure, PIPOPTS, which are passed to pip install. In newer versions of PIP, a virtual env is preferred, and it may refuse to install pfac into system python directories. In this case, set PIPOPTS=--break-system-packages will force pip to install pfac without virtual env setup. #### 4-1 Anaconda distribution If your are using Anaconda distribution for Python environment, it may be necessary to install gcc compilers from Anacona. Linux: + gcc_linux-64 + gfortran_linux-64 macOS: + clang_osx-64 + clangxx_osx-64 ``` conda install gcc_linux-64 gfortran_linux-64 ``` For the details of the Anaconda's compiler, see [the official page](https://conda.io/docs/user-guide/tasks/build-packages/compiler-tools.html). It would be better to create a new virtual environment for FAC, as the compiler installation sometimes affects other Python packages. For the details of the virtual environment, see [Anaconda's documentation](https://conda.io/docs/user-guide/tasks/manage-python.html#installing-a-different-version-of-python) # Usage ### PFAC interface The modules can be called just like any python modules, either from the interpreter interactively, or pass the script to python. e.g., ``` python fe24_level.py ``` Some example scripts can be found in [demo](demo) directory. Note that PFAC is not thread safe. Only one instance of calculation can be done in one Python kernel. ### SFAC Interface The non-python interface produces 3 executables, "sfac", "scrm" and "spol", accepting input files as arguments. The syntax of the input file for both programs is identical, and is very similar to the Python syntax, except for the missing of flow controls. ### Manual For more details, please read the [manual](https://github.com/flexible-atomic-code/fac/blob/release-pdf/manual.pdf), including the FAQ section of it. # Contents of FAC ### Third party content that cannot be distributed under GPL. These directories are bundled in fac_util.tar.gz, and are listed in the UtilList file. + blas/, BLAS routines in fortran. + coul/, fortran routines related to coulomb functions. + ionis/, ionization balance calculation of Arnaud&Raymond, and that of Mazzotta et al. Rates fitted by Verner et al. + lapack/, fortran routines from LAPACK. + minpack/, minpack optimization package. + quadpack/, some routines from quadpack for quadrature. + mpfun/, it used to be the multi-precision floating point arithmetic package by Beiley. Since v0.8.6, it was replaced by my own implementation of quad-precision arithmetics. The associated Legendre functions are also put into this directory. + ode/, Livermore Solver for odinary differential equations. + toms/, some numerical routines from TOMS. ## Contents distributed under GPL. These files are bundled in fac_core.tar.gz + README, this file. + ChangeLog, changes. + configure.ac,AutoConf input file + configure, configure script after parsing configure.ac + setup.py, python setup script for building the pfac interface + demo/, some demo scripts. + doc/, reference guide for FAC + doc/papers/, papers describe the theoretical backgrounds. + faclib/, core numerical library. + python/, python interface. + sfac/, non-python interface. # Contribution For bugs and suggestions, please report to [our issue page](https://github.com/flexible-atomic-code/fac/issues). # Contact mingfenggu2003@gmail.com