-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from NCAR/update_version
v0.5.0 Release
- Loading branch information
Showing
17 changed files
with
248 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
FROM ubuntu:22.04 | ||
|
||
RUN apt update \ | ||
&& apt -y install \ | ||
cmake \ | ||
cmake-curses-gui \ | ||
curl \ | ||
libcurl4-openssl-dev \ | ||
libhdf5-dev \ | ||
m4 \ | ||
nlohmann-json3-dev \ | ||
vim \ | ||
zlib1g-dev \ | ||
git \ | ||
lcov \ | ||
make \ | ||
libnetcdff-dev \ | ||
valgrind \ | ||
gcc \ | ||
gfortran \ | ||
g++ \ | ||
&& apt clean | ||
|
||
# Set environment variables to install MUSICA using gcc | ||
ENV FC=gfortran | ||
ENV FFLAGS="-I/usr/include/" | ||
|
||
# Install json-fortran for gnu version | ||
RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.2.0.tar.gz \ | ||
&& tar -zxvf 8.2.0.tar.gz \ | ||
&& cd json-fortran-8.2.0 \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& cmake -D SKIP_DOC_GEN:BOOL=TRUE .. \ | ||
&& make install | ||
|
||
# Copy the musica code | ||
COPY . musica | ||
|
||
# Set json-fortran variable to install MUSICA using gcc | ||
ENV JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-8.2.0" | ||
|
||
# Build and install MUSICA | ||
RUN cd musica \ | ||
&& cmake -S . \ | ||
-B build \ | ||
-D ENABLE_TESTS=ON \ | ||
-D ENABLE_TUVX=OFF \ | ||
&& cd build \ | ||
&& make install -j 8 | ||
|
||
RUN cd musica/musica-fortran/test \ | ||
&& mkdir build && cd build \ | ||
&& cmake .. \ | ||
&& make | ||
|
||
RUN cd musica/musica-fortran/test \ | ||
&& cp -r configs/chapman ./build/chapman | ||
|
||
WORKDIR musica/musica-fortran/test/build |
Submodule tuv-x
updated
39 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module musica_micm | ||
module micm_mod | ||
use iso_c_binding | ||
implicit none | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"camp-files": [ | ||
"species.json", | ||
"reactions.json" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{ | ||
"camp-data": [ | ||
{ | ||
"name": "Chapman", | ||
"type": "MECHANISM", | ||
"reactions": [ | ||
{ | ||
"type": "PHOTOLYSIS", | ||
"reactants": { | ||
"O2": {} | ||
}, | ||
"products": { | ||
"O": { | ||
"yield": 2.0 | ||
} | ||
}, | ||
"MUSICA name": "R1" | ||
}, | ||
{ | ||
"type": "ARRHENIUS", | ||
"A": 8.018e-17, | ||
"reactants": { | ||
"O": {}, | ||
"O2": {} | ||
}, | ||
"products": { | ||
"O3": {} | ||
}, | ||
"MUSICA name": "R2" | ||
}, | ||
{ | ||
"type": "PHOTOLYSIS", | ||
"reactants": { | ||
"O3": {} | ||
}, | ||
"products": { | ||
"O": {}, | ||
"O2": {} | ||
}, | ||
"MUSICA name": "R3" | ||
}, | ||
{ | ||
"type": "ARRHENIUS", | ||
"A": 1.576e-15, | ||
"reactants": { | ||
"O": {}, | ||
"O3": {} | ||
}, | ||
"products": { | ||
"O2": { | ||
"yield": 2.0 | ||
} | ||
}, | ||
"MUSICA name": "R4" | ||
}, | ||
{ | ||
"type": "PHOTOLYSIS", | ||
"reactants": { | ||
"O3": {} | ||
}, | ||
"products": { | ||
"O1D": {}, | ||
"O2": {} | ||
}, | ||
"MUSICA name": "R5" | ||
}, | ||
{ | ||
"type": "ARRHENIUS", | ||
"A": 7.11e-11, | ||
"reactants": { | ||
"O1D": {}, | ||
"M": {} | ||
}, | ||
"products": { | ||
"O": {}, | ||
"M": {} | ||
}, | ||
"MUSICA name": "R6" | ||
}, | ||
{ | ||
"type": "ARRHENIUS", | ||
"A": 1.2e-10, | ||
"reactants": { | ||
"O1D": {}, | ||
"O3": {} | ||
}, | ||
"products": { | ||
"O2": { | ||
"yield": 2.0 | ||
} | ||
}, | ||
"MUSICA name": "R7" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"camp-data": [ | ||
{ | ||
"name": "M", | ||
"type": "CHEM_SPEC", | ||
"tracer type": "CONSTANT" | ||
}, | ||
{ | ||
"name": "O2", | ||
"type": "CHEM_SPEC", | ||
"tracer type": "CONSTANT" | ||
}, | ||
{ | ||
"name": "O", | ||
"type": "CHEM_SPEC", | ||
"absolute tolerance": 1e-12 | ||
}, | ||
{ | ||
"name": "O1D", | ||
"type": "CHEM_SPEC", | ||
"absolute tolerance": 1e-12 | ||
}, | ||
{ | ||
"name": "O3", | ||
"type": "CHEM_SPEC", | ||
"absolute tolerance": 1e-12 | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,42 @@ | ||
program test | ||
use iso_c_binding | ||
use musica_micm | ||
use micm_mod | ||
implicit none | ||
type(micm_t) :: m | ||
|
||
real(c_double) :: temperature | ||
real(c_double) :: pressure | ||
real(c_double) :: time_step | ||
real(c_double), dimension(10) :: concentrations | ||
real(c_double), dimension(5) :: concentrations | ||
integer(c_size_t) :: num_concentrations | ||
integer :: errcode | ||
|
||
temperature = 10d0 | ||
pressure = 20d0 | ||
time_step = 1d0 | ||
concentrations = (/ 1d0, 2d0, 3d0, 4d0, 5d0, 6d0, 7d0, 8d0, 9d0, 10d0 /) | ||
num_concentrations = 10 | ||
concentrations = (/ 0.75, 0.4, 0.8, 0.01, 0.02 /) | ||
num_concentrations = 5 | ||
|
||
write(*,*) " * [Fortran] Creating MICM" | ||
m = micm_t("micm_config") | ||
m = micm_t("chapman") | ||
|
||
write(*,*) " * [Fortran] Creating solver" | ||
write(*,*) " * [Fortran] Solver creating status indicates ", m%create_solver(), " (1 is success, else failure) " | ||
|
||
write(*,*) " * [Fortran] Initial temp", temperature | ||
write(*,*) " * [Fortran] Initial pressure", pressure | ||
write(*,*) " * [Fortran] Initial time_step", time_step | ||
write(*,*) " * [Fortran] Initial concentrations", concentrations | ||
write(*,*) " * [Fortran] Initial number of concentrations", num_concentrations | ||
|
||
write(*,*) " * [Fortran] Starting to solve" | ||
call m%solve(temperature, pressure, time_step, concentrations, num_concentrations) | ||
write(*,*) " * [Fortran] After solving, concentrations", concentrations | ||
|
||
write(*,*) " * [Fortran] Calling destructor for MICM" | ||
call m%delete | ||
errcode = m%create_solver() | ||
|
||
if (errcode == 1) then | ||
write(*,*) " * [Fortran] Failed in creating solver" | ||
stop 3 | ||
else | ||
write(*,*) " * [Fortran] Initial temp", temperature | ||
write(*,*) " * [Fortran] Initial pressure", pressure | ||
write(*,*) " * [Fortran] Initial time_step", time_step | ||
write(*,*) " * [Fortran] Initial number of concentrations", num_concentrations | ||
write(*,*) " * [Fortran] Initial concentrations", concentrations | ||
|
||
write(*,*) " * [Fortran] Solving starts..." | ||
call m%solve(temperature, pressure, time_step, concentrations, num_concentrations) | ||
|
||
write(*,*) " * [Fortran] After solving, concentrations", concentrations | ||
endif | ||
|
||
end program |
Oops, something went wrong.