Commit cbcf2ebd authored by Jean Matthieu Haussaire's avatar Jean Matthieu Haussaire
Browse files

Accelerates the computation of the transport for boxes in regions

parent 72e2b37b
......@@ -210,14 +210,14 @@ def obsoper(self, inputs, mode,
# Transport for boxes in regions
hbox = np.zeros((nbox*ngrid), np.float64)
for n in range(ngrid):
for jy in range(fp_header_nest.numy):
for ix in range(fp_header_nest.numx):
if tracer.regions[jy, ix] > 0:
hbox[n*nbox + tracer.regions[jy, ix] - 1] += \
grid_nest[ix, jy, n]
hbox = np.zeros((ngrid,nbox), np.float64)
for jy in range(fp_header_nest.numy):
for ix in range(fp_header_nest.numx):
if tracer.regions[jy, ix] > 0:
hbox[:,tracer.regions[jy, ix] - 1] += \
grid_nest[ix, jy, :ngrid]
hbox = hbox.flatten()
# TODO: account for possible difference nested grid/inversion domain
hnest = grid_nest
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment