Skip to content

bderembl/qgw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Finite differences QG model that rely on FFTW for the elliptic solver.

Dependencies:

For single core execution, compile with

gcc -O3 -Wall qg.c -o qg.e -lm -lfftw3 -llapacke -lnetcdf

For parallel execution, compile with

mpicc -D_MPI -O3 qg.c -o qg.e -lfftw3_mpi -lfftw3 -lm -llapacke -lnetcdf

There are several test cases in test/

you can run the model with

./qg.e params.in

or

mpirun -np 4 ./qg.e params.in

The number of processor is arbitrary.

QG equations

$$\frac{∂ q}{∂ t} = -J(ψ,q) - β v + ν Δ q$$

For a single layer configuration, we have

$$q = Δ ψ$$

and for multi layer

$$q = Δ ψ + \frac{∂}{∂ z} \frac{f_0^2}{N^2}\frac{∂}{∂ z} ψ$$

with $f_0$ the Coriolis parameter and $N^2$ the Brunt Vaisala frequency.

Discretization

The model is written with finite differences. For closed domains, variables are discretized at cell corner. For periodic domain, variables are discretized at cell center.

to access the value of a field at index i,j,k one uses

psi[idx(i,j,k)]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published