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 -lnetcdfFor parallel execution, compile with
mpicc -D_MPI -O3 qg.c -o qg.e -lfftw3_mpi -lfftw3 -lm -llapacke -lnetcdfThere are several test cases in test/
you can run the model with
./qg.e params.inor
mpirun -np 4 ./qg.e params.inThe 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)]