Skip to content
Snippets Groups Projects
Commit 0bb614cf authored by Christoph Knote's avatar Christoph Knote
Browse files

Merge branch 'develop'

parents a6beb0bc 521ac659
No related branches found
No related tags found
No related merge requests found
Showing
with 221 additions and 17594 deletions
boxmox/boxmox/README.aux
boxmox/boxmox/README.log
boxmox/boxmox/README.toc
boxmox/boxmox/README.pdf
boxmox/boxmox/compiled_mechs
boxmox/bin/kpp
boxmox/src/*.o
boxmox/src/lex.yy.c
boxmox/src/y.tab.c
boxmox/src/y.tab.h
bin/
share
build
src/kpp
boxmox*.tar.gz
boxmox/UserManual.toc
boxmox/UserManual.aux
boxmox/UserManual.log
boxmox/UserManual.pdf
doc/boxmox_UserManual.pdf
src/bison.c
src/bison.h
src/yacc.c
**~
# bc we create this automatically using build_dist.sh
Makefile.am
doc/boxmox_README.pdf
**.DS_Store
# http://www.gnu.org/software/automake
Makefile.in
/ar-lib
/mdate-sh
/py-compile
/test-driver
/ylwrap
.deps/
.dirstamp
# http://www.gnu.org/software/autoconf
autom4te.cache
/autoscan.log
/autoscan-*.log
/aclocal.m4
/compile
/config.cache
/config.guess
/config.h.in
/config.log
/config.status
/config.sub
/configure
/configure.scan
/depcomp
/install-sh
/missing
/stamp-h1
# https://www.gnu.org/software/libtool/
/ltmain.sh
# http://www.gnu.org/software/texinfo
/texinfo.tex
# http://www.gnu.org/software/m4/
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
# Generated Makefile
# (meta build system like autotools,
# can automatically generate from config.status script
# (which is called by configure script))
Makefile
create_patch:
image: ubuntu:rolling
script:
- bash create_BOXMOX_patch.bash
tags:
- ehs_vm
boxmox_latest:
image: ubuntu:rolling
script:
- cp -r boxmox boxmox_latest
- bash prep_BOXMOX_src_directory.bash boxmox_latest latest
- tar cvzf boxmox_latest.tar.gz boxmox_latest
tags:
- ehs_vm
artifacts:
paths:
- boxmox_latest.tar.gz
image: ubuntu:rolling
.compile:
script:
- bash install_BOXMOX.bash COMPILE_ONLY
- export KPP_HOME=$(pwd)/boxmox
- export PATH=$KPP_HOME/bin:$KPP_HOME/boxmox/bin:$PATH
- cd boxmox/models
- prepare_BOXMOX_mechanism MOZART_4
- new_BOXMOX_experiment_from_example chamber_experiment
- for mechpath in *def;
do
mech=${mechpath/.def/};
echo ${mech};
if [ "${mech}" != "CB05TUCl_EPA" ] && [ "${mech}" != "MCMv3_3" ];
then
prepare_BOXMOX_mechanism -f ${mech};
new_BOXMOX_experiment ${mech} chamber_experiment_${mech};
cp chamber_experiment/*csv chamber_experiment_${mech}/;
cd chamber_experiment_${mech};
./${mech}.exe;
cd ..;
fi;
done
tags:
- ehs_vm
cache:
paths:
- "$CI_PROJECT_DIR/build/"
compile_ubuntu_latest:
image: ubuntu:rolling
extends: .compile
build:
before_script:
- DEBIAN_FRONTEND=noninteractive apt-get -qq update
- DEBIAN_FRONTEND=noninteractive apt-get -qq install wget patch make gcc gfortran flex bison texlive
tags:
- ehs_vm
- DEBIAN_FRONTEND=noninteractive apt-get -qq install wget patch make gcc gfortran flex bison texlive autoconf autotools-dev
- "[ -f ./version ] && export VERSION=$(cat ./version)"
script:
- . build_dist.sh "$CI_PROJECT_DIR/build"
artifacts:
name: boxmox-latest
paths:
- boxmox-*.tar.gz
File moved
......@@ -4,8 +4,7 @@
# Builds simulation code for chemical kinetic systems
#
# Copyright (C) 1995-1996 Valeriu Damian and Adrian Sandu
# Copyright (C) 1997-2005 Adrian Sandu
# with contributions from: Mirela Damian, Rolf Sander
# Copyright (C) 1997-2004 Adrian Sandu
#
# KPP is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
......@@ -30,58 +29,43 @@
#
#######################################################################################
include ../Makefile.defs
SUBDIRS = src
EXTRA_DIST = src/bison.h src/code.h src/gdata.h src/gdef.h src/scan.h
BISON=bison -d
CFLAGS=`cat ../cflags`
dist_doc_DATA = README.md doc/kpp_UserManual.pdf doc/boxmox_UserManual.pdf
dist_bin_SCRIPTS = scripts/list_BOXMOX_mechanisms \
scripts/new_BOXMOX_experiment \
scripts/new_BOXMOX_experiment_from_example \
scripts/prepare_BOXMOX_mechanism \
scripts/validate_BOXMOX_installation
all: kpp
install-data-local:
$(MKDIR_P) $(DESTDIR)$(pkgdatadir)/compiled_mechs
.c.o:
@echo " "$(CC) $(CC_FLAGS) $(CFLAGS) -c $*.c
@$(CC) $(CC_FLAGS) $(CFLAGS) -I$(INCLUDE_DIR) -c $*.c
uninstall-local:
rmdir $(DESTDIR)$(pkgdatadir)/compiled_mechs 2>/dev/null || :
OBJS = \
y.tab.o \
lex.yy.o \
scanner.o \
scanutil.o \
kpp.o \
gen.o \
code.o \
code_c.o \
code_f77.o \
code_f90.o \
code_matlab.o \
debug.o
dist-hook:
chmod u+w $(distdir)/boxmox/wrapper
@sed 's/__BOXMOX_VERSION__/'$(VERSION)'/g' $(distdir)/boxmox/wrapper > tmp; mv tmp $(distdir)/boxmox/wrapper
chmod u+w $(distdir)/drv/boxmox.f90
@sed 's/__BOXMOX_VERSION__/'$(VERSION)'/g' $(distdir)/drv/boxmox.f90 > tmp; mv tmp $(distdir)/drv/boxmox.f90
chmod u+w $(distdir)/drv/boxmox_adjoint.f90
@sed 's/__BOXMOX_VERSION__/'$(VERSION)'/g' $(distdir)/drv/boxmox_adjoint.f90 > tmp; mv tmp $(distdir)/drv/boxmox_adjoint.f90
chmod u+w $(distdir)/scripts/new_BOXMOX_experiment
@sed 's/__BOXMOX_VERSION__/'$(VERSION)'/g' $(distdir)/scripts/new_BOXMOX_experiment > tmp; mv tmp $(distdir)/scripts/new_BOXMOX_experiment
chmod u+w $(distdir)/scripts/new_BOXMOX_experiment_from_example
@sed 's/__BOXMOX_VERSION__/'$(VERSION)'/g' $(distdir)/scripts/new_BOXMOX_experiment_from_example > tmp; mv tmp $(distdir)/scripts/new_BOXMOX_experiment_from_example
kpp: $(OBJS)
@echo " "$(CC) $(CC_FLAGS) $(CFLAGS) $(OBJS) -L$(FLEX_LIB_DIR) -lfl -o kpp
@$(CC) $(CC_FLAGS) $(CFLAGS) $(OBJS) -L$(FLEX_LIB_DIR) -lfl -o kpp
@mv kpp ../bin
install-data-hook:
@echo " "
@echo " --- YOU ARE GOOD TO GO ---"
@echo " "
@echo "To use BOXMOX, you need to add the following lines to"
@echo "your .bashrc, .profile (a hidden file in your home directory)"
@echo "or similar, so they are executed upon login:"
@echo " "
@echo "export KPP_HOME=${prefix}/share/boxmox"
@echo "export PATH=${prefix}/bin:\$$PATH"
@echo " "
clean:
@rm -f *~ *.o cflags
maintainer-clean: clean
@rm -f lex.yy.c y.tab.c y.tab.h
lex.yy.c: scan.l scan.h
@echo " "$(FLEX) scan.l
@$(FLEX) -olex.yy.c scan.l
y.tab.c: scan.y scan.h
@echo " "$(BISON) scan.y
@$(BISON) -o y.tab.c scan.y
flex: lex.yy.c y.tab.c
scanner.o: scan.h gdata.h
scanutil.o: scan.h
kpp.o: gdata.h
gen.o: gdata.h code.h
debug.o: gdata.h
code.o: gdata.h code.h
code_c.o: gdata.h code.h
code_f.o: gdata.h code.h
......@@ -4,35 +4,51 @@
Documentation, user downloads, online tools and further information can be found [here](https://mbees.med.uni-augsburg.de/boxmodeling/).
This is the development repository. BOXMOX is an extension to KPP, hence it lives as part of KPP. For distribution, a patch against standard KPP is created, KPP is downloaded from the original location, and the code is patched. For testing, each commit creates a [downloadable distribution](https://git.rz.uni-augsburg.de/knotechr/boxmox/-/jobs/artifacts/master/download?job=boxmox_latest) which can used directly for testing.
This is the development repository.
Feel free to push merge requests and add issues if you should encounter any.
## Latest distributable archive
Please cite our work when BOXMOX use constituted a relevant contribution to your scientific work. The citation for BOXMOX is [Knote et al., Atm. Env., 2015](http://dx.doi.org/10.1016/j.atmosenv.2014.11.066).
## Code structure
The most current BOXMOX distribution .tar.gz can be found [here](https://mbees.med.uni-augsburg.de/gitlab/mbees/boxmox/-/jobs/artifacts/master/download?job=build).
`boxmox/`
## Contributing
Main KPP directory, patched and extended for BOXMOX.
We are looking forward to receiving your [new issue report](https://mbees.med.uni-augsburg.de/gitlab/mbees/boxmox/-/issues/new).
`boxmox/boxmox/`
If you'd like to contribute source code directly, please [create a fork](https://mbees.med.uni-augsburg.de/gitlab/mbees/boxmox), make your changes and then [submit a merge request](https://mbees.med.uni-augsburg.de/gitlab/mbees/boxmox/-/merge_requests/new) to the original project.
Additional data and code for BOXMOX.
## Citation
`boxmox/boxmox/wrapper`
Please cite our work when BOXMOX use constituted a relevant contribution to your scientific work. The citation for BOXMOX is [Knote et al., Atm. Env., 2015](http://dx.doi.org/10.1016/j.atmosenv.2014.11.066).
Main BOXMOX user code file.
## Where does BOXMOX extend KPP?
`boxmox/boxmox/boxmox(_adjoint).f90`
`drv/boxmox.f90`/ `drv/boxmox_adjoint.f90`
KPP (adjoint) driver for BOXMOX.
`boxmox/boxmox/examples`
`drv/wrapper`
This is where all BOXMOX extension code lives.
`case_studies/`
Test cases for BOXMOX usage.
[Christoph Knote](mailto:christoph.knote@med.uni-augsburg.de), [MBEES, Faculty of Medicine, University of Augsburg](https://mbees.med.uni-augsburg.de), Germany
`doc/boxmox_README.tex`
BOXMOX documentation.
`models/`
Additional chemistry mechanisms included with BOXMOX.
`scripts/`
Command-line scripts to drive BOXMOX.
`util/UserRateLaws_BOXMOX.f90`
Rate constant equations for BOXMOX.
## License statement
......@@ -49,3 +65,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
## Contact
[Christoph Knote](mailto:christoph.knote@med.uni-augsburg.de), [MBEES, Faculty of Medicine, University of Augsburg](https://mbees.med.uni-augsburg.de), Germany
# -*- sh -*-
##############################################################################
#
# KPP - The Kinetic PreProcessor
# Builds simulation code for chemical kinetic systems
#
# Copyright (C) 1995-1997 Valeriu Damian and Adrian Sandu
# Copyright (C) 1997-2005 Adrian Sandu
#
# KPP is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation (http://www.gnu.org/copyleft/gpl.html); either version 2 of the
# License, or (at your option) any later version.
#
# KPP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along
## with this program; if not, consult http://www.gnu.org/copyleft/gpl.html or
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# Adrian Sandu
# Computer Science Department
# Virginia Polytechnic Institute and State University
# Blacksburg, VA 24060
# E-mail: sandu@cs.vt.edu
#
##############################################################################
# In order to compile KPP you have to provide the following information:
# 1. The name of the compiler you want to use. Normaly this
# is either GNU C compiler (gcc) or the native compiler (cc)
# You can use the complete pathname if the compiler is not in $PATH
# Note that for SUN machines is better to use gcc.
# For GNU C compiler use:
# CC=gcc
# For the native compiler use:
# CC=cc
CC=gcc
# 2. The name of your lexical analizer. KPP requires FLEX to be used.
# FLEX is a public domain lexical analizer and you can download it from
# http://www.gnu.org/software/flex/ or any other mirror site. If flex
# directory is not included in your path use the complete pathname.
FLEX=flex
# 3. The complete pathname of the FLEX library (libfl.a).
# On many systems this is either:
# /usr/lib, /usr/lib64, /usr/local/util/lib/flex
FLEX_LIB_DIR=/usr/lib
# 4. Platform independent C compiler flags. By default "-O" is used which
# turns on optimization. If you are experiencing problems you may try
# "-g" to include debuging informations.
CC_FLAGS= -g -Wall
# 5. Path to include additional directories
# Typically: /usr/include on Linux
# /usr/include/sys on Mac OS X
INCLUDE_DIR = /usr/include
##############################################################################
......@@ -15,11 +15,11 @@
\ \\[8cm]
{\LARGE BOXMOX extensions to KPP} \\[1cm]
Christoph Knote (christoph.knote@lmu.de)\\
Meteorological Institute, LMU Munich, Germany
Christoph Knote (christoph.knote@med.uni-augsburg.de)\\
Model-Based Environmental Exposure Science, Faculty of Medicine, University of Augsburg, Germany
\\[1cm]
Version 1.8a\\
09/2019
Version 1.8\\
03/2022
% version name comment
% 0.9 CK initial release
......@@ -34,6 +34,7 @@ Version 1.8a\\
% 1.7 CK revamped mixing process options, included simple aerosol as
% surface density area and radius
% 1.8a CK implemented NOx fixing
% 1.8 CK move to GNU autotools for distribution
\end{center}
\thispagestyle{empty}
......@@ -46,11 +47,20 @@ Version 1.8a\\
\section*{Version history}
\subsection*{1.8a}
\subsection*{1.8}
\textit{not released yet}
New features
\begin{itemize}
\item Move to GNU autotools for distribution
\end{itemize}
\subsection*{1.8a}
\textit{not released}
New features
\begin{itemize}
\item Implemented NO$_x$ fixing method for steady state calculations
\end{itemize}
......@@ -200,49 +210,22 @@ doi:10.5194/acp-6-187-2006, 2006.
\emph{BOXMOX is a Linux program, we assume you are working on a reasonably
recent Linux distribution.}
You should have received or downloaded the \emph{install\_BOXMOX.bash} shell
script. The script is written in {\tt bash}, a shell that is installed on most
*nix machines, but might not be your default. Do not worry. Open the script in
your favorite text editor and adapt the user section to your machine. You need
to set
Requirements for installing and running BOXMOX:
\begin{itemize}
\item absolute path to the location you want BOXMOX to be
\item C compiler (usually {\tt gcc} or {\tt cc})
\item C compile flags (if any)
\item absolute path to the FLEX binary (test with {\tt which flex})
\item absolute path to the FLEX library (libfl.a, try {\tt type -a libfl.a})
\item Fortran compiler ({\tt gfortran} is assumed)
\item flex (test with {\tt which flex})
\item flex library (libfl.a, try {\tt type -a libfl.a})
\item yacc or bison
\end{itemize}
Save the file. Now execute it:
BOXMOX installation is then straightforward:
\begin{verbatim}
me@mymachine> bash install_BOXMOX.bash
BOXMOX extension to KPP (1.7)
Output directory: /glade/u/home/knote/testy
C compiler: gcc
C compiler flags: -O
FLEX binary: /usr/bin/flex
FLEX library: /usr/lib64/libfl.a
Downloading BOXMOX
Downloading KPP
Unpacking KPP
Patching KPP
Compiling KPP
Tex'ing BOXMOX readme (boxmox/README.pdf)
--- YOU ARE GOOD TO GO ---
Remember to set the following env. variables and
add them to your .bashrc. to remember them permanently:
export KPP_HOME=/glade/u/home/knote/boxmox
export PATH=$KPP_HOME/bin:$PATH
me@mymachine>
./configure --prefix=<absolue path to where BOXMOX should be installed>
make
make install
\end{verbatim}
Once you see the message ``YOU ARE GOOD TO GO'', everything should have worked
......@@ -288,7 +271,7 @@ me@mymachine>
This creates a box model executable for the chosen mechanism (in this case,
MOZART-4) which you can now use for your experiments. The executables can be
found in \emph{\$KPP\_HOME/boxmox/compiled\_mechs/\mech}.
found in \emph{\$KPP\_HOME/compiled\_mechs/\mech}.
\subsubsection{{\tt new\_BOXMOX\_experiment}}
......@@ -343,7 +326,7 @@ values.
A typical \emph{BOXMOX.nml} file looks like this:
\begin{alltt}
\input{examples/BOXMOX.nml}
\input{../case_studies/BOXMOX.nml}
\end{alltt}
......@@ -758,7 +741,7 @@ Make sure the following variables are set:
#LANGUAGE Fortran90
#DOUBLE ON
#INTEGRATOR rosenbrock
#DRIVER ../boxmox/boxmox
#DRIVER boxmox
#JACOBIAN SPARSE_LU_ROW
#HESSIAN OFF
\end{verbatim}
......
File deleted
#!/bin/sh
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
CC=cc
if [ x$1 != x ]; then CC=$1; fi
exec 5>./cflags
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}:${CC}" in
*:HP-UX:*:*:cc*) # For HP-UX workstations
echo " -Aa -D_HPUX_SOURCE " 1>&5; exit 0 ;;
*:AIX:*:*:cc*) # For machines running AIX
echo " -Aa " 1>&5; exit 0 ;;
*:IRIX:*:*:cc*) # For machines running IRIX
echo " " 1>&5; exit 0 ;;
*:IRIX64:*:*:cc*) # For machines running IRIX64
echo " " 1>&5; exit 0 ;;
*:Linux:*:*:cc*) # For Linux machines
echo " " 1>&5; exit 0 ;;
*:SunOS:*:*:cc*) # For SUN machines
echo " Please use gcc compiler on SUN machines."; exit 1 ;;
*:*:*:*:gcc*) # this is the default case, for gcc
echo " " 1>&5; exit 0 ;;
*:*:*:*:*) # this is the default case
echo " " 1>&5; exit 0 ;;
esac
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#FUNCTION AGGREGATE
#JACOBIAN SPARSE_LU_ROW
#DOUBLE ON
#INTFILE rosenbrock_soa
#INLINE F90_GLOBAL
INTEGER Autonomous
COMMON /INTGDATA/ Autonomous
REAL*8 STEPSTART
COMMON /GDATA/ STEPSTART
#ENDINLINE
#INLINE F90_INIT
STEPMIN=0.0001
STEPMAX=3600.
Autonomous = 1
STEPSTART=STEPMIN
#ENDINLINE
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment