Skip to content

Commit

Permalink
Updates container to use CESM submodules and removes mct option from …
Browse files Browse the repository at this point in the history
…config
  • Loading branch information
jasonb5 committed Jul 2, 2024
1 parent 9b2ff92 commit 9cadb86
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CIME/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def __init__(self):
)
self._set_attribute(
"driver_choices",
("mct", "nuopc"),
("nuopc"),
desc="Sets the available driver choices for the model.",
)
self._set_attribute(
Expand Down
21 changes: 5 additions & 16 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ FROM condaforge/mambaforge:${MAMBAFORGE_VERSION} AS base
SHELL ["/bin/bash", "-c"]

# First layer as they never change, required for E3SM testing, TODO: fix in unittesting as well
RUN mkdir -p /storage/inputdata/cpl/gridmaps/oQU240 /storage/inputdata/share/domains && \
RUN mkdir -p \
/storage/inputdata/cpl/gridmaps/oQU240 \
/storage/inputdata/share/domains \
/storage/timings && \
wget -O /storage/inputdata/cpl/gridmaps/oQU240/map_oQU240_to_ne4np4_aave.160614.nc https://portal.nersc.gov/project/e3sm/inputdata/cpl/gridmaps/oQU240/map_oQU240_to_ne4np4_aave.160614.nc && \
wget -O /storage/inputdata/share/domains/domain.ocn.ne4np4_oQU240.160614.nc https://portal.nersc.gov/project/e3sm/inputdata/share/domains/domain.ocn.ne4np4_oQU240.160614.nc && \
wget -O /storage/inputdata/share/domains/domain.lnd.ne4np4_oQU240.160614.nc https://portal.nersc.gov/project/e3sm/inputdata/share/domains/domain.lnd.ne4np4_oQU240.160614.nc
Expand Down Expand Up @@ -77,20 +80,6 @@ RUN curl -L -k -o "${PWD}/pnetcdf.tar.gz" \
make install && \
rm -rf "${PWD}/pnetcdf"

# CESM dependencies
ENV CCS_CONFIG_TAG=ccs_config_cesm0.0.109
ENV CMEPS_TAG=cmeps0.14.73
ENV CDEPS_TAG=cdeps1.0.41
ENV SHARE_TAG=share1.1.2
ENV PARALLELIO_TAG=pio2_6_2

RUN git clone -b ${CCS_CONFIG_TAG} https://github.com/ESMCI/ccs_config_cesm /src/ccs_config && \
git clone -b ${CMEPS_TAG} https://github.com/ESCOMP/CMEPS.git /src/components/cmeps && \
git clone -b ${CDEPS_TAG} https://github.com/ESCOMP/CDEPS.git /src/components/cdeps && \
git clone -b ${SHARE_TAG} https://github.com/ESCOMP/CESM_share /src/share && \
git clone -b ${PARALLELIO_TAG} https://github.com/NCAR/ParallelIO /src/libraries/parallelio && \
mkdir -p /storage/timings

ARG CIME_BRANCH=master
ARG CIME_REPO=https://github.com/esmci/cime

Expand All @@ -99,7 +88,7 @@ RUN git clone -b ${CIME_BRANCH} ${CIME_REPO} /src/cime

# General variables
ENV USER=root
ENV LOGNAME=container
ENV LOGNAME=root
ENV ESMFMKFILE=/opt/conda/lib/esmf.mk

WORKDIR /src/cime
Expand Down
25 changes: 14 additions & 11 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ then

pushd "${SRC_PATH}/E3SM"

git config --global --add safe.directory "${PWD}"
git config --global --add safe.directory "*"

# fix E3SM gitmodules
fix_gitmodules "${PWD}"
Expand All @@ -74,9 +74,6 @@ then
# fix CIME gitmodules
fix_gitmodules "${PWD}"

git config --global --add safe.directory "${PWD}"
git config --global --add safe.directory "${PWD}/CIME/non_py/cprnc"

# checkout submodules
git submodule update --init "${GIT_SUBMODULE_FLAGS}"

Expand All @@ -86,21 +83,27 @@ elif [[ "${CIME_MODEL}" == "cesm" ]]
then
echo "Setting up CESM"

# copy pre cloned repos to new source path
if [[ "${SRC_PATH}" != "/src/cime" ]]
then
cp -rf /src/ccs_config /src/components /src/libraries /src/share "${SRC_PATH}/../"
fi
[[ ! -e "${SRC_PATH}/CESM" ]] && git clone -b ${CESM_BRANCH:-master} ${GIT_FLAGS} ${E3SM_REPO:-https://github.com/ESCOMP/CESM} "${SRC_PATH}/CESM"

pushd "${SRC_PATH}/CESM"

git config --global --add safe.directory "${PWD}"
git config --global --add safe.directory "${PWD}/CIME/non_py/cprnc"
git config --global --add safe.directory "*"

# fix CIME gitmodules
fix_gitmodules "${PWD}"

git status

# update CIME submodules
git submodule update --init "${GIT_SUBMODULE_FLAGS}"

pushd cime

fix_gitmodules "${PWD}"

# checkout submodules
git submodule update --init "${GIT_SUBMODULE_FLAGS}"

# link v3 config_machines
ln -sf /root/.cime/config_machines.v3.xml /root/.cime/config_machines.xml
fi
Expand Down

0 comments on commit 9cadb86

Please sign in to comment.