Skip to content

Commit

Permalink
OCEAN_COUPLING: oceanmodel libraries are now set within ecwam
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab committed Mar 6, 2024
1 parent c09a23a commit decbfe5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ project( ${ECWAM_PROJECT_NAME} LANGUAGES Fortran C CXX )
include( ecwam_macros )
ecbuild_enable_fortran( REQUIRED NO_MODULE_DIRECTORY )

### Determine ocean model precision
if( NOT DEFINED OCEAN_PREC )
if( HAVE_SINGLE_PRECISION )
set(OCEAN_PREC SP)
else()
set(OCEAN_PREC DP)
endif()
endif()
string( TOLOWER "${OCEAN_PREC}" ocean_prec )

### Dependencies

ecbuild_find_package( fiat REQUIRED )
Expand Down Expand Up @@ -55,7 +65,7 @@ ecbuild_add_option( FEATURE UNWAM
ecbuild_add_option( FEATURE OCEAN_COUPLING
DEFAULT ON
DESCRIPTION "Support ocean coupling"
CONDITION ${PNAME}_OCEANMODEL_LIBRARIES )
REQUIRED_PACKAGES "nemo_${ocean_prec}" )

ecbuild_add_option( FEATURE ECWAM_LAUNCH
DEFAULT ON
Expand Down
6 changes: 2 additions & 4 deletions src/ecwam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,13 @@ if( HAVE_MULTIO )
list(APPEND ECWAM_DEFINITIONS WAM_HAVE_MULTIO)
endif()

set( ${PNAME}_OCEANMODEL_LIBRARIES "" )
if( HAVE_OCEAN_COUPLING )
list(APPEND ECWAM_DEFINITIONS WITH_NEMO )
if( ${PNAME}_OCEANMODEL_HAVE_SINGLE_PRECISION )
list(APPEND ECWAM_DEFINITIONS PARKIND1_SINGLE_NEMO )
endif()
else()
unset( ${PNAME}_OCEANMODEL_LIBRARIES )
unset( ${PNAME}_OCEANMODEL_INCLUDE_DIRS )
set( ${PNAME}_OCEANMODEL_LIBRARIES nemogcmcoup.${OCEAN_PREC} )
endif()

if( HAVE_ECFLOW )
Expand All @@ -430,7 +429,6 @@ ecbuild_add_library(
field_api_${prec}
$<${HAVE_ECFLOW}:ecflow_lightf>
PUBLIC_INCLUDES $<INSTALL_INTERFACE:include>
PRIVATE_INCLUDES ${${PNAME}_OCEANMODEL_INCLUDE_DIRS}
PRIVATE_DEFINITIONS ${ECWAM_PRIVATE_DEFINITIONS}
PUBLIC_DEFINITIONS ${ECWAM_DEFINITIONS}
)
Expand Down

0 comments on commit decbfe5

Please sign in to comment.