Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 17 additions & 11 deletions Dockerfile.camp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ RUN dnf -y update \
sundials-devel \
lapack-devel \
openblas-devel \
git \
valgrind \
gsl-devel \
cmake \
&& dnf clean all
Expand All @@ -33,11 +35,14 @@ RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/6.1.0.tar.gz
&& make install \
&& cd ~

RUN curl -LO https://github.com/open-atmos/camp/archive/refs/tags/v1.0.0-gamma.tar.gz \
&& tar -zxvf v1.0.0-gamma.tar.gz
#RUN git clone https://github.com/open-atmos/camp.git
RUN git clone https://github.com/jtgasparik/camp_.git \
&& cd camp_ \
&& git checkout SIMPOL_multiple_layers \
&& cd ~

# Install a modified version of CVODE
RUN cd camp-1.0.0-gamma \
RUN cd camp_ \
&& tar -zxvf cvode-3.4-alpha.tar.gz \
&& cd cvode-3.4-alpha \
&& mkdir build \
Expand All @@ -50,30 +55,31 @@ RUN cd camp-1.0.0-gamma \
&& make install \
&& cd ~

ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64:/usr/local/jsonfortran-gnu-6.1.0/lib"
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}/usr/local/lib:/usr/local/lib64:/usr/local/jsonfortran-gnu-6.1.0/lib"
#ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64:/usr/local/jsonfortran-gnu-6.1.0/lib"
ENV PATH="${PATH}:/usr/local/jsonfortran-gnu-6.1.0/lib"

# Build CAMP
RUN cd camp-1.0.0-gamma \
RUN cd camp_ \
&& mkdir build \
&& cd build \
&& export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-6.1.0" \
&& cmake -D CMAKE_BUILD_TYPE=release \
-D CMAKE_C_FLAGS_DEBUG="-pg" \
-D CMAKE_Fortran_FLAGS_DEBUG="-pg" \
&& cmake -D CMAKE_BUILD_TYPE=debug \
#-D CMAKE_C_FLAGS_DEBUG="-pg" \
#-D CMAKE_Fortran_FLAGS_DEBUG="-pg" \
-D CMAKE_MODULE_LINKER_FLAGS="-pg" \
-D ENABLE_GSL:BOOL=TRUE \
.. \
&& make \
&& cd ~

# NOTE: Modify .dockerignore to whitelist files/directories to copy.
COPY . /partmc/
COPY partmc_ /partmc/

RUN mkdir /build \
&& cd /build \
&& export CAMP_HOME="/camp-1.0.0-gamma/build/" \
&& cmake -D CMAKE_BUILD_TYPE=release \
&& export CAMP_HOME="/camp_/build/" \
&& cmake -D CMAKE_BUILD_TYPE=debug \
-D CMAKE_C_FLAGS_DEBUG="-g" \
-D CMAKE_Fortran_FLAGS_DEBUG="-g" \
-D CMAKE_C_FLAGS_RELEASE="-O2 -g -Werror -Wall -Wextra" \
Expand Down
4 changes: 3 additions & 1 deletion scenarios/6_camp/aero_init_comp.dat
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# mass fractions
organic_matter.POA 1.0
one_layer.organic_matter.POA 0.4
two_layer.organic_matter.POA 0.3
three_layer.organic_matter.POA 0.3
37 changes: 36 additions & 1 deletion scenarios/6_camp/aerosol_representation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,42 @@
{
"name" : "PartMC single particle",
"type" : "AERO_REP_SINGLE_PARTICLE",
"maximum computational particles" : 10500
"maximum computational particles" : 120,
"layers": [
{
"name": "one_layer",
"phases": [
"dust",
"sea_salt",
"organic_matter",
"black_carbon",
"other_PM"
],
"covers": "two_layer"
},
{
"name": "two_layer",
"phases": [
"dust",
"sea_salt",
"organic_matter",
"black_carbon",
"other_PM"
],
"covers": "three_layer"
},
{
"name": "three_layer",
"phases": [
"dust",
"sea_salt",
"organic_matter",
"black_carbon",
"other_PM"
],
"covers": "none"
}
]
}
]
}
2 changes: 1 addition & 1 deletion scenarios/6_camp/camp.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
run_type particle # particle-resolved run
output_prefix out/camp # prefix of output files
n_repeat 1 # number of Monte Carlo repeats
n_part 10000 # total number of particles
n_part 100 # total number of particles
restart no # whether to restart from saved state (yes/no)
do_select_weighting no # whether to select weighting explicitly (yes/no)

Expand Down
12 changes: 6 additions & 6 deletions scenarios/6_camp/plot_aero_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def major_formatter(x, pos):
return f'{1e9*x:.1f}'

pos = [0,0]
mass_conc, mass_std = get_mass_conc(file, n_times,'organic_matter.ISOP-P1_aero',
mass_conc, mass_std = get_mass_conc(file, n_times,'one_layer.organic_matter.ISOP-P1_aero',
n_repeats=n_runs)
axes[pos[0]][pos[1]].plot(times[partmc_ind_to_plot], mass_conc[partmc_ind_to_plot],
color=colors[0], ls='', marker='%s'%(part_symbol), label="ISOP_P1_aero",
Expand All @@ -79,12 +79,12 @@ def major_formatter(x, pos):
axes[pos[0]][pos[1]].grid(True,linestyle='--')
axes[pos[0]][pos[1]].set_xlim([0,24*60])
axes[pos[0]][pos[1]].xaxis.set_major_locator(ticker.FixedLocator([0,360,720,1080,1440]))
axes[pos[0]][pos[1]].xaxis.set_major_formatter(time_formatter)
#axes[pos[0]][pos[1]].xaxis.set_major_formatter(time_formatter)
axes[pos[0]][pos[1]].set_ylim([0,3e-9])
axes[pos[0]][pos[1]].yaxis.set_major_formatter(major_formatter)
#axes[pos[0]][pos[1]].yaxis.set_major_formatter(major_formatter)
axes[pos[0]][pos[1]].set_ylabel(r'Mass concentration ($\mu \rm g \, m^{-3}$)')
pos = [1,0]
mass_conc, mass_std = get_mass_conc(file, n_times,'organic_matter.ISOP-P2_aero',
mass_conc, mass_std = get_mass_conc(file, n_times,'one_layer.organic_matter.ISOP-P2_aero',
n_repeats=n_runs)
axes[pos[0]][pos[1]].plot(times[partmc_ind_to_plot], mass_conc[partmc_ind_to_plot],
color=colors[0], ls='', marker='%s'%(part_symbol), label="ISOP-P2_aero",
Expand All @@ -94,10 +94,10 @@ def major_formatter(x, pos):
axes[pos[0]][pos[1]].set_xlabel('Simulation time (h)')
axes[pos[0]][pos[1]].set_xlim([0,24*60])
axes[pos[0]][pos[1]].xaxis.set_major_locator(ticker.FixedLocator([0,360,720,1080,1440]))
axes[pos[0]][pos[1]].xaxis.set_major_formatter(time_formatter)
#axes[pos[0]][pos[1]].xaxis.set_major_formatter(time_formatter)
axes[pos[0]][pos[1]].set_ylabel(r'Mass concentration ($\mu \rm g \, m^{-3}$)')
axes[pos[0]][pos[1]].set_ylim([0,3e-10])
axes[pos[0]][pos[1]].yaxis.set_major_formatter(major_formatter)
#axes[pos[0]][pos[1]].yaxis.set_major_formatter(major_formatter)
out_filename = 'out/timeseries_aero.pdf'
print("Writing %s" % out_filename)
fig.savefig(out_filename)
8 changes: 4 additions & 4 deletions scenarios/6_camp/plot_gas_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ def time_formatter(x, pos):
axes[pos[0]][pos[1]].grid(True,linestyle='--')
axes[pos[0]][pos[1]].set_xlim([0,24*60])
axes[pos[0]][pos[1]].xaxis.set_major_locator(ticker.FixedLocator([0,360,720,1080,1440]))
axes[pos[0]][pos[1]].xaxis.set_major_formatter(time_formatter)
#axes[pos[0]][pos[1]].xaxis.set_major_formatter(time_formatter)
axes[pos[0]][pos[1]].set_ylabel("Mixing ratio (ppm)")
axes[pos[0]][pos[1]].set_ylim([0,.14])
positions = [0,.02,.04,.06,.08,.10,.12,.14]
axes[pos[0]][pos[1]].yaxis.set_major_locator(ticker.FixedLocator(positions))
axes[pos[0]][pos[1]].yaxis.set_major_formatter(major_formatter)
#axes[pos[0]][pos[1]].yaxis.set_major_formatter(major_formatter)

pos = [1,0]
var = 'ISOP'
Expand All @@ -102,10 +102,10 @@ def time_formatter(x, pos):
axes[pos[0]][pos[1]].grid(True,linestyle='--')
axes[pos[0]][pos[1]].set_xlim([0,24*60])
axes[pos[0]][pos[1]].xaxis.set_major_locator(ticker.FixedLocator([0,360,720,1080,1440]))
axes[pos[0]][pos[1]].xaxis.set_major_formatter(time_formatter)
#axes[pos[0]][pos[1]].xaxis.set_major_formatter(time_formatter)
axes[pos[0]][pos[1]].set_ylabel("Mixing ratio (ppm)")
axes[pos[0]][pos[1]].set_ylim([0,ymax[0]])
axes[pos[0]][pos[1]].yaxis.set_major_formatter(major_formatter)
#axes[pos[0]][pos[1]].yaxis.set_major_formatter(major_formatter)
out_filename = 'out/camp_gases.pdf'
print("Writing %s" % out_filename)
fig.savefig(out_filename)
1 change: 1 addition & 0 deletions src/camp_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ subroutine pmc_camp_interface_solve(camp_core, camp_state, &

! Update the PartMC gas-phase state
call gas_state_get_camp_conc(gas_state, camp_state)
!call camp_core%print()

end subroutine pmc_camp_interface_solve

Expand Down
2 changes: 1 addition & 1 deletion test/camp/aero_init_comp.dat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# mass fractions
organic_matter.POA 1.0
one_layer.organic_matter.POA 1.0
11 changes: 10 additions & 1 deletion test/camp/aerosol_representation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
{
"name" : "PartMC single particle",
"type" : "AERO_REP_SINGLE_PARTICLE",
"maximum computational particles" : 1050
"maximum computational particles" : 1050,
"layers": [
{
"name": "one_layer",
"phases": [
"organic_matter"
],
"covers": "none"
}
]
}
]
}