Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/kpp standalone #69

Open
wants to merge 1 commit into
base: dev/no-diff-to-benchmark
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ This file documents all notable changes to the GEOS-Chem Classic wrapper reposit
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

### Changed
- Updated GEOS-Chem to 14.5.0
- Updated HEMCO to 3.10.0
Expand Down
27 changes: 27 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,32 @@ set_target_properties(${EXE_FILE_NAME}
PROPERTIES
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
Expand Down Expand Up @@ -71,6 +97,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()
Loading