Skip to content

Commit 219f360

Browse files
committed
Fixed bug in initq. Mean q should be removed properly now.
1 parent b3a182c commit 219f360

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import matplotlib.colors as mcl
2727

2828

29-
# Define blue colormap with nice blue.
29+
# Define blue colormap.
3030
cdict = {
3131
'red': ((0.0, 0.0, 0.0), (0.5, 0.216, 0.216), (1.0, 1.0, 1.0)),
3232
'green': ((0.0, 0.0, 0.0), (0.5, 0.494, 0.494), (1.0, 1.0, 1.0)),
@@ -42,7 +42,7 @@ class Model:
4242
This is the skeleton of a QG model that consists of a number of conserved
4343
quantities that are advected horizontally. Implementations of this model
4444
need to specify the number of conserved quantities (nz) and supply an
45-
inversion relation that yield the streamfuncion given the conserved quan-
45+
inversion relation that yields the streamfuncion given the conserved quan-
4646
tities. The model geometry is doubly periodic in the perturbations; mean
4747
flow and gradients in the conserved quantities can be prescribed.
4848
"""
@@ -108,7 +108,7 @@ def initq(self, qp):
108108
"""Transform qp to spectral space and initialize q."""
109109
self.q = fftw.interfaces.numpy_fft.rfft2(qp, axes=(0, 1),
110110
threads=self.threads)
111-
self.q[:,0,0] = 0. # ensuring zero mean
111+
self.q[0,0,:] = 0. # ensuring zero mean
112112

113113
def timestep(self):
114114
"""Perform time step."""

0 commit comments

Comments
 (0)