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.
For a single layer configuration, we have
and for multi layer
with
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)]