Skip to content

ICON benchmark failure in Field initialization #38

@fluidnumerics-joe

Description

@fluidnumerics-joe

On the feature/icon branch, the icon benchmarks currently fail with

[72.22%] ··· ======= =========================
             --              integrator
             ------- -------------------------
              npart   <function AdvectionRK2>
             ======= =========================
              10000            failed
             ======= =========================
             For parameters: 10000, <function AdvectionRK2>
             INFO: Using known vertical dimension mapping: 'depth_2' (interfaces) and 'depth' (centers).
             INFO: Renaming vertical dimensions: {'depth_2': 'zf', 'depth': 'zc'}
             INFO: cf_xarray found variable 'w' with CF standard name 'w' in dataset, renamed it to 'W' for Parcels simulation.
             INFO: cf_xarray found variable 'u' with CF standard name 'u' in dataset, renamed it to 'U' for Parcels simulation.
             INFO: cf_xarray found variable 'v' with CF standard name 'v' in dataset, renamed it to 'V' for Parcels simulation.
             Traceback (most recent call last):
               File "/group/tdgs/joe/parcels-benchmarks/.asv/env/b54e0339d4ce929e91168b1373f7b02b/lib/python3.12/site-packages/asv_runner/server.py", line 179, in _run_server
                 _run(run_args)
               File "/group/tdgs/joe/parcels-benchmarks/.asv/env/b54e0339d4ce929e91168b1373f7b02b/lib/python3.12/site-packages/asv_runner/run.py", line 72, in _run
                 result = benchmark.do_run()
                          ^^^^^^^^^^^^^^^^^^
               File "/group/tdgs/joe/parcels-benchmarks/.asv/env/b54e0339d4ce929e91168b1373f7b02b/lib/python3.12/site-packages/asv_runner/benchmarks/_base.py", line 661, in do_run
                 return self.run(*self._current_params)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               File "/group/tdgs/joe/parcels-benchmarks/.asv/env/b54e0339d4ce929e91168b1373f7b02b/lib/python3.12/site-packages/asv_runner/benchmarks/peakmem.py", line 66, in run
                 self.func(*param)
               File "/group/tdgs/joe/parcels-benchmarks/benchmarks/icon.py", line 63, in peakmem_pset_execute
                 self.pset_execute(npart,integrator)
               File "/group/tdgs/joe/parcels-benchmarks/benchmarks/icon.py", line 51, in pset_execute
                 fieldset = FieldSet.from_ugrid_conventions(ds)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               File "/group/tdgs/joe/parcels-benchmarks/.asv/env/b54e0339d4ce929e91168b1373f7b02b/lib/python3.12/site-packages/parcels/_core/fieldset.py", line 215, in from_ugrid_conventions
                 fields["U"] = Field("U", ds["U"], grid, _select_uxinterpolator(ds["U"]))
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               File "/group/tdgs/joe/parcels-benchmarks/.asv/env/b54e0339d4ce929e91168b1373f7b02b/lib/python3.12/site-packages/parcels/_core/field.py", line 129, in __init__
                 raise e
               File "/group/tdgs/joe/parcels-benchmarks/.asv/env/b54e0339d4ce929e91168b1373f7b02b/lib/python3.12/site-packages/parcels/_core/field.py", line 123, in __init__
                 _assert_valid_uxdataarray(data)
               File "/group/tdgs/joe/parcels-benchmarks/.asv/env/b54e0339d4ce929e91168b1373f7b02b/lib/python3.12/site-packages/parcels/_core/field.py", line 425, in _assert_valid_uxdataarray
                 raise ValueError(
             ValueError: Field is missing a 'location' attribute in the field's metadata. This attribute is required for xarray.DataArray objects.
             Error validating field 'U'.

In reviewing the parcels code, it's not clear that the location attribute really ought to be required any more. Initially, I was thinking the location metadata would be used for interpolator selection; we currently use the dimension names for a field to determine the pre-defined interpolator to use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions