Giter Club home page Giter Club logo

tsunami's Introduction

tsunami

A parallel tsunami simulator. Companion running example for Modern Fortran: Building Efficient Parallel Applications.

Organization

  • Chapter 2: We implement our first working solver which solves for linear advection of a wave in one dimension. First encounter with declaration, variables, loops, branches, arithmetic, and writing to console.
  • Chapter 3: We refactor our program from Chapter 2 to use procedures -- a finite difference function and a subroutine to set initial conditions.
  • Chapter 4: We refactor our program from Chapter 3 to define the procedures in external modules. We use this opportunity to augment the simulator to solve for non-linear gravity waves.
  • Chapter 7: We parallelize the program from Chapter 4 using coarrays and observe the speed up.
  • Chapter 8: We refactor our program from Chapter 7 to model our physical quantities (water height and velocity) using a derived type, and implement common arithmetic operations as type-bound methods.
  • Chapter 10: We continue working on the code from Chapter 9 and overload the assignment operator to automatically synchronize the data across parallel images on every assignment.
  • Chapter 12: In the final chapter, we revisit the parallel code from Chapter 10 and explore how Fortran 2018 Teams, Events, and Collectives can be used for some more advanced parallel patterns.

Getting started

Get the code

You can get the latest code by cloning the master branch:

git clone https://github.com/modern-fortran/tsunami

or by downloading it as a zip file.

Build the code

cd tsunami
make -k

You can compile the tsunami versions in chapters 2, 3, and 4 with gfortran alone. For the code in chapters 7, 8, 10, and 12, you'll need the latest stable build of OpenCoarrays, which will give you the caf compiler wrapper.

Set up the Python environment for visualization (optional)

Python scripts are provided to visualize tsunami output.

python3 -m venv venv
source venv/bin/activate
pip install -U pip
pip install -U -r requirements.txt

tsunami's People

Contributors

milancurcic avatar scivision avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.