From c4b1180b3326a09f3af6072ffff6e611e0a6904d Mon Sep 17 00:00:00 2001 From: Paul Earnshaw Date: Fri, 29 Oct 2021 14:52:36 +0100 Subject: [PATCH] Update pp_save_rules.py Make sure call to cftime.datetime has the requisite number of arguments, in this case ensuring the start date is December 1st of the year the start date is actually in, when the month is december. --- lib/iris/fileformats/pp_save_rules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iris/fileformats/pp_save_rules.py b/lib/iris/fileformats/pp_save_rules.py index cc17e8f87b..16df5b42d3 100644 --- a/lib/iris/fileformats/pp_save_rules.py +++ b/lib/iris/fileformats/pp_save_rules.py @@ -280,7 +280,7 @@ def _general_time_rules(cube, pp): pp.t1 = time_coord.units.num2date(time_coord.bounds[0, 0]) pp.t2 = time_coord.units.num2date(time_coord.bounds[0, 1]) if pp.t1.month == 12: - pp.t1 = cftime.datetime(pp.t1.year) + pp.t1 = cftime.datetime(pp.t1.year, 12, 1, 0, 0, 0) else: pp.t1 = cftime.datetime(pp.t1.year - 1, 12, 1, 0, 0, 0) pp.t2 = cftime.datetime(pp.t2.year, 3, 1, 0, 0, 0)