Skip to content

Commit

Permalink
Add a Dockerfile that builds MOM6 and runs the double gyre model
Browse files Browse the repository at this point in the history
  • Loading branch information
ashao committed Aug 27, 2024
1 parent d234bce commit a139f2c
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Use the official Ubuntu 22.04 as the base image
FROM ubuntu:22.04

# Update the package list and install the required packages
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
gcc \
gfortran \
libopenmpi-dev \
netcdf-bin \
openmpi-bin \
linux-tools-common \
libnetcdf-dev \
libnetcdff-dev \
ca-certificates \
autoconf \
build-essential

# Clone and compile MOM6
RUN git clone https://github.com/NOAA-GFDL/MOM6-examples.git && \
cd MOM6-examples && \
git submodule update --init --recursive src/MOM6 && \
cd src/MOM6/ac/deps && make -j && \
cd .. && \
autoreconf && \
cd .. && \
mkdir -p build && \
cd build && \
../ac/configure && \
make -j

# Get the MOM6 cases and setup the double gyre example
RUN mkdir -p MOM6-examples/ocean_only/double_gyre/RESTART

WORKDIR /MOM6-examples/ocean_only/double_gyre
CMD [ "mpirun", "--allow-run-as-root", "-n", "4", "/MOM6-examples/src/MOM6/build/MOM6" ]




0 comments on commit a139f2c

Please sign in to comment.