Skip to content
Snippets Groups Projects
Commit 13f61f98 authored by Arnd Plumhoff's avatar Arnd Plumhoff
Browse files

Minor changes

  - functionality to use example code
parent 991a7381
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
MITgcmP=$(pwd)/MITgcm-git
while getopts d:khai option
while getopts d:khaix option
do
case "${option}"
in
......@@ -11,11 +11,12 @@ do
h) HELP=1;;
a) ARCHITECTURE=${OPTARG};;
i) INSTALL=1;;
x) EXAMPLE=1;;
esac
done
if [ ! -z "$HELP" ] || [ -z "$DATADIR" ]; then
echo -e "\nOPTIONS:\n -d dir \tlocation of computing data (mandatory)\n -i\t\tinstall required packages\n -k\t\tkeep binary files\n -a\t\tarchitecture [amd64(default), ia32]\n -h\t\thelp "
echo -e "\nOPTIONS:\n -d dir \tlocation of data (mandatory)\n -i\t\tinstall required packages\n -k\t\tkeep binary files\n -a\t\tarchitecture [amd64(default), ia32]\n -x\t\tuse example data (WARNING: deletes the content of the data folder and replaces it with example code)\n -h\t\thelp "
exit 0
fi
......@@ -28,11 +29,18 @@ if [ -z "$ARCHITECTURE" ]; then
fi
if [ ! -z "$INSTALL" ]; then
sudo apt-get -y update
echo "Installing new packages..."
sudo apt-get -y update
sudo apt-get -y install build-essential git gfortran python python3
fi
git clone https://github.com/MITgcm/MITgcm.git $MITgcmP
git clone --depth=1 https://github.com/MITgcm/MITgcm.git $MITgcmP
if [ ! -z "$EXAMPLE" ]; then
rm -rf $DATADIR/*
cp -r $MITgcmP/verification/tutorial_barotropic_gyre/* $DATADIR
fi
cd $DATADIR/build
rm Makefile -rf
$MITgcmP/tools/genmake2 -mods ../code -of $MITgcmP/tools/build_options/linux_${ARCHITECTURE}_gfortran -rootdir $MITgcmP
......@@ -45,5 +53,5 @@ ln -s ../build/mitgcmuv .
./mitgcmuv > output.txt
if [ -z $KEEP ]; then
rm $MITgcmP -rf
rm $MITgcmP -rf
fi
FROM mitgcm/testreport-images:ubuntu_18_04_villon
RUN git clone https://github.com/MITgcm/MITgcm.git /MITgcm
RUN git clone --depth=1 https://github.com/MITgcm/MITgcm.git /MITgcm
COPY build.sh /MITgcm
......
#!/bin/sh
cd /data/build
rm Makefile
/MITgcm/tools/genmake2 -mods ../code -of /MITgcm/tools/build_options/linux_amd64_gfortran -rootdir /MITgcm
make depend
make
......
version: "2"
services:
mitgcm:
case-study-mitgcm:
build:
context: .
dockerfile: Dockerfile
container_name: mitgcm-runner
# environment:
# - MITGCM_EXP=tutorial_barotropic_gyre
# - MITGCM_PRECS="16 16"
container_name: case-study-mitgcm
volumes:
- ../data:/data
- /etc/timezone:/etc/timezone:ro
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment