Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revision of the manual #516

Open
wants to merge 81 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
b2aaff3
Cleanup from previous PR
rs028 Nov 29, 2023
2cedfa7
Initial revision of the manual
rs028 Jan 22, 2024
d6b52e3
Initial version of latex workflow
rs028 Jan 23, 2024
62e4d6d
Use texlive-action
rs028 Jan 23, 2024
fa13a34
Use texlive-action
rs028 Jan 23, 2024
590a1f9
Check for inkscape
rs028 Jan 23, 2024
d09fe64
Add inkscape
rs028 Jan 23, 2024
18a8908
Test latex compilation
rs028 Jan 23, 2024
2b2c438
Check executables
rs028 Jan 23, 2024
1283759
Check executables
rs028 Jan 23, 2024
aedbbfb
Check executables
rs028 Jan 23, 2024
beb6499
Check executables
rs028 Jan 23, 2024
0dcc484
Test compile script
rs028 Jan 23, 2024
5f0be48
Test inkscape
rs028 Jan 23, 2024
b87442d
Force images filename to png
rs028 Jan 23, 2024
67a467a
Force images filename to png
rs028 Jan 23, 2024
f205b3e
Test pdflatex
rs028 Jan 23, 2024
80c452e
Test pdflatex
rs028 Jan 23, 2024
c6c2712
Test bibtex
rs028 Jan 23, 2024
2fb7c56
Test bibtex
rs028 Jan 23, 2024
11e0e94
Fix ci.yml error
rs028 Jan 23, 2024
252672f
Find correct paths
rs028 Jan 23, 2024
5b03de5
Find correct paths
rs028 Jan 23, 2024
17c851a
Find correct paths
rs028 Jan 23, 2024
e79c14c
Find correct paths
rs028 Jan 23, 2024
81ed719
Find correct paths
rs028 Jan 23, 2024
53cff51
Find correct paths
rs028 Jan 23, 2024
2852008
Find correct paths
rs028 Jan 23, 2024
4b3fb7e
Do everything in one step
rs028 Jan 23, 2024
9eee38b
Check that pdf is generated
rs028 Jan 23, 2024
b9c007d
Tidying up
rs028 Jan 23, 2024
0c431fa
Consolidate .gitignore files
rs028 Jan 23, 2024
c389837
Test upload action
rs028 Jan 24, 2024
8402692
Test git setup in actions
rs028 Jan 24, 2024
f80dff5
Test git commit in actions
rs028 Jan 24, 2024
041f3c7
Test git commit in actions
rs028 Jan 24, 2024
77ba8b6
Test git config
rs028 Jan 24, 2024
c981d6c
Test git config
rs028 Jan 24, 2024
e5e12a9
Run tests on ubuntu-20
rs028 Jan 25, 2024
2ce1f67
Test github variable
rs028 Jan 25, 2024
3be6a59
Test github variable
rs028 Jan 25, 2024
b60a004
Check branch for workflow
rs028 Jan 25, 2024
1b32263
Update Introduction
rs028 Jan 31, 2024
4e94f7f
Fix repo permission
rs028 Jan 31, 2024
c17d9cd
Fix repo permission
rs028 Jan 31, 2024
60a5dd9
Fix repo permission
rs028 Jan 31, 2024
43e64ce
Fix repo permission
rs028 Jan 31, 2024
937b0c7
Fix repo permission
rs028 Jan 31, 2024
a1cdd86
Fix repo permission
rs028 Jan 31, 2024
422a225
Update Introduction and Installation
rs028 Feb 2, 2024
079ec99
Update Installation
rs028 Feb 2, 2024
8c2309e
Update Installation
rs028 Feb 2, 2024
592af83
Update Installation
rs028 Feb 2, 2024
6cb8e8f
Test actions checkout
rs028 Feb 3, 2024
b066ce3
Check actions permissions
rs028 Feb 3, 2024
fa133c1
Check actions permissions
rs028 Feb 3, 2024
c0a18ce
Check actions permissions
rs028 Feb 3, 2024
7b5e630
Check actions permissions
rs028 Feb 3, 2024
f10a1cc
Check actions permissions
rs028 Feb 3, 2024
7ef6d3d
Check actions permissions
rs028 Feb 3, 2024
6630137
Check actions permissions
rs028 Feb 3, 2024
887db7d
Test checkout action
rs028 Feb 3, 2024
07d0c05
Test branch
rs028 Feb 3, 2024
d5f4975
Test commit on branch
rs028 Feb 3, 2024
62dc4ed
Test commit on branch
rs028 Feb 3, 2024
94bb0db
Correct permissions
rs028 Feb 3, 2024
9342ecc
Correct permissions
rs028 Feb 3, 2024
5cf07b8
Correct permissions
rs028 Feb 3, 2024
688fbdc
updates to manual
rs028 Aug 14, 2024
564856f
Update github actions
rs028 Aug 14, 2024
857c3aa
Update github actions
rs028 Aug 14, 2024
765b823
Update github actions
rs028 Aug 14, 2024
8e7d97f
Update github actions
rs028 Aug 14, 2024
8f32f96
Update github actions
rs028 Aug 14, 2024
5e09b0e
Correct file permissions of docker files
rs028 Aug 14, 2024
a84e5a1
Test github action
rs028 Aug 14, 2024
956678a
Test github action
rs028 Aug 14, 2024
ce1d131
Test github action
rs028 Aug 14, 2024
a76e6f6
Test github action
rs028 Aug 14, 2024
bf064b0
Test github action
rs028 Aug 14, 2024
d89b01b
Test github action
rs028 Aug 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 54 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
rs028 marked this conversation as resolved.
Show resolved Hide resolved

# -------------------------------------------------------------
# (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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
88 changes: 88 additions & 0 deletions .github/workflows/tex.yml
Original file line number Diff line number Diff line change
@@ -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 }}
3 changes: 0 additions & 3 deletions build/mech_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions doc/figures/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion doc/figures/model-setup.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions doc/latex/.gitignore

This file was deleted.

15 changes: 12 additions & 3 deletions doc/latex/AtChem2-Manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}}
Expand Down Expand Up @@ -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
5 changes: 3 additions & 2 deletions doc/latex/Credits.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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}.
Expand Down
Loading
Loading