Skip to content

Commit

Permalink
Merge pull request #140 from NCAR/main
Browse files Browse the repository at this point in the history
Release version 1.4.2
  • Loading branch information
boulderdaze authored Sep 25, 2023
2 parents 137bea5 + 520cbdd commit d148287
Show file tree
Hide file tree
Showing 76 changed files with 419 additions and 1,675 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "libs/micm"]
path = libs/micm
url = https://github.com/NCAR/micm.git
[submodule "libs/camp"]
path = libs/camp
url = https://github.com/open-atmos/camp.git
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.2.0.tar.gz
&& make -j 8 install

# copy the interactive server code
COPY . /music-box
COPY ./libs/camp /camp

# Install a modified version of CVODE
RUN mkdir cvode_build \
&& cd cvode_build \
&& tar -zxvf /music-box/libs/camp/cvode-3.4-alpha.tar.gz \
&& tar -zxvf /camp/cvode-3.4-alpha.tar.gz \
&& cd cvode-3.4-alpha \
&& mkdir build \
&& cd build \
Expand All @@ -66,9 +66,12 @@ RUN mkdir camp_build \
-D CMAKE_Fortran_FLAGS_DEBUG="-pg" \
-D CMAKE_MODULE_LINKER_FLAGS="-pg" \
-D ENABLE_GSL:BOOL=TRUE \
/music-box/libs/camp \
/camp \
&& make

# copy the interactive server code
COPY . /music-box

# build music-box
RUN cd music-box \
&& mkdir build \
Expand Down
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,33 @@ MusicBox: A MUSICA model for boxes and columns.

Copyright (C) 2020 National Center for Atmospheric Research

# Install and run from local git clone

```
git clone https://github.com/NCAR/music-box
cd music-box
git submodule init
git submodule update
docker build -t music-box .
docker run --rm -it music-box
```

Running those commands will put you in a docker container, at which point you can run

```
cd /music-box/build
make test
```

and you will see tests run, and hopefully pass.

There are a number of examples you can run and modify.

```
cd /music-box/examples/camp_examples/bright_chamber/use_case_7/
/music-box/build/music_box use_case_7_config.json
```

# Install and run (interactive version)

The only requirement for running MusicBox is that you have [Docker Desktop](https://www.docker.com/get-started) installed and running. With Docker Desktop running, open a terminal window and run the following command: (The first time you run this command, the MusicBox code will be downloaded from Docker Hub, which may take a few minutes.)
Expand Down Expand Up @@ -37,16 +64,6 @@ You will need to have [Docker Desktop](https://www.docker.com/get-started) insta
docker run -it --rm ncar/music-box bash
```

## Running MusicBox with the MICM Solver
MICM can be specified as the chemical solver by configuring the [model components](config_options.md#model-components) section of the configuration file. By default, MusicBox loads the Chapman chemistry mechanism for simulations using MICM. To run the model with this mechanism under one of the model configurations in the `examples/` folder:

```
cd /build
cp examples/micm_examples/bright_chamber/use_case_4.json .
cp examples/micm_examples/bright_chamber/use_case_4_initial.csv data/
./music_box use_case_4.json
```

## Running MusicBox with the CAMP Solver

CAMP can be specified as the chemical solver by configuring the [model components](config_options.md#model-components) section of the configuration file. To run the model using the CAMP solver under one of the model configurations in the `examples/` folder:
Expand Down
16 changes: 1 addition & 15 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(FetchContent)

FetchContent_Declare(musicacore
GIT_REPOSITORY https://github.com/NCAR/musica-core.git
GIT_TAG 6a628d4f368c9a6b2aa01e5138660d961819c77c
GIT_TAG 25ef3ab
FIND_PACKAGE_ARGS NAMES musicacore
)

Expand Down Expand Up @@ -141,17 +141,3 @@ find_path(CAMP_INCLUDE_DIR camp_core.mod
/usr/local/lib
/usr/local/lib64)
include_directories(${CAMP_INCLUDE_DIR})

################################################################################
# MICM library

include(FetchContent)

set(ENABLE_FORTRAN_LINK ON)
FetchContent_Declare(micm
GIT_REPOSITORY https://github.com/NCAR/micm.git
GIT_TAG 20c0a19
FIND_PACKAGE_ARGS NAMES micm
)

FetchContent_MakeAvailable(micm)
23 changes: 0 additions & 23 deletions config_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,29 +369,6 @@ NetCDF files should have a dimension of <code>time</code>, and variables whose o
</code></pre>
<hr>
<h3 class="code-line" data-line-start=321 data-line-end=322 ><a id="Model_Components_321"></a>Model Components</h3>
<p class="has-line-data" data-line-start="322" data-line-end="323">The model components section of the MusicBox configuration specifies settings for the chemical solver. For most use cases of MusicBox, modifying the model components is not neccesary.</p>
<h5 class="code-line" data-line-start=324 data-line-end=325 ><a id="Model_components_configuration_with_the_MICM_solver_324"></a>Model components configuration with the MICM solver:</h5>
<h1 class="code-line" data-line-start=325 data-line-end=326 ><a id="_325"></a></h1>
<pre><code class="has-line-data" data-line-start="327" data-line-end="347" class="language-json">{
"<span class="hljs-attribute">model components</span>" : <span class="hljs-value">[
{
"<span class="hljs-attribute">type</span>" : <span class="hljs-value"><span class="hljs-string">"MICM"</span></span>,
"<span class="hljs-attribute">solver</span>" : <span class="hljs-value">{
"<span class="hljs-attribute">type</span>" : <span class="hljs-value"><span class="hljs-string">"Rosenbrock"</span></span>,
"<span class="hljs-attribute">chemistry time step [min]</span>" : <span class="hljs-value"><span class="hljs-number">5.0</span></span>,
"<span class="hljs-attribute">absolute tolerance</span>" : <span class="hljs-value"><span class="hljs-number">1.0e-12</span></span>,
"<span class="hljs-attribute">relative tolerance</span>" : <span class="hljs-value"><span class="hljs-number">1.0e-4</span>
</span>}
</span>},
{
"<span class="hljs-attribute">type</span>" : <span class="hljs-value"><span class="hljs-string">"musica-emissions"</span>
</span>},
{
"<span class="hljs-attribute">type</span>" : <span class="hljs-value"><span class="hljs-string">"musica-loss"</span>
</span>}
]
</span>}
</code></pre>
<h5 class="code-line" data-line-start=348 data-line-end=349 ><a id="Configuring_the_CAMP_solver_348"></a>Configuring the CAMP solver:</h5>
<p class="has-line-data" data-line-start="349" data-line-end="350"><strong>When using the CAMP solver, additional configuration files are required.</strong> By default, these are stored in a directory <code>camp_data</code>. Inside this folder:</p>
<p class="has-line-data" data-line-start="351" data-line-end="354">|—<code>config.json</code> — Points to <code>specise.json</code> and <code>mechanism.json</code>.<br>
Expand Down
1 change: 0 additions & 1 deletion doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,6 @@ WARN_LOGFILE =

INPUT = doxygen_files \
../src \
../libs/micm/src \
../libs/musica-core/src \
../test

Expand Down
1 change: 0 additions & 1 deletion etc/casper/build_music_box_casper_gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ mkdir -p build
cd build
cmake -D CMAKE_C_COMPILER=gcc \
-D CMAKE_Fortran_COMPILER=gfortran \
-D ENABLE_MICM_TESTS=OFF \
-D CMAKE_BUILD_TYPE=release \
-D CMAKE_C_FLAGS="-std=c99 ${NCAR_LIBS_GSL}" \
-D SUITE_SPARSE_AMD_LIB=$SUITE_SPARSE_HOME/lib/libamd.so \
Expand Down
1 change: 0 additions & 1 deletion etc/casper/build_music_box_casper_intel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ mkdir -p build
cd build
cmake -D CMAKE_C_COMPILER=icc \
-D CMAKE_Fortran_COMPILER=ifort \
-D ENABLE_MICM_TESTS=OFF \
-D CMAKE_BUILD_TYPE=release \
-D CMAKE_C_FLAGS="-std=c99 ${NCAR_LIBS_GSL}" \
-D SUITE_SPARSE_AMD_LIB=$SUITE_SPARSE_HOME/lib/libamd.so \
Expand Down
25 changes: 0 additions & 25 deletions etc/change_mechanism.sh

This file was deleted.

1 change: 0 additions & 1 deletion etc/cheyenne/build_music_box_cheyenne_gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ mkdir -p build
cd build
cmake -D CMAKE_C_COMPILER=gcc \
-D CMAKE_Fortran_COMPILER=gfortran \
-D ENABLE_MICM_TESTS=OFF \
-D CMAKE_BUILD_TYPE=release \
-D CMAKE_C_FLAGS="-std=c99 ${NCAR_LIBS_GSL}" \
-D SUITE_SPARSE_AMD_LIB=$SUITE_SPARSE_HOME/lib/libamd.so \
Expand Down
1 change: 0 additions & 1 deletion etc/cheyenne/build_music_box_cheyenne_intel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ mkdir -p build
cd build
cmake -D CMAKE_C_COMPILER=icc \
-D CMAKE_Fortran_COMPILER=ifort \
-D ENABLE_MICM_TESTS=OFF \
-D CMAKE_BUILD_TYPE=release \
-D CMAKE_C_FLAGS="-std=c99 ${NCAR_LIBS_GSL}" \
-D SUITE_SPARSE_AMD_LIB=$SUITE_SPARSE_HOME/lib/libamd.so \
Expand Down
1 change: 0 additions & 1 deletion etc/modeling2/build_music_box_modeling2_gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ mkdir -p build
cd build
cmake3 -D CMAKE_C_COMPILER=gcc \
-D CMAKE_Fortran_COMPILER=gfortran \
-D ENABLE_MICM_TESTS=OFF \
-D CMAKE_BUILD_TYPE=release \
-D CMAKE_C_FLAGS="-std=c99" \
-D GSL_CBLAS_LIB=$GSL_HOME/lib/libgslcblas.so \
Expand Down
Loading

0 comments on commit d148287

Please sign in to comment.