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

Final touches

parent 639580a7
No related branches found
No related tags found
No related merge requests found
Pipeline #24 passed
......@@ -16,6 +16,10 @@ We are looking forward to receiving your [new issue report](https://mbees.med.un
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.
## Building a distribution
Once forked, you can create your own distributable archive using the `build_dist.sh` script, which takes the build directory as argument.
## Citation
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).
......@@ -26,7 +30,7 @@ Please cite our work when BOXMOX use constituted a relevant contribution to your
KPP (adjoint) driver for BOXMOX.
`drv/wrapper`
`boxmox/wrapper`
This is where all BOXMOX extension code lives.
......@@ -34,7 +38,7 @@ This is where all BOXMOX extension code lives.
Test cases for BOXMOX usage.
`doc/boxmox_README.tex`
`boxmox/boxmox_README.tex`
BOXMOX documentation.
......
#!/bin/bash
boxmoxVersion=1.8
kppVersion=2.2.3
kppFile=kpp-2.2.3_Nov.2012.tar.gz
boxmoxDir=boxmox
kppDir=kpp-$kppVersion
wrkDir=patch_wrk_dir
prepScript=$(pwd)/prep_BOXMOX_src_directory.bash
patchName=$(pwd)/boxmox_${boxmoxVersion}_${kppVersion}.patch
tar xvzf $kppFile
# copy both directories here to have relative paths
rm -rf $wrkDir
mkdir -p $wrkDir
cp -r $boxmoxDir $wrkDir/boxmox
mv $kppDir $wrkDir/kpp
cd $wrkDir
bash ${prepScript} boxmox ${boxmoxVersion}
diff -rupwN kpp boxmox > ${patchName}
exit 0
#!/bin/bash
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# BOXMOX extensions to KPP - installation script
#
# execute as
# me@mymachine> bash install_BOXMOX.bash
#
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
#
# 1.0 Christoph Knote - NCAR/ACD - knote@ucar.edu - 06/2014
# 1.1 Christoph Knote - NCAR/ACD - knote@ucar.edu - 07/2014
# updates to the MOZART mechanism
# 1.2 Christoph Knote - LMU - christoph.knote@lmu.de - 08/2015
# various updates to BOXMOX
# 1.3 Christoph Knote - LMU - christoph.knote@lmu.de - 11/2015
# new Namelist feature, various code updates
# 1.4 Christoph Knote - LMU - christoph.knote@lmu.de - 09/2016
# included MCM and other mechanisms, code updates
# 1.5 Christoph Knote - LMU - christoph.knote@lmu.de - 11/2016
# new commands included for simplified usage, code updates
# 1.6 Christoph Knote - LMU - christoph.knote@lmu.de - 02/2017
# ability to create adjoint using prepare_BOXMOX_mechanism
# 1.6.1 Christoph Knote - LMU - christoph.knote@lmu.de - 02/2017
# bugfix release
# 1.7 Christoph Knote - LMU - christoph.knote@lmu.de - 12/2017
# new file format, heterogeneous reactions/aerosol, dilution
# 1.8 Christoph Knote - UniA - christoph.knote@med.uni-augsburg.de - 11/2021
# first release from new website at University Augsburg
#
# USER SECTION
# This is where your BOXMOX will be
boxmoxDir=$(pwd)/boxmox
# your C compiler - gcc should be fine on most systems
CC=gcc
# the FLEX lexical analyzer - check via "which flex"
FLEX=$(which flex 2> /dev/null)
# the FLEX library directory - on Linux try via "type -a libfl.a",
# if this fails it is usually somewhere close to the binary (e.g. in ../lib)
FLEX_LIB_DIR=/usr/lib/x86_64-linux-gnu
# your C compiler flags (if any). Note: separate multiple arguments by spaces and enclose in quotation marks.
CC_FLAGS="-g -Wall"
# standard headers
INCLUDE_DIR=/usr/include
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# nothing to be changed beyond this point...
boxmoxVersion=1.8
# see if we have everything we need
hash sed >/dev/null 2>&1 || { echo "BOXMOX installer needs 'sed'"; exit 1; }
hash make >/dev/null 2>&1 || { echo "BOXMOX installer needs 'make'"; exit 1; }
hash bison >/dev/null 2>&1 || { echo "BOXMOX installer needs 'bison'"; exit 1; }
# see if the given options make sense
hash $CC >/dev/null 2>&1 || { echo "C compiler $CC unknown"; exit 1; }
[ -f $FLEX ] || { echo "No FLEX executable found at $FLEX"; exit 1; }
[ -f $FLEX_LIB_DIR/libfl.a ] || { echo "No FLEX library found in $FLEX_LIB_DIR"; exit 1; }
[ -d $INCLUDE_DIR ] || { echo "No include directory found at $INCLUDE_DIR"; exit 1; }
hash gfortran >/dev/null 2>&1 || { echo "Note: BOXMOX will need 'gfortran' or another Fortran compiler."; }
# let's go - describe what's gonna happen
echo " "
echo "BOXMOX extension to KPP (${boxmoxVersion})"
echo " "
echo "Output directory: $boxmoxDir"
echo "C compiler: $CC"
echo "C compiler flags: $CC_FLAGS"
echo "FLEX binary: $FLEX"
echo "FLEX library: $FLEX_LIB_DIR/libfl.a"
echo " "
[ -z $KPP_HOME ] || { echo "The KPP_HOME variable is set (to '${KPP_HOME}'), it seems there is already another KPP/BOXMOX installation. Make sure to update your \$KPP_HOME and \$PATH variables after this new installation."; echo ""; }
mkdir -p $boxmoxDir || { echo "Could not create BOXMOX directory $boxmoxDir"; exit 1; }
cd $boxmoxDir
# make (missing) bin subfolder
mkdir -p bin
mv Makefile.defs Makefile.defs.BACK
sed "s|CC=.*|CC=$CC|;s|CC_FLAGS=.*|CC_FLAGS=$CC_FLAGS|;s|FLEX=.*|FLEX=$FLEX|;s|FLEX_LIB_DIR=.*|FLEX_LIB_DIR=$FLEX_LIB_DIR|;s|INCLUDE_DIR = .*|INCLUDE_DIR = $INCLUDE_DIR|" Makefile.defs.BACK > Makefile.defs
[[ $? ]] || { echo "Could not patch Makefile.defs"; exit 1; }
make &> compile.log
[ -f bin/kpp ] || { echo "Could not compile BOXMOX - see compile.log"; exit 1; }
export KPP_HOME=$boxmoxDir
export PATH=$KPP_HOME/bin:$KPP_HOME/boxmox/bin:$PATH
echo " "
echo " --- YOU ARE GOOD TO GO ---"
echo " "
echo "Remember to copy the following lines into"
echo "your .bashrc (a hidden file in your home directory)"
echo "so they are executed upon login:"
echo " "
echo "export KPP_HOME=$boxmoxDir"
echo "export PATH=\$KPP_HOME/bin:\$KPP_HOME/boxmox/bin:\$PATH"
echo " "
File deleted
#!/bin/bash
boxmoxDir=$1
boxmoxVersion=$2
# now clean up the superfluous directories and files
rm -rf ${boxmoxDir}/boxmox/compiled_mechs
find . -name "*.DS_Store" -delete
find . -name "*~" -delete
find . -name "*.log" -delete
find . -name "*.aux" -delete
find . -name "*.o" -delete
find . -name "*.dvi" -delete
find . -name "*synctex*" -delete
find . -name "*_CSIRO*" -delete
find . -name "*NO_NO2*" -delete
# replace BOXMOX version strings
sed -i 's/__BOXMOX_VERSION__/'${boxmoxVersion}'/g' ${boxmoxDir}/boxmox/wrapper
sed -i 's/__BOXMOX_VERSION__/'${boxmoxVersion}'/g' ${boxmoxDir}/boxmox/boxmox.f90
sed -i 's/__BOXMOX_VERSION__/'${boxmoxVersion}'/g' ${boxmoxDir}/boxmox/boxmox_adjoint.f90
sed -i 's/__BOXMOX_VERSION__/'${boxmoxVersion}'/g' ${boxmoxDir}/boxmox/bin/new_BOXMOX_experiment
sed -i 's/__BOXMOX_VERSION__/'${boxmoxVersion}'/g' ${boxmoxDir}/boxmox/bin/new_BOXMOX_experiment_from_example
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