Skip to content

Commit

Permalink
Merge pull request #1 from climbfuji/no_arg_mismatch
Browse files Browse the repository at this point in the history
Update branch no_arg_mismatch
  • Loading branch information
DusanJovic-NOAA authored Feb 26, 2024
2 parents c87dbb7 + 13ec121 commit 44eb919
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 17 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.10)

project(ccpp_framework
VERSION 5.0.0
Expand All @@ -11,10 +11,11 @@ set(AUTHORS "Dom Heinzeller" "Grant Firl" "Mike Kavulich" "Steve Goldhaber")
string(TIMESTAMP YEAR "%Y")

#------------------------------------------------------------------------------
# Set MPI flags for C/C++/Fortran
if (MPI)
find_package(MPI REQUIRED C Fortran)
endif (MPI)
# Set MPI flags for C/C++/Fortran with MPI F08 interface
find_package(MPI REQUIRED C Fortran)
if(NOT MPI_Fortran_HAVE_F08_MODULE)
message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface")
endif()

#------------------------------------------------------------------------------
# Set OpenMP flags for C/C++/Fortran
Expand Down
8 changes: 0 additions & 8 deletions src/ccpp_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
!
module ccpp_types

#ifdef MPI
use mpi_f08, only: MPI_Comm
#endif

!! \section arg_table_ccpp_types
!! \htmlinclude ccpp_types.html
Expand All @@ -33,12 +31,6 @@ module ccpp_types
public :: ccpp_t, one
public :: MPI_Comm

#ifndef MPI
type :: MPI_Comm
integer :: dummy = 0
end type MPI_Comm
#endif

!> @var Definition of constant one
integer, parameter :: one = 1

Expand Down
12 changes: 10 additions & 2 deletions test_prebuild/test_blocked_data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.10)

project(ccpp_blocked_data
VERSION 1.0.0
LANGUAGES Fortran)
LANGUAGES C Fortran)

#------------------------------------------------------------------------------
# Request a static build
option(BUILD_SHARED_LIBS "Build a shared library" OFF)

#------------------------------------------------------------------------------
# Set MPI flags for C/C++/Fortran with MPI F08 interface
find_package(MPI REQUIRED C Fortran)
if(NOT MPI_Fortran_HAVE_F08_MODULE)
message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface")
endif()

#------------------------------------------------------------------------------
# Set the sources: physics type definitions
set(TYPEDEFS $ENV{CCPP_TYPEDEFS})
Expand Down Expand Up @@ -57,6 +64,7 @@ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O0 -fno-unsafe-math-optimizatio

#------------------------------------------------------------------------------
add_library(ccpp_blocked_data STATIC ${SCHEMES} ${CAPS} ${API})
target_link_libraries(ccpp_blocked_data PRIVATE MPI::MPI_Fortran)
# Generate list of Fortran modules from defined sources
foreach(source_f90 ${CAPS} ${API})
get_filename_component(tmp_source_f90 ${source_f90} NAME)
Expand Down
3 changes: 3 additions & 0 deletions test_prebuild/test_blocked_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ mkdir build
cd build
cmake .. 2>&1 | tee log.cmake
make 2>&1 | tee log.make
./test_blocked_data.x
# On systems where linking against the MPI library requires a parallel launcher,
# use 'mpirun -np 1 ./test_blocked_data.x' or 'srun -n 1 ./test_blocked_data.x' etc.
```
12 changes: 10 additions & 2 deletions test_prebuild/test_chunked_data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.10)

project(ccpp_chunked_data
VERSION 1.0.0
LANGUAGES Fortran)
LANGUAGES C Fortran)

#------------------------------------------------------------------------------
# Request a static build
option(BUILD_SHARED_LIBS "Build a shared library" OFF)

#------------------------------------------------------------------------------
# Set MPI flags for C/C++/Fortran with MPI F08 interface
find_package(MPI REQUIRED C Fortran)
if(NOT MPI_Fortran_HAVE_F08_MODULE)
message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface")
endif()

#------------------------------------------------------------------------------
# Set the sources: physics type definitions
set(TYPEDEFS $ENV{CCPP_TYPEDEFS})
Expand Down Expand Up @@ -57,6 +64,7 @@ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O0 -fno-unsafe-math-optimizatio

#------------------------------------------------------------------------------
add_library(ccpp_chunked_data STATIC ${SCHEMES} ${CAPS} ${API})
target_link_libraries(ccpp_chunked_data PRIVATE MPI::MPI_Fortran)
# Generate list of Fortran modules from defined sources
foreach(source_f90 ${CAPS} ${API})
get_filename_component(tmp_source_f90 ${source_f90} NAME)
Expand Down
3 changes: 3 additions & 0 deletions test_prebuild/test_chunked_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ mkdir build
cd build
cmake .. 2>&1 | tee log.cmake
make 2>&1 | tee log.make
./test_chunked_data.x
# On systems where linking against the MPI library requires a parallel launcher,
# use 'mpirun -np 1 ./test_chunked_data.x' or 'srun -n 1 ./test_chunked_data.x' etc.
```

0 comments on commit 44eb919

Please sign in to comment.