Code Monkey home page Code Monkey logo

swm's Introduction

SWM is a simplified kernel representing the nonlinear PDE's governing geophysical fluid flow.
Please contact the Point of Contact below before distributing it further, or if any questions or issues arise.

Resolution:

Resolution may be changed by the following procedure.
In shallow_swap.c change these 

#define M 64
#define N 64

to the desired numbers. M and N can be changed independently.

COPY vs SWAP:

There is an optimization that avoids copies in loop 300 by swapping pointers. COPY can be turned on and off by defining _COPY_ or not, as desired.

Building:

bash-3.2$ gcc -O2 shallow_swap.c wtime.c
bash-3.2$ ./a.out > results.txt

Validation: 

Compare results.txt with the provided file results_ref.txt, particularly the last values printed, namely those below-
 diagonal elements of p
 diagonal elements of u
 diagonal elements of v

Performance: 

Performance reported in results_ref.txt is that obtained on a single core of a 2.6 GHz Intel Core i7 Macbook Pro with 2400 MHz DDR4 memory.

Point of Contact:

Dr. Richard Loft
National Center for Atmospheric Research
[email protected]

swm's People

Contributors

cenamiller avatar supreethms1809 avatar johnmauff avatar havogt avatar halehawk avatar sherimickelson avatar

Stargazers

Jeff Carpenter avatar  avatar

Watchers

Thomas Hauser avatar  avatar  avatar Jian Sun avatar  avatar  avatar Siddhartha Ghosh avatar  avatar Pranay Reddy Kommera avatar  avatar  avatar  avatar

swm's Issues

Python version of SWM code

@cenamiller I have created a new Python version of the SWM code.
Currently, Boundary conditions are disabled. I am getting an index out-of-bound error when I enable it.
Need a little debugging.

Possibly missing factor in z calculation

Looking at the paper, it seems there is a factor 1/4 missing in the z computation

z[idx11] = (fsdx * (v[idx11] - v[idx01]) - fsdy * (u[idx11] - u[idx10])) / (p[idx00] + p[idx10] + p[idx11] + p[idx01]);

 z[idx11] = (fsdx * (v[idx11] - v[idx01]) - fsdy * (u[idx11] - u[idx10])) / (0.25*(p[idx00] + p[idx10] + p[idx11] + p[idx01])); 

Conda env for SWM

Login to derecho

module load conda
conda create -n py38 python=3.8
conda activate py38
conda install numpy

gt4py example instructions

python3.8 -m venv venv
source venv/bin/activate
git clone [email protected]:ai2cm/shallow_water_demo.git && cd shallow_water_demo
pip install -e "./[plot]"

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.