From 25f3252ddce51f1775ea24766eed1bf0881fda3d Mon Sep 17 00:00:00 2001 From: Erica Neininger Date: Thu, 1 Oct 2026 15:18:39 +0100 Subject: [PATCH 1/3] Add OMP directive keywords --- lfric_styling/.github/agents/CopilotAgents.agent.md | 0 lfric_styling/lfric_styling.py | 5 +++-- lfric_styling/styling_keywords.py | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 lfric_styling/.github/agents/CopilotAgents.agent.md diff --git a/lfric_styling/.github/agents/CopilotAgents.agent.md b/lfric_styling/.github/agents/CopilotAgents.agent.md new file mode 100644 index 00000000..e69de29b diff --git a/lfric_styling/lfric_styling.py b/lfric_styling/lfric_styling.py index 8573dc76..7ad51182 100755 --- a/lfric_styling/lfric_styling.py +++ b/lfric_styling/lfric_styling.py @@ -30,9 +30,10 @@ def lowercase_keywords(file): with open(file, "r") as fp: lines = fp.read() for keyword in NEW_KEYWORDS: - # regex to check if a keyword is preceded with a '!' symbol + # regex to check if a keyword is preceded with a '!' symbol, + # unless the comment is an OpenMP directive starting with '!$OMP', # or if it matches a keyword and group each. - pattern = rf"((?:(?<=!)).*|(\b{re.escape(keyword.upper())}\b))" + pattern = rf"((?:(?<=!)(?!\$OMP)).*|(\b{re.escape(keyword.upper())}\b))" lines = re.sub(pattern, convert_to_lower, lines, flags=re.MULTILINE) with open(file, "w") as fp: diff --git a/lfric_styling/styling_keywords.py b/lfric_styling/styling_keywords.py index 3fbc4e3b..6311ec60 100644 --- a/lfric_styling/styling_keywords.py +++ b/lfric_styling/styling_keywords.py @@ -3,7 +3,7 @@ # For further details please refer to the file LICENSE # which you should have received as part of this distribution. # Created date: 10/03/2025 -# Modified date: 14/03/2025 +# Modified date: 30/09/2025 # *****************************COPYRIGHT******************************* """ @@ -224,6 +224,7 @@ "ddim", "deallocate", "decode", + "default", "deferred", "delim", "derf", @@ -488,12 +489,14 @@ "nextrec", "nint", "nml", + "no wait", "none", "non_intrinsic", "non_overridable", "nopass", "norm2", "not", + "nowait", "null", "nullify", "number", @@ -511,6 +514,7 @@ "pad", "parameter", "parity", + "parallel", "pass", "perror", "pointer", @@ -587,6 +591,7 @@ "save", "scale", "scan", + "schedule", "secnds", "second", "select", @@ -616,6 +621,7 @@ "sqrt", "srand", "stat", + "static", "status", "stat_failed_image", "stat_locked", From 5e61996e54190965deccacfe5f5e0a469fcb24de Mon Sep 17 00:00:00 2001 From: Erica Neininger Date: Thu, 1 Oct 2026 15:31:02 +0100 Subject: [PATCH 2/3] Add shared and dynamic keywords --- lfric_styling/styling_keywords.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lfric_styling/styling_keywords.py b/lfric_styling/styling_keywords.py index 6311ec60..8427b3f1 100644 --- a/lfric_styling/styling_keywords.py +++ b/lfric_styling/styling_keywords.py @@ -259,6 +259,7 @@ "dtan", "dtanh", "dtime", + "dynamic", "elemental", "else", "encode", @@ -602,6 +603,7 @@ "sequential", "set_exponent", "shape", + "shared", "shifta", "shiftl", "shiftr", From d59e8ed396fc41af6139ffadec3620c17ac454e7 Mon Sep 17 00:00:00 2001 From: Erica Neininger Date: Thu, 1 Oct 2026 15:46:38 +0100 Subject: [PATCH 3/3] Remove github directory --- lfric_styling/.github/agents/CopilotAgents.agent.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lfric_styling/.github/agents/CopilotAgents.agent.md diff --git a/lfric_styling/.github/agents/CopilotAgents.agent.md b/lfric_styling/.github/agents/CopilotAgents.agent.md deleted file mode 100644 index e69de29b..00000000