From 60d9fdc2a45061bc4e1c4b452a9a2c0fbd32ca27 Mon Sep 17 00:00:00 2001 From: Jian Sun Date: Wed, 1 Nov 2023 21:32:39 -0600 Subject: [PATCH 1/2] Make gpu flags and case env vars visible to MPAS dycore --- CIME/Tools/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CIME/Tools/Makefile b/CIME/Tools/Makefile index ff8bb42ce53..aaa73cdb490 100644 --- a/CIME/Tools/Makefile +++ b/CIME/Tools/Makefile @@ -562,8 +562,10 @@ ifdef MPAS_LIBDIR # is named libmpas.a), but adding the PHONY declaration provides an extra bit of safety .PHONY: libmpas libmpas: cam_abortutils.o physconst.o - $(MAKE) -C $(MPAS_LIBDIR) CC="$(CC)" FC="$(FC)" PIODEF="$(PIODEF)" FFLAGS='$(FREEFLAGS) $(FFLAGS)' \ - FCINCLUDES='$(INCLDIR) $(INCS) -I$(ABS_INSTALL_SHAREDPATH)/include -I$(ABS_ESMF_PATH)/include' + $(MAKE) -C $(MPAS_LIBDIR) CC="$(CC)" FC="$(FC)" PIODEF="$(PIODEF)" \ + FFLAGS='$(FREEFLAGS) $(FFLAGS)' GPUFLAGS='$(GPUFLAGS)' \ + CASEROOT='$(CASEROOT)' COMPILER='$(COMPILER)' MACH='$(MACH)' \ + FCINCLUDES='$(INCLDIR) $(INCS) -I$(ABS_INSTALL_SHAREDPATH)/include -I$(ABS_ESMF_PATH)/include' dyn_comp.o: libmpas dyn_grid.o: libmpas From a9e1dc2d14dc72c3d3410da20c9018c532eb8f68 Mon Sep 17 00:00:00 2001 From: Jian Sun Date: Wed, 1 Nov 2023 21:39:20 -0600 Subject: [PATCH 2/2] Add some comments --- CIME/Tools/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CIME/Tools/Makefile b/CIME/Tools/Makefile index aaa73cdb490..c663b1edf26 100644 --- a/CIME/Tools/Makefile +++ b/CIME/Tools/Makefile @@ -561,6 +561,10 @@ ifdef MPAS_LIBDIR # this isn't necessary, since libmpas should never be an actual file (the library that is created # is named libmpas.a), but adding the PHONY declaration provides an extra bit of safety .PHONY: libmpas +# The CASEROOT, COMPILER and MACH are added so that the Depends file could be visible to +# the MPAS dycore. +# The GPUFLAGS is added so that the GPU flags defined in ccs_config_cesm could also be +# used to build the MPAS dycore if needed. libmpas: cam_abortutils.o physconst.o $(MAKE) -C $(MPAS_LIBDIR) CC="$(CC)" FC="$(FC)" PIODEF="$(PIODEF)" \ FFLAGS='$(FREEFLAGS) $(FFLAGS)' GPUFLAGS='$(GPUFLAGS)' \