Skip to content

Commit 13ee446

Browse files
committed
Partial implementaiton of FABM linking in drivers
1 parent 98e9972 commit 13ee446

3 files changed

Lines changed: 24 additions & 10 deletions

File tree

cmake/FindFABM.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# if provided in GOTM_PREFIX, use FABM modules used by GOTM
33
find_path(FABM_PREFIX_PATH
44
NAMES include/fabm_driver.h
5-
HINTS "${FABM_PREFIX}" "${GOTM_PREFIX}" "$ENV{FABM_PREFIX}"
5+
HINTS "$ENV{FABM_PREFIX}" "${GOTM_PREFIX}" "$ENV{FABM_PREFIX}"
66
PATHS "$ENV{LOCALAPPDATA}/fabm/gotm" "$ENV{APPDATA}/fabm/gotm" "$ENV{HOME}/local/fabm/gotm"
77
DOC "Installation prefix for Framework for Aquatic Biogeochemical Models - fabm.net"
88
)

src/drivers/CMakeLists.txt

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,27 @@ if(USE_GETM)
3434
)
3535
endif()
3636

37-
option(USE_FABM "Enable FABM-based drivers" OFF)
38-
if(USE_FABM)
37+
include(FindFABM)
38+
39+
# Add FABM include directories if found
40+
if(FABM_INCLUDE_DIRS)
41+
target_include_directories(mossco_drivers PRIVATE ${FABM_INCLUDE_DIRS})
42+
endif()
43+
if(FABM_LIBRARIES)
44+
target_link_libraries(mossco_drivers PRIVATE ${FABM_LIBRARIES})
45+
endif()
46+
47+
option(USE_FABM "Enable FABM-based drivers" ON)
48+
#if(USE_FABM)
49+
# FABM drivers are enabled by default, so we append them to DRIVER_SOURCES
3950
list(APPEND DRIVER_SOURCES
40-
fabm0d_driver.F90
41-
fabm_benthic_driver.F90
42-
fabm_gotm_driver.F90
51+
#fabm0d_driver.F90
52+
#fabm_benthic_driver.F90
53+
#fabm_gotm_driver.F90
4354
fabm_pelagic_driver.F90
4455
fabm_sediment_driver.F90
4556
)
46-
endif()
57+
#endif()
4758

4859
# Option to enable or disable EROSED-related sources
4960
option(USE_EROSED "Enable EROSED-related drivers (biotypes, benthoseffect_class)" OFF)
@@ -77,6 +88,7 @@ endif()
7788

7889

7990
# Option to enable or disable clm_driver.F90
91+
# @todo this really depends on working netcdf only
8092
option(USE_CLM "Enable CLM file-based coupling" OFF)
8193
if(USE_CLM )
8294
list(APPEND DRIVER_SOURCES
@@ -90,6 +102,8 @@ target_sources(mossco_drivers PRIVATE ${DRIVER_SOURCES})
90102
# Link against mossco_utilities to get access to ESMF, versioning, NetCDF (via ESMF), etc.
91103
# Using PUBLIC will propagate the usage requirements of mossco_utilities (like its INTERFACE include directories
92104
# and link libraries) to targets that link against mossco_drivers.
105+
106+
target_include_directories(mossco_drivers PUBLIC ${CMAKE_BINARY_DIR}/src/utilities)
93107
target_link_libraries(mossco_drivers PUBLIC mossco_utilities)
94108

95109
# Ensure that consumers of mossco_drivers can find Fortran modules (.mod files)

src/drivers/fabm_pelagic_driver.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
!> @brief 3D generic driver for the Framework for Aquatic Biogeochemical Models (FABM)
33
!>
44
!> This computer program is part of MOSSCO.
5-
!> @copyright Copyright 2021-2022 Helmholtz-Zentrum Hereon
6-
!> @copyright Copyright 2013-2021 Helmholtz-Zentrum Geesthacht
5+
!> @copyright Copyright 2021-2025 Helmholtz-Zentrum hereon GmbH
6+
!> @copyright Copyright 2013-2021 Helmholtz-Zentrum Geesthacht GmbH
77
!> @author Richard Hofmeister
8-
!> @author Carsten Lemmen <carsten.lemmen@hereon.de
8+
!> @author Carsten Lemmen <carsten.lemmen@hereon.de>
99
!
1010
! MOSSCO is free software: you can redistribute it and/or modify it under the
1111
! terms of the GNU General Public License v3+. MOSSCO is distributed in the

0 commit comments

Comments
 (0)