Skip to content

Commit

Permalink
Fixed problem when multi_model fails when the cube has no latitude or…
Browse files Browse the repository at this point in the history
… longitude component.
  • Loading branch information
ledm committed Jun 25, 2019
1 parent 8270467 commit 933403f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions esmvalcore/preprocessor/_multimodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,17 @@ def _put_in_cube(template_cube, cube_data, statistic, t_axis):
t_axis,
standard_name='time',
units=template_cube.coord('time').units)
lats = template_cube.coord('latitude')
lons = template_cube.coord('longitude')

# no plevs
if len(template_cube.shape) == 3:
lats = template_cube.coord('latitude')
lons = template_cube.coord('longitude')
cspec = [(times, 0), (lats, 1), (lons, 2)]
# plevs
elif len(template_cube.shape) == 4:
plev = template_cube.coord('air_pressure')
lats = template_cube.coord('latitude')
lons = template_cube.coord('longitude')
cspec = [(times, 0), (plev, 1), (lats, 2), (lons, 3)]
elif len(template_cube.shape) == 1:
cspec = [
Expand Down

0 comments on commit 933403f

Please sign in to comment.