Skip to content

Commit

Permalink
Alquimia code and compilation with EMI
Browse files Browse the repository at this point in the history
  • Loading branch information
bsulman committed Jun 5, 2024
1 parent 1355c30 commit 981cf9e
Show file tree
Hide file tree
Showing 6 changed files with 3,312 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ module ExternalModelConstants
integer, public, parameter :: EM_ID_STUB = 500
integer, parameter, public :: EM_STUB_SOIL_HYDRO_STAGE = 501
integer, parameter, public :: EM_STUB_SOIL_THERMAL_STAGE = 502

integer, public, parameter :: EM_ID_ALQUIMIA = 600
integer, public, parameter :: EM_ALQUIMIA_SOLVE_STAGE = 601
integer, public, parameter :: EM_ALQUIMIA_COLDSTART_STAGE = 602

! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
! IDs for variable sent from ALM to External Model
Expand Down
3 changes: 2 additions & 1 deletion components/elm/src/external_models/emi/src/em/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ add_subdirectory(fates)
add_subdirectory(ptm)
add_subdirectory(vsfm)
add_subdirectory(stub)
add_subdirectory(alquimia)

set(EMI_LIBRARIES emi_em_base; emi_em_betr; emi_em_fates; emi_em_ptm; emi_em_vsfm; emi_em_stub; ${EMI_LIBRARIES} PARENT_SCOPE)
set(EMI_LIBRARIES emi_em_base; emi_em_betr; emi_em_fates; emi_em_ptm; emi_em_vsfm; emi_em_stub; emi_em_alquimia; ${EMI_LIBRARIES} PARENT_SCOPE)


Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
set(EMI_EM_ALQUIMIA_SOURCES
ExternalModelAlquimiaMod.F90
)

include_directories(${CMAKE_BINARY_DIR}/elm_stub/shr)
include_directories(${CMAKE_BINARY_DIR}/elm_stub/utils)
include_directories(${CMAKE_BINARY_DIR}/elm_stub/elm_types_stub)
include_directories(${CMAKE_BINARY_DIR}/constants)
include_directories(${CMAKE_BINARY_DIR}/emi_data_types)
include_directories(${CMAKE_BINARY_DIR}/emi_data_definition)
include_directories(${CMAKE_BINARY_DIR}/em/base)

# Find PETSC stuff
# Not necessary for Crunch?
find_package(PETSc)
if (NOT PETSC_FOUND)
message(FATAL_ERROR "PETSc was not found.")
endif()
include_directories(${PETSC_INCLUDES})

# Include PETSc in the rpath.
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:${PETSC_DIR}/${PETSC_ARCH}/lib")

include_directories(${ALQUIMIA_DIR})
link_libraries(${ALQUIMIA_DIR}/libalquimia.so ${PETSC_LIBRARIES})
#link_libraries(${PETSC_DIR}/${PETSC_ARCH}/lib/libmpifort.dylib)) # This was necessary on Mac
link_libraries($ENV{PFLOTRAN_DIR}/libpflotranchem.a)


include(add_emi_library)
add_emi_library(emi_em_alquimia ${EMI_EM_ALQUIMIA_SOURCES} )




set(EMI_LIBRARIES emi_em_alquimia;${EMI_LIBRARIES} PARENT_SCOPE)
set(EMI_LIBRARIES emi_em_alquimia;${EMI_LIBRARIES})


if (NOT CMAKE_INSTALL_PREFIX STREQUAL "INSTALL_DISABLED")
install(TARGETS emi_em_alquimia DESTINATION lib)
file(GLOB HEADERS *.h)
install(FILES ${HEADERS} DESTINATION include/)
endif()
Loading

0 comments on commit 981cf9e

Please sign in to comment.