diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12174ed21..33ac6f352 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,16 +9,17 @@ # # ----------------------------------------------------------------------------- -# Workflow for continuous integration (CI) of AtChem2, -# using Github Actions and Codecov +# Workflow for the continuous integration (CI) of AtChem2, using +# Github Actions and Codecov # # Acknowledgements: J. Allsopp -# ----------------------------------------------------- # +# -------------------------------------------------------------------- # name: AtChem2 CI # ------------------------------ EVENTS ------------------------------ # # Controls when the workflow is activated on: + # Triggers when a pull request is created or updated (only on the # master branch) pull_request: @@ -27,58 +28,64 @@ on: # Triggers when a push is made to the master branch (either by # merging a pull request, or by direct commit) push: - branches: - - master + branches: [ master ] # Run manually from the Actions tab workflow_dispatch: # ------------------------------ JOBS ------------------------------ # -# This workflow contains a single job called `testing`, which compiles -# the AtChem2 model, runs the Testsuite, and checks the Testsuite code -# coverage using Codecov +# This workflow contains a single job called `ci_testing` which +# compiles the AtChem2 model, runs the Testsuite, and checks the code +# coverage using Codecov (https://app.codecov.io/gh/AtChem/AtChem2) jobs: - testing: - # The job runs on both linux (ubuntu) and macos runner images, - # with three versions of gnu fortran -- the runner images are - # described here: https://github.com/actions/runner-images + ci_testing: + # The job runs on two versions of linux (ubuntu) and macos runner + # images, with three versions of gnu fortran -- the runner images + # are described here: https://github.com/actions/runner-images runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, macos-12] - fortran: [9, 10, 11] - exclude: #TODO: fortran9 does not work on macos12 - - os: macos-12 - fortran: 9 + os: [ubuntu-20.04, ubuntu-22.04] #, macos-12, macos-13] + fortran: [10, 11, 12] + exclude: # gfortran-11, gfortran-12 not available for ubuntu-20.04 + - os: ubuntu-20.04 + fortran: 11 + - os: ubuntu-20.04 + fortran: 12 fail-fast: false # ------------------------------------------------------------- - # Sequence of tasks to be executed as part of the `testing` job: - # 1. checkout the repository - # 2. install gfortran, AtChem2 dependencies - # 3. compile AtChem2 - # 4. run all tests (indent, style, unit, model) - # 5. recompile AtChem2, run unit and model tests for Codecov + # Sequence of tasks to be executed as part of the `ci_testing` job: + # 1. Checkout the repository + # 2. Install gfortran, AtChem2 dependencies + # 3. Compile AtChem2 + # 4. Run the Testsuite with default settings + # 5. Recompile AtChem2, run unit and model tests for Codecov steps: # ------------------------------------------------------------- # (1) Checkout the repository under $GITHUB_WORKSPACE - - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout with: fetch-depth: 2 # ------------------------------------------------------------- # (2) Install gfortran, if not supplied with the runner image, - # and the AtChem2 dependencies (CVODE, openlibm, numdiff, FRUIT) + # and the AtChem2 dependencies: CVODE, openlibm, numdiff, FRUIT + + # gfortran on ubuntu + # - name: Install gfortran-11 (ubuntu-20.04) + # if: matrix.os == 'ubuntu-20.04' && matrix.fortran == 11 + # run: sudo apt-get install gfortran-11 - # gfortran on macos-11 - - name: Install gfortran-9 (macos-11) - if: matrix.os == 'macos-11' && matrix.fortran == 9 + # gfortran on macos + - name: Install gfortran-10 (macos-12) + if: matrix.os == 'macos-12' && (matrix.fortran == 10) # || matrix.fortran == 11) run: brew install gcc@${{ matrix.fortran }} - # gfortran on macos-12 - - name: Install gfortran-9 and gfortran-10 (macos-12) - if: matrix.os == 'macos-12' && (matrix.fortran == 9 || matrix.fortran == 10) + - name: Install gfortran-10 and gfortran-11 (macos-13) + if: matrix.os == 'macos-13' && (matrix.fortran == 10 || matrix.fortran == 11) run: brew install gcc@${{ matrix.fortran }} # AtChem2 dependencies @@ -97,13 +104,13 @@ jobs: # ------------------------------------------------------------- # (3) Compile AtChem2 using the standard compilation flags - name: Build AtChem2 - # Set $FORT_VERSION for use with the `Makefile`, called from - # the `build_atchem2.sh` script + # Set $FORT_VERSION for use with the `Makefile`, which is + # called by the `build_atchem2.sh` script env: FORT_VERSION: ${{ matrix.fortran }} run: | cp tools/install/Makefile.skel Makefile - ./build/build_atchem2.sh ./model/mechanism.fac + ./build/build_atchem2.sh ./model/mechanism.fac ./model/configuration/ ./mcm/ # macos only if [ $RUNNER_OS != "Linux" ] ; then @@ -114,8 +121,8 @@ jobs: fi # ------------------------------------------------------------- - # (4) Run all tests: indent, style, unit, model - + # (4) Run the Testsuite using the standard compilation flags and + # default settings: indent, style, unit, model tests - name: Indent and Style tests run: | make indenttest @@ -129,26 +136,27 @@ jobs: export PATH=$PATH:$PWD/numdiff/bin make unittests make oldtests # NB: oldtests will eventually be merged into modeltests - #make modeltests # NB: modeltests are temporarily deactivated (pass on linux, fail on macos) + #make modeltests # TODO: temporarily deactivated (pass on linux, fail on macos) # ------------------------------------------------------------- - # (5) Recompile AtChem2 using the code coverage flags, then - # upload the gcov files to Codecov - + # (5) Recompile AtChem2 using the code coverage compilation + # flags, then upload the gcov files to Codecov - name: Unit and Model tests (x Codecov) - if: matrix.os == 'ubuntu-22.04' && matrix.fortran == 11 + if: matrix.os == 'ubuntu-22.04' && matrix.fortran == 12 # Set $FORT_VERSION for use with the `Makefile` env: FORT_VERSION: ${{ matrix.fortran }} run: | export PATH=$PATH:$PWD/numdiff/bin make clean + # unit tests make unittests CCOV=true - mv tests/unit_tests/*.gc* ./ # Needed to deal with gcc11 changing the way it handles gcda and gcna files - make modeltests CCOV=true # Run only the new model Testsuite + mv tests/unit_tests/*.gc* ./ # for gcc>=11 handling of *.gcda, *.gcna files + # model tests + make modeltests CCOV=true # run only the new Testsuite - - name: Upload coverage reports to Codecov - if: matrix.os == 'ubuntu-22.04' && matrix.fortran == 11 - uses: codecov/codecov-action@v3 + - name: Upload coverage reports to Codecov # TODO: update codecov action + if: matrix.os == 'ubuntu-22.04' && matrix.fortran == 12 + uses: codecov/codecov-action@v3 # https://github.com/marketplace/actions/codecov with: gcov: true diff --git a/.github/workflows/tex.yml b/.github/workflows/tex.yml new file mode 100644 index 000000000..a9ab3d677 --- /dev/null +++ b/.github/workflows/tex.yml @@ -0,0 +1,88 @@ +# ----------------------------------------------------------------------------- +# +# Copyright (c) 2017 Sam Cox, Roberto Sommariva +# +# This file is part of the AtChem2 software package. +# +# This file is covered by the MIT license which can be found in the file +# LICENSE.md at the top level of the AtChem2 distribution. +# +# ----------------------------------------------------------------------------- + +# Workflow to generate automatically the pdf file of the AtChem2 manual +# -------------------------------------------------------------------- # +name: AtChem2 PDF + +# ------------------------------ EVENTS ------------------------------ # +# Controls when the workflow is activated +on: + + # Triggers when a pull request is created or updated (only on the + # master branch) + pull_request: + branches: [ master ] + paths: + - './doc/latex/*.tex' + - './doc/figures/*.svg' + + # Triggers when a push is made to the master branch (either by + # merging a pull request, or by direct commit) + push: + branches: [ master ] + +# ------------------------------ JOBS ------------------------------ # +# This workflow contains a single job called `pdf_manual` which sets +# up a full TeXLive environment, compiles the latex source files, and +# generates the pdf file of the manual +jobs: + pdf_manual: + # The job runs on the latest version of linux (ubuntu) + runs-on: ubuntu-latest + + steps: + + # ------------------------------------------------------------- + # 1. Checkout the repository from the branch associated with the + # current Pull Request + - name: Checkout repo + uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout + with: + fetch-depth: 2 + ref: ${{ github.ref }} + + # - name: Check Token Permissions + # run: | + # echo "Token Permissions: $(curl -sSL -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/AtChem/AtChem2 | jq .permissions)" + + # ------------------------------------------------------------- + # 2. Setup TeXLive and Inkscape (v1.x), then run the script to + # generate the pdf file of the manual + - name: Setup TexLive and compile the manual + uses: xu-cheng/texlive-action@v2 # https://github.com/marketplace/actions/github-action-with-texlive + with: + scheme: full + run: | + # install inkscape + apk add inkscape + # run script to generate the pdf file + ./tools/make_manual_pdf.sh + + - name: Upload pdf file as artifact + uses: actions/upload-artifact@v4 # https://github.com/marketplace/actions/upload-a-build-artifact + with: + name: AtChem2-Manual.pdf + path: doc/AtChem2-Manual.pdf + + # ------------------------------------------------------------- + # 3. + - name: Configure git + run: | + git config --local user.name "github-actions[bot]" + git config --local user.email "github-actions[bot]@users.noreply.github.com" + + - name: Commit and Push + run: | + git add doc/AtChem2-Manual.pdf + git status + #git commit -m "Update AtChem2-Manual.pdf" + #git push origin HEAD:${{ github.ref }} diff --git a/build/mech_converter.py b/build/mech_converter.py index 12ba1a5dd..b8796b84b 100644 --- a/build/mech_converter.py +++ b/build/mech_converter.py @@ -278,9 +278,6 @@ def convert_to_fortran(input_file, mech_dir, mcm_vers): # Check that each of the RO2s from 'Peroxy radicals' are present # in the RO2 reference list from the MCM. If not, print a warning # at the top of mechanism.f90 for each errant species. - # - # TODO: This will break the expected format when mechanism.f90 is - # replaced by a parsable format print('looping over inputted RO2s') with open(os.path.join(mech_dir, 'mechanism.f90'), 'w') as mech_rates_file: diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 000000000..5597b662d --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,8 @@ +# Ignore latex auxiliary files and png images in this directory +figures/*.png +latex/*.aux +latex/*.bbl +latex/*.blg +latex/*.log +latex/*.out +latex/*.toc diff --git a/doc/figures/.gitignore b/doc/figures/.gitignore deleted file mode 100644 index 9d57a63f4..000000000 --- a/doc/figures/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore image files in this directory -*.png diff --git a/doc/figures/model-setup.svg b/doc/figures/model-setup.svg index 8f0a4bdc8..c9f5397f9 100644 --- a/doc/figures/model-setup.svg +++ b/doc/figures/model-setup.svg @@ -1042,7 +1042,7 @@ id="tspan4213-2-4-6-4-6" x="346.74762" y="557.91309" - style="font-size:20px;line-height:1.25;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none">atchem-lib + style="font-size:20px;line-height:1.25;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none">AtChem-lib diff --git a/doc/latex/.gitignore b/doc/latex/.gitignore deleted file mode 100644 index c863c1bd1..000000000 --- a/doc/latex/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# Ignore latex auxiliary files in this directory -*.aux -*.log -*.out -*.toc -*.bbl -*.blg diff --git a/doc/latex/AtChem2-Manual.tex b/doc/latex/AtChem2-Manual.tex index e9893dd30..c9170e66c 100644 --- a/doc/latex/AtChem2-Manual.tex +++ b/doc/latex/AtChem2-Manual.tex @@ -11,11 +11,12 @@ % -------------------- PREAMBLE -------------------- % \documentclass[11pt,a4paper]{report} -\usepackage{helvet,graphicx,hyperref,color} +\usepackage{helvet,graphicx,hyperref} \usepackage{fancyhdr,caption,natbib} -\usepackage[nottoc]{tocbibind} +\usepackage[dvipsnames]{xcolor} \usepackage[version=3]{mhchem} +% page style \pagestyle{fancy} \setlength{\headheight}{13.6pt} \rhead{\leftmark} @@ -24,9 +25,15 @@ \renewcommand{\bibname}{References} \frenchspacing +% links +\hypersetup{colorlinks=true, + linkcolor=BrickRed, + citecolor=ForestGreen, + urlcolor=NavyBlue} + % shortcuts \newcommand{\maindir}{\texttt{\em Main Directory}} -\newcommand{\depdir}{\texttt{\em Dependency Directory}} +\newcommand{\depdir}{\texttt{\em Dependencies Directory}} \newcommand{\sharedir}{\texttt{\em Shared Library Directory}} \newcommand{\degc}{^\circ\mathrm{C}} @@ -73,5 +80,7 @@ \bibliographystyle{abbrvnat} \bibliography{References} +\addcontentsline{toc}{chapter}{References} \end{document} +% rates output and reaction rates output can't be zero in config diff --git a/doc/latex/Credits.tex b/doc/latex/Credits.tex index e75fd1a0d..b693656de 100644 --- a/doc/latex/Credits.tex +++ b/doc/latex/Credits.tex @@ -27,8 +27,10 @@ \section{Credits} \label{sec:credits} \begin{itemize} \item James Allsopp +\item Will Drysdale \item Maarten Fabr{\'e} \item Alfred Mayhew +\item Killian Murphy \item Beth Nelson \item Mike Newland \item Marios Panagi @@ -63,7 +65,6 @@ \section{Acknowledgements} \label{sec:acknowledgements} \item Nahid Chowdhury \item Stuart Lacy \item Vasilis Matthaios -\item Killian Murphy \item Paul Monks \item Jon Wakelin \item Rob Woodward-Massey @@ -79,7 +80,7 @@ \section{Funding} \label{sec:funding} Funding has been provided, at different stages, by: \begin{itemize} -\item Eurochamp project: \url{https://www.eurochamp.org}. +\item EUROCHAMP project: \url{https://www.eurochamp.org}. \item Met Office: \url{https://www.metoffice.gov.uk}. \item National Centre for Atmospheric Science (NCAS):\\ \url{https://www.ncas.ac.uk}. \item Natural Environment Research Council (NERC):\\ \url{https://nerc.ukri.org}. diff --git a/doc/latex/Development.tex b/doc/latex/Development.tex index b6a4a6fba..86ee28bf2 100644 --- a/doc/latex/Development.tex +++ b/doc/latex/Development.tex @@ -31,8 +31,8 @@ \section{General Information} \label{sec:general-information} AtChem2 is under active development, which means that the \texttt{master\ branch} is sometimes a few steps ahead of the latest stable release. Any modification to the code is automatically run -through the \hyperref[sec:test-suite]{Test Suite} before it is merged -into the \texttt{master\ branch}. The Test Suite is designed to ensure +through the \hyperref[sec:test-suite]{Testsuite} before it is merged +into the \texttt{master\ branch}. The Testsuite is designed to ensure that changes to the code do not cause unintended behaviour or unexplained differences in the model results, so the development version is normally safe to use. However, it is recommended to use the @@ -50,16 +50,16 @@ \section{General Information} \label{sec:general-information} The coding guidelines for Fortran are detailed in Sect.\ref{sec:style-guide}. % -------------------------------------------------------------------- % -\section{Test Suite} \label{sec:test-suite} +\section{Testsuite} \label{sec:test-suite} AtChem2 uses \href{https://github.com/features/actions}{GitHub Actions} for \textbf{continuous integration} testing. This programming approach ensures that changes to the code do not modify the behaviour and the -results of the software in an unintended fashion. The Test Suite is in +results of the software in an unintended fashion. The Testsuite is in the \texttt{tests/} directory and consists of a series of tests and short model runs that check the model functionality and calculations against known outputs. The \href{https://codecov.io}{Codecov} service -is used to verify that the Test Suite covers a significant fraction of +is used to verify that the Testsuite covers a significant fraction of the codebase ($>$90\%) and a wide range of common configurations. There are four types of tests, which can be executed from the @@ -78,7 +78,7 @@ \section{Test Suite} \label{sec:test-suite} outputs -- \verb|make modeltests|. \end{itemize} -The command \verb|make alltests| runs all the tests in the Test Suite +The command \verb|make alltests| runs all the tests in the Testsuite in succession. Each test outputs the results to the terminal and, in case of failure, a log file (\texttt{tests/testsuite.log}) is generated for the indent, style and behaviour tests. If all tests are @@ -92,9 +92,9 @@ \section{Test Suite} \label{sec:test-suite} Testsuite PASSED \end{verbatim} -The Test Suite is automatically run every time a Pull Request (PR) is created +The Testsuite is automatically run every time a Pull Request (PR) is created or updated on the main github repository (\texttt{AtChem/AtChem2}). The Pull -Request triggers a build on GitHub Actions which runs the entire Test Suite on +Request triggers a build on GitHub Actions which runs the entire Testsuite on two architectures (Linux and macOS) using different versions of the GNU \texttt{gfortran} compiler. The CI tester performs the following tasks on each architecture: @@ -260,7 +260,7 @@ \section{Style Guide} \label{sec:style-guide} of one: the second argument sends the script output to another file, leaving the original file untouched. -Both scripts are also used in the Test Suite to run the style and +Both scripts are also used in the Testsuite to run the style and indent tests (Sec.~\ref{sec:test-suite}): each script is run over each source file and the output is sent to a \texttt{.cmp} file. If the \texttt{.cmp} file matches the original file, the test passes. diff --git a/doc/latex/Execution.tex b/doc/latex/Execution.tex index 63db19c98..160ccfe53 100644 --- a/doc/latex/Execution.tex +++ b/doc/latex/Execution.tex @@ -25,7 +25,7 @@ \section{Box-Model} \label{sec:box-model} \subsection{Mechanism file} \label{subsec:mechanism-file} -AtChem2 is designed to use the \href{http://mcm.york.ac.uk}{MCM} +AtChem2 is designed to use the \href{https://mcm.york.ac.uk/MCM}{MCM} as a chemical mechanism; other chemical mechanisms can be used, as long as they are in the correct format. diff --git a/doc/latex/Installation.tex b/doc/latex/Installation.tex index e14597c42..583a125b0 100644 --- a/doc/latex/Installation.tex +++ b/doc/latex/Installation.tex @@ -14,56 +14,56 @@ \chapter{Model Installation} \label{ch:installation} % -------------------------------------------------------------------- % \section{Requirements} \label{sec:requirements} -AtChem2 can be installed on Linux/Unix and macOS operating systems. A -working knowledge of the \textbf{unix shell} and its -\href{https://swcarpentry.github.io/shell-novice/}{basic commands} +AtChem2 can be installed and used on either Linux/Unix or macOS +operating systems. A working knowledge of the \textbf{unix shell} and +its \href{https://swcarpentry.github.io/shell-novice/}{basic commands} is \emph{required} to install and use the model. AtChem2 requires the -following tools: +following software tools: \begin{itemize} -\item Fortran -- the model compiles with GNU \texttt{gfortran} +\item bash, or a bash-compatible shell, and common utilities: wget, + tar, zip/unzip, make. +\item a text editor (emacs, nano, vim, gedit, or similar). +\item a Fortran compiler -- the model compiles with GNU \texttt{gfortran} (version 4.8 and above) and with Intel \texttt{ifort} (version 17.0)\\ - $\hookrightarrow$ default compiler: \texttt{gfortran} -\item \texttt{make} + $\hookrightarrow$ default Fortran compiler: \texttt{gfortran}. \item Python~\footnote{All Python scripts used in AtChem2 work equally - with Python v2 and v3. Support for Python v2 will be removed in - future versions of AtChem2.} -\item Ruby (optional) + with Python v2 and v3. Support for Python v2 will be removed in + future versions of AtChem2.} +\item Ruby, rake (both optional). \end{itemize} Some or all of these tools may already be installed on the operating -system. Use the \texttt{which} command to find out (e.g., -\verb|which python|, \verb|which cmake|, etc\ldots); otherwise, check +system: use the \texttt{which} command to find out (e.g., +\verb|which python|, \verb|which make|, etc\ldots). Otherwise, check the local documentation or ask the system administrator. In addition, AtChem2 has the following dependencies: \begin{itemize} -%\item BLAS, LAPACK -\item CVODE -- requires \texttt{cmake} -\item openlibm -\item numdiff (optional) -\item FRUIT (optional) +\item CVODE -- requires \texttt{gcc}, \texttt{cmake}. %, BLAS, LAPACK +\item openlibm. +\item numdiff (optional). +\item FRUIT (optional). \end{itemize} For detailed instructions on the installation and configuration of the -dependencies go to Sect.~\ref{sec:dependencies}. +dependencies, go to Sect.~\ref{sec:dependencies}. % -------------------------------------------------------------------- % \section{Download} \label{sec:download} Two versions of AtChem2 are available for download: the \href{https://github.com/AtChem/AtChem2/releases}{stable version} and -the development version, also known as \texttt{master\ branch} (see -Sect.~\ref{sec:general-information} for details). The source code can -be obtained in two ways: +the \emph{development version}, also known as \texttt{master\ branch} +(see Sect.~\ref{sec:general-information} for details). The source code +of AtChem2 can be obtained in two ways: \begin{itemize} -\item with \textbf{git} (This method will download the development - version and it is recommended if you want to contribute to the model - development): +\item with \textbf{git} (this is the recommended method to contribute + to the model development): \begin{enumerate} - \item Open the terminal. Move to the directory where you want to - install AtChem2. + \item Open the terminal. Move to the directory where AtChem2 will be + installed. \item Execute: \begin{itemize} \item if using HTTPS:\\ @@ -77,7 +77,7 @@ \section{Download} \label{sec:download} \item Download the archive file (\texttt{.tar.gz} or \texttt{.zip}) of the \href{https://github.com/AtChem/AtChem2/releases/}{stable} or of the \href{https://github.com/AtChem/AtChem2/archive/master.zip}{development} - version to the directory where you want to install AtChem2. + version to the directory where AtChem2 will be installed. \item Open the terminal. Move to the directory where the archive file was downloaded. \item Execute \verb|tar -zxfv *.tar.gz| or \verb|unzip -v *.zip| @@ -87,42 +87,45 @@ \section{Download} \label{sec:download} \end{itemize} The AtChem2 source code is now in a directory called \texttt{AtChem2} -(if git was used) or \texttt{AtChem2-1.x} (if the stable version was -downloaded) or \texttt{AtChem2-master} (if the development version was -downloaded). This directory, which can be given any name, is the -\maindir\ of the model. In this manual, the \maindir\ is assumed to -be: \texttt{\$HOME/AtChem2}. +(if git was used) or \texttt{AtChem2-1.x} (if the archive file of the +stable version was downloaded) or \texttt{AtChem2-master} (if the +archive file of the development version was downloaded). This +directory is the AtChem2 \maindir. In this manual, the \maindir\ is +assumed to be \texttt{\$HOME/AtChem2/}, but it can be given any name +and path -- depending on the user's preferences. % -------------------------------------------------------------------- % \section{Dependencies} \label{sec:dependencies} -AtChem2 has a number of dependencies (external tools and libraries): -some are required, and without them the model cannot be installed or -used, others are optional. It is recommended to use the same directory -for all the dependencies of AtChem2: the \depdir\ can be located -anywhere and given any name. In this manual, the \depdir\ is -assumed to be: \texttt{\$HOME/atchem-lib/}. +AtChem2 has a number of dependencies (additional software tools and +libraries): some are \emph{required}, and without them the model +cannot be installed or used, others are \emph{optional}, and only +needed to run the Testsuite. It is recommended to install all the +AtChem2 dependencies into the same directory, called \depdir. In this +manual, the \depdir\ is assumed to be \texttt{\$HOME/AtChem-lib/}, but +it can be given any name and path -- depending on the user's +preferences. -Before installing the dependencies, make sure that a Fortran compiler -(e.g., \texttt{gfortran}), Python, make, cmake and (optionally) Ruby -are installed on the operating system, as explained in -Sect.~\ref{sec:requirements}. +Before installing the dependencies, make sure that the requirements +listed in Sect.~\ref{sec:requirements} are met, and that the unix +shell is bash or bash-compatible (type \verb|echo $SHELL| at the +terminal to find out). \subsection{Required dependencies} \label{subsec:required-dependencies} % \subsubsection{BLAS and LAPACK} % BLAS and LAPACK are standard Fortran libraries for linear -% algebra. They are needed to install and compile the CVODE library -- -% see below. Usually they are located in the \texttt{/usr/lib/} -% directory (e.g., \texttt{/usr/lib/libblas/} and -% \texttt{/usr/lib/lapack/}). The location may be different, especially -% if you are using a High Performance Computing (HPC) system: check the +% algebra. Together with \texttt{cmake} hey are needed only to compile +% the CVODE library -- see below. Usually they are located in the +% \texttt{/usr/lib/} directory (e.g., \texttt{/usr/lib/libblas/} and +% \texttt{/usr/lib/lapack/}). The location may be different, +% especially on a High Performance Computing (HPC) system: check the % local documentation or ask the system administrator. \subsubsection{CVODE} -AtChem2 uses the CVODE library which is part of the open source +AtChem2 uses the CVODE library, which is part of the open source \href{https://computing.llnl.gov/projects/sundials}{SUNDIALS suite} \citep{hindmarsh_2005}, to solve the system of ordinary differential equations (ODE). The version of CVODE currently used in AtChem2 is @@ -133,34 +136,33 @@ \subsubsection{CVODE} \begin{enumerate} \item Open the terminal. Move to the \maindir\ (\verb|cd ~/AtChem2|). \item Open the installation script (\texttt{tools/install/install\_cvode.sh}) - with a text editor: + with the text editor: \begin{itemize} % \item If LAPACK and BLAS are not in the default location (see % above), change the \texttt{LAPACK\_LIBS} variable for your % architecture (Linux or macOS) as appropriate. - \item If you are not using the \texttt{gcc} compiler - (\texttt{gfortran}), change the line + \item If using a compiler other than \texttt{gcc}, change the line \texttt{-DCMAKE\_C\_COMPILER:FILEPATH=gcc \textbackslash} accordingly. \end{itemize} \item Run the installation script (change the path to the \depdir\ as needed): \begin{verbatim} - ./tools/install/install_cvode.sh ~/atchem-lib/ + ./tools/install/install_cvode.sh ~/AtChem-lib/ \end{verbatim} \end{enumerate} If the installation is successful, there should be a working CVODE -installation at \texttt{\textasciitilde/atchem-lib/cvode/}. Take note -of the path to the CVODE library -(\texttt{\textasciitilde/atchem-lib/cvode/lib/}), as it will be needed -later to complete the configuration of AtChem2 (Sect.~\ref{sec:install}). +installation at \texttt{\textasciitilde/AtChem-lib/cvode/}. Take note +of the path to CVODE (\texttt{\textasciitilde/AtChem-lib/cvode/lib/}), +as it will be neededlater to complete the configuration of AtChem2 +(Sect.~\ref{sec:install}). \subsubsection{openlibm} openlibm is a \href{https://openlibm.org}{portable version} of the open source \textbf{libm} library. Installing openlibm and linking -against it allows reproducible results by ensuring the same +against it, allows reproducible results by ensuring the same implementation of several mathematical functions across platforms. The current version of openlibm is 0.8.1 and it can be installed using @@ -172,12 +174,12 @@ \subsubsection{openlibm} \item Run the installation script (change the path to the \depdir\ as needed): \begin{verbatim} - ./tools/install/install_openlibm.sh ~/atchem-lib/ + ./tools/install/install_openlibm.sh ~/AtChem-lib/ \end{verbatim} \end{enumerate} If the installation is successful, there should be a working openlibm -installation at \texttt{\textasciitilde/atchem-lib/openlibm-0.8.1/}. +installation at \texttt{\textasciitilde/AtChem-lib/openlibm-0.8.1/}. Take note of the path to openlibm, as it will be needed later to complete the configuration of AtChem2 (Sect.~\ref{sec:install}). @@ -187,24 +189,24 @@ \subsubsection{numdiff} numdiff is an open source \href{https://www.nongnu.org/numdiff/}{tool} used to compare files containing numerical fields. It is needed only -if you want to run the \hyperref[sec:test-suite]{Test Suite}, a series -of tests used to ensure that the model works properly and that changes -to the code do not result in unintended behaviour. Installation of -numdiff is recommended if you want to contribute to the development of -AtChem2. +to run the \hyperref[sec:test-suite]{Testsuite}, a battery of tests +used during the development of AtChem2 to ensure that the model works +properly and that changes to the source code do not result in +unintended behaviour. Installation of numdiff is recommended for users +who want to contribute to the development of AtChem2. Use \verb|which numdiff| to check if the program is already installed -on your system. If not, ask the system administrator. Alternatively, -numdiff can be installed locally (e.g., in the \depdir) using the -script \texttt{install\_numdiff.sh} in the \texttt{tools/install/} -directory. +on the operating system. If not, ask the system administrator. +Alternatively, numdiff can be installed locally (e.g., in the \depdir) +using the script \texttt{install\_numdiff.sh} in the +\texttt{tools/install/} directory. \begin{enumerate} \item Open the terminal. Move to the \maindir\ (\verb|cd ~/AtChem2|). \item Run the installation script (change the path to the \depdir\ as needed): \begin{verbatim} - ./tools/install/install_numdiff.sh ~/atchem-lib/ + ./tools/install/install_numdiff.sh ~/AtChem-lib/ \end{verbatim} \item Move to the \texttt{\$HOME} directory (\texttt{cd\ \textasciitilde}). Open the \texttt{.bash\_profile} file (or the \texttt{.profile} @@ -212,7 +214,7 @@ \subsubsection{numdiff} following line to the bottom of the file (change the path to the \depdir\ as needed): \begin{verbatim} - export PATH=$PATH:$HOME/atchem-lib/numdiff/bin + export PATH=$PATH:$HOME/AtChem-lib/numdiff/bin \end{verbatim} \item Close the terminal. \item Reopen the terminal. Execute \verb|which numdiff| to check that @@ -246,12 +248,12 @@ \subsubsection{FRUIT} \item Run the installation script (change the path to the \depdir\ as needed): \begin{verbatim} - ./tools/install/install_fruit.sh ~/atchem-lib/ + ./tools/install/install_fruit.sh ~/AtChem-lib/ \end{verbatim} \end{enumerate} If the installation is successful, there should be a working FRUIT -installation at \texttt{\textasciitilde/atchem-lib/fruit\_3.4.3/}. +installation at \texttt{\textasciitilde/AtChem-lib/fruit\_3.4.3/}. Take note of the path to FRUIT, as it will be needed later to complete the configuration of AtChem2 (Sect.~\ref{sec:install}). @@ -271,16 +273,16 @@ \section{Install} \label{sec:install} cp ./tools/install/Makefile.skel ./Makefile \end{verbatim} \item Open the \texttt{Makefile} with a text editor. Set the variables - \texttt{\$CVODELIB}, \texttt{\$OPENLIBMDIR}, \texttt{\$FRUITDIR} to + \texttt{\$CVODELIBDIR}, \texttt{\$OPENLIBMDIR}, \texttt{\$FRUITDIR} to the paths of CVODE, openlibm and FRUIT, as indicated in Sect.~\ref{subsec:required-dependencies}. Use full paths, because using relative paths may cause compilation errors~\footnote{See issue \href{https://github.com/AtChem/AtChem2/issues/364}{\#364}.}. For example (change the path to the \depdir\ as needed): \begin{verbatim} - CVODELIB = $(HOME)/atchem-lib/cvode/lib - OPENLIBMDIR = $(HOME)/atchem-lib/openlibm-0.8.1 - FRUITDIR = $(HOME)/atchem-lib/fruit_3.4.3 + CVODELIBDIR = $(HOME)/AtChem-lib/cvode/lib + OPENLIBMDIR = $(HOME)/AtChem-lib/openlibm-0.8.1 + FRUITDIR = $(HOME)/AtChem-lib/fruit_3.4.3 \end{verbatim} If FRUIT has not been installed (it is optional), leave the default value for \texttt{\$FRUITDIR}. @@ -315,25 +317,24 @@ \section{Install} \label{sec:install} a solution can be found on the \href{https://github.com/AtChem/AtChem2/wiki/Known-Issues}{wiki}. -AtChem2 is now ready to be used. Optionally, the Test Suite can be run +AtChem2 is now ready to be used. Optionally, the Testsuite can be run to check that the model has been installed correctly: go to Sect.~\ref{subsec:tests-optional} for more information. The directory structure and the organization of AtChem2 are described in Sect.~\ref{sec:model-structure} (see also Fig.~\ref{fig:atchem-arch}). For detailed instructions on how to set up, configure, build and -execute an AtChem2 box-model go to Chapt.~\ref{ch:setup} and +execute an AtChem2 box-model, go to Chapt.~\ref{ch:setup} and Chapt.~\ref{ch:execution}. \subsection{Tests (optional)} \label{subsec:tests-optional} -The \hyperref[sec:test-suite]{Test Suite} can be used to verify that +The \hyperref[sec:test-suite]{Testsuite} can be used to verify that AtChem2 has been installed correctly and works as intended. It is -recommended to run the Test Suite if you want to contribute to the -development of the AtChem2 model. Note that in order to run the Test -Suite the \hyperref[subsec:optional-dependencies]{optional dependencies} +recommended to run the Testsuite if you want to contribute to the +development of the AtChem2 model. Note that in order to run the Testsuite the \hyperref[subsec:optional-dependencies]{optional dependencies} have to be installed. -To run the Test Suite, open the terminal and execute one of the +To run the Testsuite, open the terminal and execute one of the following commands from the \maindir: \begin{itemize} @@ -353,8 +354,7 @@ \section{Model Structure} \label{sec:model-structure} AtChem2 is organized in several directories which contain the source code, the compilation files, the chemical mechanism, the model -configuration and output, several scripts and utilities, and the Test -Suite. +configuration and output, several scripts and utilities, and the Testsuite. The directory structure of AtChem2 is derived from the directory structure of AtChem-online, but it was substantially changed with the @@ -395,7 +395,7 @@ \section{Model Structure} \label{sec:model-structure} \hline \texttt{tools/} & \texttt{tools/} & various scripts and plotting tools.\\ \hline - \texttt{travis/}~$(\dag)$ & \texttt{tests/}~$(\ddag)$ & scripts and files for the Test Suite.\\ + \texttt{travis/}~$(\dag)$ & \texttt{tests/}~$(\ddag)$ & scripts and files for the Testsuite.\\ \end{tabular} \end{table} @@ -405,7 +405,7 @@ \section{Model Structure} \label{sec:model-structure} the compiler, the source code; the directory \texttt{tests/}~\footnote{Called \texttt{travis/} in version 1.2 and earlier.} contains the files and the scripts necessary to run the -\hyperref[sec:test-suite]{Test Suite}. +\hyperref[sec:test-suite]{Testsuite}. For the majority of the users, the most important directories are \texttt{doc/}, which contains the user manual and other documents, diff --git a/doc/latex/Introduction.tex b/doc/latex/Introduction.tex index ea7a34724..f256f2201 100644 --- a/doc/latex/Introduction.tex +++ b/doc/latex/Introduction.tex @@ -14,49 +14,48 @@ \chapter{Introduction} \label{ch:introduction} \textbf{AtChem2} is an open source modelling tool for atmospheric chemistry. It is designed to build and run zero-dimensional box-models using the Master Chemical Mechanism -(\href{http://mcm.york.ac.uk}{MCM}). The \textbf{MCM} is a +(\href{https://mcm.york.ac.uk/MCM}{MCM}). The \textbf{MCM} is a near-explicit chemical mechanism which describes the gas-phase oxidation of primary emitted Volatile Organic Compounds (VOC) to carbon dioxide (\cf{CO2}) and water (\cf{H2O}). The MCM protocol is detailed in \citet{jenkin_1997} and subsequent updates -\citep{saunders_2003, jenkin_2003, bloss_2005, jenkin_2015}. Although -it is meant to be used with the MCM, AtChem2 can use any other -chemical mechanism, as long as it is in the correct format +\citep{saunders_2003, jenkin_2003, bloss_2005, jenkin_2012, jenkin_2015}. +Although it is meant to be used with the MCM, AtChem2 can use any +other chemical mechanism, as long as it is in the correct format (Sect.~\ref{sec:chemical-mechanism}). AtChem2 is a development of \textbf{AtChem-online}, a modelling web -tool created to facilitate the use of the MCM in the simulation of -laboratory and environmental chamber experiments within the -\href{https://www.eurochamp.org}{EUROCHAMP} community -\citep{martin_2009}. AtChem-online runs as a web service -- provided -by the University of Leeds --and can be accessed at -\href{https://atchem.york.ac.uk/}{https://atchem.york.ac.uk/}: -in order to use AtChem-online, a user needs only a text editor, file -compression software, a web browser, and an internet connection. A -tutorial -- with examples and exercises -- is available on the MCM -\href{http://mcm.york.ac.uk/atchem/tutorial_intro.htt}{website}. +tool created at the University of Leeds to facilitate the use of the +MCM in the simulation of laboratory and environmental chamber +experiments within the \href{https://www.eurochamp.org}{EUROCHAMP} +community \citep{martin_2009}. AtChem-online runs as a +\href{https://atchem.york.ac.uk}{web service}, provided by the +University of York: in order to use AtChem-online, a user needs only a +text editor, file compression software, a web browser, and an internet +connection. A tutorial -- with examples and exercises -- is available on +the \href{https://mcm.york.ac.uk/MCM/atchemonline/intro}{MCM website}. AtChem-online is easy to use even for inexperienced users but has a number of limitations, mostly related to its nature as a web -application. AtChem2 was developed from AtChem-online with the -objective to provide an \emph{offline} modelling tool capable of +application. \textbf{AtChem2} was developed from AtChem-online with +the objective to provide an \emph{offline} modelling tool capable of running long simulations of computationally intensive models, as well as batch simulations for sensitivity studies. In addition, AtChem2 implements a continuous integration workflow, coupled with a -comprehensive suite of tests and version control software -(\href{https://git-scm.com}{git}), which makes it robust, reliable -and traceable. +comprehensive Testsuite and version control software +(\href{https://git-scm.com}{git}), which makes it robust, reliable and +traceable. The codebase of AtChem2 is structured into four components (or layers) -- as illustrated in Fig.~\ref{fig:atchem-arch} -- and is written -mostly in Fortran 90/95. Installation, compilation and execution of +mostly in Fortran 90/95. Installation, compilation and execution of AtChem2 are semi-automated via a number of shell and Python scripts that require minimal input from the user. This document (\texttt{AtChem2-Manual.pdf}) is the AtChem2 user manual and contains all the information required to install, set up and use the current version of AtChem2. A summary of these instructions, additional information, and a list of \emph{known issues} can be found on the -\href{https://github.com/AtChem/AtChem2/wiki}{wiki}. +\href{https://github.com/AtChem/AtChem2/wiki}{AtChem2 wiki}. \begin{figure}[htb] \centering @@ -65,15 +64,43 @@ \chapter{Introduction} \label{ch:introduction} \label{fig:atchem-arch} \end{figure} +% -------------------------------------------------------------------- % +\section{Conventions} \label{sec:conventions} + +The following conventions are adopted in the AtChem2 user manual and +documentation: + +\begin{description} +\item[\maindir] is the base directory of the AtChem2 model.\\ + For example: \texttt{\$HOME/AtChem2/}. +\item[\depdir] is the directory where the AtChem2 dependencies are installed.\\ + For example: \texttt{\$HOME/AtChem-lib/}. +\item[\sharedir] is the directory for the chemical mechanism shared + library (\texttt{mechanism.so}).\\ + By default, it is \texttt{model/configuration/} in the \maindir. +\end{description} + +The user can change the locations and names of these directories +according to their setup, workflow, personal preferences, etc\ldots +As long as the user specifies the correct paths to the libraries and +directories needed by AtChem2, the model will compile and run. + +\textbf{Important Note}: AtChem2 runs in Coordinated Universal Time +(UTC, i.e. GMT timezone) with no daylight saving. This is to simplify +the calculation of the solar angles and, therefore, of the photolysis +rates. The user must ensure that the input data and the model +constraints are provided in UTC, and convert the output to Local Time +(if necessary). + % -------------------------------------------------------------------- % \section{License and citation} \label{sec:license-citation} -AtChem2 is open source -- released under \textbf{MIT license} -- and is hosted -at \href{https://github.com/AtChem/AtChem2}{https://github.com/AtChem/AtChem2}. -A copy of the license can be found in the \texttt{LICENSE.md} file. +AtChem2 is open source -- under \textbf{MIT license} -- and is hosted at:\\ +\href{https://github.com/AtChem/AtChem2}{https://github.com/AtChem/AtChem2}. -The model is free to use, compatible with the terms of the MIT -license; if used in a publication, please cite the GMD paper:\\ +AtChem2 is free to use, compatible with the MIT license terms. A copy +of the license can be found in the \texttt{LICENSE} file. If used in a +publication, please cite the GMD paper \citet{sommariva_2020}:\\ R.~Sommariva, S.~Cox, C.~Martin, K.~Boro{\'n}ska, J.~Young, P.~K. Jimack, M.~J. Pilling, V.~N. Matthaios, B.~S. Nelson, M.~J. Newland, M.~Panagi, diff --git a/doc/latex/References.bib b/doc/latex/References.bib index d9480478e..2f2396870 100644 --- a/doc/latex/References.bib +++ b/doc/latex/References.bib @@ -62,6 +62,20 @@ @article{jenkin_2003 doi = {10.5194/acp-3-181-2003}, } +@article{jenkin_2012, + author = {Jenkin, M. E. and Wyche, K. P. and Evans, C. J. and Carr, T. and + Monks, P. S. and Alfarra, M. R. and Barley, M. H. and + McFiggans, G. B. and Young, J. C. and Rickard, A. R.}, + title = {Development and chamber evaluation of the {MCM} v3.2 degradation + scheme for {$\beta$}-caryophyllene}, + journal = {Atmospheric Chemistry and Physics}, + year = {2012}, + volume = {12}, + number = {11}, + pages = {5275--5308}, + doi = {10.5194/acp-12-5275-2012}, +} + @article{jenkin_2015, author = {Jenkin, M. E. and Young, J. C. and Rickard, A. R.}, title = {The {MCM} v3.3.1 degradation scheme for isoprene}, @@ -122,10 +136,11 @@ @conference{sommariva_2018 @article{sommariva_2020, author = {Sommariva, R. and Cox, S. and Martin, C. and Boro{\'n}ska, K. and - Young, J. and Jimack, P. K. and Pilling, M. J. and Matthaios, V. N. and - Nelson, B. S. and Newland, M. J. and Panagi, M. and Bloss, W. J. and - Monks, P. S. and Rickard, A. R.}, - title = {{AtChem} (version 1), an open-source box model for the {Master Chemical Mechanism}}, + Young, J. and Jimack, P. K. and Pilling, M. J. and + Matthaios, V. N. and Nelson, B. S. and Newland, M. J. and + Panagi, M. and Bloss, W. J. and Monks, P. S. and Rickard, A. R.}, + title = {{AtChem} (version 1), an open-source box model for the + {Master Chemical Mechanism}}, journal = {Geoscientific Model Development}, year = 2020, volume = 13, diff --git a/doc/latex/Setup.tex b/doc/latex/Setup.tex index bbdfb2701..d8383e2ba 100644 --- a/doc/latex/Setup.tex +++ b/doc/latex/Setup.tex @@ -201,7 +201,7 @@ \subsection{MCM extraction} \label{subsec:mcm-extraction} The MCM website provides a convenient tool that can be used to download the whole Master Chemical Mechanism -- or subsets of it -- in FACSIMILE format. Only a brief overview of the process is given here: -for more information go to the \href{http://mcm.york.ac.uk}{MCM website}. +for more information, go to the \href{http://mcm.york.ac.uk}{MCM website}. First, select the species of interest using the \href{http://mcm.york.ac.uk/roots.htt}{MCM browser} and add the @@ -570,7 +570,7 @@ \subsection{JFAC} \label{subsec:jfac} between \texttt{0} (photolysis rates are set to zero) and \texttt{1} (photolysis rates are not corrected). JFAC is \emph{not applied} to constant or constrained photolysis rates (Fig.~\ref{fig:photol}). For -more information go to Sect.~\ref{subsec:jfac-calculation}. +more information, go to Sect.~\ref{subsec:jfac-calculation}. \begin{itemize} \item fixed value @@ -830,7 +830,7 @@ \subsection{outputRates.config} \label{subsec:outputrates} -- are designed to facilitate the rate of production and destruction analysis (ROPA/RODA) of selected species of interests, rather than processing all the files saved in the \texttt{model/output/reactionRates/} -directory. For more information go to Sect.~\ref{sec:output}. +directory. For more information, go to Sect.~\ref{sec:output}. \subsection{outputSpecies.config} \label{subsec:outputspecies} diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh old mode 100644 new mode 100755 index e3c6b618e..6c0d88132 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # ----------------------------------------------------------------------------- # # Copyright (c) 2009 - 2012 Chris Martin, Kasia Boronska, Jenny Young, @@ -16,41 +16,41 @@ # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- -# This script is run everytime the container is run. +# This script is run everytime the container is run. # -# First it copies the /atchem/ directory that is created during the build to +# First it copies the /atchem/ directory that is created during the build to # the home directory of the user running the container. This is for # compatibility with singularity, where the user running the container is not -# root, and therefore cannot modify the model files in place. +# root, and therefore cannot modify the model files in place. # # Next it moves the user configuration from /data_transfer/ and copies it into # the ~/atchem/ directory. This /data_transfer/ directory is created when the # the user mounts a volume when running the container (e.g `docker run -v...`) # # We then move to the ~/atchem directory and build the model using the mechanism -# specified by the user as a runtime argument to `docker run`. +# specified by the user as a runtime argument to `docker run`. # -# Then the model is run by executing the newly built atchem2 file. +# Then the model is run by executing the newly built atchem2 file. # # On completion the atchem model output directory is copied to the data_transfer # directory and as such onto the host filesystem # ----------------------------------------------------------------------------- -# make a copy to home to allow for compatibility with singularity -\command cp -rf /atchem/ ~/ +# Make a copy to home to allow for compatibility with singularity +\command cp -rf /atchem/ ~/ # Transfer in user config \command cp -rf /data_transfer/* ~/atchem/ -# move into atchem dir +# Move into atchem dir cd ~/atchem/ -# build model using user specified mechanism +# Build model using user specified mechanism ./build/build_atchem2.sh $1 echo $1 -# run model +# Run model ./atchem2 -# copy outputs to data_transfer / host filesystem -\command cp -rf ~/atchem/model/output /data_transfer/model/ \ No newline at end of file +# Copy outputs to data_transfer / host filesystem +\command cp -rf ~/atchem/model/output /data_transfer/model/ diff --git a/docker/install.sh b/docker/install.sh old mode 100644 new mode 100755 index e245f0730..1c8d0ef7a --- a/docker/install.sh +++ b/docker/install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # ----------------------------------------------------------------------------- # # Copyright (c) 2009 - 2012 Chris Martin, Kasia Boronska, Jenny Young, @@ -16,34 +16,34 @@ # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- -# This is the install script that is run when the container is built. It +# This is the install script that is run when the container is built. It # installs the necessary dependacies for installing AtChem2 (gcc-gfortran, # wget, cmake and python3.11). # -# It then runs the install scripts provided with the model (install_cvode.sh +# It then runs the install scripts provided with the model (install_cvode.sh # and install_openlibm.sh) to install additional dependancies required to build # the model. -# -# Next it produces the Makefile from the skeleton, and amends the dependancy +# +# Next it produces the Makefile from the skeleton, and amends the dependancy # paths. -# +# # Finally it does some housekeeping, updating the build_atchem2.sh to be able -# to find the python installation, and makes the docker entrypoint script -# executable. +# to find the python installation, and makes the docker entrypoint script +# executable. # ----------------------------------------------------------------------------- # Install dependancies from package repository dnf install -y which gcc-gfortran wget cmake python3.11 -# make directories +# Make directories mkdir /atchem-lib # mkdir /atchem -# move to /atchem so the dependacy installation scripts work correctly. +# Move to /atchem so the dependacy installation scripts work correctly. cd atchem # Install dependancies to /atchem-lib -./tools/install/install_cvode.sh /atchem-lib/ +./tools/install/install_cvode.sh /atchem-lib/ ./tools/install/install_openlibm.sh /atchem-lib/ # Change atchem dependancy paths and create Makefile from skeleton @@ -52,4 +52,4 @@ sed -i 's,openlibm-0.8.1,/atchem-lib/openlibm-0.8.1,g' ./Makefile # Fix python command to match installed version sed -i "s/python/python3/g" ./build/build_atchem2.sh -chmod +x docker/entrypoint.sh \ No newline at end of file +chmod +x docker/entrypoint.sh diff --git a/model/configuration/.gitignore b/model/configuration/.gitignore index 604ca8a6a..07689914c 100644 --- a/model/configuration/.gitignore +++ b/model/configuration/.gitignore @@ -1,3 +1,3 @@ # Ignore auto-generated mechanism files in this directory mechanism.* -customRateFuncs.o \ No newline at end of file +customRateFuncs.o diff --git a/model/configuration/customRateFuncs.f90 b/model/configuration/customRateFuncs.f90 index 04e30b8d2..6b87c0471 100644 --- a/model/configuration/customRateFuncs.f90 +++ b/model/configuration/customRateFuncs.f90 @@ -13,6 +13,7 @@ ! LICENSE.md at the top level of the AtChem2 distribution. ! ! ----------------------------------------------------------------------------- + ! ******************************************************************** ! ! ATCHEM2 -- MODULE customRateFunctions ! @@ -24,6 +25,6 @@ module custom_functions_mod contains - !Define your functions here. + ! Define your functions here. -end module custom_functions_mod \ No newline at end of file +end module custom_functions_mod diff --git a/tools/make_manual_pdf.sh b/tools/make_manual_pdf.sh index 0efeea769..f2c171df5 100755 --- a/tools/make_manual_pdf.sh +++ b/tools/make_manual_pdf.sh @@ -10,14 +10,14 @@ # # ----------------------------------------------------------------------------- -# Script to generate the AtChem2 manual pdf file. +# Script to generate the pdf file of the AtChem2 manual. # # N.B.: the script MUST be run from the main directory of AtChem2. # Convert svg figures to png format using Inkscape (v1.x) cd doc/figures/ for FIG in *.svg; do - inkscape --export-type="png" $FIG + inkscape --export-type="png" --export-filename=${FIG%%.*}.png $FIG done # Compile LaTeX source files, generate pdf file @@ -30,10 +30,8 @@ pdflatex AtChem2-Manual.tex # Move pdf file to doc/ directory mv -f AtChem2-Manual.pdf ../AtChem2-Manual.pdf -echo "" echo "||----------------------------------------||" echo "|| AtChem2-Manual.pdf saved to doc/ ||" echo "||----------------------------------------||" -echo "" exit 0 diff --git a/tools/update_version_number.sh b/tools/update_version_number.sh index 9bd4efa7b..ff6e57c30 100755 --- a/tools/update_version_number.sh +++ b/tools/update_version_number.sh @@ -20,8 +20,6 @@ VERS_NEW="v1.3-dev" # Ignore the .git/ directory, exclude this script and the changelog file find ./ -not -path "./.git/*" -type f ! -name "update_version_number.sh" ! -name "CHANGELOG.md" -print | xargs perl -pi -e "s/$VERS_OLD/$VERS_NEW/g" -echo "" -echo "==> AtChem2 version number changed to:" $VERS_NEW -echo "" +echo -e "\n==> AtChem2 version number changed to:" $VERS_NEW "\n" exit 0