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

[Draft] Update MUSICA CCPP wrapper to use new MUSICA/MICM functions #242

Closed
wants to merge 2 commits into from
Closed
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
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
35 changes: 23 additions & 12 deletions docker/Dockerfile.musica
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# 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
FROM esmf:latest
# TODO(jiwon): Update readme and remove system architecture
# FROM esmf:latest
FROM --platform=linux/amd64 esmf:latest

###################################################
## Install necessary packages
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