Skip to content

Commit c148f45

Browse files
committed
returned to previous status
1 parent de26221 commit c148f45

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bgcval2/functions/circulation.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,17 @@ def davisstraightflux(nc, keys, straight='Davis', **kwargs):
379379
flux = nc.variables[keys[0]][0, :, LAT0:LAT1, LON]
380380
e1v_4d = np.broadcast_to(e1v[np.newaxis, :], thkcello.shape[:])
381381

382-
383382
if ndim == 3: #hfy
384383
flux = nc.variables[keys[0]][0, LAT0:LAT1, LON]
385384
e1v_4d = e1v
386385
thkcello = thkcello.sum(0)
387386

388387
flux = np.ma.masked_where(flux==0., flux)
389-
390-
flux = np.ma.sum(flux * e1v_4d * thkcello)
388+
if keys[0] in ['vo', 'uo']:
389+
flux = np.ma.sum(flux * e1v_4d * thkcello)
390+
else:
391+
# sum already calculated.
392+
flux = np.ma.sum(flux)
391393

392394
return flux
393395

0 commit comments

Comments
 (0)