From 6f687eaa0414ea9f8a4cbb04125db09176bb8fce Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Fri, 12 Sep 2025 12:36:21 -0600 Subject: [PATCH 01/40] Add changes to MPAS-Model code necessary to run stochastic physics. The stochastic_physics submodule itself will be added in a separate commit. --- src/Makefile | 3 ++- src/core_atmosphere/Makefile | 10 +++++++--- src/core_atmosphere/Registry.xml | 6 ++++++ src/core_atmosphere/dynamics/Makefile | 3 ++- .../dynamics/mpas_atm_time_integration.F | 16 ++++++++++++++++ src/core_atmosphere/mpas_atm_core.F | 6 ++++++ 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index b9c037c8cc..88947030fa 100644 --- a/src/Makefile +++ b/src/Makefile @@ -9,7 +9,8 @@ else all: mpas mpas: $(AUTOCLEAN_DEPS) externals frame ops dycore drver - $(LINKER) $(LDFLAGS) -o $(EXE_NAME) driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time +# $(LINKER) $(LDFLAGS) -o $(EXE_NAME) driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time + $(LINKER) $(LDFLAGS) -o $(EXE_NAME) driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f91 -L./external/esmf_time_f90 -lesmf_time -lmkl_intel_lp64 -lmkl_core -lmkl_sequential externals: $(AUTOCLEAN_DEPS) ( cd external; $(MAKE) FC="$(FC)" SFC="$(SFC)" CC="$(CC)" SCC="$(SCC)" FFLAGS="$(FFLAGS)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" NETCDF="$(NETCDF)" CORE="$(CORE)" all ) diff --git a/src/core_atmosphere/Makefile b/src/core_atmosphere/Makefile index 966027bc77..7116f46449 100644 --- a/src/core_atmosphere/Makefile +++ b/src/core_atmosphere/Makefile @@ -42,7 +42,8 @@ post_build: physcore: mpas_atm_dimensions.o ( cd physics; $(MAKE) all ) - ( mkdir libphys; cd libphys; ar -x ../physics/libphys.a ) + ( cd stochastic_physics; $(MAKE) -f Makefile all ) + ( mkdir libphys; cd libphys; ar -x ../physics/libphys.a; ar -x ../stochastic_physics/libstochphys.a ) ( cd ../..; ln -sf ./src/core_atmosphere/physics/physics_wrf/files/*TBL .) ( cd ../..; ln -sf ./src/core_atmosphere/physics/physics_wrf/files/*DATA* .) ( cd ../..; ln -sf ./src/core_atmosphere/physics/physics_noahmp/parameters/*TBL .) @@ -68,6 +69,7 @@ mpas_atm_dimensions.o: clean: ( cd physics; $(MAKE) clean ) ( cd dynamics; $(MAKE) clean ) + ( cd stochastic_physics; $(MAKE) clean ) ( cd diagnostics; $(MAKE) clean ) ( cd utils; $(MAKE) clean ) ( cd ../..; rm -f *TBL ) @@ -84,7 +86,9 @@ clean: $(RM) $@ $*.mod ifeq "$(GEN_F90)" "true" $(CPP) $(CPPFLAGS) $(PHYSICS) $(CPPINCLUDES) -I./inc $< > $*.f90 - $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I../external/esmf_time_f90 +# $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I../external/esmf_time_f90 + $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I./stochastic_physics -I../external/esmf_time_f90 else - $(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./inc -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I../external/esmf_time_f90 +# $(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./inc -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I../external/esmf_time_f90 + $(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./inc -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I./stochastic_physics -I../external/esmf_time_f90 endif diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 1e867129f3..b15a61261f 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -32,6 +32,10 @@ description="The number of atmospheric layers"/> + + #ifdef DO_PHYSICS + + diff --git a/src/core_atmosphere/dynamics/Makefile b/src/core_atmosphere/dynamics/Makefile index 6892633c68..bb7d95a6ed 100644 --- a/src/core_atmosphere/dynamics/Makefile +++ b/src/core_atmosphere/dynamics/Makefile @@ -22,5 +22,6 @@ ifeq "$(GEN_F90)" "true" $(CPP) $(CPPFLAGS) $(PHYSICS) $(CPPINCLUDES) $< > $*.f90 $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I.. -I../../framework -I../../operators -I../physics -I../physics/physics_wrf -I../physics/physics_mmm -I../../external/esmf_time_f90 else - $(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I.. -I../../framework -I../../operators -I../physics -I../physics/physics_wrf -I../physics/physics_mmm -I../../external/esmf_time_f90 +# $(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I.. -I../../framework -I../../operators -I../physics -I../physics/physics_wrf -I../physics/physics_mmm -I../../external/esmf_time_f90 + $(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I.. -I../../framework -I../../operators -I../physics -I../physics/physics_wrf -I../physics/physics_mmm -I../stochastic_physics -I../../external/esmf_time_f90 endif diff --git a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F index 0601020cde..4d3588e296 100644 --- a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F +++ b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F @@ -31,6 +31,7 @@ module atm_time_integration use mpas_atmphys_driver_microphysics use mpas_atmphys_todynamics use mpas_atmphys_utilities + use mpas_stochastic_physics, only : stochastic_physics_pattern_apply #endif use mpas_atm_boundaries, only : nSpecZone, nRelaxZone, nBdyZone, mpas_atm_get_bdy_state, mpas_atm_get_bdy_tend ! regional_MPAS addition @@ -880,6 +881,8 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group) #endif real (kind=RKIND) :: time_dyn_step + character(len=32) :: tend_names(4) + integer :: ierr logical, parameter :: debug = .false. @@ -1077,11 +1080,24 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group) call mpas_timer_start('physics_get_tend') rk_step = 1 dynamics_substep = 1 + +! apply random perturbation pattern to the tendency + tend_names(1) = "rucuten" + tend_names(2) = "rvcuten" + tend_names(3) = "rublten" + tend_names(4) = "rvblten" + call stochastic_physics_pattern_apply(domain, 4, tend_names, ierr) + call physics_get_tend( block, mesh, state, diag, tend, tend_physics, & block % configs, rk_step, dynamics_substep, & tend_ru_physics, tend_rtheta_physics, tend_rho_physics, & exchange_halo_group ) call mpas_timer_stop('physics_get_tend') + +! apply random perturbation pattern to the tendency + tend_names(1) = "tend_rtheta_physics" +! tend_names(2) = "tend_rho_physics" + call stochastic_physics_pattern_apply(domain, 1, tend_names, ierr) #else #ifndef MPAS_CAM_DYCORE ! diff --git a/src/core_atmosphere/mpas_atm_core.F b/src/core_atmosphere/mpas_atm_core.F index a490c807d5..682cc8a752 100644 --- a/src/core_atmosphere/mpas_atm_core.F +++ b/src/core_atmosphere/mpas_atm_core.F @@ -48,6 +48,7 @@ function atm_core_init(domain, startTimeStamp) result(ierr) use mpas_attlist, only : mpas_modify_att use mpas_string_utils, only : mpas_string_replace use mpas_atm_halos, only: atm_build_halo_groups, exchange_halo_group + use mpas_stochastic_physics, only : stochastic_physics_pattern_init implicit none @@ -301,6 +302,9 @@ function atm_core_init(domain, startTimeStamp) result(ierr) ! Prepare the dynamics for integration ! call mpas_atm_dynamics_init(domain) + ! + ! init stochastic pattern generation + call stochastic_physics_pattern_init (domain, ierr) end function atm_core_init @@ -1013,6 +1017,7 @@ subroutine atm_do_timestep(domain, dt, itimestep) use mpas_atmphys_update #endif use mpas_atm_halos, only: exchange_halo_group + use mpas_stochastic_physics, only : stochastic_physics_pattern_adv implicit none @@ -1045,6 +1050,7 @@ subroutine atm_do_timestep(domain, dt, itimestep) endif #endif + call stochastic_physics_pattern_adv(domain, itimestep, ierr) call atm_timestep(domain, dt, currTime, itimestep, exchange_halo_group) end subroutine atm_do_timestep From bb262cd24ca7365eab4534b0d7ee5714c041546c Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Fri, 12 Sep 2025 12:53:03 -0600 Subject: [PATCH 02/40] Add stochastic physics as a submodule. --- .gitmodules | 3 +++ src/core_atmosphere/stochastic_physics | 1 + 2 files changed, 4 insertions(+) create mode 160000 src/core_atmosphere/stochastic_physics diff --git a/.gitmodules b/.gitmodules index 2a5c453488..1b90c4c28b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "src/core_atmosphere/physics/physics_noaa/GFL"] path = src/core_atmosphere/physics/physics_noaa/GFL url = https://github.com/NOAA-GSL/GFL.git +[submodule "src/core_atmosphere/stochastic_physics"] + path = src/core_atmosphere/stochastic_physics + url = https://github.com/dtcenter/stochastic_physics.git diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics new file mode 160000 index 0000000000..fad2fe9f42 --- /dev/null +++ b/src/core_atmosphere/stochastic_physics @@ -0,0 +1 @@ +Subproject commit fad2fe9f42f6b7f744b128b4a2a9433f91e4296f From e5bde4d84849baff01961f907cd7b981a3c4ec86 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Tue, 16 Sep 2025 11:49:37 -0600 Subject: [PATCH 03/40] Bug fix: Add missing lines for stochastic physics to Registry.xml. --- src/core_atmosphere/Registry.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index b15a61261f..429bc41497 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -4214,6 +4214,11 @@ description="Total cell-centered meridional wind tendency from physics" persistence="scratch" /> + + + #ifdef DO_PHYSICS @@ -4722,5 +4727,6 @@ #ifdef DO_PHYSICS #include "physics/Registry_noahmp.xml" +#include "stochastic_physics/Registry_stoch_physics.xml" #endif From 293e081a917bb0ee74973574af3dcf192ebac344 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Tue, 16 Sep 2025 11:51:52 -0600 Subject: [PATCH 04/40] Change hash of stochastic_physics. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index fad2fe9f42..4cbae6bdff 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit fad2fe9f42f6b7f744b128b4a2a9433f91e4296f +Subproject commit 4cbae6bdff80a8ce23e6f80375b7954da4490699 From cee787ed7e0ba85300d04f3b2f7d9bb690f1c6aa Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Fri, 14 Nov 2025 17:09:56 -0700 Subject: [PATCH 05/40] Update hashes of GFL and MYNN-EDMF submodules. Not sure why this wasn't updated during latest merge of gsl/develop. --- src/core_atmosphere/physics/physics_noaa/GFL | 2 +- src/core_atmosphere/physics/physics_noaa/MYNN-EDMF | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core_atmosphere/physics/physics_noaa/GFL b/src/core_atmosphere/physics/physics_noaa/GFL index bb85663877..9f55b90145 160000 --- a/src/core_atmosphere/physics/physics_noaa/GFL +++ b/src/core_atmosphere/physics/physics_noaa/GFL @@ -1 +1 @@ -Subproject commit bb8566387728d1e1e1e15e82d9837d75997557ec +Subproject commit 9f55b9014506619083b6b8ccacb26bceafbacad6 diff --git a/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF b/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF index c1ba7d97e1..7c14493e29 160000 --- a/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF +++ b/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF @@ -1 +1 @@ -Subproject commit c1ba7d97e1553519c82b11ca9fbca91ead21a9c9 +Subproject commit 7c14493e294c18f0318dd859b6fe328439cc7e3b From c93caca873073d3be1f7107fc75e2426ecd03f4d Mon Sep 17 00:00:00 2001 From: ning wang Date: Mon, 24 Nov 2025 10:26:53 -0700 Subject: [PATCH 06/40] A new version of SPPT merged into the latest gsl/MPAS_stoch_physics. --- .../dynamics/mpas_atm_time_integration.F | 10 +++++++--- src/core_atmosphere/mpas_atm_core.F | 12 ++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F index 4d3588e296..d49d58d1ea 100644 --- a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F +++ b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F @@ -31,7 +31,7 @@ module atm_time_integration use mpas_atmphys_driver_microphysics use mpas_atmphys_todynamics use mpas_atmphys_utilities - use mpas_stochastic_physics, only : stochastic_physics_pattern_apply + use mpas_stochastic_physics, only : stochastic_physics_pattern_apply, dosppt #endif use mpas_atm_boundaries, only : nSpecZone, nRelaxZone, nBdyZone, mpas_atm_get_bdy_state, mpas_atm_get_bdy_tend ! regional_MPAS addition @@ -1086,7 +1086,9 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group) tend_names(2) = "rvcuten" tend_names(3) = "rublten" tend_names(4) = "rvblten" - call stochastic_physics_pattern_apply(domain, 4, tend_names, ierr) + if (dosppt(domain)) then + call stochastic_physics_pattern_apply(domain, 4, tend_names, ierr) + endif call physics_get_tend( block, mesh, state, diag, tend, tend_physics, & block % configs, rk_step, dynamics_substep, & @@ -1097,7 +1099,9 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group) ! apply random perturbation pattern to the tendency tend_names(1) = "tend_rtheta_physics" ! tend_names(2) = "tend_rho_physics" - call stochastic_physics_pattern_apply(domain, 1, tend_names, ierr) + if (dosppt(domain)) then + call stochastic_physics_pattern_apply(domain, 1, tend_names, ierr) + endif #else #ifndef MPAS_CAM_DYCORE ! diff --git a/src/core_atmosphere/mpas_atm_core.F b/src/core_atmosphere/mpas_atm_core.F index 13ae398deb..7420c9767e 100644 --- a/src/core_atmosphere/mpas_atm_core.F +++ b/src/core_atmosphere/mpas_atm_core.F @@ -48,7 +48,7 @@ function atm_core_init(domain, startTimeStamp) result(ierr) use mpas_attlist, only : mpas_modify_att use mpas_string_utils, only : mpas_string_replace use mpas_atm_halos, only: atm_build_halo_groups, exchange_halo_group - use mpas_stochastic_physics, only : stochastic_physics_pattern_init + use mpas_stochastic_physics, only : stochastic_physics_pattern_init, dosppt implicit none @@ -304,7 +304,9 @@ function atm_core_init(domain, startTimeStamp) result(ierr) call mpas_atm_dynamics_init(domain) ! ! init stochastic pattern generation - call stochastic_physics_pattern_init (domain, ierr) + if (dosppt(domain)) then + call stochastic_physics_pattern_init (domain, ierr) + endif end function atm_core_init @@ -1019,7 +1021,7 @@ subroutine atm_do_timestep(domain, dt, itimestep) use mpas_atmphys_update #endif use mpas_atm_halos, only: exchange_halo_group - use mpas_stochastic_physics, only : stochastic_physics_pattern_adv + use mpas_stochastic_physics, only : stochastic_physics_pattern_adv, dosppt implicit none @@ -1052,7 +1054,9 @@ subroutine atm_do_timestep(domain, dt, itimestep) endif #endif - call stochastic_physics_pattern_adv(domain, itimestep, ierr) + if (dosppt(domain)) then + call stochastic_physics_pattern_adv(domain, itimestep, ierr) + endif call atm_timestep(domain, dt, currTime, itimestep, exchange_halo_group) end subroutine atm_do_timestep From 845ff87d76dd44e984999481157c64a6e7baad1c Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Thu, 18 Dec 2025 17:03:47 -0700 Subject: [PATCH 07/40] Update hash of stochastic_physics submodule to point to the head of the gsl/MPAS_stoch_physics in the stochastic_physics repo. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index 4cbae6bdff..0b8abcd291 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit 4cbae6bdff80a8ce23e6f80375b7954da4490699 +Subproject commit 0b8abcd291644d670280e72b63e765fdbfef06b5 From 995a0cfc19a37095f6c5ff8fbafee5ebbb295e02 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Mon, 2 Feb 2026 13:27:36 -0700 Subject: [PATCH 08/40] Update hash of stochastic_physics to the hash from Ning for 8-byte integer seed workaround. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index 0b8abcd291..0fa4f15ea6 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit 0b8abcd291644d670280e72b63e765fdbfef06b5 +Subproject commit 0fa4f15ea67e87c1ae248e4197cd1b6f0f30dbe5 From 5cf356a6cd95405ad5dc71a4e67ec9467ece19be Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Wed, 4 Feb 2026 16:36:24 -0700 Subject: [PATCH 09/40] Change name of and file for output stream for chemistry (and dust and smoke) from "output" to "output_smoke" (and file from "history..." to "history_smoke...". This is necessary because the stream name "output" is already taken by the main output stream, and having the same name for two different output streams apparently causes SMIOL I/O errors during the forecast (and incorrect/corrupted history*.nc files). --- src/core_atmosphere/physics/registry.chemistry.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core_atmosphere/physics/registry.chemistry.xml b/src/core_atmosphere/physics/registry.chemistry.xml index 92581393a4..4ce4f2c1f2 100644 --- a/src/core_atmosphere/physics/registry.chemistry.xml +++ b/src/core_atmosphere/physics/registry.chemistry.xml @@ -171,9 +171,9 @@ - From d63788d6d97f0fef2ba9254c62c22dcc5d803d91 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Wed, 25 Feb 2026 02:12:28 -0700 Subject: [PATCH 10/40] Modifications to Makefile to make sure that after make is invoked, (1) no stale stream_list.atmosphere files exist in the two default_inputs directories (one under core_atmosphere and the other immediately under the MPAS-Model top-level directory), and (2) for the atmosphere core, all files (stream-related as well as namelist) in the top-level directory are backed up before new such files are copied from the default_inputs directory back up a level into the top-level directory. Previously, existing (and thus possibly outdated) stream_list.atmosphere.* files in the top-level directory were not being replaced by newer ones in default_inputs, and that was causing unexpected (and wrong) behavior. Probably a similar fix is needed for the init_atmsophere core and maybe even other ones. --- src/core_atmosphere/Makefile | 82 +++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/src/core_atmosphere/Makefile b/src/core_atmosphere/Makefile index 966027bc77..eebad79d3d 100644 --- a/src/core_atmosphere/Makefile +++ b/src/core_atmosphere/Makefile @@ -28,6 +28,13 @@ core_reg: core_input_gen: if [ ! -e default_inputs ]; then mkdir default_inputs; fi + @# Since both the streams.atmosphere file and new stream_list.atmoshpere + @# files are regenerated on every make invocation, delete all such existing + @# files in default_inputs in order ensure that any stale stream_list.atmosphere. + @# files are removed. Removal of streams.atmosphere is not necessary since + @# it will always be overwritten, but we do so to maintain the same behavior + @# for all stream-related files. + rm -f default_inputs/streams.atmosphere default_inputs/stream_list.atmosphere.* ( cd default_inputs; $(NL_GEN) ../Registry_processed.xml namelist.atmosphere in_defaults=true ) ( cd default_inputs; $(ST_GEN) ../Registry_processed.xml streams.atmosphere stream_list.atmosphere. listed in_defaults=true) @@ -36,9 +43,82 @@ gen_includes: core_reg (cd inc; $(REG_PARSE) ../Registry_processed.xml $(CPPFLAGS) ) post_build: + @# + @# In the following line, ROOT_DIR is the path to the top-level MPAS-Model + @# directory. This if-statement creates a default_inputs directory under + @# this root directory if it doesn't already exist, e.g. + @# + @# /path/to/my/MPAS-Model/default_inputs + @# + @# Call this the "main" default_inputs directory. + @# if [ ! -e $(ROOT_DIR)/default_inputs ]; then mkdir $(ROOT_DIR)/default_inputs; fi + @# + @# Remove streams.atmosphere and any stream_list.atmosphere. files from + @# ROOT_DIR/default_inputs before copying into this directory the newly- + @# generated files from the current core's default_inputs directory. This + @# ensures that stale streams.atmosphere files from previous make invocations + @# are removed from ROOT_DIR/default_inputs. + @# + rm -f $(ROOT_DIR)/default_inputs/streams.$(CORE) $(ROOT_DIR)/default_inputs/stream_list.$(CORE).* + @# + @# The following line copies everything from the default_inputs subidirectory + @# under the current core's source directory into the main default_inputs + @# directory. Since there is a Makefile like this under each core, we call + @# the former the (current) core's default_inputs directory. For example, if + @# this Makefile is for the atmosphere core, it will be located under + @# + @# /path/to/my/MPAS-Model/src/core_atmosphere + @# + @# Then the following command will copy everything from + @# + @# /path/to/my/MPAS-Model/src/core_atmosphere/default_inputs + @# + @# into + @# + @# /path/to/my/MPAS-Model/default_inputs + @# + @# Note that the core's default_inputs directory is guaranteed to not + @# contain any stale stream_list.atmosphere. files from previous make + @# invocations (see the rm command in the core_input_gen target). + @# cp default_inputs/* $(ROOT_DIR)/default_inputs/. - ( cd $(ROOT_DIR)/default_inputs; for FILE in `ls -1`; do if [ ! -e ../$$FILE ]; then cp $$FILE ../.; fi; done ) + @# + @################################################################ + @# The following line will copy each file in the main default_inputs + @# directory one level up into the top-level MPAS-Model directory, i.e. + @# ROOT_DIR, but ONLY IF that file doesn't already exist in ROOT_DIR. + @# + @# CAUTION: + @# If files from an old build are already present in ROOT_DIR and a + @# new build causes them to be updated in ROOT_DIR/default_inputs, + @# the following line WILL NOT update those files in ROOT_DIR. + @# + @# This seems to be intentional behavior, but it's not clear why. + @# + @#( cd $(ROOT_DIR)/default_inputs; for FILE in `ls -1`; do if [ ! -e ../$$FILE ]; then cp $$FILE ../.; fi; done ) + @# + @################################################################ + @# + @# Update line so it ALWAYS copies over all files from ROOT_DIR/default_inputs + @# into ROOT_DIR. + @# + @#( cd $(ROOT_DIR)/default_inputs; for FILE in `ls -1`; do cp $$FILE ../.; done ) + @# + @################################################################ + @# + @# Even better is to make backups of any existing files in ROOT_DIR + @# (by renaming them as .old001, .old002, etc) and then copying the + @# file in ROOT_DIR/default_inputs over to ROOT_DIR. + @# + ( cd $(ROOT_DIR)/default_inputs; for FILE in `ls -1`; do \ + if [ -e ../$$FILE ]; then \ + N=1; \ + while [ -e "../$$FILE.old$$(printf '%03d' $$N)" ]; do N=$$((N+1)); done; \ + mv "../$$FILE" "../$$FILE.old$$(printf '%03d' $$N)"; \ + fi; \ + cp $$FILE ../.; \ + done ) physcore: mpas_atm_dimensions.o ( cd physics; $(MAKE) all ) From cea828b9c53cd3b76b32c069b449807cd4500459 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Wed, 25 Feb 2026 02:19:05 -0700 Subject: [PATCH 11/40] Change the name of the output stream in registry.chemistry.xml (as well as its output file) so it doesn't conflict with the default output stream. --- src/core_atmosphere/physics/registry.chemistry.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core_atmosphere/physics/registry.chemistry.xml b/src/core_atmosphere/physics/registry.chemistry.xml index 92581393a4..4ce4f2c1f2 100644 --- a/src/core_atmosphere/physics/registry.chemistry.xml +++ b/src/core_atmosphere/physics/registry.chemistry.xml @@ -171,9 +171,9 @@ - From 8428af88227c2b8e4649bedb51d2997c34a768ee Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Wed, 11 Mar 2026 13:16:01 -0600 Subject: [PATCH 12/40] Switch hash of stochastic_physics to branch in which the merge with stochastic_physics's master branh will gradually happen. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index 4cbae6bdff..4e0f56160f 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit 4cbae6bdff80a8ce23e6f80375b7954da4490699 +Subproject commit 4e0f56160f0794eca34e993c208b9a89eccd3cc1 From f8fea43c497ed7fce7493a00962670d7a5b1219c Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Wed, 11 Mar 2026 16:50:55 -0600 Subject: [PATCH 13/40] Fix hash of stochastic_physics. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index 0fa4f15ea6..4e0f56160f 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit 0fa4f15ea67e87c1ae248e4197cd1b6f0f30dbe5 +Subproject commit 4e0f56160f0794eca34e993c208b9a89eccd3cc1 From 40603530e71a5443118a604d18b11cd53ff7eced Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Sat, 14 Mar 2026 12:30:42 -0600 Subject: [PATCH 14/40] In the top-level Makefile, add a flag to CPPFLAGS that will let the stochastic_physics code know that the dycore being used is MPAS. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 9b12a88df6..0eedb9704b 100644 --- a/Makefile +++ b/Makefile @@ -1583,6 +1583,10 @@ IO_MESSAGE = "Using the SMIOL library." override CPPFLAGS += "-DMPAS_SMIOL_SUPPORT" endif +# Add flag to CPPFLAGS that will let the stochastic_physics code know that +# the dycore being used is MPAS. +override CPPFLAGS += "-DMPAS_STOCH" + mpas_main: $(MAIN_DEPS) cd src; $(MAKE) FC="$(FC)" \ CC="$(CC)" \ From 9bdd0deb794321d98b92d3b9872d939695effcb9 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Sat, 14 Mar 2026 12:32:15 -0600 Subject: [PATCH 15/40] Update hash of stochastic_physics. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index 4e0f56160f..1ba37570b1 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit 4e0f56160f0794eca34e993c208b9a89eccd3cc1 +Subproject commit 1ba37570b1147342486786e8adcb0b4285ce4714 From 57f2ccf5e7d13a5a03ee8a2bd8ac9ee93337a59a Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Sat, 14 Mar 2026 13:37:21 -0600 Subject: [PATCH 16/40] Update hash of stochastic_physics. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index 1ba37570b1..dbd7393af4 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit 1ba37570b1147342486786e8adcb0b4285ce4714 +Subproject commit dbd7393af41944bb110ddfbad00132fbb993a357 From 6f5de0ae2be8357778d34b77114b44ed23c19e56 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Tue, 24 Mar 2026 13:24:59 -0600 Subject: [PATCH 17/40] Remove definition of macro MPAS_STOCH from main MPAS Makefile. This will instead be defined in the Makefile for stochastic_physics only (in a separate commit into the stochastic_physics repo) since it is only needed by the stochastic_physics submodule. --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0eedb9704b..bdccb05d1e 100644 --- a/Makefile +++ b/Makefile @@ -1583,9 +1583,9 @@ IO_MESSAGE = "Using the SMIOL library." override CPPFLAGS += "-DMPAS_SMIOL_SUPPORT" endif -# Add flag to CPPFLAGS that will let the stochastic_physics code know that -# the dycore being used is MPAS. -override CPPFLAGS += "-DMPAS_STOCH" +## Add flag to CPPFLAGS that will let the stochastic_physics code know that +## the dycore being used is MPAS. +#override CPPFLAGS += "-DMPAS_STOCH" mpas_main: $(MAIN_DEPS) cd src; $(MAKE) FC="$(FC)" \ From 662e9c272af81222062af9ec08945705b055bac2 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Tue, 24 Mar 2026 13:28:01 -0600 Subject: [PATCH 18/40] Update hash of stochastic_physics. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index dbd7393af4..a92756d4cb 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit dbd7393af41944bb110ddfbad00132fbb993a357 +Subproject commit a92756d4cba920f1d444ea4ffe0754c8882c1b44 From b4c22a18e89a1904e9783dfc37364e5aa4d9512e Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Tue, 24 Mar 2026 17:25:23 -0600 Subject: [PATCH 19/40] Remove commented-out lines in Makefile that refer to MPAS_STOCH (since that is now added in the Makefile in stochastic_physics). --- Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile b/Makefile index bdccb05d1e..9b12a88df6 100644 --- a/Makefile +++ b/Makefile @@ -1583,10 +1583,6 @@ IO_MESSAGE = "Using the SMIOL library." override CPPFLAGS += "-DMPAS_SMIOL_SUPPORT" endif -## Add flag to CPPFLAGS that will let the stochastic_physics code know that -## the dycore being used is MPAS. -#override CPPFLAGS += "-DMPAS_STOCH" - mpas_main: $(MAIN_DEPS) cd src; $(MAKE) FC="$(FC)" \ CC="$(CC)" \ From d2708cf8df3cc4955b4bb7dde307060e3f343756 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Tue, 24 Mar 2026 17:35:59 -0600 Subject: [PATCH 20/40] Update hash of stochastic_physics. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index a92756d4cb..15f9e24633 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit a92756d4cba920f1d444ea4ffe0754c8882c1b44 +Subproject commit 15f9e24633b3ca5622ee199da3c719fe28e031f1 From ec08395b294a51436e00382a65bc517bb91a3518 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Fri, 27 Mar 2026 12:41:46 -0600 Subject: [PATCH 21/40] Update hash of stochastic_physics. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index 15f9e24633..60a0c171c0 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit 15f9e24633b3ca5622ee199da3c719fe28e031f1 +Subproject commit 60a0c171c03ec886a462a611924ae6e92844ac45 From a11e46faf7f4cf8cfb375aa369ef67442c1e9ba9 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Sat, 28 Mar 2026 21:09:22 -0600 Subject: [PATCH 22/40] Add lines to physics Makefile to also build the executable that builds the TEMPO tables. --- src/core_atmosphere/physics/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core_atmosphere/physics/Makefile b/src/core_atmosphere/physics/Makefile index dfe7ea1e8c..f3e1dd8dd6 100644 --- a/src/core_atmosphere/physics/Makefile +++ b/src/core_atmosphere/physics/Makefile @@ -66,6 +66,7 @@ core_physics_mmm: core_physics_init core_microphysics: core_physics_init core_physics_mmm (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas) + (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.intel run_build_tables ; cp run_build_tables ../../../../../) core_SMOKE: core_physics_init (cd physics_noaa/SMOKE; cp ./MPAS/Makefile .; cp ./MPAS/mpas_smoke_wrapper.F90 .; $(MAKE) all) @@ -290,6 +291,7 @@ clean: ( cd physics_noahmp/src; $(MAKE) clean ) ( cd physics_noahmp/utility; $(MAKE) clean ) ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas clean; fi ) + ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.intel clean; fi ) ( if [ -d physics_noaa/UGWP ]; then cd physics_noaa/UGWP; $(MAKE) clean; fi ) ( if [ -d physics_noaa/RUCLSM ]; then cd physics_noaa/RUCLSM; $(MAKE) -f MPAS/Makefile clean; fi ) ( if [ -d physics_noaa/MYNN-EDMF ]; then cd physics_noaa/MYNN-EDMF; cp ./MPAS/Makefile .; $(MAKE) clean; fi ) From d5a21078fe393b20293ae1dab7a4a1b8ba46fd69 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Mon, 30 Mar 2026 09:13:10 -0600 Subject: [PATCH 23/40] Remove commented-out lines in Makefiles. --- src/Makefile | 1 - src/core_atmosphere/Makefile | 2 -- src/core_atmosphere/dynamics/Makefile | 1 - 3 files changed, 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 88947030fa..305047d837 100644 --- a/src/Makefile +++ b/src/Makefile @@ -9,7 +9,6 @@ else all: mpas mpas: $(AUTOCLEAN_DEPS) externals frame ops dycore drver -# $(LINKER) $(LDFLAGS) -o $(EXE_NAME) driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time $(LINKER) $(LDFLAGS) -o $(EXE_NAME) driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f91 -L./external/esmf_time_f90 -lesmf_time -lmkl_intel_lp64 -lmkl_core -lmkl_sequential externals: $(AUTOCLEAN_DEPS) diff --git a/src/core_atmosphere/Makefile b/src/core_atmosphere/Makefile index 433b9b1362..0508ad1504 100644 --- a/src/core_atmosphere/Makefile +++ b/src/core_atmosphere/Makefile @@ -166,9 +166,7 @@ clean: $(RM) $@ $*.mod ifeq "$(GEN_F90)" "true" $(CPP) $(CPPFLAGS) $(PHYSICS) $(CPPINCLUDES) -I./inc $< > $*.f90 -# $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I../external/esmf_time_f90 $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I./stochastic_physics -I../external/esmf_time_f90 else -# $(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./inc -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I../external/esmf_time_f90 $(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./inc -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I./stochastic_physics -I../external/esmf_time_f90 endif diff --git a/src/core_atmosphere/dynamics/Makefile b/src/core_atmosphere/dynamics/Makefile index bb7d95a6ed..62d595c90a 100644 --- a/src/core_atmosphere/dynamics/Makefile +++ b/src/core_atmosphere/dynamics/Makefile @@ -22,6 +22,5 @@ ifeq "$(GEN_F90)" "true" $(CPP) $(CPPFLAGS) $(PHYSICS) $(CPPINCLUDES) $< > $*.f90 $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I.. -I../../framework -I../../operators -I../physics -I../physics/physics_wrf -I../physics/physics_mmm -I../../external/esmf_time_f90 else -# $(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I.. -I../../framework -I../../operators -I../physics -I../physics/physics_wrf -I../physics/physics_mmm -I../../external/esmf_time_f90 $(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I.. -I../../framework -I../../operators -I../physics -I../physics/physics_wrf -I../physics/physics_mmm -I../stochastic_physics -I../../external/esmf_time_f90 endif From 365959c76d4a844bb74be30e40458ee2e7634ba8 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Mon, 30 Mar 2026 09:32:05 -0600 Subject: [PATCH 24/40] Clean up comments. --- src/core_atmosphere/Makefile | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/core_atmosphere/Makefile b/src/core_atmosphere/Makefile index 0508ad1504..8110d41e0e 100644 --- a/src/core_atmosphere/Makefile +++ b/src/core_atmosphere/Makefile @@ -28,12 +28,12 @@ core_reg: core_input_gen: if [ ! -e default_inputs ]; then mkdir default_inputs; fi - @# Since both the streams.atmosphere file and new stream_list.atmoshpere + @# Since both the streams.atmosphere file and new stream_list.atmoshpere.* @# files are regenerated on every make invocation, delete all such existing - @# files in default_inputs in order ensure that any stale stream_list.atmosphere. - @# files are removed. Removal of streams.atmosphere is not necessary since - @# it will always be overwritten, but we do so to maintain the same behavior - @# for all stream-related files. + @# files in default_inputs in order ensure that any stale stream_list.atmosphere.* + @# files are removed. Note that removal of streams.atmosphere is not necessary + @# here since it will always be overwritten, but we do so to maintain the + @# same behavior for all stream-related files. rm -f default_inputs/streams.atmosphere default_inputs/stream_list.atmosphere.* ( cd default_inputs; $(NL_GEN) ../Registry_processed.xml namelist.atmosphere in_defaults=true ) ( cd default_inputs; $(ST_GEN) ../Registry_processed.xml streams.atmosphere stream_list.atmosphere. listed in_defaults=true) @@ -54,10 +54,10 @@ post_build: @# if [ ! -e $(ROOT_DIR)/default_inputs ]; then mkdir $(ROOT_DIR)/default_inputs; fi @# - @# Remove streams.atmosphere and any stream_list.atmosphere. files from - @# ROOT_DIR/default_inputs before copying into this directory the newly- + @# Remove streams.atmosphere and any stream_list.atmosphere.* files from + @# ROOT_DIR/default_inputs before copying into this directory the newly @# generated files from the current core's default_inputs directory. This - @# ensures that stale streams.atmosphere files from previous make invocations + @# ensures that stale streams.atmosphere.* files from previous make invocations @# are removed from ROOT_DIR/default_inputs. @# rm -f $(ROOT_DIR)/default_inputs/streams.$(CORE) $(ROOT_DIR)/default_inputs/stream_list.$(CORE).* @@ -70,7 +70,7 @@ post_build: @# @# /path/to/my/MPAS-Model/src/core_atmosphere @# - @# Then the following command will copy everything from + @# Then the line below will copy everything from @# @# /path/to/my/MPAS-Model/src/core_atmosphere/default_inputs @# @@ -79,15 +79,16 @@ post_build: @# /path/to/my/MPAS-Model/default_inputs @# @# Note that the core's default_inputs directory is guaranteed to not - @# contain any stale stream_list.atmosphere. files from previous make - @# invocations (see the rm command in the core_input_gen target). + @# contain any stale stream_list.atmosphere.* files from previous make + @# invocations (see the rm command in the core_input_gen target above). @# cp default_inputs/* $(ROOT_DIR)/default_inputs/. @# @################################################################ @# The following line will copy each file in the main default_inputs - @# directory one level up into the top-level MPAS-Model directory, i.e. - @# ROOT_DIR, but ONLY IF that file doesn't already exist in ROOT_DIR. + @# directory (at ROOT_DIR/default_inputs) one level up into the top-level + @# MPAS-Model directory, i.e. ROOT_DIR, but ONLY IF that file doesn't + @# already exist in ROOT_DIR. @# @# CAUTION: @# If files from an old build are already present in ROOT_DIR and a From 795dd8cea5a099b40e3348d6946a9f6e848c06e5 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Mon, 30 Mar 2026 09:39:27 -0600 Subject: [PATCH 25/40] Get rid of comments in Makefile for brevity. --- src/core_atmosphere/Makefile | 72 ------------------------------------ 1 file changed, 72 deletions(-) diff --git a/src/core_atmosphere/Makefile b/src/core_atmosphere/Makefile index 8110d41e0e..d917ebfb30 100644 --- a/src/core_atmosphere/Makefile +++ b/src/core_atmosphere/Makefile @@ -28,12 +28,6 @@ core_reg: core_input_gen: if [ ! -e default_inputs ]; then mkdir default_inputs; fi - @# Since both the streams.atmosphere file and new stream_list.atmoshpere.* - @# files are regenerated on every make invocation, delete all such existing - @# files in default_inputs in order ensure that any stale stream_list.atmosphere.* - @# files are removed. Note that removal of streams.atmosphere is not necessary - @# here since it will always be overwritten, but we do so to maintain the - @# same behavior for all stream-related files. rm -f default_inputs/streams.atmosphere default_inputs/stream_list.atmosphere.* ( cd default_inputs; $(NL_GEN) ../Registry_processed.xml namelist.atmosphere in_defaults=true ) ( cd default_inputs; $(ST_GEN) ../Registry_processed.xml streams.atmosphere stream_list.atmosphere. listed in_defaults=true) @@ -43,75 +37,9 @@ gen_includes: core_reg (cd inc; $(REG_PARSE) ../Registry_processed.xml $(CPPFLAGS) ) post_build: - @# - @# In the following line, ROOT_DIR is the path to the top-level MPAS-Model - @# directory. This if-statement creates a default_inputs directory under - @# this root directory if it doesn't already exist, e.g. - @# - @# /path/to/my/MPAS-Model/default_inputs - @# - @# Call this the "main" default_inputs directory. - @# if [ ! -e $(ROOT_DIR)/default_inputs ]; then mkdir $(ROOT_DIR)/default_inputs; fi - @# - @# Remove streams.atmosphere and any stream_list.atmosphere.* files from - @# ROOT_DIR/default_inputs before copying into this directory the newly - @# generated files from the current core's default_inputs directory. This - @# ensures that stale streams.atmosphere.* files from previous make invocations - @# are removed from ROOT_DIR/default_inputs. - @# rm -f $(ROOT_DIR)/default_inputs/streams.$(CORE) $(ROOT_DIR)/default_inputs/stream_list.$(CORE).* - @# - @# The following line copies everything from the default_inputs subidirectory - @# under the current core's source directory into the main default_inputs - @# directory. Since there is a Makefile like this under each core, we call - @# the former the (current) core's default_inputs directory. For example, if - @# this Makefile is for the atmosphere core, it will be located under - @# - @# /path/to/my/MPAS-Model/src/core_atmosphere - @# - @# Then the line below will copy everything from - @# - @# /path/to/my/MPAS-Model/src/core_atmosphere/default_inputs - @# - @# into - @# - @# /path/to/my/MPAS-Model/default_inputs - @# - @# Note that the core's default_inputs directory is guaranteed to not - @# contain any stale stream_list.atmosphere.* files from previous make - @# invocations (see the rm command in the core_input_gen target above). - @# cp default_inputs/* $(ROOT_DIR)/default_inputs/. - @# - @################################################################ - @# The following line will copy each file in the main default_inputs - @# directory (at ROOT_DIR/default_inputs) one level up into the top-level - @# MPAS-Model directory, i.e. ROOT_DIR, but ONLY IF that file doesn't - @# already exist in ROOT_DIR. - @# - @# CAUTION: - @# If files from an old build are already present in ROOT_DIR and a - @# new build causes them to be updated in ROOT_DIR/default_inputs, - @# the following line WILL NOT update those files in ROOT_DIR. - @# - @# This seems to be intentional behavior, but it's not clear why. - @# - @#( cd $(ROOT_DIR)/default_inputs; for FILE in `ls -1`; do if [ ! -e ../$$FILE ]; then cp $$FILE ../.; fi; done ) - @# - @################################################################ - @# - @# Update line so it ALWAYS copies over all files from ROOT_DIR/default_inputs - @# into ROOT_DIR. - @# - @#( cd $(ROOT_DIR)/default_inputs; for FILE in `ls -1`; do cp $$FILE ../.; done ) - @# - @################################################################ - @# - @# Even better is to make backups of any existing files in ROOT_DIR - @# (by renaming them as .old001, .old002, etc) and then copying the - @# file in ROOT_DIR/default_inputs over to ROOT_DIR. - @# ( cd $(ROOT_DIR)/default_inputs; for FILE in `ls -1`; do \ if [ -e ../$$FILE ]; then \ N=1; \ From 722cac124a46b0eb4955453b8fa351bf53cd740a Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Mon, 30 Mar 2026 10:01:45 -0600 Subject: [PATCH 26/40] Update hash of stochastic_physics. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index 60a0c171c0..17222a717c 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit 60a0c171c03ec886a462a611924ae6e92844ac45 +Subproject commit 17222a717c4b6e202370202742d57fdd9e5344ad From aaf05d0b9efcd7cf887e42bdbc3dbdac17951f61 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Mon, 30 Mar 2026 14:22:22 -0600 Subject: [PATCH 27/40] Modify Makefile so that TEMPO's ccn_activate.bin file gets copied to the top level of MPAS-Model. --- src/core_atmosphere/physics/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/Makefile b/src/core_atmosphere/physics/Makefile index f3e1dd8dd6..9be0b7ba93 100644 --- a/src/core_atmosphere/physics/Makefile +++ b/src/core_atmosphere/physics/Makefile @@ -65,7 +65,7 @@ core_physics_mmm: core_physics_init (cd physics_mmm; $(MAKE) -f Makefile.mpas all) core_microphysics: core_physics_init core_physics_mmm - (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas) + (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas; cp tables/ccn_activate.bin ../../../../../) (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.intel run_build_tables ; cp run_build_tables ../../../../../) core_SMOKE: core_physics_init From b3a8e0c630ec95b484e086694e21bc065a5a41b3 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Tue, 31 Mar 2026 15:01:34 -0600 Subject: [PATCH 28/40] Update hash of stochastic_physics. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index 17222a717c..9a287feeac 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit 17222a717c4b6e202370202742d57fdd9e5344ad +Subproject commit 9a287feeac496b587aaf26e2f46a70e5f6e65f2f From 462953d29d5b51370b81cf3b5454c971c4684ec5 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Tue, 31 Mar 2026 16:54:32 -0600 Subject: [PATCH 29/40] Comment out lines that try to build the run_build_tables executable that generates the data tables for the TEMPO microphysics scheme. This is necessary because the makefile invoked (Makefile.intel) is only for the intel fortran compiler but the CI tests for the repo include build tests with gnu fortran (which are failing with these lines present). --- src/core_atmosphere/physics/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core_atmosphere/physics/Makefile b/src/core_atmosphere/physics/Makefile index 9be0b7ba93..3e484ddcf8 100644 --- a/src/core_atmosphere/physics/Makefile +++ b/src/core_atmosphere/physics/Makefile @@ -66,7 +66,7 @@ core_physics_mmm: core_physics_init core_microphysics: core_physics_init core_physics_mmm (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas; cp tables/ccn_activate.bin ../../../../../) - (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.intel run_build_tables ; cp run_build_tables ../../../../../) + @#(cd physics_noaa/TEMPO; $(MAKE) -f Makefile.intel run_build_tables ; cp run_build_tables ../../../../../) core_SMOKE: core_physics_init (cd physics_noaa/SMOKE; cp ./MPAS/Makefile .; cp ./MPAS/mpas_smoke_wrapper.F90 .; $(MAKE) all) @@ -291,7 +291,7 @@ clean: ( cd physics_noahmp/src; $(MAKE) clean ) ( cd physics_noahmp/utility; $(MAKE) clean ) ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas clean; fi ) - ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.intel clean; fi ) + @#( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.intel clean; fi ) ( if [ -d physics_noaa/UGWP ]; then cd physics_noaa/UGWP; $(MAKE) clean; fi ) ( if [ -d physics_noaa/RUCLSM ]; then cd physics_noaa/RUCLSM; $(MAKE) -f MPAS/Makefile clean; fi ) ( if [ -d physics_noaa/MYNN-EDMF ]; then cd physics_noaa/MYNN-EDMF; cp ./MPAS/Makefile .; $(MAKE) clean; fi ) From e3dedb888c388344fa18b73d997173f766dfa1de Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Wed, 1 Apr 2026 14:08:17 -0600 Subject: [PATCH 30/40] Add code to choose between Makefile.gfortran and Makefile.intel when building TEMPO's executable for generating microphysics tables. --- src/core_atmosphere/physics/Makefile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/core_atmosphere/physics/Makefile b/src/core_atmosphere/physics/Makefile index 3e484ddcf8..4f5e6023fa 100644 --- a/src/core_atmosphere/physics/Makefile +++ b/src/core_atmosphere/physics/Makefile @@ -18,6 +18,23 @@ OBJS_init = \ mpas_atmphys_functions.o \ mpas_atmphys_utilities.o +# Set MAKEFILE_SUFFIX needed to build TEMPO's executable for generating +# microphysics tables. +MAKEFILE_SUFFIX = none + +ifeq "$(FC_SERIAL)" "gfortran" +ifeq "$(FC_PARALLEL)" "mpif90" +MAKEFILE_SUFFIX = gfortran +endif +endif + +ifeq "$(FC_SERIAL)" "ifort" +ifeq "$(FC_PARALLEL)" "mpiifort" +MAKEFILE_SUFFIX = intel +endif +endif +$(info MAKEFILE_SUFFIX = $(MAKEFILE_SUFFIX)) + OBJS = \ mpas_atmphys_camrad_init.o \ mpas_atmphys_control.o \ @@ -66,7 +83,7 @@ core_physics_mmm: core_physics_init core_microphysics: core_physics_init core_physics_mmm (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas; cp tables/ccn_activate.bin ../../../../../) - @#(cd physics_noaa/TEMPO; $(MAKE) -f Makefile.intel run_build_tables ; cp run_build_tables ../../../../../) + (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.$(MAKEFILE_SUFFIX) run_build_tables ; cp run_build_tables ../../../../../) core_SMOKE: core_physics_init (cd physics_noaa/SMOKE; cp ./MPAS/Makefile .; cp ./MPAS/mpas_smoke_wrapper.F90 .; $(MAKE) all) @@ -291,7 +308,7 @@ clean: ( cd physics_noahmp/src; $(MAKE) clean ) ( cd physics_noahmp/utility; $(MAKE) clean ) ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas clean; fi ) - @#( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.intel clean; fi ) + ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.$(MAKEFILE_SUFFIX) clean; fi ) ( if [ -d physics_noaa/UGWP ]; then cd physics_noaa/UGWP; $(MAKE) clean; fi ) ( if [ -d physics_noaa/RUCLSM ]; then cd physics_noaa/RUCLSM; $(MAKE) -f MPAS/Makefile clean; fi ) ( if [ -d physics_noaa/MYNN-EDMF ]; then cd physics_noaa/MYNN-EDMF; cp ./MPAS/Makefile .; $(MAKE) clean; fi ) From 91bcfba7c93452971382c017ecdcc1f970983042 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Thu, 2 Apr 2026 14:29:50 -0600 Subject: [PATCH 31/40] Bug fixes and improvements to Makefiles. --- src/core_atmosphere/Makefile | 7 ++++++- src/core_atmosphere/physics/Makefile | 25 +++++++++++++++++-------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/core_atmosphere/Makefile b/src/core_atmosphere/Makefile index d917ebfb30..92bb34cfa3 100644 --- a/src/core_atmosphere/Makefile +++ b/src/core_atmosphere/Makefile @@ -78,7 +78,12 @@ mpas_atm_dimensions.o: clean: ( cd physics; $(MAKE) clean ) ( cd dynamics; $(MAKE) clean ) - ( cd stochastic_physics; $(MAKE) clean ) + @# The stochastic_physics directory contains both a makefile (lower case + @# "m") and a Makefile (upper case "M"). The former is used for FV3 and + @# the latter for MPAS. The default for "make" is to use "makefile", but + @# here, we want to use the one for MPAS (with an upper case "M"). Indicate + @# that using the -f flag. + ( cd stochastic_physics; $(MAKE) -f Makefile clean ) ( cd diagnostics; $(MAKE) clean ) ( cd utils; $(MAKE) clean ) ( cd ../..; rm -f *TBL ) diff --git a/src/core_atmosphere/physics/Makefile b/src/core_atmosphere/physics/Makefile index 4f5e6023fa..6b81f38f01 100644 --- a/src/core_atmosphere/physics/Makefile +++ b/src/core_atmosphere/physics/Makefile @@ -18,22 +18,25 @@ OBJS_init = \ mpas_atmphys_functions.o \ mpas_atmphys_utilities.o -# Set MAKEFILE_SUFFIX needed to build TEMPO's executable for generating -# microphysics tables. -MAKEFILE_SUFFIX = none +# Set TEMPO_TBLS_MAKEFILE_SUFFIX needed to build TEMPO's executable for +# generating microphysics tables. Note that when the "clean" target is +# invoked by upstream Makefies, FC_SERIAL and FC_PARALLEL will not be set, +# in which case TEMPO_TBLS_MAKEFILE_SUFFIX will be set to its default +# value of "none". +TEMPO_TBLS_MAKEFILE_SUFFIX = none ifeq "$(FC_SERIAL)" "gfortran" ifeq "$(FC_PARALLEL)" "mpif90" -MAKEFILE_SUFFIX = gfortran +TEMPO_TBLS_MAKEFILE_SUFFIX = gfortran endif endif ifeq "$(FC_SERIAL)" "ifort" ifeq "$(FC_PARALLEL)" "mpiifort" -MAKEFILE_SUFFIX = intel +TEMPO_TBLS_MAKEFILE_SUFFIX = intel endif endif -$(info MAKEFILE_SUFFIX = $(MAKEFILE_SUFFIX)) +$(info TEMPO_TBLS_MAKEFILE_SUFFIX = $(TEMPO_TBLS_MAKEFILE_SUFFIX)) OBJS = \ mpas_atmphys_camrad_init.o \ @@ -83,7 +86,7 @@ core_physics_mmm: core_physics_init core_microphysics: core_physics_init core_physics_mmm (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas; cp tables/ccn_activate.bin ../../../../../) - (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.$(MAKEFILE_SUFFIX) run_build_tables ; cp run_build_tables ../../../../../) + (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.$(TEMPO_TBLS_MAKEFILE_SUFFIX) run_build_tables ; cp run_build_tables ../../../../../) core_SMOKE: core_physics_init (cd physics_noaa/SMOKE; cp ./MPAS/Makefile .; cp ./MPAS/mpas_smoke_wrapper.F90 .; $(MAKE) all) @@ -308,7 +311,13 @@ clean: ( cd physics_noahmp/src; $(MAKE) clean ) ( cd physics_noahmp/utility; $(MAKE) clean ) ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas clean; fi ) - ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.$(MAKEFILE_SUFFIX) clean; fi ) + @# For cleaning the TEMPO executable for generating microphysics tables, call both + @# the intel and the gfortran Makefiles. This is because when the "clean" target + @# is invoked in upstream Makefiles, a compiler is not specified, so it is not + @# clear which of the two Makefiles to use here. By calling both, we ensure that + @# the directory is properly cleaned regardless of which compiler was used to build + @# the executable. + ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.gfortran clean; $(MAKE) -f Makefile.intel clean; fi ) ( if [ -d physics_noaa/UGWP ]; then cd physics_noaa/UGWP; $(MAKE) clean; fi ) ( if [ -d physics_noaa/RUCLSM ]; then cd physics_noaa/RUCLSM; $(MAKE) -f MPAS/Makefile clean; fi ) ( if [ -d physics_noaa/MYNN-EDMF ]; then cd physics_noaa/MYNN-EDMF; cp ./MPAS/Makefile .; $(MAKE) clean; fi ) From 7782ece84d3edd382fee74bbb4e35f26a0d5389a Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Thu, 2 Apr 2026 14:30:10 -0600 Subject: [PATCH 32/40] Update hash of stochastic_physics. --- src/core_atmosphere/stochastic_physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/stochastic_physics b/src/core_atmosphere/stochastic_physics index 9a287feeac..16d9eca781 160000 --- a/src/core_atmosphere/stochastic_physics +++ b/src/core_atmosphere/stochastic_physics @@ -1 +1 @@ -Subproject commit 9a287feeac496b587aaf26e2f46a70e5f6e65f2f +Subproject commit 16d9eca781528eda6d4636436256a59ef6fa0e27 From 0c2d253c0e47e3110abcb11407ef4d4f7556d860 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Thu, 2 Apr 2026 14:30:43 -0600 Subject: [PATCH 33/40] Add lines to GitHub Actions workflow file that will link in the Intel Math Kernel Library (MKL). --- .github/workflows/build_mpas_intel.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_mpas_intel.yml b/.github/workflows/build_mpas_intel.yml index f7e1a46c9d..1cbf826ccd 100644 --- a/.github/workflows/build_mpas_intel.yml +++ b/.github/workflows/build_mpas_intel.yml @@ -129,6 +129,9 @@ jobs: echo "LD_LIBRARY_PATH=${AUTOTOOLS}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV echo "PATH=${PNETCDF}/bin:$PATH" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=${PNETCDF}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV + echo "MKLROOT=/opt/intel/oneapi/mkl/latest" >> $GITHUB_ENV + echo "LDFLAGS=-L/opt/intel/oneapi/mkl/latest/lib/intel64" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=/opt/intel/oneapi/mkl/latest/lib/intel64:$LD_LIBRARY_PATH" >> $GITHUB_ENV - name: Build MPAS Standalone (make) if: matrix.build-system == 'make' @@ -144,4 +147,4 @@ jobs: mkdir build cd build cmake -DMPAS_DOUBLE_PRECISION=OFF -DMPAS_CORES="init_atmosphere;atmosphere" .. - make -j8 \ No newline at end of file + make -j8 From 2934e479bded7c3faff8e296a912927cc94e2985 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Thu, 2 Apr 2026 16:32:40 -0600 Subject: [PATCH 34/40] Find location of MKL library on GitHub runner. --- .github/workflows/build_mpas_intel.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build_mpas_intel.yml b/.github/workflows/build_mpas_intel.yml index 1cbf826ccd..c5ed0bd639 100644 --- a/.github/workflows/build_mpas_intel.yml +++ b/.github/workflows/build_mpas_intel.yml @@ -42,6 +42,19 @@ jobs: install-oneapi: false mpi-wrapper-setup: classic + - name: Find MKL library location + run: | + echo "=== MKL root candidates ===" + ls /opt/intel/oneapi/mkl/ || echo "No mkl dir" + echo "=== lib dir contents ===" + ls /opt/intel/oneapi/mkl/latest/lib/ || echo "No lib dir" + echo "=== lib/intel64 dir ===" + ls /opt/intel/oneapi/mkl/latest/lib/intel64/ 2>/dev/null || echo "No intel64 subdir" + echo "=== find libmkl ===" + find /opt/intel/oneapi/mkl -name "libmkl_core*" 2>/dev/null | head -20 + echo "=== MKLROOT env var ===" + echo "${MKLROOT}" + - name: Cache Intel id: cache-INTEL uses: actions/cache@v4 From 97a98ec52aabe1aa967890bc16764f57acbc259c Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Thu, 2 Apr 2026 16:49:10 -0600 Subject: [PATCH 35/40] Second attempt to find MKL library. --- .github/workflows/build_mpas_intel.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_mpas_intel.yml b/.github/workflows/build_mpas_intel.yml index c5ed0bd639..947f8f2538 100644 --- a/.github/workflows/build_mpas_intel.yml +++ b/.github/workflows/build_mpas_intel.yml @@ -44,16 +44,15 @@ jobs: - name: Find MKL library location run: | - echo "=== MKL root candidates ===" - ls /opt/intel/oneapi/mkl/ || echo "No mkl dir" - echo "=== lib dir contents ===" - ls /opt/intel/oneapi/mkl/latest/lib/ || echo "No lib dir" - echo "=== lib/intel64 dir ===" - ls /opt/intel/oneapi/mkl/latest/lib/intel64/ 2>/dev/null || echo "No intel64 subdir" - echo "=== find libmkl ===" - find /opt/intel/oneapi/mkl -name "libmkl_core*" 2>/dev/null | head -20 - echo "=== MKLROOT env var ===" - echo "${MKLROOT}" + echo "=== /opt/intel/oneapi contents ===" + ls /opt/intel/oneapi/ 2>/dev/null || echo "No /opt/intel/oneapi dir" + echo "=== broad libmkl search ===" + find /opt/intel /usr -name "libmkl_core*" 2>/dev/null | head -20 || echo "libmkl_core not found" + echo "=== installed intel-oneapi packages ===" + dpkg -l | grep intel-oneapi || echo "No intel-oneapi packages found" + echo "=== MKLROOT / MKL_ROOT env ===" + echo "MKLROOT=${MKLROOT}" + echo "MKL_ROOT=${MKL_ROOT}" - name: Cache Intel id: cache-INTEL From fe3720c03bf042a1577df883bb5abac0f997e397 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Thu, 2 Apr 2026 17:07:35 -0600 Subject: [PATCH 36/40] Install MKL library in Github Actions. --- .github/workflows/build_mpas_intel.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build_mpas_intel.yml b/.github/workflows/build_mpas_intel.yml index 947f8f2538..49755a16dc 100644 --- a/.github/workflows/build_mpas_intel.yml +++ b/.github/workflows/build_mpas_intel.yml @@ -42,6 +42,16 @@ jobs: install-oneapi: false mpi-wrapper-setup: classic + - name: Install MKL + run: | + wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ + | gpg --dearmor \ + | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \ + | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo apt-get update -q + sudo apt-get install -y intel-oneapi-mkl-devel + - name: Find MKL library location run: | echo "=== /opt/intel/oneapi contents ===" From 0f4d720bcb0e7eeccee685352e94d2902454c311 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Thu, 2 Apr 2026 17:22:28 -0600 Subject: [PATCH 37/40] Fix MKL locations in Github Actions runner. --- .github/workflows/build_mpas_intel.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_mpas_intel.yml b/.github/workflows/build_mpas_intel.yml index 49755a16dc..07762192ed 100644 --- a/.github/workflows/build_mpas_intel.yml +++ b/.github/workflows/build_mpas_intel.yml @@ -151,9 +151,9 @@ jobs: echo "LD_LIBRARY_PATH=${AUTOTOOLS}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV echo "PATH=${PNETCDF}/bin:$PATH" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=${PNETCDF}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - echo "MKLROOT=/opt/intel/oneapi/mkl/latest" >> $GITHUB_ENV - echo "LDFLAGS=-L/opt/intel/oneapi/mkl/latest/lib/intel64" >> $GITHUB_ENV - echo "LD_LIBRARY_PATH=/opt/intel/oneapi/mkl/latest/lib/intel64:$LD_LIBRARY_PATH" >> $GITHUB_ENV + echo "MKLROOT=/opt/intel/oneapi/mkl/2025.3" >> $GITHUB_ENV + echo "LDFLAGS=-L/opt/intel/oneapi/mkl/2025.3/lib" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=/opt/intel/oneapi/mkl/2025.3/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - name: Build MPAS Standalone (make) if: matrix.build-system == 'make' From 1b05207dae59d4337e10a9c31b941fa9ba92ef61 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Thu, 2 Apr 2026 17:42:41 -0600 Subject: [PATCH 38/40] Bug fixes to Github Actions workflow file. --- .github/workflows/build_mpas_intel.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_mpas_intel.yml b/.github/workflows/build_mpas_intel.yml index 07762192ed..7c173fe547 100644 --- a/.github/workflows/build_mpas_intel.yml +++ b/.github/workflows/build_mpas_intel.yml @@ -152,15 +152,15 @@ jobs: echo "PATH=${PNETCDF}/bin:$PATH" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=${PNETCDF}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV echo "MKLROOT=/opt/intel/oneapi/mkl/2025.3" >> $GITHUB_ENV - echo "LDFLAGS=-L/opt/intel/oneapi/mkl/2025.3/lib" >> $GITHUB_ENV + echo "MKL_LIBDIR=/opt/intel/oneapi/mkl/2025.3/lib" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=/opt/intel/oneapi/mkl/2025.3/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - name: Build MPAS Standalone (make) if: matrix.build-system == 'make' run: | cd ${driver_ROOT}/MPAS-Model/MPAS-Model - make intel-mpi CORE=init_atmosphere - make intel-mpi CORE=atmosphere + make intel-mpi CORE=init_atmosphere "LDFLAGS_OPT=-O3 -L${MKL_LIBDIR}" + make intel-mpi CORE=atmosphere "LDFLAGS_OPT=-O3 -L${MKL_LIBDIR}" - name: Build MPAS Standalone (cmake) if: matrix.build-system == 'cmake' From 18f58f393a3d9980da51e947d414995d6574074c Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Fri, 3 Apr 2026 08:27:45 -0600 Subject: [PATCH 39/40] More debugging of GitHub Actions workflow file. --- .github/workflows/build_mpas_intel.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_mpas_intel.yml b/.github/workflows/build_mpas_intel.yml index 7c173fe547..e73eba2f86 100644 --- a/.github/workflows/build_mpas_intel.yml +++ b/.github/workflows/build_mpas_intel.yml @@ -153,14 +153,15 @@ jobs: echo "LD_LIBRARY_PATH=${PNETCDF}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV echo "MKLROOT=/opt/intel/oneapi/mkl/2025.3" >> $GITHUB_ENV echo "MKL_LIBDIR=/opt/intel/oneapi/mkl/2025.3/lib" >> $GITHUB_ENV + echo "LIBRARY_PATH=/opt/intel/oneapi/mkl/2025.3/lib:$LIBRARY_PATH" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=/opt/intel/oneapi/mkl/2025.3/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - name: Build MPAS Standalone (make) if: matrix.build-system == 'make' run: | cd ${driver_ROOT}/MPAS-Model/MPAS-Model - make intel-mpi CORE=init_atmosphere "LDFLAGS_OPT=-O3 -L${MKL_LIBDIR}" - make intel-mpi CORE=atmosphere "LDFLAGS_OPT=-O3 -L${MKL_LIBDIR}" + make intel-mpi CORE=init_atmosphere + make intel-mpi CORE=atmosphere - name: Build MPAS Standalone (cmake) if: matrix.build-system == 'cmake' From 82c99cdfae63164883cdb931595bda55093caee0 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Fri, 3 Apr 2026 08:43:31 -0600 Subject: [PATCH 40/40] More debugging. --- .github/workflows/build_mpas_intel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_mpas_intel.yml b/.github/workflows/build_mpas_intel.yml index e73eba2f86..80a45e8ea9 100644 --- a/.github/workflows/build_mpas_intel.yml +++ b/.github/workflows/build_mpas_intel.yml @@ -63,6 +63,7 @@ jobs: echo "=== MKLROOT / MKL_ROOT env ===" echo "MKLROOT=${MKLROOT}" echo "MKL_ROOT=${MKL_ROOT}" + echo "Bye" - name: Cache Intel id: cache-INTEL