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

Support for TChem in PartMC (gas phase) #198

Merged
merged 65 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
5d04412
first working version
jcurtis2 May 6, 2024
c25674a
add spec file reading for tchem. pass value of config to tchem
jcurtis2 May 9, 2024
15e8fb4
update tchem_interface
jcurtis2 May 15, 2024
749acc5
minor clean up
jcurtis2 May 16, 2024
5d6668f
fix bug in mapping
jcurtis2 May 16, 2024
359e9cd
fix test specfiles
jcurtis2 May 16, 2024
99e5383
first step to cleaner CMakeList.txt. consider TChem install path vari…
jcurtis2 May 17, 2024
317719b
update set and get statevector tchem. add simple test
jcurtis2 May 22, 2024
26be744
fix missing precompile for tchem
jcurtis2 May 22, 2024
eb19872
simplify CMakeList
jcurtis2 May 22, 2024
d4da691
accounting for water vapor
jcurtis2 May 23, 2024
271da36
stub out aerosols to subroutine calls
jcurtis2 May 24, 2024
4057c0e
resolve most of CMakeList.txt
jcurtis2 Jun 17, 2024
741d072
improve tchem testcases. add chapman mechanism
jcurtis2 Jun 17, 2024
d9909e4
fix aero_data issues. add aero and numerics yaml file name reading
jcurtis2 Jun 19, 2024
6e77371
Merge remote-tracking branch 'origin' into link_tchem
jcurtis2 Jun 20, 2024
a4b0d41
clean up aerosols in testcase
jcurtis2 Jun 20, 2024
22dff70
improve testcase
jcurtis2 Jun 22, 2024
010ea45
add solver yaml passing. passing of time step
jcurtis2 Jun 22, 2024
5c4cc52
fix missing declarations
jcurtis2 Jul 22, 2024
26b4caf
unignore tchem clone
jcurtis2 Jul 22, 2024
0d86e3d
add c++ library
jcurtis2 Jul 22, 2024
b23d880
add testing conditions to tchem
jcurtis2 Jul 22, 2024
7eb58f6
fix build of non tchem partmc
jcurtis2 Jul 29, 2024
d627561
fix typo
jcurtis2 Aug 7, 2024
4581012
update tchem tests
jcurtis2 Aug 19, 2024
0e38676
closer to building
jcurtis2 Aug 23, 2024
89062f6
clean up of tchem interface code
jcurtis2 Aug 23, 2024
b92064e
add more to cmakelist.txt
jcurtis2 Aug 26, 2024
965b44e
add dockerfile for tchem and add it to CI
jcurtis2 Aug 27, 2024
2ac9219
fix missing line continuation in dockerfile
jcurtis2 Aug 27, 2024
7c59b58
improve CMakeLists.txt
jcurtis2 Aug 29, 2024
8522bf6
clean up tchem_interface
jcurtis2 Sep 11, 2024
6250593
Merge remote-tracking branch 'origin/link_tchem' into link_tchem
jcurtis2 Sep 11, 2024
a5bab1c
fix filename for tchem test
jcurtis2 Sep 12, 2024
433328a
make cmake behave. -Wimplicit-interface issue
jcurtis2 Sep 12, 2024
93ffc2d
Merge branch 'master' into link_tchem
jcurtis2 Sep 12, 2024
2093548
experiment with parallel testing
jcurtis2 Sep 14, 2024
18b2a00
update scenario spec files
jcurtis2 Sep 17, 2024
d9297e1
pass batch and nbatch to tchem
jcurtis2 Sep 30, 2024
3a71a95
specify solving one system
jcurtis2 Oct 2, 2024
7f86924
change timing to use system_clock
jcurtis2 Oct 2, 2024
73d8847
comment out currently unused aero_data related code
jcurtis2 Oct 2, 2024
769ae18
fix logic for reading of gas_data
jcurtis2 Oct 19, 2024
26c3878
add comment in spec files for tchem. fix camp comment in tests
jcurtis2 Oct 19, 2024
089ddc4
update dockerfile
jcurtis2 Oct 20, 2024
83498ac
add equation reference
jcurtis2 Oct 20, 2024
f165310
add search for compiler dependent openmp flags
jcurtis2 Oct 20, 2024
bd19a44
disable serial requirement for tchem tests
jcurtis2 Oct 20, 2024
959fec7
fix tchem dockerfile to use main
jcurtis2 Oct 20, 2024
fd43d15
another try at tchem dockerfile
jcurtis2 Oct 20, 2024
1cb5206
testing removal of ssh for submodule
jcurtis2 Oct 20, 2024
55245e6
remove serial requirement for tchem tests
jcurtis2 Oct 20, 2024
d35d10d
move getting time to a util function
jcurtis2 Oct 20, 2024
986c8a2
move tchem needed libraries out of compiler flags
jcurtis2 Oct 21, 2024
53018b3
do unit conversions in place
jcurtis2 Oct 23, 2024
051bd47
change dockerfile.tchem back to main branch
jcurtis2 Oct 23, 2024
3463e7d
less aggressive cmakelist
jcurtis2 Oct 23, 2024
1c8f222
change mole_dens subroutines to molar_conc
jcurtis2 Oct 23, 2024
4f23bcb
remove unneeded subroutine
jcurtis2 Oct 23, 2024
a51fa48
Fix missing space
jcurtis2 Oct 23, 2024
4864270
add function to convert rh to water vapor mixing ratio
jcurtis2 Oct 23, 2024
1c86637
change gas_state_set_camp_conc to use partmc env_state instead of cam…
jcurtis2 Oct 23, 2024
1db9b18
test checking for interfaces in CMakelists.txt
jcurtis2 Oct 23, 2024
947b115
remove cmake interface checking
jcurtis2 Oct 28, 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
15 changes: 15 additions & 0 deletions .github/workflows/tchem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: TChem

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Build the testing docker image
run: docker build -f Dockerfile.tchem -t partmc-test .
- name: Run the tests in the docker container
run: docker run -t partmc-test bash -c 'export CTEST_PARALLEL_LEVEL=4; cd /build; make test'
84 changes: 81 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ cmake_minimum_required(VERSION 2.6.4)
# http://www.cmake.org/Bug/view.php?id=8598
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35707
# http://www.cmake.org/Bug/view.php?id=8408
project(PARTMC Fortran C)
if (ENABLE_TCHEM)
# Use the wrapper to nvcc for the CXX compiler for GPU
if (ENABLE_TCHEM_GPU)
set(ENV{CXX} $ENV{KOKKOS_PATH}/bin/nvcc_wrapper)
project(PARTMC Fortran C CXX)
else()
project(PARTMC Fortran C)
endif()
else()
project(PARTMC Fortran C)
endif()

set(PACKAGE_BUGREPORT "[email protected]")
set(PACKAGE_NAME "PartMC")
Expand All @@ -17,6 +27,7 @@ set(PACKAGE_VERSION "2.8.0")
option(ENABLE_GSL "Enable GSL library for random number generation" OFF)
option(ENABLE_MOSAIC "Enable MOSAIC chemistry support" OFF)
option(ENABLE_CAMP "Enable CAMP chemistry support" OFF)
option(ENABLE_TCHEM "Enable TChem chemistry support" OFF)
option(ENABLE_MPI "Enable MPI parallel support" OFF)
option(ENABLE_SUNDIALS "Enable SUNDIALS solver for condensation support" OFF)
option(ENABLE_C_SORT "Enable C sorting routines" OFF)
Expand Down Expand Up @@ -98,6 +109,50 @@ if(ENABLE_CAMP)
add_definitions(-DPMC_USE_CAMP)
endif()

######################################################################

if(ENABLE_TCHEM)
find_path(TCHEM_INCLUDE_DIR tchem_atm/TChem_Driver.hpp
DOC "TChem include directory"
PATHS $ENV{TCHEM_HOME}/include/)
find_library(TCHEM_LIB tchem_atm
DOC "TChem library"
PATHS $ENV{TCHEM_HOME}/lib64 $ENV{TCHEM_HOME}/lib)
add_definitions(-DPMC_USE_TCHEM)
include_directories(${TCHEM_INCLUDE_DIR})
find_path(YAML_INCLUDE_DIR yaml-cpp/yaml.h
DOC "TChem include directory"
PATHS $ENV{YAML_PATH}/include/)
find_library(YAML_LIB yaml-cpp
PATHS $ENV{YAML_PATH}/lib)
include_directories(${YAML_INCLUDE_DIR})
find_path(KOKKOS_INCLUDE_DIR Kokkos_Core.hpp
DOC "Kokkos include directory"
PATHS $ENV{KOKKOS_PATH}/include)
find_library(KOKKOS_LIB kokkoscore
PATHS $ENV{KOKKOS_PATH}/lib64 $ENV{KOKKOS_PATH}/lib)
include_directories(${KOKKOS_INCLUDE_DIR})
find_path(KOKKOSKERNEL_INCLUDE_DIR KokkosKernels_Utils.hpp
DOC "Kokkos include directory"
PATHS $ENV{KOKKOSKERNEL_PATH}/include)
find_library(KOKKOSKERNEL_LIB kokkoskernels
PATHS $ENV{KOKKOSKERNEL_PATH}/lib64 $ENV{KOKKOSKERNEL_PATH}/lib)
find_path(TINES_INCLUDE_DIR tines/Tines.hpp
DOC "Tines include directory"
PATHS $ENV{TINES_PATH}/include)
find_library(TINES_LIB tines
PATHS $ENV{TINES_PATH}/lib64 $ENV{TINES_PATH}/lib)
include_directories(${TINES_INCLUDE_DIR})
set(CPP_LIB -lstdc++)
# find_path(LAPACK_INCLUDE_DIR lapack.h
# DOC "LAPACK include directory"
# PATHS $ENV{LAPACK_PATH}/include)
find_library(LAPACK_LIB openblas
PATHS $ENV{LAPACK_PATH}/lib)
# include_directories(${LAPACK_INCLUDE_DIR})
option(ENABLE_TCHEM_GPU "Enable TChem GPU chemistry support" OFF)
endif()

######################################################################
# MPI

Expand Down Expand Up @@ -154,6 +209,9 @@ if(ENABLE_MPI)
endif()
add_test(test_rand ${CMAKE_BINARY_DIR}/test_run/run_test_directory.sh rand)
add_test(test_sedi ${CMAKE_BINARY_DIR}/test_run/run_test_directory.sh sedi)
if (ENABLE_TCHEM)
add_test(test_tchem ${CMAKE_BINARY_DIR}/test_run/run_test_directory.sh tchem)
endif()
add_test(test_weighting ${CMAKE_BINARY_DIR}/test_run/run_test_directory.sh weighting)

######################################################################
Expand All @@ -176,21 +234,41 @@ add_library(partmclib src/aero_state.F90 src/integer_varray.F90
src/netcdf.F90 src/aero_info.F90 src/aero_info_array.F90
src/nucleate.F90 src/condense.F90 src/fractal.F90 src/chamber.F90
src/camp_interface.F90 src/photolysis.F90 src/sys.F90
src/tchem_interface.F90
src/aero_component.F90
${SUNDIALS_SRC} ${GSL_SRC}
${SUNDIALS_SRC} ${GSL_SRC} ${TCHEM_SRC}
${C_SORT_SRC})

target_link_libraries(partmclib ${NETCDF_LIBS} ${SUNDIALS_LIBS}
${MOSAIC_LIB} ${GSL_LIBS} ${CAMP_LIB})
${MOSAIC_LIB} ${GSL_LIBS} ${CAMP_LIB} ${TCHEM_LIB} ${YAML_LIB}
${KOKKOS_LIB} ${KOKKOSKERNEL_LIB} ${TINES_LIB} ${CPP_LIB} ${LAPACK_LIB})

if (ENABLE_TCHEM)
find_package(OpenMP REQUIRED)
if (ENABLE_TCHEM_GPU)
add_link_options(${OpenMP_CXX_FLAGS})
else()
add_link_options(${OpenMP_Fortran_FLAGS})
endif()
include(FindThreads)
target_link_libraries(partmclib ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
endif()

set_target_properties(partmclib PROPERTIES OUTPUT_NAME partmc)
if (ENABLE_TCHEM_GPU)
add_link_options(${OpenMP_CXX_FLAGS})
set_target_properties(partmclib PROPERTIES LINKER_LANGUAGE CXX)
endif()

######################################################################
# partmc executable

add_executable(partmc src/partmc.F90)

target_link_libraries(partmc partmclib)
if (ENABLE_TCHEM_GPU)
set_property(TARGET partmc PROPERTY LINKER_LANGUAGE CXX)
endif()

######################################################################
# test_bidisperse_ode
Expand Down
177 changes: 177 additions & 0 deletions Dockerfile.tchem
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
FROM ubuntu:22.04

ARG BUILD_TYPE=RELEASE
ARG SACADO=ON
RUN echo "BUILD TYPE:" ${BUILD_TYPE}
RUN echo "SACADO:" ${SACADO}

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
autoconf \
clang-format \
cmake \
gcc \
g++ \
gfortran \
git \
lcov \
make \
libopenblas-dev \
pkg-config \
ca-certificates \
less \
tmux \
libnetcdf-dev \
libnetcdff-dev \
libgsl-dev \
openssh-client

RUN git clone https://github.com/PCLAeroParams/TChem-atm.git /tchem_dir/
WORKDIR /tchem_dir/
RUN git submodule update --init --recursive

RUN cmake -S /tchem_dir/external/Tines/ext/kokkos -B /build/kokkos_build \
-DCMAKE_INSTALL_PREFIX="/install/kokkos_install" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_FLAGS="-fopenmp -g" \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_OPENMP=ON \
-DKokkos_ENABLE_CUDA=OFF \
-DKokkos_ENABLE_CUDA_CONSTEXPR=OFF \
-DKokkos_ENABLE_CUDA_LAMBDA=OFF
WORKDIR /build/kokkos_build/
RUN make -j \
&& make install

RUN cmake -S /tchem_dir/external/Tines/ext/gtest -B /build/gtest_build \
-DCMAKE_INSTALL_PREFIX="/install/gtest_install" \
-DCMAKE_CXX_COMPILER=g++
WORKDIR /build/gtest_build
RUN make -j \
&& make install

RUN cmake -S /tchem_dir/external/Tines/ext/yaml -B /build//yaml_build \
-DCMAKE_INSTALL_PREFIX="/install/yaml_install" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_FLAGS="-g -c" \
-DCMAKE_EXE_LINKER_FLAGS="" \
-DCMAKE_BUILD_TYPE=RELEASE
WORKDIR /build/yaml_build
RUN make -j \
&& make install

RUN cmake -S /tchem_dir/external/Sundials -B /build/sundials_build \
-DCMAKE_INSTALL_PREFIX="/install/sundials_install" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_FLAGS="-g" \
-DCMAKE_C_FLAGS="-g" \
-DCMAKE_EXE_LINKER_FLAGS="" \
-DENABLE_CALIPER:BOOL=OFF \
-DCMAKE_BUILD_TYPE=RELEASE
WORKDIR /build/sundials_build
RUN make -j \
&& make install

RUN cmake -S /tchem_dir/external/Skywalker -B /build/skywalker_build \
-DCMAKE_INSTALL_PREFIX="/install/skywalker_install" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_C_COMPILER=gcc \
-DSKYWALKER_PRECISION=double \
-DCMAKE_BUILD_TYPE=RELEASE
WORKDIR /build/skywalker_build
RUN make -j \
&& make install

RUN cmake -S /tchem_dir/external/Tines/src -B /build/tines_build \
-DCMAKE_INSTALL_PREFIX="/install/tines_install" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_FLAGS="-g" \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_EXE_LINKER_FLAGS="-lgfortran" \
-DTINES_ENABLE_DEBUG=OFF \
-DTINES_ENABLE_VERBOSE=OFF \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DTINES_ENABLE_TEST=OFF \
-DTINES_ENABLE_EXAMPLE=OFF \
-DSUNDIALS_INSTALL_PATH=/install/sundials_install \
-DYAML_INSTALL_PATH=/install/yaml_install \
-DKOKKOS_INSTALL_PATH=/install/kokkos_install \
-DOPENBLAS_INSTALL_PATH=`/usr/lib64` \
-DGTEST_INSTALL_PATH=/install/gtest_install
WORKDIR /build/tines_build
RUN make -j \
&& make install

RUN cmake -S /tchem_dir/external/kokkos-kernels -B /build/kokkoskernels_build \
-DCMAKE_INSTALL_PREFIX="/install/kokkoskernels_install" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_FLAGS="-g" \
-DCMAKE_EXE_LINKER_FLAGS="-lgfortran" \
-DKokkosKernels_ENABLE_EXAMPLES=OFF \
-DKokkosKernels_ENABLE_EXPERIMENTAL=OFF \
-DKokkosKernels_ENABLE_TESTS=OFF \
-DKokkosKernels_ENABLE_COMPONENT_BLAS=OFF \
-DKokkosKernels_ENABLE_COMPONENT_GRAPH=OFF \
-DKokkosKernels_ENABLE_COMPONENT_LAPACK=OFF \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DKokkos_ROOT=/install/kokkos_install
WORKDIR /build/kokkoskernels_build
RUN make -j4 \
&& make install



RUN cmake -S /tchem_dir/src -B /tchem_build \
-DCMAKE_INSTALL_PREFIX=/tchem_install \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_FLAGS="-g" \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_EXE_LINKER_FLAGS="-lgfortran" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DTCHEM_ATM_ENABLE_VERBOSE=OFF \
-DTCHEM_ATM_ENABLE_TEST=ON \
-DTCHEM_ATM_ENABLE_EXAMPLE=ON \
-DTCHEM_ATM_ENABLE_SACADO_JACOBIAN_ATMOSPHERIC_CHEMISTRY=${SACADO} \
-DKOKKOS_INSTALL_PATH=/install/kokkos_install \
-DTINES_INSTALL_PATH=/install/tines_install \
-DTCHEM_ATM_ENABLE_SKYWALKER=ON \
-DTCHEM_ATM_ENABLE_REAL_TYPE="double" \
-DSKYWALKER_INSTALL_PATH=/install/skywalker_install \
-DTCHEM_ATM_ENABLE_KOKKOSKERNELS=ON \
-DKOKKOSKERNELS_INSTALL_PATH=/install/kokkoskernels_install \
-DTCHEM_ATM_ENABLE_SKYWALKER=ON \
-DGTEST_INSTALL_PATH=/install/gtest_install
WORKDIR /tchem_build
RUN make -j \
&& make install

#RUN export FC=gfortran \
# export CC=gcc \
# export CXX=g++

COPY . /partmc/
RUN cd /build \
&& export TCHEM_HOME="/tchem_install" \
&& export KOKKOS_PATH="/install/kokkos_install" \
&& export KOKKOSKERNEL_PATH="/install/kokkoskernels_install" \
&& export YAML_PATH="/install/yaml_install" \
&& export TINES_PATH="/install/tines_install" \
&& export LAPACK_PATH="/usr/" \
&& export SUNDIALS_HOME="/install/sundials_install/" \
&& export LD_LIBRARY_PATH="/usr/lib:/usr/lib64:$LD_LIBRARY_PATH" \
&& cmake -DCMAKE_BUILD_TYPE=release \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_Fortran_COMPILER=gfortran \
-DCMAKE_C_FLAGS_RELEASE="-O2 -g -Werror -Wall -Wextra" \
-DCMAKE_Fortran_FLAGS_RELEASE="-O2 -g -Werror -fimplicit-none -Wall -Wextra -Wconversion -Wunderflow -Wimplicit-interface -Wno-compare-reals -Wno-unused -Wno-unused-parameter -Wno-unused-dummy-argument -fbounds-check" \
-D ENABLE_GSL:BOOL=TRUE \
-D ENABLE_TCHEM:BOOL=TRUE \
-D ENABLE_SUNDIALS:BOOL=TRUE \
-DCMAKE_C_FLAGS="-lpthread -ldl -fopenmp" \
-DCMAKE_Fortran_FLAGS="-lpthread -ldl -fopenmp" \
/partmc \
&& make
WORKDIR /build
1 change: 1 addition & 0 deletions scenarios/1_urban_plume/urban_plume.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ t_output 3600 # output interval (0 disables) (s)
t_progress 600 # progress printing interval (0 disables) (s)

do_camp_chem no # whether to use CAMP for chemistry
do_tchem no # whether to use TChem for chemistry

gas_data gas_data.dat # file containing gas data
gas_init gas_init.dat # initial gas concentrations
Expand Down
1 change: 1 addition & 0 deletions scenarios/2_urban_plume2/urban_plume2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ t_output 3600 # output interval (0 disables) (s)
t_progress 600 # progress printing interval (0 disables) (s)

do_camp_chem no # whether to use CAMP for chemistry
do_tchem no # whether to use TChem for chemistry

gas_data gas_data.dat # file containing gas data
gas_init gas_init.dat # initial gas concentrations
Expand Down
1 change: 1 addition & 0 deletions scenarios/3_condense/cond_template.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ t_output 1 # output interval (0 disables) (s)
t_progress 60 # progress printing interval (0 disables) (s)

do_camp_chem no # whether to use CAMP for chemistry
do_tchem no # whether to use TChem for chemistry

temp_profile %%TEMP_PROFILE%% # temperature profile file
pressure_profile pressure.dat # pressure profile file
Expand Down
1 change: 1 addition & 0 deletions scenarios/4_chamber/chamber.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ t_output 420 # output interval (0 disables) (s)
t_progress 2520 # progress printing interval (0 disables) (s)

do_camp_chem no # whether to use CAMP for chemistry
do_tchem no # whether to use TChem for chemistry

gas_data gas_data.dat # file containing gas data
gas_init gas_init.dat # initial gas mixing ratios
Expand Down
1 change: 1 addition & 0 deletions scenarios/5_coag_brownian/example.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ t_output 3600 # output interval (0 disables) (s)
t_progress 600 # progress printing interval (0 disables) (s)

do_camp_chem no # whether to use CAMP for chemistry
do_tchem no # whether to use TChem for chemistry

gas_data gas_data.dat # file containing gas data
gas_init gas_init.dat # initial gas concentrations
Expand Down
1 change: 1 addition & 0 deletions scenarios/6_camp/camp.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ t_progress 600 # progress printing interval (0 disables) (s)

do_camp_chem yes # whether to use CAMP for chemistry
camp_config config.json
do_tchem no # whether to use TChem for chemistry

gas_init gas_init.dat # initial gas concentrations

Expand Down
2 changes: 1 addition & 1 deletion src/camp_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ subroutine pmc_camp_interface_solve(camp_core, camp_state, &
call env_state_set_camp_env_state(env_state, camp_state)

! Set the CAMP gas-phase species concentrations
call gas_state_set_camp_conc(gas_state, camp_state, gas_data)
call gas_state_set_camp_conc(gas_state, env_state, camp_state, gas_data)

! Recalculate the photolysis rate constants
call photolysis%update_rate_constants()
Expand Down
Loading