Skip to content

Commit

Permalink
fixed the musica fortran path
Browse files Browse the repository at this point in the history
  • Loading branch information
boulderdaze committed Jan 30, 2024
1 parent d503eba commit f61ad0d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Externals_CAM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local_path = ccpp_framework
protocol = git
repo_url = https://github.com/peverwhee/ccpp-framework
tag = CPF_0.2.050
tag = CPF_0.2.051
required = True

[ncar-physics]
Expand All @@ -11,7 +11,7 @@ protocol = git
repo_url = https://github.com/ESCOMP/atmospheric_physics
# tag = atmos_phys0_01_000
# TODO(jiwon)
branch = update_micm_interface
branch = 73-unit-conversion
required = True

[externals_description]
Expand Down
2 changes: 1 addition & 1 deletion cime_config/buildlib
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _build_cam():
os.path.join(atm_root, "src", "dynamics", "utils"),
os.path.join(atm_root, "src", "physics", "utils"),
os.path.join(atm_root, "src", "utils"),
os.path.join("/usr/local/musica-0.4.0/fortran_include/")]
os.path.join(os.environ.get("MUSICA_FORTRAN_INCLUDE"))]
for path in phys_dirs:
if path not in paths:
paths.append(path)
Expand Down
33 changes: 16 additions & 17 deletions docker/Dockerfile.musica
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN dnf -y update \
&& dnf clean all

##################################################
# Set symlink to the specific python version
# Set a symlink to the specific python version
# that supports a deprecated pacakge for cime (distuitls)
##################################################
RUN ln -fs /usr/bin/python3.11 /usr/bin/python3
Expand Down Expand Up @@ -56,26 +56,25 @@ RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.2.0.tar.gz

# add a symlink
RUN ln -s /usr/local/jsonfortran-gnu-8.2.0/lib/libjsonfortran.a /usr/local/lib/libjsonfortran.a
ENV JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-8.2.0"

###################################################
## Build and install MUSICA
###################################################

# TODO(jiwon): update after musica & atmospheric_phys PRs are approved
# RUN git clone https://github.com/NCAR/musica.git
RUN git clone -b update_for_ccpp_wrapper --depth 1 https://github.com/NCAR/musica.git
RUN mkdir /musica/build \
&& cd /musica/build \
&& export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-8.2.0" \
##################################################
# Build and install MUSICA
##################################################
RUN git clone --depth 1 --branch v.0.5.0 https://github.com/NCAR/musica.git
RUN cd musica \
&& cmake \
-D MAKE_MUSICA_FORTRAN_INSTALLABLE=ON \
-D ENABLE_TESTS=OFF \
-D ENABLE_TUVX=OFF \
.. \
-S . \
-B build \
-D MAKE_MUSICA_FORTRAN_INSTALLABLE=ON \
-D ENABLE_TESTS=OFF \
-D ENABLE_TUVX=OFF \
&& cd build \
&& make install -j 8

# add a symlink
RUN ln -s /usr/local/musica-0.4.0/lib64/libmusica.a /usr/local/lib/libmusica.a
# add a symlinks
RUN ln -s /usr/local/musica-0.5.0/lib64/libmusica.a /usr/local/lib/libmusica.a
ENV MUSICA_FORTRAN_INCLUDE=/usr/local/musica-0.5.0/fortran-include

###################################################
## Build CAM-SIMA
Expand Down

0 comments on commit f61ad0d

Please sign in to comment.