From a845cb28200f89788200bcd90c72c21d0cbbeb19 Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Fri, 5 Feb 2021 12:23:38 +0100 Subject: [PATCH] Fix units for MSWEP data --- esmvalcore/cmor/_fixes/native6/mswep.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esmvalcore/cmor/_fixes/native6/mswep.py b/esmvalcore/cmor/_fixes/native6/mswep.py index 34563ec5dc..dd041fa56c 100644 --- a/esmvalcore/cmor/_fixes/native6/mswep.py +++ b/esmvalcore/cmor/_fixes/native6/mswep.py @@ -92,11 +92,11 @@ def _fix_units(self, cube): cube.units = Unit(self.vardef.units) if frequency in ('day', '3hr'): - # divide by number of seconds in a month - cube.data = cube.core_data() / 60 * 60 * 24 * 30 - elif frequency == 'mon': # divide by number of seconds in a day - cube.data = cube.core_data() / 60 * 60 * 24 + cube.data = cube.core_data() / (60 * 60 * 24) + elif frequency == 'mon': + # divide by number of seconds in a month + cube.data = cube.core_data() / (60 * 60 * 24 * 30) else: raise ValueError(f'Cannot fix units for frequency: {frequency!r}')