-
Notifications
You must be signed in to change notification settings - Fork 0
/
actris-container.def
89 lines (79 loc) · 4.5 KB
/
actris-container.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
BootStrap: docker
From: ubuntu:20.04
%files
./flexpart_makefile /usr/local/makefile
./common /usr/local/footprints/
./xarray_extras /usr/local/footprints/
./fpout /usr/local/footprints/
%environment
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
export PATH=/opt/mamba/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/eccodes/lib:$LD_LIBRARY_PATH
. /etc/bash.bashrc
%post
apt-get update -y && apt-get upgrade -y && apt-get install -y software-properties-common && DEBIAN_FRONTEND="noninteractive" TZ="Europe" apt-get install -y tzdata
apt-get -q -y install build-essential git cmake software-properties-common wget g++ gfortran autoconf libtool automake flex bison curl \
libbz2-dev libssl-dev libreadline-dev libsqlite3-dev tk-dev ruby libnetcdf-dev libnetcdff-dev libeccodes-dev nano wget python3.9 python3.9-venv && \
apt-get -q clean && \
rm -rf /var/lib/apt/lists/*
ulimit -s unlimited
alias ll='ls --color=auto -alF' >> /etc/bash.bashrc
##################################################
# Base environment for FLEXPART #
##################################################
python3.9 -m venv /usr/local/py_envs/actris_env
/usr/local/py_envs/actris_env/bin/pip install --upgrade pip setuptools wheel
/usr/local/py_envs/actris_env/bin/pip install numpy scipy h5py netCDF4 matplotlib cartopy pandas xarray shapely pyshp pyproj --no-cache-dir
##################################################
# Install eccodes #
##################################################
mkdir -p /usr/local
cd /usr/local
wget https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.32.1-Source.tar.gz?api=v2
tar -xzf "eccodes-2.32.1-Source.tar.gz?api=v2"
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/eccodes -DBUILD_SHARED_LIBS=BOTH ../eccodes-2.32.1-Source
make
ctest
make install
rm "/usr/local/eccodes-2.32.1-Source.tar.gz?api=v2"
rm -r /usr/local/eccodes-2.32.1-Source
/usr/local/py_envs/actris_env/bin/pip install eccodes
/usr/local/py_envs/actris_env/bin/python -m eccodes selfcheck
##################################################
# Install FLEXPART #
##################################################
cd /usr/local
wget https://www.flexpart.eu/downloads/66
tar xvf 66
cd /usr/local/flexpart_v10.4_3d7eebf/src
sed -i "s/if(isec1(6).eq.129) then/if((isec1(6).eq.129).and.(k.eq.0)) then/" gridcheck_ecmwf.f90
sed -i "s/if(isec1(6).eq.129) then/if((isec1(6).eq.129).and.(k.eq.0)) then/" gridcheck_nests.f90
sed -i "s/if(isec1(6).eq.129) oro(i,j)= \&\!\! ECMWF OROGRAPHY/if((isec1(6).eq.129).and.(k.eq.0)) oro(i,j)= \&\!\! ECMWF OROGRAPHY/" readwind_ecmwf.f90
sed -i "s/if(isec1(6).eq.129) oro(i,j)= \&\!\! ECMWF OROGRAPHY/if((isec1(6).eq.129).and.(k.eq.0)) oro(i,j)= \&\!\! ECMWF OROGRAPHY/" readwind_ecmwf_mpi.f90
sed -i "s/if(isec1(6).eq.129) oro(i,j)= \&\!\! ECMWF OROGRAPHY/if((isec1(6).eq.129).and.(k.eq.0)) oro(i,j)= \&\!\! ECMWF OROGRAPHY/" readwind_emos.f90
sed -i "s/if(isec1(6).eq.129) oron(i,j,l)= \&\!\! ECMWF OROGRAPHY/if((isec1(6).eq.129).and.(k.eq.0)) oron(i,j,l)= \&\!\! ECMWF OROGRAPHY/" readwind_nests.f90
cp /usr/local/makefile ./
make ncf=yes
##################################################
# Environment for footprints image creation #
##################################################
python3.9 -m venv /usr/local/py_envs/footprints_env
/usr/local/py_envs/footprints_env/bin/pip install xarray pandas numpy zarr netCDF4 h5py scipy h5netcdf dask
/usr/local/py_envs/footprints_env/bin/python -m pip install -e /usr/local/footprints/common/
/usr/local/py_envs/footprints_env/bin/python -m pip install -e /usr/local/footprints/xarray_extras/
/usr/local/py_envs/footprints_env/bin/python -m pip install -e /usr/local/footprints/fpout/
##################################################
# Install soft-io #
##################################################
python3.9 -m venv /usr/local/py_envs/softio_env
/usr/local/py_envs/softio_env/bin/pip install pandas xarray numpy tqdm scipy hvplot dask toolz holoviews geoviews cartopy netCDF4 h5py
cd /usr/local
git clone https://github.com/iagos-dc/soft-io.git
cd /usr/local/soft-io
/usr/local/py_envs/softio_env/bin/pip install -e .
#%runscript
# eval "$(micromamba shell hook --shell bash)"
# micromamba activate