Skip to content

Commit b566fc8

Browse files
committed
Merge branch 'hotfix-v8.2.1'
This merge addresses several issues in the MPAS-Atmosphere model and in the MPAS infrastructure. Specific changes in this merge include: * Improved detection of an 'mpi_f08' module (PR #1202), as well as improved detection of netCDF and PnetCDF library paths (PR #1203), in the top-level Makefile. * The addition of a missing dependency in the physics Makefile to correct parallel build issues (PR #1204). * Fixes to the CMake build files used by MPAS-JEDI (PR #1205). * Fixes to double-precision builds of MPAS-Atmosphere (PR #1207, PR #1208). * Correction of the calculation of height AGL used in the computation of 1-km radar reflectivity fields (PR #1213). * Correction of an issue that prevented the MYNN PBL scheme from being used without also using the Thompson aerosol-aware microphysics (PR #1215). * Fixes to allow MPAS-Atmosphere to be built without physics (i.e., dynamics- only builds) (PR #1221). * Various code cleanup and minor corrections (PR #1206, PR #1212, PR #1224, PR #1226).
2 parents 942d402 + dd7d751 commit b566fc8

22 files changed

+457
-170
lines changed

Makefile

+6-5
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,10 @@ else # Not using PIO, using SMIOL
737737
endif
738738

739739
ifneq "$(NETCDF)" ""
740-
ifneq ($(wildcard $(NETCDF)/lib), )
740+
ifneq ($(wildcard $(NETCDF)/lib/libnetcdf.*), )
741741
NETCDFLIBLOC = lib
742742
endif
743-
ifneq ($(wildcard $(NETCDF)/lib64), )
743+
ifneq ($(wildcard $(NETCDF)/lib64/libnetcdf.*), )
744744
NETCDFLIBLOC = lib64
745745
endif
746746
CPPINCLUDES += -I$(NETCDF)/include
@@ -761,10 +761,10 @@ endif
761761

762762

763763
ifneq "$(PNETCDF)" ""
764-
ifneq ($(wildcard $(PNETCDF)/lib), )
764+
ifneq ($(wildcard $(PNETCDF)/lib/libpnetcdf.*), )
765765
PNETCDFLIBLOC = lib
766766
endif
767-
ifneq ($(wildcard $(PNETCDF)/lib64), )
767+
ifneq ($(wildcard $(PNETCDF)/lib64/libpnetcdf.*), )
768768
PNETCDFLIBLOC = lib64
769769
endif
770770
CPPINCLUDES += -I$(PNETCDF)/include
@@ -1352,9 +1352,10 @@ mpi_f08_test:
13521352
$(info Checking for mpi_f08 support...)
13531353
$(eval MPAS_MPI_F08 := $(shell $\
13541354
printf "program main\n$\
1355-
& use mpi_f08, only : MPI_Init, MPI_Comm\n$\
1355+
& use mpi_f08, only : MPI_Init, MPI_Comm, MPI_INTEGER, MPI_Datatype\n$\
13561356
& integer :: ierr\n$\
13571357
& type (MPI_Comm) :: comm\n$\
1358+
& type (MPI_Datatype), parameter :: MPI_INTEGERKIND = MPI_INTEGER\n$\
13581359
& call MPI_Init(ierr)\n$\
13591360
end program main\n" | sed 's/&/ /' > mpi_f08.f90; $\
13601361
$\

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MPAS-v8.2.0
1+
MPAS-v8.2.1
22
====
33

44
The Model for Prediction Across Scales (MPAS) is a collaborative project for

cmake/Functions/MPAS_Functions.cmake

+36-4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,33 @@ function(get_mpas_version mpas_version)
2929
set(${mpas_version} ${CMAKE_MATCH_1} PARENT_SCOPE)
3030
endfunction()
3131

32+
##
33+
# get_git_version( <git_version> )
34+
# Extracts the current Git version of the project.
35+
# <git_version> will contain the Git version string.
36+
# Example usage:
37+
# get_git_version(GIT_VERSION)
38+
# message("Git Version: ${GIT_VERSION}")
39+
##
40+
41+
42+
function(get_git_version git_version)
43+
execute_process(
44+
COMMAND git describe --tags --always
45+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
46+
RESULT_VARIABLE RESULT
47+
OUTPUT_VARIABLE GIT_VERSION
48+
OUTPUT_STRIP_TRAILING_WHITESPACE
49+
)
50+
51+
if(NOT RESULT EQUAL 0)
52+
message(WARNING "Failed to get Git version!")
53+
endif()
54+
set(${git_version} ${GIT_VERSION} PARENT_SCOPE
55+
)
56+
endfunction()
57+
58+
3259
##
3360
# mpas_fortran_target( <target-name> )
3461
#
@@ -162,15 +189,20 @@ function(mpas_core_target)
162189
file(MAKE_DIRECTORY ${CORE_DATADIR})
163190

164191
#Process registry and generate includes, namelists, and streams
165-
if(${ARG_CORE} STREQUAL "atmosphere" AND ${DO_PHYSICS})
166-
set(CPP_EXTRA_FLAGS ${CPP_EXTRA_FLAGS} -DDO_PHYSICS)
192+
get_git_version(git_version)
193+
string(TOUPPER ${ARG_CORE} ARG_CORE_UPPER)
194+
set(CPP_EXTRA_FLAGS ${CPP_EXTRA_FLAGS} -DCORE_${ARG_CORE_UPPER} -DMPAS_NAMELIST_SUFFIX=${ARG_CORE} -DMPAS_EXE_NAME=mpas_${ARG_CORE} -DMPAS_GIT_VERSION=${git_version} -DMPAS_BUILD_TARGET=${CMAKE_Fortran_COMPILER_ID})
195+
message("CPP_EXTRA_FLAGS: ${CPP_EXTRA_FLAGS}")
196+
if (${DO_PHYSICS})
197+
set(CPP_EXTRA_FLAGS ${CPP_EXTRA_FLAGS} -DDO_PHYSICS)
167198
endif()
168-
add_custom_command(OUTPUT Registry_processed.xml
199+
200+
add_custom_command(OUTPUT Registry_processed.xml
169201
COMMAND ${CPP_EXECUTABLE} -E -P ${CPP_EXTRA_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/Registry.xml > Registry_processed.xml
170202
COMMENT "CORE ${ARG_CORE}: Pre-Process Registry"
171203
DEPENDS Registry.xml)
172204
add_custom_command(OUTPUT ${ARG_INCLUDES}
173-
COMMAND mpas_parse_${ARG_CORE} Registry_processed.xml
205+
COMMAND mpas_parse_${ARG_CORE} Registry_processed.xml ${CPP_EXTRA_FLAGS}
174206
COMMENT "CORE ${ARG_CORE}: Parse Registry"
175207
DEPENDS mpas_parse_${ARG_CORE} Registry_processed.xml)
176208
add_custom_command(OUTPUT namelist.${ARG_CORE}

0 commit comments

Comments
 (0)