Error loading UM orography file: invalid year provided in cftime.datetime(0, 0, 0, 0, 0, 0, 0, calendar='gregorian')

231 views
Skip to first unread message

Luke Abraham

unread,
Nov 17, 2020, 7:21:16 AM11/17/20
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
I'm trying to load a UM orography file in Iris 2.4.0. This was installed via conda and is using python3. I'm getting the error "invalid year provided in cftime.datetime(0, 0, 0, 0, 0, 0, 0, calendar='gregorian')" - I'm assuming because it's got no date as an orography file. This command has worked at previous versions of Iris (1.10 for instance), so I'm not sure what has changed or how to get around it. Please see below for the full output.

Any and all advice would be very welcome.

Many thanks and best wishes,
Luke


In [6]: orog=iris.load_cube(
...: '/home/vagrant/umdir/ancil/atmos/n48e/orography/globe30/v2/qrparm.orog',
...: iris.AttributeConstraint(STASH='m01s00i033'))
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-6-1b4cbf168c5d> in <module>
----> 1 orog=iris.load_cube(
2 '/home/vagrant/umdir/ancil/atmos/n48e/orography/globe30/v2/qrparm.orog',
3 iris.AttributeConstraint(STASH='m01s00i033'))


~/miniconda3/lib/python3.8/site-packages/iris/__init__.py in load_cube(uris, constraint, callback)
385 raise ValueError('only a single constraint is allowed')
386
--> 387 cubes = _load_collection(uris, constraints, callback).cubes()
388
389 try:


~/miniconda3/lib/python3.8/site-packages/iris/__init__.py in _load_collection(uris, constraints, callback)
323 try:
324 cubes = _generate_cubes(uris, callback, constraints)
--> 325 result = iris.cube._CubeFilterCollection.from_cubes(cubes, constraints)
326 except EOFError as e:
327 raise iris.exceptions.TranslationError(


~/miniconda3/lib/python3.8/site-packages/iris/cube.py in from_cubes(cubes, constraints)
155 pairs = [_CubeFilter(constraint) for constraint in constraints]
156 collection = _CubeFilterCollection(pairs)
--> 157 for cube in cubes:
158 collection.add_cube(cube)
159 return collection


~/miniconda3/lib/python3.8/site-packages/iris/__init__.py in _generate_cubes(uris, callback, constraints)
310 if scheme == 'file':
311 part_names = [x[1] for x in groups]
--> 312 for cube in iris.io.load_files(part_names, callback, constraints):
313 yield cube
314 elif scheme in ['http', 'https']:


~/miniconda3/lib/python3.8/site-packages/iris/io/__init__.py in load_files(filenames, callback, constraints)
204 fnames = handler_map[handling_format_spec]
205 if handling_format_spec.constraint_aware_handler:
--> 206 for cube in handling_format_spec.handler(fnames, callback,
207 constraints):
208 yield cube


~/miniconda3/lib/python3.8/site-packages/iris/fileformats/rules.py in load_cubes(filenames, user_callback, loader, filter_function)
424
425 all_fields_and_filenames = _generate_all_fields_and_filenames()
--> 426 for cube, field in _load_pairs_from_fields_and_filenames(
427 all_fields_and_filenames,
428 converter=loader.converter,


~/miniconda3/lib/python3.8/site-packages/iris/fileformats/rules.py in _load_pairs_from_fields_and_filenames(fields_and_filenames, converter, user_callback_wrapper)
348 for field, filename in fields_and_filenames:
349 # Convert the field to a Cube, passing down the 'converter' function.
--> 350 cube, factories, references = _make_cube(field, converter)
351
352 # Post modify the new cube with a user-callback.


~/miniconda3/lib/python3.8/site-packages/iris/fileformats/rules.py in _make_cube(field, converter)
291 def _make_cube(field, converter):
292 # Convert the field to a Cube.
--> 293 metadata = converter(field)
294
295 cube_data = field.core_data()


~/miniconda3/lib/python3.8/site-packages/iris/fileformats/pp_load_rules.py in convert(f)
732 lbcode=f.lbcode, lbtim=f.lbtim,
733 epoch_hours_unit=f.time_unit('hours'),
--> 734 t1=f.t1, t2=f.t2, lbft=f.lbft)
735 aux_coords_and_dims.extend(time_coords_and_dims)
736


~/miniconda3/lib/python3.8/site-packages/iris/fileformats/pp.py in t1(self)
1459 """
1460 if not hasattr(self, '_t1'):
-> 1461 self._t1 = cftime.datetime(self.lbyr, self.lbmon, self.lbdat,
1462 self.lbhr, self.lbmin)
1463 return self._t1


cftime/_cftime.pyx in cftime._cftime.datetime.__init__()


cftime/_cftime.pyx in cftime._cftime.assert_valid_date()


ValueError: invalid year provided in cftime.datetime(0, 0, 0, 0, 0, 0, 0, calendar='gregorian')

Luke Abraham

unread,
Nov 17, 2020, 10:50:26 AM11/17/20
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
I've confirmed that when using Iris 1.13 I do not have this issue.

RuthC

unread,
Nov 19, 2020, 5:14:11 AM11/19/20
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Odd.  There was a change for Iris2.2 specifically to handle zero dates here: https://github.com/SciTools/iris/pull/3259.  Though that PR does say "It's still possible that the problem could occur in other areas though."

From your traceback, it looks like there is an attempt to create the datetime before the  _epoch_date_hours function (which handles zero dates) ever gets called.  So I think this is an Iris bug.   Could you post it on the Github issue tracker?  Even better if you can either attach or link to an example file so we can reproduce the error.

Ruth

RuthC

unread,
Nov 19, 2020, 5:44:04 AM11/19/20
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Having said that, I have an example ancillary file on disk that loads just fine into Iris 2.4, and I don't get a time coordinate at all.  The file headers look like this (using mule-pumf):

%%%%%%%%%%%%%%%%%%%%%%%
* fixed_length_header *
%%%%%%%%%%%%%%%%%%%%%%%
  (2) sub_model                         :      1
  (3) vert_coord_type                   :      5
  (4) horiz_grid_type                   :      0
  (5) dataset_type                      :      4
  (6) run_identifier                    :      1
  (7) experiment_number                 :      1
  (9) grid_staggering                   :      6
  (10) time_type                        :      0
  (12) model_version                    :    901
  (21) t1_year                          :      0
  (22) t1_month                         :      0
  (23) t1_day                           :      0
  (24) t1_hour                          :      0
  (25) t1_minute                        :      0
  (26) t1_second                        :      0
  (27) t1_year_day_number               :      0
  (28) t2_year                          :      0
  (29) t2_month                         :      0
  (30) t2_day                           :      0
  (31) t2_hour                          :      0
  (32) t2_minute                        :      0
  (33) t2_second                        :      0
  (34) t2_year_day_number               :      0
  (35) t3_year                          :      0
  (36) t3_month                         :      0
  (37) t3_day                           :      0
  (38) t3_hour                          :      0
  (39) t3_minute                        :      0
  (40) t3_second                        :      0
  (41) t3_year_day_number               :      0
  (100) integer_constants_start         :    257
  (101) integer_constants_length        :     15
  (105) real_constants_start            :    272
  (106) real_constants_length           :      6
  (111) level_dependent_constants_dim1  :      1
  (112) level_dependent_constants_dim2  :      1
  (116) row_dependent_constants_dim1    :      1
  (117) row_dependent_constants_dim2    :      1
  (121) column_dependent_constants_dim1 :      1
  (122) column_dependent_constants_dim2 :      1
  (126) additional_parameters_dim1      :      1
  (127) additional_parameters_dim2      :      1
  (131) extra_constants_length          :      1
  (136) temp_historyfile_length         :      1
  (141) compressed_field_index1_length  :      1
  (143) compressed_field_index2_length  :      1
  (145) compressed_field_index3_length  :      1
  (150) lookup_start                    :    278
  (151) lookup_dim1                     :     64
  (152) lookup_dim2                     :      1
  (160) data_start                      :   2049
  (161) data_dim1                       : 139968

%%%%%%%%%%%%%%%%%%%%%
* integer_constants *
%%%%%%%%%%%%%%%%%%%%%
  (3) num_times        :   1
  (6) num_cols         : 432
  (7) num_rows         : 324
  (8) num_levels       :  85
  (15) num_field_types :   1

%%%%%%%%%%%%%%%%%%
* real_constants *
%%%%%%%%%%%%%%%%%%
  (1) col_spacing    : 0.833333333333
  (2) row_spacing    : 0.555555555556
  (3) start_lat      : -89.7222222222
  (4) start_lon      : 0.416666666667
  (5) north_pole_lat :           90.0
  (6) north_pole_lon :            0.0

%%%%%%%%%%%%%%
* Field 1/1  *
%%%%%%%%%%%%%%
  (1) lbyr     :               0
  (2) lbmon    :               0
  (3) lbdat    :               0
  (4) lbhr     :               0
  (5) lbmin    :               0
  (6) lbday    :               0
  (7) lbyrd    :               0
  (8) lbmond   :               0
  (9) lbdatd   :               0
  (10) lbhrd   :               0
  (11) lbmind  :               0
  (12) lbdayd  :               0
  (13) lbtim   :               0
  (14) lbft    :               0
  (15) lblrec  :          139968
  (16) lbcode  :               1
  (17) lbhem   :               0
  (18) lbrow   :             324
  (19) lbnpt   :             432
  (20) lbext   :               0
  (21) lbpack  :               2
  (22) lbrel   :               2
  (23) lbfc    :              36
  (24) lbcfc   :               0
  (25) lbproc  :               0
  (26) lbvc    :             129
  (27) lbrvc   :               0
  (28) lbexp   :               0
  (29) lbegin  :            2048
  (30) lbnrec  :           71680
  (31) lbproj  :               0
  (32) lbtyp   :              74
  (33) lblev   :            8888
  (34) lbrsvd1 :               0
  (35) lbrsvd2 :               0
  (36) lbrsvd3 :               0
  (37) lbrsvd4 :               0
  (38) lbsrce  :         9011111
  (39) lbuser1 :               1
  (40) lbuser2 :               1
  (41) lbuser3 :               0
  (42) lbuser4 :             505
  (43) lbuser5 :               0
  (44) lbuser6 :               0
  (45) lbuser7 :               1
  (46) brsvd1  :             0.0
  (47) brsvd2  :             0.0
  (48) brsvd3  :             0.0
  (49) brsvd4  :             0.0
  (50) bdatum  :             0.0
  (51) bacc    :             0.0
  (52) blev    :             0.0
  (53) brlev   :             0.0
  (54) bhlev   :             0.0
  (55) bhrlev  :             0.0
  (56) bplat   :            90.0
  (57) bplon   :             0.0
  (58) bgor    :             0.0
  (59) bzy     :  -90.2777777778
  (60) bdy     :  0.555555555556
  (61) bzx     : -0.416666666667
  (62) bdx     :  0.833333333333
  (63) bmdi    :   -1073741824.0
  (64) bmks    :             1.0
  maximum      :             1.0
  minimum      :             0.0


RuthC

unread,
Nov 19, 2020, 6:21:42 AM11/19/20
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Also, what version of cftime do you have?  The latest version is 1.2.1.  With this, I get no objection to the zero year when I do:

In [1]: import cftime

In [2]: cftime.datetime(0,0,0)
Out[2]: cftime.datetime(0, 0, 0, 0, 0, 0, 0)

In [3]: cftime.datetime(0, 0, 0, 0, 0, 0, 0, calendar='gregorian')
Out[3]: cftime.datetime(0, 0, 0, 0, 0, 0, 0)

In [4]: cftime.__version__
Out[4]: '1.2.1'


Luke Abraham

unread,
Nov 19, 2020, 10:39:19 AM11/19/20
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Dear Ruth,

Many thanks for this - it might be a cftime issue. I'm using the Met Office Virtual Machine

https://github.com/metomi/metomi-vms

With Iris installed via conda using this script

https://github.com/metomi/metomi-vms/blob/master/usr/local/bin/install-iris

Here cftime is at version 1.3.0

In [7]: cftime.__version__
Out[7]: '1.3.0'

Now trying your commands gives

In [8]: cftime.datetime(0,0,0)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-8-e7786d25dc86> in <module>
----> 1 cftime.datetime(0,0,0)

cftime/_cftime.pyx in cftime._cftime.datetime.__init__()

cftime/_cftime.pyx in cftime._cftime.assert_valid_date()

ValueError: invalid year provided in cftime.datetime(0, 0, 0, 0, 0, 0, 0, calendar='gregorian')

In [9]: cftime.datetime(0, 0, 0, 0, 0, 0, 0, calendar='gregorian')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-9-565c0bbb08a5> in <module>
----> 1 cftime.datetime(0, 0, 0, 0, 0, 0, 0, calendar='gregorian')

cftime/_cftime.pyx in cftime._cftime.datetime.__init__()

cftime/_cftime.pyx in cftime._cftime.assert_valid_date()

ValueError: invalid year provided in cftime.datetime(0, 0, 0, 0, 0, 0, 0, calendar='gregorian')


The orography file I'm using is provided from MOSRS, installed using this script

https://github.com/metomi/metomi-vms/blob/master/usr/local/bin/install-um-data

The headers from mule-pumf are below.

If I instead install cftime 1.2.1 using conda (which replaces 1.3.0) I can now open the file and run the cftime commands:

In [1]: import cftime

In [2]: cftime.__version__
Out[2]: '1.2.1'

In [3]: cftime.datetime(0,0,0)
Out[3]: cftime.datetime(0, 0, 0, 0, 0, 0, 0)

In [4]: cftime.datetime(0, 0, 0, 0, 0, 0, 0, calendar='gregorian')
Out[4]: cftime.datetime(0, 0, 0, 0, 0, 0, 0)

In [5]: import iris

In [6]: orog=iris.load_cube('/home/vagrant/umdir/ancil/atmos/n48e/orography/glob
   ...: e30/v2/qrparm.orog',iris.AttributeConstraint(STASH='m01s00i033'))

In [7]: orog
Out[7]: <iris 'Cube' of surface_altitude / (m) (latitude: 72; longitude: 96)>

Would this still be a bug issue within Iris, or is it a cftime issue only?

Many thanks and best wishes,
Luke


vagrant@vagrant:~$ /home/vagrant/umdir/mule/bin/mule-pumf --headers-only /home/vagrant/umdir/ancil/atmos/n48e/orography/globe30/v2/qrparm.orog

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

* (PUMF-II) Module Information *

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

mule       : /home/vagrant/umdir/mule/lib/mule/__init__.pyc (version 2017.08.1)

um_utils   : /home/vagrant/umdir/mule/lib/um_utils/__init__.pyc (version 2017.08.1)

um_packing : /home/vagrant/umdir/mule/lib/um_packing/__init__.pyc (version 2017.08.1) (packing lib from SHUMlib: 2017101)



/home/vagrant/umdir/mule/lib/mule/stashmaster.py:282: UserWarning: Ancillary files do not define the UM version number in the Fixed Length Header. No STASHmaster file loaded: Fields will not have STASH entries attached.

  warnings.warn(msg)

/home/vagrant/umdir/mule/lib/mule/validators.py:182: UserWarning: 

File: /home/vagrant/umdir/ancil/atmos/n48e/orography/globe30/v2/qrparm.orog

Level dependent constants not found

  warnings.warn(msg)

%%%%%%%%%%%%%%%%%%

* PUMF-II Report *

%%%%%%%%%%%%%%%%%%


File: /home/vagrant/umdir/ancil/atmos/n48e/orography/globe30/v2/qrparm.orog


%%%%%%%%%%%%%%%%%%%%%%%

* fixed_length_header *

%%%%%%%%%%%%%%%%%%%%%%%

  (2) sub_model                         : 1    

  (3) vert_coord_type                   : 5    

  (4) horiz_grid_type                   : 0    

  (5) dataset_type                      : 4    

  (6) run_identifier                    : 1    

  (7) experiment_number                 : 1    

  (9) grid_staggering                   : 6    

  (10) time_type                        : 0    

  (12) model_version                    : 803  

  (152) lookup_dim2                     : 9    

  (160) data_start                      : 2049 

  (161) data_dim1                       : 62208


%%%%%%%%%%%%%%%%%%%%%

* integer_constants *

%%%%%%%%%%%%%%%%%%%%%

  (3) num_times        : 1 

  (6) num_cols         : 96

  (7) num_rows         : 72

  (8) num_levels       : 38

  (15) num_field_types : 9 


%%%%%%%%%%%%%%%%%%

* real_constants *

%%%%%%%%%%%%%%%%%%

  (1) col_spacing    : 3.75  

  (2) row_spacing    : 2.5   

  (3) start_lat      : -88.75

  (4) start_lon      : 1.875 

  (5) north_pole_lat : 90.0  

  (6) north_pole_lon : 0.0   


%%%%%%%%%%%%%%

* Field 1/9  *

%%%%%%%%%%%%%%

  (1) lbyr     : 0            

  (2) lbmon    : 0            

  (3) lbdat    : 0            

  (4) lbhr     : 0            

  (5) lbmin    : 0            

  (6) lbday    : 0            

  (7) lbyrd    : 0            

  (8) lbmond   : 0            

  (9) lbdatd   : 0            

  (10) lbhrd   : 0            

  (11) lbmind  : 0            

  (12) lbdayd  : 0            

  (13) lbtim   : 0            

  (14) lbft    : 0            

  (15) lblrec  : 6912         

  (16) lbcode  : 1            

  (17) lbhem   : 0            

  (18) lbrow   : 72           

  (19) lbnpt   : 96           

  (20) lbext   : 0            

  (21) lbpack  : 2            

  (22) lbrel   : 2            

  (23) lbfc    : 1            

  (24) lbcfc   : 0            

  (25) lbproc  : 0            

  (26) lbvc    : 129          

  (27) lbrvc   : 0            

  (28) lbexp   : 0            

  (29) lbegin  : 2048         

  (30) lbnrec  : 4096         

  (31) lbproj  : 0            

  (32) lbtyp   : 73           

  (33) lblev   : 8888         

  (34) lbrsvd1 : 0            

  (35) lbrsvd2 : 0            

  (36) lbrsvd3 : 0            

  (37) lbrsvd4 : 0            

  (38) lbsrce  : 8031111      

  (39) lbuser1 : 1            

  (40) lbuser2 : 1            

  (41) lbuser3 : 0            

  (42) lbuser4 : 33           

  (43) lbuser5 : 0            

  (44) lbuser6 : 0            

  (45) lbuser7 : 1            

  (46) brsvd1  : 0.0          

  (47) brsvd2  : 0.0          

  (48) brsvd3  : 0.0          

  (49) brsvd4  : 0.0          

  (50) bdatum  : 0.0          

  (51) bacc    : 0.0          

  (52) blev    : 0.0          

  (53) brlev   : 0.0          

  (54) bhlev   : 0.0          

  (55) bhrlev  : 0.0          

  (56) bplat   : 90.0         

  (57) bplon   : 0.0          

  (58) bgor    : 0.0          

  (59) bzy     : -91.25       

  (60) bdy     : 2.5          

  (61) bzx     : -1.875       

  (62) bdx     : 3.75         

  (63) bmdi    : -1073741824.0

  (64) bmks    : 1.0          


%%%%%%%%%%%%%%

* Field 2/9  *

%%%%%%%%%%%%%%

  (1) lbyr     : 0            

  (2) lbmon    : 0            

  (3) lbdat    : 0            

  (4) lbhr     : 0            

  (5) lbmin    : 0            

  (6) lbday    : 0            

  (7) lbyrd    : 0            

  (8) lbmond   : 0            

  (9) lbdatd   : 0            

  (10) lbhrd   : 0            

  (11) lbmind  : 0            

  (12) lbdayd  : 0            

  (13) lbtim   : 0            

  (14) lbft    : 0            

  (15) lblrec  : 6912         

  (16) lbcode  : 1            

  (17) lbhem   : 0            

  (18) lbrow   : 72           

  (19) lbnpt   : 96           

  (20) lbext   : 0            

  (21) lbpack  : 2            

  (22) lbrel   : 2            

  (23) lbfc    : 150          

  (24) lbcfc   : 0            

  (25) lbproc  : 0            

  (26) lbvc    : 129          

  (27) lbrvc   : 0            

  (28) lbexp   : 0            

  (29) lbegin  : 6144         

  (30) lbnrec  : 4096         

  (31) lbproj  : 0            

  (32) lbtyp   : 186          

  (33) lblev   : 8888         

  (34) lbrsvd1 : 0            

  (35) lbrsvd2 : 0            

  (36) lbrsvd3 : 0            

  (37) lbrsvd4 : 0            

  (38) lbsrce  : 8031111      

  (39) lbuser1 : 1            

  (40) lbuser2 : 6913         

  (41) lbuser3 : 0            

  (42) lbuser4 : 34           

  (43) lbuser5 : 0            

  (44) lbuser6 : 0            

  (45) lbuser7 : 1            

  (46) brsvd1  : 0.0          

  (47) brsvd2  : 0.0          

  (48) brsvd3  : 0.0          

  (49) brsvd4  : 0.0          

  (50) bdatum  : 0.0          

  (51) bacc    : 0.0          

  (52) blev    : 0.0          

  (53) brlev   : 0.0          

  (54) bhlev   : 0.0          

  (55) bhrlev  : 0.0          

  (56) bplat   : 90.0         

  (57) bplon   : 0.0          

  (58) bgor    : 0.0          

  (59) bzy     : -91.25       

  (60) bdy     : 2.5          

  (61) bzx     : -1.875       

  (62) bdx     : 3.75         

  (63) bmdi    : -1073741824.0

  (64) bmks    : 1.0          


%%%%%%%%%%%%%%

* Field 3/9  *

%%%%%%%%%%%%%%

  (1) lbyr     : 0            

  (2) lbmon    : 0            

  (3) lbdat    : 0            

  (4) lbhr     : 0            

  (5) lbmin    : 0            

  (6) lbday    : 0            

  (7) lbyrd    : 0            

  (8) lbmond   : 0            

  (9) lbdatd   : 0            

  (10) lbhrd   : 0            

  (11) lbmind  : 0            

  (12) lbdayd  : 0            

  (13) lbtim   : 0            

  (14) lbft    : 0            

  (15) lblrec  : 6912         

  (16) lbcode  : 1            

  (17) lbhem   : 0            

  (18) lbrow   : 72           

  (19) lbnpt   : 96           

  (20) lbext   : 0            

  (21) lbpack  : 2            

  (22) lbrel   : 2            

  (23) lbfc    : 0            

  (24) lbcfc   : 0            

  (25) lbproc  : 0            

  (26) lbvc    : 129          

  (27) lbrvc   : 0            

  (28) lbexp   : 0            

  (29) lbegin  : 10240        

  (30) lbnrec  : 4096         

  (31) lbproj  : 0            

  (32) lbtyp   : 0            

  (33) lblev   : 8888         

  (34) lbrsvd1 : 0            

  (35) lbrsvd2 : 0            

  (36) lbrsvd3 : 0            

  (37) lbrsvd4 : 0            

  (38) lbsrce  : 8031111      

  (39) lbuser1 : 1            

  (40) lbuser2 : 13825        

  (41) lbuser3 : 0            

  (42) lbuser4 : 5            

  (43) lbuser5 : 0            

  (44) lbuser6 : 0            

  (45) lbuser7 : 1            

  (46) brsvd1  : 0.0          

  (47) brsvd2  : 0.0          

  (48) brsvd3  : 0.0          

  (49) brsvd4  : 0.0          

  (50) bdatum  : 0.0          

  (51) bacc    : 0.0          

  (52) blev    : 0.0          

  (53) brlev   : 0.0          

  (54) bhlev   : 0.0          

  (55) bhrlev  : 0.0          

  (56) bplat   : 90.0         

  (57) bplon   : 0.0          

  (58) bgor    : 0.0          

  (59) bzy     : -91.25       

  (60) bdy     : 2.5          

  (61) bzx     : -1.875       

  (62) bdx     : 3.75         

  (63) bmdi    : -1073741824.0

  (64) bmks    : 1.0          


%%%%%%%%%%%%%%

* Field 4/9  *

%%%%%%%%%%%%%%

  (1) lbyr     : 0            

  (2) lbmon    : 0            

  (3) lbdat    : 0            

  (4) lbhr     : 0            

  (5) lbmin    : 0            

  (6) lbday    : 0            

  (7) lbyrd    : 0            

  (8) lbmond   : 0            

  (9) lbdatd   : 0            

  (10) lbhrd   : 0            

  (11) lbmind  : 0            

  (12) lbdayd  : 0            

  (13) lbtim   : 0            

  (14) lbft    : 0            

  (15) lblrec  : 6912         

  (16) lbcode  : 1            

  (17) lbhem   : 0            

  (18) lbrow   : 72           

  (19) lbnpt   : 96           

  (20) lbext   : 0            

  (21) lbpack  : 2            

  (22) lbrel   : 2            

  (23) lbfc    : 0            

  (24) lbcfc   : 0            

  (25) lbproc  : 0            

  (26) lbvc    : 129          

  (27) lbrvc   : 0            

  (28) lbexp   : 0            

  (29) lbegin  : 14336        

  (30) lbnrec  : 4096         

  (31) lbproj  : 0            

  (32) lbtyp   : 0            

  (33) lblev   : 8888         

  (34) lbrsvd1 : 0            

  (35) lbrsvd2 : 0            

  (36) lbrsvd3 : 0            

  (37) lbrsvd4 : 0            

  (38) lbsrce  : 8031111      

  (39) lbuser1 : 1            

  (40) lbuser2 : 20737        

  (41) lbuser3 : 0            

  (42) lbuser4 : 6            

  (43) lbuser5 : 0            

  (44) lbuser6 : 0            

  (45) lbuser7 : 1            

  (46) brsvd1  : 0.0          

  (47) brsvd2  : 0.0          

  (48) brsvd3  : 0.0          

  (49) brsvd4  : 0.0          

  (50) bdatum  : 0.0          

  (51) bacc    : 0.0          

  (52) blev    : 0.0          

  (53) brlev   : 0.0          

  (54) bhlev   : 0.0          

  (55) bhrlev  : 0.0          

  (56) bplat   : 90.0         

  (57) bplon   : 0.0          

  (58) bgor    : 0.0          

  (59) bzy     : -91.25       

  (60) bdy     : 2.5          

  (61) bzx     : -1.875       

  (62) bdx     : 3.75         

  (63) bmdi    : -1073741824.0

  (64) bmks    : 1.0          


%%%%%%%%%%%%%%

* Field 5/9  *

%%%%%%%%%%%%%%

  (1) lbyr     : 0            

  (2) lbmon    : 0            

  (3) lbdat    : 0            

  (4) lbhr     : 0            

  (5) lbmin    : 0            

  (6) lbday    : 0            

  (7) lbyrd    : 0            

  (8) lbmond   : 0            

  (9) lbdatd   : 0            

  (10) lbhrd   : 0            

  (11) lbmind  : 0            

  (12) lbdayd  : 0            

  (13) lbtim   : 0            

  (14) lbft    : 0            

  (15) lblrec  : 6912         

  (16) lbcode  : 1            

  (17) lbhem   : 0            

  (18) lbrow   : 72           

  (19) lbnpt   : 96           

  (20) lbext   : 0            

  (21) lbpack  : 2            

  (22) lbrel   : 2            

  (23) lbfc    : 152          

  (24) lbcfc   : 0            

  (25) lbproc  : 0            

  (26) lbvc    : 129          

  (27) lbrvc   : 0            

  (28) lbexp   : 0            

  (29) lbegin  : 18432        

  (30) lbnrec  : 4096         

  (31) lbproj  : 0            

  (32) lbtyp   : 218          

  (33) lblev   : 8888         

  (34) lbrsvd1 : 0            

  (35) lbrsvd2 : 0            

  (36) lbrsvd3 : 0            

  (37) lbrsvd4 : 0            

  (38) lbsrce  : 8031111      

  (39) lbuser1 : 1            

  (40) lbuser2 : 27649        

  (41) lbuser3 : 0            

  (42) lbuser4 : 35           

  (43) lbuser5 : 0            

  (44) lbuser6 : 0            

  (45) lbuser7 : 1            

  (46) brsvd1  : 0.0          

  (47) brsvd2  : 0.0          

  (48) brsvd3  : 0.0          

  (49) brsvd4  : 0.0          

  (50) bdatum  : 0.0          

  (51) bacc    : 0.0          

  (52) blev    : 0.0          

  (53) brlev   : 0.0          

  (54) bhlev   : 0.0          

  (55) bhrlev  : 0.0          

  (56) bplat   : 90.0         

  (57) bplon   : 0.0          

  (58) bgor    : 0.0          

  (59) bzy     : -91.25       

  (60) bdy     : 2.5          

  (61) bzx     : -1.875       

  (62) bdx     : 3.75         

  (63) bmdi    : -1073741824.0

  (64) bmks    : 1.0          


%%%%%%%%%%%%%%

* Field 6/9  *

%%%%%%%%%%%%%%

  (1) lbyr     : 0            

  (2) lbmon    : 0            

  (3) lbdat    : 0            

  (4) lbhr     : 0            

  (5) lbmin    : 0            

  (6) lbday    : 0            

  (7) lbyrd    : 0            

  (8) lbmond   : 0            

  (9) lbdatd   : 0            

  (10) lbhrd   : 0            

  (11) lbmind  : 0            

  (12) lbdayd  : 0            

  (13) lbtim   : 0            

  (14) lbft    : 0            

  (15) lblrec  : 6912         

  (16) lbcode  : 1            

  (17) lbhem   : 0            

  (18) lbrow   : 72           

  (19) lbnpt   : 96           

  (20) lbext   : 0            

  (21) lbpack  : 2            

  (22) lbrel   : 2            

  (23) lbfc    : 153          

  (24) lbcfc   : 0            

  (25) lbproc  : 0            

  (26) lbvc    : 129          

  (27) lbrvc   : 0            

  (28) lbexp   : 0            

  (29) lbegin  : 22528        

  (30) lbnrec  : 4096         

  (31) lbproj  : 0            

  (32) lbtyp   : 219          

  (33) lblev   : 8888         

  (34) lbrsvd1 : 0            

  (35) lbrsvd2 : 0            

  (36) lbrsvd3 : 0            

  (37) lbrsvd4 : 0            

  (38) lbsrce  : 8031111      

  (39) lbuser1 : 1            

  (40) lbuser2 : 34561        

  (41) lbuser3 : 0            

  (42) lbuser4 : 36           

  (43) lbuser5 : 0            

  (44) lbuser6 : 0            

  (45) lbuser7 : 1            

  (46) brsvd1  : 0.0          

  (47) brsvd2  : 0.0          

  (48) brsvd3  : 0.0          

  (49) brsvd4  : 0.0          

  (50) bdatum  : 0.0          

  (51) bacc    : 0.0          

  (52) blev    : 0.0          

  (53) brlev   : 0.0          

  (54) bhlev   : 0.0          

  (55) bhrlev  : 0.0          

  (56) bplat   : 90.0         

  (57) bplon   : 0.0          

  (58) bgor    : 0.0          

  (59) bzy     : -91.25       

  (60) bdy     : 2.5          

  (61) bzx     : -1.875       

  (62) bdx     : 3.75         

  (63) bmdi    : -1073741824.0

  (64) bmks    : 1.0          


%%%%%%%%%%%%%%

* Field 7/9  *

%%%%%%%%%%%%%%

  (1) lbyr     : 0            

  (2) lbmon    : 0            

  (3) lbdat    : 0            

  (4) lbhr     : 0            

  (5) lbmin    : 0            

  (6) lbday    : 0            

  (7) lbyrd    : 0            

  (8) lbmond   : 0            

  (9) lbdatd   : 0            

  (10) lbhrd   : 0            

  (11) lbmind  : 0            

  (12) lbdayd  : 0            

  (13) lbtim   : 0            

  (14) lbft    : 0            

  (15) lblrec  : 6912         

  (16) lbcode  : 1            

  (17) lbhem   : 0            

  (18) lbrow   : 72           

  (19) lbnpt   : 96           

  (20) lbext   : 0            

  (21) lbpack  : 2            

  (22) lbrel   : 2            

  (23) lbfc    : 154          

  (24) lbcfc   : 0            

  (25) lbproc  : 0            

  (26) lbvc    : 129          

  (27) lbrvc   : 0            

  (28) lbexp   : 0            

  (29) lbegin  : 26624        

  (30) lbnrec  : 4096         

  (31) lbproj  : 0            

  (32) lbtyp   : 220          

  (33) lblev   : 8888         

  (34) lbrsvd1 : 0            

  (35) lbrsvd2 : 0            

  (36) lbrsvd3 : 0            

  (37) lbrsvd4 : 0            

  (38) lbsrce  : 8031111      

  (39) lbuser1 : 1            

  (40) lbuser2 : 41473        

  (41) lbuser3 : 0            

  (42) lbuser4 : 37           

  (43) lbuser5 : 0            

  (44) lbuser6 : 0            

  (45) lbuser7 : 1            

  (46) brsvd1  : 0.0          

  (47) brsvd2  : 0.0          

  (48) brsvd3  : 0.0          

  (49) brsvd4  : 0.0          

  (50) bdatum  : 0.0          

  (51) bacc    : 0.0          

  (52) blev    : 0.0          

  (53) brlev   : 0.0          

  (54) bhlev   : 0.0          

  (55) bhrlev  : 0.0          

  (56) bplat   : 90.0         

  (57) bplon   : 0.0          

  (58) bgor    : 0.0          

  (59) bzy     : -91.25       

  (60) bdy     : 2.5          

  (61) bzx     : -1.875       

  (62) bdx     : 3.75         

  (63) bmdi    : -1073741824.0

  (64) bmks    : 1.0          


%%%%%%%%%%%%%%

* Field 8/9  *

%%%%%%%%%%%%%%

  (1) lbyr     : 0            

  (2) lbmon    : 0            

  (3) lbdat    : 0            

  (4) lbhr     : 0            

  (5) lbmin    : 0            

  (6) lbday    : 0            

  (7) lbyrd    : 0            

  (8) lbmond   : 0            

  (9) lbdatd   : 0            

  (10) lbhrd   : 0            

  (11) lbmind  : 0            

  (12) lbdayd  : 0            

  (13) lbtim   : 0            

  (14) lbft    : 0            

  (15) lblrec  : 6912         

  (16) lbcode  : 1            

  (17) lbhem   : 0            

  (18) lbrow   : 72           

  (19) lbnpt   : 96           

  (20) lbext   : 0            

  (21) lbpack  : 2            

  (22) lbrel   : 2            

  (23) lbfc    : 174          

  (24) lbcfc   : 0            

  (25) lbproc  : 0            

  (26) lbvc    : 129          

  (27) lbrvc   : 0            

  (28) lbexp   : 0            

  (29) lbegin  : 30720        

  (30) lbnrec  : 4096         

  (31) lbproj  : 0            

  (32) lbtyp   : 209          

  (33) lblev   : 8888         

  (34) lbrsvd1 : 0            

  (35) lbrsvd2 : 0            

  (36) lbrsvd3 : 0            

  (37) lbrsvd4 : 0            

  (38) lbsrce  : 8031111      

  (39) lbuser1 : 1            

  (40) lbuser2 : 48385        

  (41) lbuser3 : 0            

  (42) lbuser4 : 17           

  (43) lbuser5 : 0            

  (44) lbuser6 : 0            

  (45) lbuser7 : 1            

  (46) brsvd1  : 0.0          

  (47) brsvd2  : 0.0          

  (48) brsvd3  : 0.0          

  (49) brsvd4  : 0.0          

  (50) bdatum  : 0.0          

  (51) bacc    : 0.0          

  (52) blev    : 0.0          

  (53) brlev   : 0.0          

  (54) bhlev   : 0.0          

  (55) bhrlev  : 0.0          

  (56) bplat   : 90.0         

  (57) bplon   : 0.0          

  (58) bgor    : 0.0          

  (59) bzy     : -91.25       

  (60) bdy     : 2.5          

  (61) bzx     : -1.875       

  (62) bdx     : 3.75         

  (63) bmdi    : -1073741824.0

  (64) bmks    : 1.0          


%%%%%%%%%%%%%%

* Field 9/9  *

%%%%%%%%%%%%%%

  (1) lbyr     : 0            

  (2) lbmon    : 0            

  (3) lbdat    : 0            

  (4) lbhr     : 0            

  (5) lbmin    : 0            

  (6) lbday    : 0            

  (7) lbyrd    : 0            

  (8) lbmond   : 0            

  (9) lbdatd   : 0            

  (10) lbhrd   : 0            

  (11) lbmind  : 0            

  (12) lbdayd  : 0            

  (13) lbtim   : 0            

  (14) lbft    : 0            

  (15) lblrec  : 6912         

  (16) lbcode  : 1            

  (17) lbhem   : 0            

  (18) lbrow   : 72           

  (19) lbnpt   : 96           

  (20) lbext   : 0            

  (21) lbpack  : 2            

  (22) lbrel   : 2            

  (23) lbfc    : 175          

  (24) lbcfc   : 0            

  (25) lbproc  : 0            

  (26) lbvc    : 129          

  (27) lbrvc   : 0            

  (28) lbexp   : 0            

  (29) lbegin  : 34816        

  (30) lbnrec  : 4096         

  (31) lbproj  : 0            

  (32) lbtyp   : 210          

  (33) lblev   : 8888         

  (34) lbrsvd1 : 0            

  (35) lbrsvd2 : 0            

  (36) lbrsvd3 : 0            

  (37) lbrsvd4 : 0            

  (38) lbsrce  : 8031111      

  (39) lbuser1 : 1            

  (40) lbuser2 : 55297        

  (41) lbuser3 : 0            

  (42) lbuser4 : 18           

  (43) lbuser5 : 0            

  (44) lbuser6 : 0            

  (45) lbuser7 : 1            

  (46) brsvd1  : 0.0          

  (47) brsvd2  : 0.0          

  (48) brsvd3  : 0.0          

  (49) brsvd4  : 0.0          

  (50) bdatum  : 0.0          

  (51) bacc    : 0.0          

  (52) blev    : 0.0          

  (53) brlev   : 0.0          

  (54) bhlev   : 0.0          

  (55) bhrlev  : 0.0          

  (56) bplat   : 90.0         

  (57) bplon   : 0.0          

  (58) bgor    : 0.0          

  (59) bzy     : -91.25       

  (60) bdy     : 2.5          

  (61) bzx     : -1.875       

  (62) bdx     : 3.75         

RuthC

unread,
Nov 19, 2020, 11:35:28 AM11/19/20
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Hi Luke,

thanks for following up.  It seems the page I looked at for cftime versions is out of date!  So cftime 1.3 was released just this week, and I have just reproduced the error with a new environment.  So yes, something will need to be done to fix this within Iris.  I've also established that variations on this error comes when running Iris's own tests, so at least we have no trouble reproducing it!  As I'm seeing a bunch of other failures, I think I'll go ahead and raise this on GitHub myself.

Will sticking to cftime 1.2.1 be OK for your current purposes?

Ruth

Luke Abraham

unread,
Nov 20, 2020, 5:02:21 AM11/20/20
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Hi Ruth,

Many thanks for this - please go ahead and raise the bug report, I'm glad that it can be reproduced with the internal tests!

I'm still working on upgrading the UKCA tutorial scripts from the old Iris 1.10 scripts using python2.7 that I used previously


(data can be downloaded from here: http://gws-access.jasmin.ac.uk/public/ukca/UKCA_Tutorial_vn109.tgz). I will be updating the UMvn10.9 tutorials to UMvn11.8 


and was checking my scripts worked. I seem to have at least one potential other issue, but this is probably unrelated to the one reported here and may be because other things need updating in the scripts. I can get the current versions to work without needing any changes if I install with 

conda install -y -c conda-forge python=3.6 iris=1.13 ipython mo_pack numpy=1.15

(i.e. still using an older version of Iris). This is good enough for the moment.

If I can't work out these issues I'll ask a new question.

Many thanks and best wishes,
Luke


RuthC

unread,
Nov 20, 2020, 5:39:50 AM11/20/20
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Thanks Luke,

in the end I just put up a dummy pull request, since the tests are run automatically there and we have a link to the output: https://github.com/SciTools/iris/pull/3923

This isn't the first time that cftime changes have broken Iris.  I'm afraid you are just unlucky to have been first to catch the problem this time.

A lot has changed in Iris and its dependencies since version 1.13, so I'd be amazed if your scripts didn't need some updates to cope with the newer versions.  We aim to keep any incompatible changes to major versions, so version 2.0 in this case.  Note also that Iris version 3.0 is currently being finalised and will have its own incompatible changes.  (The version 3.0 release candidate is also available from conda-forge - see https://github.com/SciTools/iris/releases/tag/v3.0.0rc0)

Ruth

Luke Abraham

unread,
Jul 19, 2021, 6:41:25 AM7/19/21
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Dear Ruth,

I've just tested this again with a fresh install via conda (actually mamba) and it took cftime 1.5.0 by default which still has this issue with my orography file. Rolling back to cftime 1.2.1 allows my script to run, but this then held-back other packages (none iris related I think). Do you know if this will be the expected behaviour of cftime from now on, or will I just always have to define cftime==1.2.1 on install?

Many thanks and best wishes,
Luke

RuthC

unread,
Jul 19, 2021, 6:56:25 AM7/19/21
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Hi Luke,

what version of Iris are you using?  The latest version (3.0.3) has cftime pinned to version <1.3 in the requirements, so conda should not have pulled back cftime 1.5.

We are also hoping to cut another Iris release within the next few weeks, which will have the changes required to work with cftime 1.5.  So hopefully everything will work sensibly before too long!

Ruth

Luke Abraham

unread,
Jul 19, 2021, 7:01:08 AM7/19/21
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Dear Ruth,

Thanks for this. I thought I was using 3.0.3, but apparently it's 2.4.0! I will check what's going on with the dependencies for other packages I'm trying to install. I was originally also trying to provide cf-python in the same environment for students to use in case they are more familiar with that, but it may be that this is causing other undesirable consequences. I will try again.

Best wishes,
Luke

Luke Abraham

unread,
Jul 19, 2021, 11:33:52 AM7/19/21
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Hi Ruth,

The issue was trying to install cf-python - the most recent version requires cftime at 1.5.0, as they keep in track of the changing cftime versions. Constraining cftime to 1.2.1 then means that an older version of cf-python is installed.

From the students' perspective I'll keep with only providing Iris for now, and then will allow the option for both to be available in the same environment once the dependency on cftime 1.2.1 is removed from Iris at 3.0.4.

Many thanks and best wishes,
Luke

RuthC

unread,
Jul 23, 2021, 4:55:15 AM7/23/21
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Hi Luke,

just to let you know that Iris v3.0.4 was released overnight, so you should now be able to make an environment with Iris v3.0.4 and cftime v1.5.0.

Ruth

Luke Abraham

unread,
Jul 23, 2021, 5:29:35 AM7/23/21
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Hi Ruth,

That's fantastic - many thanks. I'll give it a test!

Best wishes,
Luke

Reply all
Reply to author
Forward
0 new messages