geirev / EnKF_advection

EnKF with linear advection equation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EnKF_advection

EnKF implementation with advection equation as used in Evensen (2009). The code allows for testing various EnKF schemes with a linear advection equation on a periodic domain.

Installation:

1. Building the Project

If you plan to collaborate or contribute anything to the project, use the Advanced Installation option.

1a. Basic installation

Create a directory to clone the three following repositories:

git clone git@github.com:geirev/EnKF_advection.git
git clone git@github.com:geirev/EnKF_analysis.git
git clone git@github.com:geirev/EnKF_sampling.git

After cloning, the directory structure should look like:

.
├── EnKF_analysis
├── EnKF_sampling
└── EnKF_advection

1b. Advanced installation

Make a personal github account unless you already have one. Fork the three repositorys listed above. Next clone the repositories and set upstream to the original repositories where you need to replace with your github userid

git clone git@github.com:<userid>/EnKF_advection.git
pushd EnKF_advection
git remote add upstream https://github.com/geirev/EnKF_advection
#or, if you have set up git-ssh
#git remote add upstream git://github.com:geirev/EnKF_advection
popd

git clone git@github.com:<userid>/EnKF_analysis.git
pushd EnKF_analysis
git remote add upstream https://github.com/geirev/EnKF_analysis
#or, if you have set up git-ssh
#git remote add upstream git://github.com:geirev/EnKF_analysis
popd

git clone git@github.com:<userid>/EnKF_sampling.git
pushd EnKF_sampling
git remote add upstream https://github.com/geirev/EnKF_sampling
#or, if you have set up git-ssh
#git remote add upstream git://github.com:geirev/EnKF_sampling
popd

If you are new to Git, read the section Git instructions

2. Required Packages

Linux

sudo apt-get update
sudo apt-get install libblas-dev liblapack-dev libfftw3-dev gfortran

Mac

brew install gcc fftw openblas lapack

Note: You must have Homebrew installed to install packages using brew

3. Compile the EnKF_sampling library

Navigate to the lib folder of the EnKF_sampling repository:

cd EnKF_sampling/lib

then compile and place all the .o files as well as libanalysis.a into the build directory of the EnKR_advection repository using:

make BUILD=../../EnKF_advection/build

4. Compile the EnKF_analysis library

Navigate to the lib folder of the EnKF_analysis repository:

cd EnKF_analysis/lib

then compile and place all the .o files as well as libanalysis.a into the build directory of the EnKR_advection repository using:

make BUILD=../../EnKF_advection/build

Note: The EnKF_analysis repository depends on the EnKF_sampling repository and therefore must be compiled second!

5. Compile the EnKF_advection library

Linux

Navigate to the src folder of the EnKF_advection repository:

cd EnKF_advection/src

then compile and install the executable in the target directory, defaulting to $HOME/bin:

make BINDIR=$HOME/bin

Mac

Navigate to the src folder of the EnKF_advection repository:

cd EnKF_advection/src

then edit the following line in EnKF_advection/src/makefile from:

LIBS = ./libsampling.a ./libenkfanalysis.a -llapack -lblas -llapack /usr/lib/x86_64-linux-gnu/libfftw3.so.3

to:

LIBS = ./libsampling.a ./libenkfanalysis.a -llapack -lblas -llapack /usr/local/lib/libfftw3.a

then compile and install the executable in the target directory, defaulting to $HOME/bin:

make BINDIR=$HOME/bin

6. Run the Project

Linux

Navigate to the test directory of the EnKF_advection repository:

cd EnKF_advection/test

and run:

advect.lin

Mac

Create the /usr/local/bin directory which allows the advection2 command to be ran from anywhere on the local file system:

mkdir -p /usr/local/bin

then create a symlink for $HOME/bin/advect.lin to /usr/local/bin

ln -s $HOME/bin/advect.lin /usr/local/bin/

then run the project:

cd EnKF_advection/test
advect.lin

7. Plotting

If you have tecplot (tec360) there are .lay and .mcr files in the run directory.

About

EnKF with linear advection equation.

License:GNU General Public License v3.0


Languages

Language:Fortran 82.1%Language:Makefile 10.2%Language:Perl 2.7%Language:Shell 2.5%Language:MAXScript 2.5%Language:C++ 0.0%