Skip to content

Commit

Permalink
update esmf find
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jun 17, 2024
1 parent 88c88dd commit 29264f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,18 @@ endif()
if (NOT DEFINED MPILIB OR NOT ${MPILIB} STREQUAL "mpi-serial")
find_package(MPI REQUIRED)
endif()
set(CMAKE_MODULE_PATH "$ENV{NCAR_ROOT_ESMF}/cmake")
find_package(ESMF REQUIRED)

if (DEFINED ENV{ESMFMKFILE})
get_filename_component(ESMFLIB $ENV{ESMFMKFILE} DIRECTORY CACHE)
endif()
list(APPEND CMAKE_MODULE_PATH ${ESMFLIB}/../cmake)

message("ESMF cmake is ${CMAKE_MODULE_PATH}")
find_package(ESMF REQUIRED)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${ESMF_F90COMPILEPATHS}")



if("${COMPILER}" STREQUAL "nag")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -D__NAG__")
endif()
Expand All @@ -56,7 +64,7 @@ include(${GENF90_PATH}/CMake/genf90_utils.cmake)
process_genf90_source_list("${GENF90SOURCES}" ${CMAKE_CURRENT_BINARY_DIR} SHAREGENF90SRC)
file(GLOB SOURCES "src/*.c" "src/*.F90" "src/water_isotopes/*.F90" "RandNum/src/*.F90" "RandNum/src/*/*.F90" "RandNum/src/*/*.c")
list(APPEND SOURCES "${SHAREGENF90SRC}")
add_definitions(-DCPRINTEL)
#add_definitions(-DCPRINTEL)

add_library(share STATIC ${SOURCES})
target_include_directories(share PRIVATE include RandNum/include)
Expand Down
4 changes: 2 additions & 2 deletions src/shr_mpi_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ Module shr_mpi_mod
shr_mpi_maxr0, &
shr_mpi_maxr1
end interface shr_mpi_max

#include <mpif.h> ! mpi library include file
! mpi library include file
#include <mpif.h>

!===============================================================================
CONTAINS
Expand Down

0 comments on commit 29264f3

Please sign in to comment.