Repository: yt-project/yt

Issue:
BUG: excessive field override warnings
<!--To help us understand and resolve your issue, please fill out the form to
the best of your ability.-->
<!--You can feel free to delete the sections that do not apply.-->

### Bug report

Getting some excessive warnings when loading at least one dataset on yt-main. 

**Code for reproduction**

```python
import yt
ds = yt.load_sample("FIRE_M12i_ref11")
ad = ds.all_data()
```
will flood the output many (100s?) lines of  warnings like:

```
yt : [WARNING  ] 2022-05-19 14:39:32,365 Field ('PartType0', 'z') already exists. To override use `force_override=True`.
yt : [WARNING  ] 2022-05-19 14:39:32,365 Field ('gas', 'ones') already exists. To override use `force_override=True`.
yt : [WARNING  ] 2022-05-19 14:39:32,365 Field ('PartType0', 'ones') already exists. To override use `force_override=True`.
yt : [WARNING  ] 2022-05-19 14:39:32,365 Field ('gas', 'velocity_magnitude') already exists. To override use `force_override=True`.
yt : [WARNING  ] 2022-05-19 14:39:32,365 Field ('PartType0', 'velocity_magnitude') already exists. To override use `force_override=True`.
yt : [WARNING  ] 2022-05-19 14:39:32,366 Field ('gas', 'specific_angular_momentum') already exists. To override use `force_override=True`.
yt : [WARNING  ] 2022-05-19 14:39:32,366 Field ('PartType0', 'specific_angular_momentum') already exists. To override use `force_override=True`.
yt : [WARNING  ] 2022-05-19 14:39:32,366 Field ('gas', 'specific_angular_momentum_x') already exists. To override use `force_override=True`.
```

Pretty sure it came from this commit:

```
commit 5b642770f0501eae4fbd233596d58c1afef21939
Merge: 58235d94a 2aa604acc
Author: Matthew Turk <matthewturk@gmail.com>
Date:   Mon May 16 14:15:12 2022 -0500
    Merge pull request #3919 from neutrinoceros/fixup_add_field
    BUG: fixup FieldInfoContainer.add_field
```
(https://github.com/yt-project/yt/pull/3919)







Discussion:
just an extra note, it does happen with at least one other dataset, `ds = yt.load_sample("snapshot_033")`. It does not happen with `IsolatedGalaxy`. 

Resolving patch:
diff --git a/yt/data_objects/static_output.py b/yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -1638,6 +1638,11 @@ def add_field(
                 "force_override is only meant to be used with "
                 "derived fields, not on-disk fields."
             )
+        if not force_override and name in self.field_info:
+            mylog.warning(
+                "Field %s already exists. To override use `force_override=True`.",
+                name,
+            )
 
         self.field_info.add_field(
             name, function, sampling_type, force_override=force_override, **kwargs
diff --git a/yt/fields/field_info_container.py b/yt/fields/field_info_container.py
--- a/yt/fields/field_info_container.py
+++ b/yt/fields/field_info_container.py
@@ -350,10 +350,6 @@ def add_field(
         """
         # Handle the case where the field has already been added.
         if not force_override and name in self:
-            mylog.warning(
-                "Field %s already exists. To override use `force_override=True`.",
-                name,
-            )
             # See below.
             if function is None:
 
diff --git a/yt/fields/local_fields.py b/yt/fields/local_fields.py
--- a/yt/fields/local_fields.py
+++ b/yt/fields/local_fields.py
@@ -19,9 +19,8 @@ def add_field(
                 ftype = "gas"
             name = (ftype, name)
 
-        override = kwargs.get("force_override", False)
         # Handle the case where the field has already been added.
-        if not override and name in self:
+        if not force_override and name in self:
             mylog.warning(
                 "Field %s already exists. To override use `force_override=True`.",
                 name,


Test patch: