Skip to content

Commit

Permalink
Merge PR #73 (Add KPP standalone into 14.5.1)
Browse files Browse the repository at this point in the history
This merge brings PR #73 (Add KPP standalone into 14.5.1,
by @yantosca and @obin1) into the GCClassic "no-diff-to-benchmark"
development stream.

This PR adds code to src/CMakeLists.txt so that the KPP standalone
executable will be built if the fullchem or custom mechanism
is chosen.

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Dec 2, 2024
2 parents 384f5d3 + 9d62975 commit d807ca4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ This file documents all notable changes to the GEOS-Chem Classic wrapper reposit
- src/HEMCO/CHANGELOG.md
- src/Cloud-J/CHANGELOG.md

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The format is based on [Keep a
Changelog](https://keepachangelog.com/en/1.0.0/), and this project
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - TBD
### Added
- Added code to `src/CMakeLists.txt` to build & install the KPP standalone executable when `fullchem` or `custom` mechanisms are selected

## [14.5.0] - 2024-11-08
### Changed
Expand Down
28 changes: 28 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,33 @@ set_target_properties(${EXE_FILE_NAME}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)

#-----------------------------------------------------------------------------
# Define the KPP standalone executable:
# 1. Specify a cache variable with the default target name
# 2. Specify the location of the main program
# 3. Specify libraries that the main program depends on
# 4. Store the binary exectuable file in the bin folder (pre-install)
#
# At present build KPP standalone only for fullchem or custom mechanisms.
#-----------------------------------------------------------------------------
if("${MECH}" STREQUAL fullchem OR "${MECH}" STREQUAL custom)
set(KPPSA_FILE_NAME kpp_standalone CACHE STRING
"Default name for the KPP standalone executable file")
mark_as_advanced(KPPSA_FILE_NAME)

add_executable(${KPPSA_FILE_NAME}
GEOS-Chem/KPP/standalone/kpp_standalone.F90
)
target_link_libraries(${KPPSA_FILE_NAME}
PUBLIC
KPPStandalone
)
set_target_properties(${KPPSA_FILE_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
endif()

#-----------------------------------------------------------------------------
# When "make install" is run, copy the target to the destination folder
# (which is typically one directory higher than the CMake build folder)
Expand Down Expand Up @@ -71,6 +98,7 @@ foreach(INSTALL_PATH ${COMBINED_INSTALL_DIRS})
# Installation path is a GEOS-Chem run directory,
# Therefore we will install the executable there.
install(TARGETS ${EXE_FILE_NAME} RUNTIME DESTINATION ${INSTALL_PATH})
install(TARGETS ${KPPSA_FILE_NAME} RUNTIME DESTINATION ${INSTALL_PATH})
endif()

endforeach()

0 comments on commit d807ca4

Please sign in to comment.