Skip to content

Commit

Permalink
Merge branch 'hotfix-v8.2.1'
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
mgduda committed Aug 7, 2024
2 parents 942d402 + dd7d751 commit b566fc8
Show file tree
Hide file tree
Showing 22 changed files with 457 additions and 170 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -737,10 +737,10 @@ else # Not using PIO, using SMIOL
endif

ifneq "$(NETCDF)" ""
ifneq ($(wildcard $(NETCDF)/lib), )
ifneq ($(wildcard $(NETCDF)/lib/libnetcdf.*), )
NETCDFLIBLOC = lib
endif
ifneq ($(wildcard $(NETCDF)/lib64), )
ifneq ($(wildcard $(NETCDF)/lib64/libnetcdf.*), )
NETCDFLIBLOC = lib64
endif
CPPINCLUDES += -I$(NETCDF)/include
Expand All @@ -761,10 +761,10 @@ endif


ifneq "$(PNETCDF)" ""
ifneq ($(wildcard $(PNETCDF)/lib), )
ifneq ($(wildcard $(PNETCDF)/lib/libpnetcdf.*), )
PNETCDFLIBLOC = lib
endif
ifneq ($(wildcard $(PNETCDF)/lib64), )
ifneq ($(wildcard $(PNETCDF)/lib64/libpnetcdf.*), )
PNETCDFLIBLOC = lib64
endif
CPPINCLUDES += -I$(PNETCDF)/include
Expand Down Expand Up @@ -1352,9 +1352,10 @@ mpi_f08_test:
$(info Checking for mpi_f08 support...)
$(eval MPAS_MPI_F08 := $(shell $\
printf "program main\n$\
& use mpi_f08, only : MPI_Init, MPI_Comm\n$\
& use mpi_f08, only : MPI_Init, MPI_Comm, MPI_INTEGER, MPI_Datatype\n$\
& integer :: ierr\n$\
& type (MPI_Comm) :: comm\n$\
& type (MPI_Datatype), parameter :: MPI_INTEGERKIND = MPI_INTEGER\n$\
& call MPI_Init(ierr)\n$\
end program main\n" | sed 's/&/ /' > mpi_f08.f90; $\
$\
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MPAS-v8.2.0
MPAS-v8.2.1
====

The Model for Prediction Across Scales (MPAS) is a collaborative project for
Expand Down
40 changes: 36 additions & 4 deletions cmake/Functions/MPAS_Functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,33 @@ function(get_mpas_version mpas_version)
set(${mpas_version} ${CMAKE_MATCH_1} PARENT_SCOPE)
endfunction()

##
# get_git_version( <git_version> )
# Extracts the current Git version of the project.
# <git_version> will contain the Git version string.
# Example usage:
# get_git_version(GIT_VERSION)
# message("Git Version: ${GIT_VERSION}")
##


function(get_git_version git_version)
execute_process(
COMMAND git describe --tags --always
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if(NOT RESULT EQUAL 0)
message(WARNING "Failed to get Git version!")
endif()
set(${git_version} ${GIT_VERSION} PARENT_SCOPE
)
endfunction()


##
# mpas_fortran_target( <target-name> )
#
Expand Down Expand Up @@ -162,15 +189,20 @@ function(mpas_core_target)
file(MAKE_DIRECTORY ${CORE_DATADIR})

#Process registry and generate includes, namelists, and streams
if(${ARG_CORE} STREQUAL "atmosphere" AND ${DO_PHYSICS})
set(CPP_EXTRA_FLAGS ${CPP_EXTRA_FLAGS} -DDO_PHYSICS)
get_git_version(git_version)
string(TOUPPER ${ARG_CORE} ARG_CORE_UPPER)
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})
message("CPP_EXTRA_FLAGS: ${CPP_EXTRA_FLAGS}")
if (${DO_PHYSICS})
set(CPP_EXTRA_FLAGS ${CPP_EXTRA_FLAGS} -DDO_PHYSICS)
endif()
add_custom_command(OUTPUT Registry_processed.xml

add_custom_command(OUTPUT Registry_processed.xml
COMMAND ${CPP_EXECUTABLE} -E -P ${CPP_EXTRA_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/Registry.xml > Registry_processed.xml
COMMENT "CORE ${ARG_CORE}: Pre-Process Registry"
DEPENDS Registry.xml)
add_custom_command(OUTPUT ${ARG_INCLUDES}
COMMAND mpas_parse_${ARG_CORE} Registry_processed.xml
COMMAND mpas_parse_${ARG_CORE} Registry_processed.xml ${CPP_EXTRA_FLAGS}
COMMENT "CORE ${ARG_CORE}: Parse Registry"
DEPENDS mpas_parse_${ARG_CORE} Registry_processed.xml)
add_custom_command(OUTPUT namelist.${ARG_CORE}
Expand Down
Loading

0 comments on commit b566fc8

Please sign in to comment.