Skip to content

storm/hurricane distance tagging clears unrelated refinement tags #2980

@asalmgren

Description

@asalmgren

Location

  • Source/ERF_Tagging.cpp:816-843
  • Called from Source/ERF_Tagging.cpp:349 and Source/ERF_Tagging.cpp:867

Problem

tag_on_distance_from_eye() sets every cell to either TagBox::SET or TagBox::CLEAR.

That means when storm/hurricane tracking runs, cells outside the tracking radius are forcibly cleared, including cel
ls that may already be tagged by other criteria (e.g., density, vorticity, user boxes). This breaks the expected uni
on-of-criteria behavior in AMR tagging.

Why this is a bug

Tagging from multiple criteria should be additive unless explicitly requested otherwise. Clearing in this helper int
roduces hidden criterion precedence and can drop required refinement unexpectedly.

Suggested patch

Only set tags inside the radius and do not clear outside it.

--- a/Source/ERF_Tagging.cpp
+++ b/Source/ERF_Tagging.cpp
@@
-            if (dist < rad_tag) {
-                tag_arr(i,j,k) = TagBox::SET;
-            } else {
-                tag_arr(i,j,k) = TagBox::CLEAR;
-            }
+            if (dist < rad_tag) {
+                tag_arr(i,j,k) = TagBox::SET;
+            }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions