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 @@ ...@@ -2,7 +2,7 @@
MITgcmP=$(pwd)/MITgcm-git MITgcmP=$(pwd)/MITgcm-git
while getopts d:khai option while getopts d:khaix option
do do
case "${option}" case "${option}"
in in
...@@ -11,11 +11,12 @@ do ...@@ -11,11 +11,12 @@ do
h) HELP=1;; h) HELP=1;;
a) ARCHITECTURE=${OPTARG};; a) ARCHITECTURE=${OPTARG};;
i) INSTALL=1;; i) INSTALL=1;;
x) EXAMPLE=1;;
esac esac
done done
if [ ! -z "$HELP" ] || [ -z "$DATADIR" ]; then 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 exit 0
fi fi
...@@ -28,11 +29,18 @@ if [ -z "$ARCHITECTURE" ]; then ...@@ -28,11 +29,18 @@ if [ -z "$ARCHITECTURE" ]; then
fi fi
if [ ! -z "$INSTALL" ]; then 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 sudo apt-get -y install build-essential git gfortran python python3
fi 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 cd $DATADIR/build
rm Makefile -rf rm Makefile -rf
$MITgcmP/tools/genmake2 -mods ../code -of $MITgcmP/tools/build_options/linux_${ARCHITECTURE}_gfortran -rootdir $MITgcmP $MITgcmP/tools/genmake2 -mods ../code -of $MITgcmP/tools/build_options/linux_${ARCHITECTURE}_gfortran -rootdir $MITgcmP
...@@ -45,5 +53,5 @@ ln -s ../build/mitgcmuv . ...@@ -45,5 +53,5 @@ ln -s ../build/mitgcmuv .
./mitgcmuv > output.txt ./mitgcmuv > output.txt
if [ -z $KEEP ]; then if [ -z $KEEP ]; then
rm $MITgcmP -rf rm $MITgcmP -rf
fi fi
FROM mitgcm/testreport-images:ubuntu_18_04_villon 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 COPY build.sh /MITgcm
......
#!/bin/sh #!/bin/sh
cd /data/build cd /data/build
rm Makefile
/MITgcm/tools/genmake2 -mods ../code -of /MITgcm/tools/build_options/linux_amd64_gfortran -rootdir /MITgcm /MITgcm/tools/genmake2 -mods ../code -of /MITgcm/tools/build_options/linux_amd64_gfortran -rootdir /MITgcm
make depend make depend
make make
......
version: "2" version: "2"
services: services:
mitgcm: case-study-mitgcm:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: mitgcm-runner container_name: case-study-mitgcm
# environment:
# - MITGCM_EXP=tutorial_barotropic_gyre
# - MITGCM_PRECS="16 16"
volumes: volumes:
- ../data:/data - ../data:/data
- /etc/timezone:/etc/timezone:ro - /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