Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #163 from havahol/paper_release_fdmvsfvm
Browse files Browse the repository at this point in the history
Paper release fdmvsfvm
  • Loading branch information
havahol authored Feb 8, 2019
2 parents 0ddc965 + f9de829 commit 8ff0f0c
Show file tree
Hide file tree
Showing 314 changed files with 10,217 additions and 69,472 deletions.
151 changes: 151 additions & 0 deletions Introduction.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```\n",
"This software is part of GPU Ocean. \n",
"\n",
"Copyright (C) 2018, 2019 SINTEF Digital\n",
"Copyright (C) 2018, 2019 Norwegian Meteorological Institute\n",
"\n",
"This notebook provides the description of the code found in this \n",
"software package, which is provided as supplementary material to\n",
"\"Evaluation of Selected Finite-Difference and Finite-Volume Approaches \n",
"to Rotational Shallow-Water Flow\" \n",
"by Holm, Brodtkorb, Broström, Christensen and Sætra.\n",
"\n",
"This program is free software: you can redistribute it and/or modify\n",
"it under the terms of the GNU General Public License as published by\n",
"the Free Software Foundation, either version 3 of the License, or\n",
"(at your option) any later version.\n",
"\n",
"This program is distributed in the hope that it will be useful,\n",
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n",
"GNU General Public License for more details.\n",
"\n",
"You should have received a copy of the GNU General Public License\n",
"along with this program. If not, see <http://www.gnu.org/licenses/>.\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Evaluation of Selected Finite-Difference and Finite-Volume Approaches to Rotational Shallow-Water Flow - Software Supplement "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This software package is provideded as a supplement to the paper *Evaluation of Selected Finite-Difference and Finite-Volume Approaches to Rotational Shallow-Water Flow* written by Håvard H. Holm, André R. Brodtkorb, Göran Broström, Kai. H. Christensen, and Martin L. Sætra"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Purpose\n",
"The main purpose of this software is to provide code that set up, run, and evaluate four numerical schemes on the test cases presented in the paper, and reproduce the results. \n",
"\n",
"The code is written in Python, whereas the numerical schemes are implemented in CUDA and accessed through the PyCUDA library.\n",
"\n",
"Each test case is represented by a Jupyter Notebook. In some cases, two notebooks are provided for a single case, so that one notebook sets up the case and runs the simulations, wheareas the other do the post-processing and plotting. This way, the plots can be adjusted at any time without the need of rerunning the simulations, which may be time consuming depending on your available hardware."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Organization of the code\n",
"The code is organized as follows:\n",
"- `notebooks/` contains notebooks representing the test cases for rotational shallow-water schemes\n",
"- `SWESimulators/` contains python modules for each scheme and a selection of utility classes and functions.\n",
"- `SWESimulators/gpu_kernels/` contains the CUDA implementations of the numerical schemes\n",
"- `notebooks/matlab/` contains octave-compatible code to generate reference solutions to the rossby adjustment problem. \n",
"- `tests/` contains regression tests for the numerical schemes\n",
"\n",
"Small result files produced for the paper can also be found under the `notebooks/`-folder, and the subfolders not mentioned above."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Installation \n",
"In order to run this code, you need to have access to a CUDA enabled GPU, with CUDA toolkit and appropriate drivers installed. If you are on Windows, you also need to have installed Visual Studios and add the path to its bin folder in PATH. This is so that pycuda can find a C++ compiler.\n",
"\n",
"We recommend that you set up your python environment using Conda as follows:\n",
"- Install [miniconda](https://conda.io/miniconda.html) (which is a minimal subset of Anaconda)\n",
"- Install jupyter notebook (unless you already have it installed on your system) by opening a terminal (or Anaconda prompt if on Windows) and type\n",
" ```\n",
" conda install -c conda-forge jupyter\n",
" ```\n",
"- Install the conda extensions that allows jupyter notebook to select conda environments as kernels:\n",
" ```\n",
" conda install -c conda-forge nb_conda_kernels\n",
" ```\n",
"- Create a new conda environment according to the environment file in this repository\n",
" ```\n",
" conda env create -f conda_environment.yml\n",
" ```\n",
"\n",
"You should now be able to start a jupyter notebook server, open one of our notebooks, select the conda environment 'gpuocean' as kernel, and run the code. \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# The test cases\n",
"The notebooks are named with a CaseX-prefix to make it easy to find the relevant cases. \n",
"- **Case A: Traditional Non-rotating Shallow-Water Benchmarks** This is really two test cases. First there is the lake-at-rest benchmark, before SWASHES benchmark 4.1.1. Each of them is presented in their own notebook.\n",
" - `testCasesDemos/CaseA_LakeAtRest.ipynb`\n",
" - `testCasesDemos/CaseA_SwashesDambreak.ipynb`\n",
"- **Case B: Rossby Adjustment**. One notebook sets up the test and runs the simulations, whereas the other notebook plots results based on the generated results, or existing simulation results available for download. The reference solution can be obtained from one of the octave-files.\n",
" - `testCasesDemos/CaseB_RossbyAdjustment.ipynb`\n",
" - `testCasesDemos/CaseB_RossbyAdjustment_Plotting.ipynb`\n",
" - `testCasesDemos/matlab/python_like_steady_state.m`\n",
"- **Case C: The Adjustment Problem for Variable Rossby Radius of Deformation** One notebook sets up the test and run simulations, whereas the other read results and produces plots. Reference solution obtained from octave scripts.\n",
" - `testCasesDemos/CaseC_VariableRossbyRadius.ipynb`\n",
" - `testCasesDemos/CaseC_VariableRossbyRadius_Plotting.ipynb`\n",
" - `testCasesDemos/matlab/variable_depth_steady_state.m`\n",
"- **Case D: Kelvin Waves** One notebook that sets up the test cases, runs the simulations and plots the results.\n",
" - `testCasesDemos/CaseD_Kelvin.ipynb`\n",
"- **Case E: Planetary Rossby Waves** One notebook sets up use cases and runs simulations, the other reads and visualize results.\n",
" - `testCasesDemos/CaseE_PlanetaryRossbyWaves.ipynb`\n",
" - `testCasesDemos/CaseE_F_RossbyWaves_Plotter.ipynb`\n",
"- **Case F: Topographic Rossby Waves** One notebook sets up use cases and runs simulations, the other reads and visualize results.\n",
" - `testCasesDemos/CaseF_TopographicRossbyWaves.ipynb`\n",
" - `testCasesDemos/CaseE_F_RossbyWaves_Plotter.ipynb`\n",
"- **Numerical order:** One notebook present the experimental setup to investigate convergence rates for the four numerical schemes.\n",
" - `testCasesDemos/NumericalOrder.ipynb`"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
33 changes: 0 additions & 33 deletions README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-

"""
This python class implements a Ensemble of particles, each consisting of a single drifter in its own ocean state. The perturbation parameter is the wind direction.
This software is a part of GPU Ocean.
Copyright (C) 2018 SINTEF Digital
Copyright (C) 2018 SINTEF ICT
This python class implements a Ensemble of particles, each consisting of a single drifter in its own ocean state. The perturbation parameter is the wind direction.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# -*- coding: utf-8 -*-

"""
This notebook sets up and runs a set of benchmarks to compare
different numerical discretizations of the SWEs
This software is part of GPU Ocean.
Copyright (C) 2017 SINTEF ICT
Copyright (C) 2016 SINTEF ICT,
Copyright (C) 2017-2019 SINTEF Digital
Copyright (C) 2017-2019 Norwegian Meteorological Institute
This python module implements a series of functions for generating
bathymetry and initial conditions for the shallow water equations.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
10 changes: 7 additions & 3 deletions gpu_ocean/SWESimulators/CDKLM16.py → SWESimulators/CDKLM16.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# -*- coding: utf-8 -*-

"""
This python module implements
This software is part of GPU Ocean.
Copyright (C) 2016 SINTEF ICT,
Copyright (C) 2017-2019 SINTEF Digital
Copyright (C) 2017-2019 Norwegian Meteorological Institute
This python module implements the finite-volume scheme proposed by
Alina Chertock, Michael Dudzinski, A. Kurganov & Maria Lukacova-Medvidova (2016)
Well-Balanced Schemes for the Shallow Water Equations with Coriolis Forces
Copyright (C) 2016 SINTEF ICT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down
7 changes: 6 additions & 1 deletion gpu_ocean/SWESimulators/CTCS.py → SWESimulators/CTCS.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# -*- coding: utf-8 -*-

"""
This software is part of GPU Ocean.
Copyright (C) 2016 SINTEF ICT,
Copyright (C) 2017-2019 SINTEF Digital
Copyright (C) 2017-2019 Norwegian Meteorological Institute
This python module implements the Centered in Time, Centered in Space
(leapfrog) numerical scheme for the shallow water equations,
described in
L. P. Røed, "Documentation of simple ocean models for use in ensemble
predictions", Met no report 2012/3 and 2012/5 .
Copyright (C) 2016 SINTEF ICT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
9 changes: 6 additions & 3 deletions gpu_ocean/SWESimulators/Common.py → SWESimulators/Common.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# -*- coding: utf-8 -*-

"""
This python module implements the different helper functions and
classes
This software is part of GPU Ocean.
Copyright (C) 2017-2019 SINTEF Digital
Copyright (C) 2017-2019 Norwegian Meteorological Institute
Copyright (C) 2018 SINTEF ICT
This python module implements the different helper functions and
classes that are shared through out all elements of the code.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
10 changes: 7 additions & 3 deletions gpu_ocean/SWESimulators/FBL.py → SWESimulators/FBL.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# -*- coding: utf-8 -*-

"""
This software is part of GPU Ocean.
Copyright (C) 2016 SINTEF ICT,
Copyright (C) 2017-2019 SINTEF Digital
Copyright (C) 2017-2019 Norwegian Meteorological Institute
This python module implements the Forward Backward Linear numerical
scheme for the shallow water equations, described in
L. P. Røed, "Documentation of simple ocean models for use in ensemble
predictions", Met no report 2012/3 and 2012/5 .
Copyright (C) 2016 SINTEF ICT
predictions", Met no report 2012/3 and 2012/5.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# -*- coding: utf-8 -*-

"""
This python module implements helpers for IPython / Jupyter and CUDA
This software is part of GPU Ocean.
Copyright (C) 2018, 2019 SINTEF Digital
Copyright (C) 2018 SINTEF ICT
This python module implements helpers for IPython / Jupyter and CUDA
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
8 changes: 6 additions & 2 deletions gpu_ocean/SWESimulators/KP07.py → SWESimulators/KP07.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# -*- coding: utf-8 -*-

"""
This software is part of GPU Ocean.
Copyright (C) 2016 SINTEF ICT,
Copyright (C) 2017-2019 SINTEF Digital
Copyright (C) 2017-2019 Norwegian Meteorological Institute
This python module implements the Kurganov-Petrova numerical scheme
for the shallow water equations, described in
A. Kurganov & Guergana Petrova
A Second-Order Well-Balanced Positivity Preserving Central-Upwind
Scheme for the Saint-Venant System Communications in Mathematical
Sciences, 5 (2007), 133-160.
Copyright (C) 2016 SINTEF ICT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-

"""
This software is part of GPU Ocean.
Copyright (C) 2018 SINTEF Digital
This python class implements an ensemble of particles, each consisting
of a single drifter in its own ocean state. Each ocean model is
perturbed during each timestep, using small scale perturbations.
Copyright (C) 2018 SINTEF ICT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# -*- coding: utf-8 -*-

"""
This software is part of GPU Ocean.
Copyright (C) 2018, 2019 SINTEF Digital
Copyright (C) 2018, 2019 Norwegian Meteorological Institute
This python class produces random perturbations that are to be added to
the ocean state fields in order to generate model error.
Copyright (C) 2018 SINTEF ICT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# -*- coding: utf-8 -*-

"""
This software is part of GPU Ocean.
Copyright (C) 2016 SINTEF ICT,
Copyright (C) 2017-2019 SINTEF Digital
Copyright (C) 2017-2019 Norwegian Meteorological Institute
This python class aids in plotting results from the numerical
simulations
Copyright (C) 2016 SINTEF ICT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand Down
Loading

0 comments on commit 8ff0f0c

Please sign in to comment.