Skip to content

Commit

Permalink
Major cleanup of CCPP cmake build config (#436)
Browse files Browse the repository at this point in the history
* Major cleanup of CCPP cmake build config.
  • Loading branch information
climbfuji authored Dec 14, 2021
1 parent e7687f4 commit a1b0f33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions ccpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,20 @@ endif()
#------------------------------------------------------------------------------
# Set flag for 32bit dynamics build
if(32BIT)
set(DYN32 ON CACHE BOOL "Enable support for 32bit fast physics in CCPP")
message(STATUS "Dynamics compiled with 32-bit option, adjust fv_sat_adj types")
message(STATUS "Compile CCPP slow physics with 64-bit precision, fast physics with 32-bit precision")
add_definitions(-DOVERLOAD_R4)
message ("Force 64 bits in ccpp")
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real-size 64")
set(CMAKE_Fortran_FLAGS_PHYSICS "-real-size 64 -no-prec-div -no-prec-sqrt")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8")
set(CMAKE_Fortran_FLAGS_PHYSICS "-fdefault-real-8 -fdefault-double-8")
endif()
set(CMAKE_Fortran_FLAGS_DYNAMICS "")
else()
set(DYN32 OFF CACHE BOOL "Disable support for 32bit fast physics in CCPP")
message(STATUS "Compile CCPP physics with 64-bit precision")
remove_definitions(-DOVERLOAD_R8)
remove_definitions(-DOVERLOAD_R4)
set(CMAKE_Fortran_FLAGS_PHYSICS "")
set(CMAKE_Fortran_FLAGS_DYNAMICS "")
endif()

#------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion ccpp/framework
2 changes: 1 addition & 1 deletion ccpp/physics
Submodule physics updated 1 files
+68 −161 CMakeLists.txt

0 comments on commit a1b0f33

Please sign in to comment.