Skip to content

Commit

Permalink
case.build works; wait for the other PRs approved
Browse files Browse the repository at this point in the history
  • Loading branch information
boulderdaze committed Dec 16, 2023
1 parent ea25903 commit dfa6eaa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
3 changes: 2 additions & 1 deletion Externals_CAM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ required = True
local_path = src/physics/ncar_ccpp
protocol = git
repo_url = https://github.com/ESCOMP/atmospheric_physics
tag = atmos_phys0_01_000
# tag = atmos_phys0_01_000
branch = update_micm_interface # TODO(jiwon)
required = True

[externals_description]
Expand Down
3 changes: 2 additions & 1 deletion cime_config/buildlib
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def _build_cam():
case.get_value("COMP_INTERFACE")),
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(atm_root, "src", "utils"),
os.path.join("/usr/local/musica-0.4.0/fortran_include/")]
for path in phys_dirs:
if path not in paths:
paths.append(path)
Expand Down
33 changes: 22 additions & 11 deletions docker/Dockerfile.musica
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# parts of CAM require x86 architecture (gptl, which relies on the rdtsc x86 assembly instruction)
# esmf is am image you are expected to have built. Read the README file for instructions
# TODO(jiwon): Update readme and remove system architecture
# FROM esmf:latest
FROM --platform=linux/amd64 esmf:latest

###################################################
Expand All @@ -11,13 +13,20 @@ RUN dnf -y update \
git \
hostname \
m4 \
python \
python3.11 \
sudo \
svn \
tree \
vim \
json-devel \
&& dnf clean all

##################################################
# Set symlink to the specific python version
# that supports a deprecated pacakge for cime (distuitls)
##################################################
RUN ln -fs /usr/bin/python3.11 /usr/bin/python3

###################################################
## Make sure the mpi compilers can be found
###################################################
Expand Down Expand Up @@ -54,22 +63,24 @@ RUN ln -s /usr/local/jsonfortran-gnu-8.2.0/lib/libjsonfortran.a /usr/local/lib/l
## Build and install MUSICA
###################################################

RUN git clone https://github.com/NCAR/musica.git
# 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" \
&& cmake \
-D ENABLE_TESTS=OFF \
-D ENABLE_TUVX=OFF \
.. \
-D MAKE_MUSICA_FORTRAN_INSTALLABLE=ON \
-D ENABLE_TESTS=OFF \
-D ENABLE_TUVX=OFF \
.. \
&& make install -j 8

# add a symlink
RUN ln -s /usr/local/musica-0.3.0/lib64/libmusica.a /usr/local/lib/libmusica.a
RUN ln -s /usr/local/musica-0.4.0/lib64/libmusica.a /usr/local/lib/libmusica.a

###################################################
## Build CAM-SIMA
###################################################
##################################################
# Build CAM-SIMA
##################################################

# create a user to run the case
RUN adduser cam_sima_user \
Expand Down Expand Up @@ -116,4 +127,4 @@ RUN /home/cam_sima_user/CAM-SIMA/docker/ftp_download.sh
# # add the snapshot file
RUN echo "ncdata='/home/cam_sima_user/run_heldsuarez_cam6_nt2_bigg_try005.cam.h5.0001-01-01-00000.nc'" >> user_nl_cam

RUN ./case.build
RUN ./case.build

0 comments on commit dfa6eaa

Please sign in to comment.