Skip to content

Commit

Permalink
IFS-SOURCE-ECWAM-SYNC: building with ecflow_light now a configurable …
Browse files Browse the repository at this point in the history
…option
  • Loading branch information
awnawab committed Jan 9, 2024
1 parent 3f77924 commit b326f5a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
12 changes: 4 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ ecbuild_add_option( FEATURE ECWAM_LAUNCH
DEFAULT ON
DESCRIPTION "Use share/ecwam/scripts/ecwam-launch script to run ecwam tests" )

ecbuild_add_option( FEATURE ECFLOW
DESCRIPTION "ecflow meter updates"
REQUIRED_PACKAGES "ecflow_light")

if( HAVE_ECWAM_LAUNCH )
# Overwrite meaning of mpiexec
set( ECWAM_LAUNCH ${CMAKE_CURRENT_SOURCE_DIR}/share/ecwam/scripts/ecwam-launch )
Expand Down Expand Up @@ -90,14 +94,6 @@ if( HAVE_OMP )
set( OpenMP_Fortran_LIBRARIES OpenMP::OpenMP_Fortran )
endif()

### Check if this is a standalone ecWAM build
if(PROJECT_IS_TOP_LEVEL OR (PARENT_PROJECT_NAME STREQUAL "ecwam-bundle"))
set(ECWAM_STANDALONE 1)
else()
set(ECWAM_STANDALONE 0)
ecbuild_find_package( ecflow_light REQUIRED )
endif()

### Sources

include(ecwam_compile_flags)
Expand Down
10 changes: 8 additions & 2 deletions src/ecwam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -420,19 +420,25 @@ else()
unset( ${PNAME}_OCEANMODEL_INCLUDE_DIRS )
endif()

if( HAVE_ECFLOW )
list(APPEND ECWAM_PRIVATE_DEFINITIONS WAM_HAVE_ECFLOW)
endif()

ecbuild_add_library(
TARGET ${ecwam}
SOURCES ${ecwam_srcs}
PUBLIC_LIBS fiat parkind_${prec} $<$<NOT:${ECWAM_STANDALONE}>:ecflow_lightf> ${ecwam}_intfb
PUBLIC_LIBS fiat parkind_${prec} ${ecwam}_intfb
${MPI_Fortran_LIBRARIES}
${${PNAME}_OCEANMODEL_LIBRARIES}
PRIVATE_LIBS eccodes_f90
${MULTIO_LIBRARIES}
${OpenMP_Fortran_LIBRARIES}
field_api_${prec}
$<${HAVE_ECFLOW}:ecflow_lightf>
PUBLIC_INCLUDES $<INSTALL_INTERFACE:include>
PRIVATE_INCLUDES ${${PNAME}_OCEANMODEL_INCLUDE_DIRS}
PUBLIC_DEFINITIONS ${ECWAM_DEFINITIONS} $<${ECWAM_STANDALONE}:_ECWAM_STANDALONE>
PRIVATE_DEFINITIONS ${ECWAM_PRIVATE_DEFINITIONS}
PUBLIC_DEFINITIONS ${ECWAM_DEFINITIONS}
)

ecwam_target_fortran_module_directory(
Expand Down
6 changes: 3 additions & 3 deletions src/ecwam/wavemdl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
USE YOWASSI , ONLY : WAMASSI
USE YOWGRIB , ONLY : IGRIB_GET_VALUE
USE MPL_MODULE, ONLY : MPL_BARRIER, MPL_GATHERV
#ifndef _ECWAM_STANDALONE
#ifdef WAM_HAVE_ECFLOW
USE ECFLOW_LIGHT, ONLY : ECFLOW_LIGHT_UPDATE_METER
#endif
! ---------------------------------------------------------------------
Expand Down Expand Up @@ -288,7 +288,7 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
LOGICAL :: LLINIT
LOGICAL :: LLINIT_FIELDG

#ifndef _ECWAM_STANDALONE
#ifdef WAM_HAVE_ECFLOW
CHARACTER(LEN = 64) :: METER_NAME
INTEGER(KIND=JWIM) :: METER_VALUE
INTEGER(KIND=JWIM) :: ERROR
Expand Down Expand Up @@ -670,7 +670,7 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
CALL DIFDATE (CDATEF, CDTPRO, IFCST)
IFCSTEP_HOUR=IFCST/3600
IF (IRANK == 1) THEN
#ifdef _ECWAM_STANDALONE
#ifndef WAM_HAVE_ECFLOW
WRITE(CLSETEV,' (A25,'' step '',I8,''&'') ') CMETER,IFCSTEP_HOUR
CLSMSNAME=" "
CLECFNAME=" "
Expand Down

0 comments on commit b326f5a

Please sign in to comment.