forked from ESCOMP/CAM-SIMA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0002-Disable-physics-for-MPAS-dycore-only-build.patch
42 lines (35 loc) · 1.42 KB
/
0002-Disable-physics-for-MPAS-dycore-only-build.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kuan-Chih Wang <kuanchihw@ucar.edu>
Date: Thu, 1 Aug 2024 17:09:58 -0600
Subject: [PATCH] Disable physics for MPAS dycore-only build
When building MPAS as a dycore, all physics-related components are disabled.
This build configuration is usually used by CAM/CAM-SIMA, and can be achieved by
defining the `MPAS_CAM_DYCORE` macro in `CPPFLAGS`.
The `PHYSICS` variable controls whether physics are enabled in MPAS, but its logic
is decoupled from the `MPAS_CAM_DYCORE` macro. Disabling physics in MPAS currently
requires manual interventions.
Therefore, automatically disable physics when the `MPAS_CAM_DYCORE` macro is found
in `CPPFLAGS`.
This downstream patch is maintained by CAM-SIMA for its particular use case of MPAS.
---
src/core_atmosphere/Makefile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/core_atmosphere/Makefile b/src/core_atmosphere/Makefile
index 8d9f4f1a..cac8255e 100644
--- a/src/core_atmosphere/Makefile
+++ b/src/core_atmosphere/Makefile
@@ -4,8 +4,11 @@
# To build a dycore-only MPAS-Atmosphere model, comment-out or delete
# the definition of PHYSICS, below
#
-PHYSICS=-DDO_PHYSICS
-
+# If MPAS_CAM_DYCORE is found in CPPFLAGS, PHYSICS will become undefined automatically
+#
+ifeq ($(findstring MPAS_CAM_DYCORE,$(CPPFLAGS)),)
+ PHYSICS = -DDO_PHYSICS
+endif
ifdef PHYSICS
PHYSCORE = physcore
--
2.43.0