Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ccpp/framework
Submodule framework updated 85 files
+1 −0 .github/workflows/python.yaml
+3 −3 .travis.yml
+9 −55 CMakeLists.txt
+1 −1 CODEOWNERS
+0 −16 cmake/add_sources.cmake
+0 −218 cmake/code_coverage.cmake
+0 −48 cmake/detect_openmp.cmake
+0 −7 cmake/export_dynamic.cmake
+6 −6 doc/HelloWorld/hello_scheme.meta
+2 −2 doc/HelloWorld/hello_world_host.meta
+6 −6 doc/HelloWorld/temp_adjust.meta
+84 −190 scripts/ccpp_capgen.py
+16 −101 scripts/ccpp_datafile.py
+9 −6 scripts/ccpp_fortran_to_metadata.py
+1 −1 scripts/ccpp_prebuild.py
+238 −1,997 scripts/ccpp_suite.py
+6 −2 scripts/code_block.py
+1 −1 scripts/common.py
+156 −72 scripts/constituents.py
+1 −1 scripts/conversion_tools/unit_conversion.py
+45 −34 scripts/ddt_library.py
+2 −2 scripts/file_utils.py
+13 −15 scripts/fortran_tools/fortran_write.py
+63 −28 scripts/fortran_tools/parse_fortran.py
+65 −66 scripts/fortran_tools/parse_fortran_file.py
+385 −0 scripts/framework_env.py
+41 −26 scripts/host_cap.py
+39 −31 scripts/host_model.py
+1 −1 scripts/metadata2html.py
+8 −2 scripts/metadata_parser.py
+73 −54 scripts/metadata_table.py
+252 −659 scripts/metavar.py
+1 −1 scripts/mkcap.py
+1 −1 scripts/mkdoc.py
+1 −1 scripts/mkstatic.py
+2 −0 scripts/parse_tools/__init__.py
+24 −12 scripts/parse_tools/parse_checkers.py
+1 −1 scripts/parse_tools/parse_log.py
+7 −2 scripts/parse_tools/parse_object.py
+6 −2 scripts/parse_tools/parse_source.py
+6 −2 scripts/parse_tools/preprocess.py
+123 −3 scripts/parse_tools/xml_tools.py
+8 −3 scripts/state_machine.py
+1,912 −0 scripts/suite_objects.py
+1,294 −0 scripts/var_props.py
+5 −46 src/CMakeLists.txt
+190 −164 src/ccpp_constituent_prop_mod.F90
+4 −4 test/advection_test/cld_ice.meta
+4 −4 test/advection_test/cld_liq.meta
+3 −3 test/advection_test/run_test
+5 −2 test/advection_test/test_host.F90
+9 −2 test/advection_test/test_host.meta
+1 −1 test/advection_test/test_host_data.meta
+8 −3 test/advection_test/test_reports.py
+6 −6 test/capgen_test/environ_conditions.meta
+6 −6 test/capgen_test/make_ddt.meta
+5 −5 test/capgen_test/run_test
+4 −2 test/capgen_test/temp_adjust.F90
+6 −6 test/capgen_test/temp_adjust.meta
+6 −6 test/capgen_test/temp_calc_adjust.meta
+8 −8 test/capgen_test/temp_set.meta
+7 −4 test/capgen_test/test_host.F90
+9 −2 test/capgen_test/test_host.meta
+1 −1 test/capgen_test/test_host_data.meta
+9 −4 test/capgen_test/test_reports.py
+6 −0 test/run_doctest.sh
+62 −0 test/run_tests.sh
+2 −2 test/unit_tests/sample_files/test_host.meta
+6 −6 test/unit_tests/sample_files/test_multi_ccpp_arg_tables.meta
+2 −2 test/unit_tests/sample_scheme_files/CCPPeq1_var_in_fort_meta.meta
+2 −2 test/unit_tests/sample_scheme_files/CCPPeq1_var_missing_in_fort.meta
+2 −2 test/unit_tests/sample_scheme_files/CCPPeq1_var_missing_in_meta.meta
+2 −2 test/unit_tests/sample_scheme_files/CCPPgt1_var_in_fort_meta.meta
+2 −2 test/unit_tests/sample_scheme_files/CCPPnotset_var_missing_in_meta.meta
+2 −2 test/unit_tests/sample_scheme_files/invalid_dummy_arg.meta
+2 −2 test/unit_tests/sample_scheme_files/invalid_subr_stmnt.meta
+6 −6 test/unit_tests/sample_scheme_files/mismatch_intent.meta
+4 −4 test/unit_tests/sample_scheme_files/missing_arg_table.meta
+6 −6 test/unit_tests/sample_scheme_files/missing_fort_header.meta
+6 −6 test/unit_tests/sample_scheme_files/reorder.meta
+6 −6 test/unit_tests/sample_scheme_files/temp_adjust.meta
+38 −31 test/unit_tests/test_metadata_scheme_file.py
+65 −68 test/unit_tests/test_metadata_table.py
+424 −0 test/unit_tests/test_var_transforms.py
+7 −3 tests/test_metadata_parser.py
2 changes: 1 addition & 1 deletion ccpp/physics
Submodule physics updated 113 files
811 changes: 811 additions & 0 deletions scm/data/physics_input_data/sfc_emissivity_idx.txt

Large diffs are not rendered by default.

166 changes: 88 additions & 78 deletions scm/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,76 +159,99 @@ else (APPLE)
message (FATAL_ERROR "Unsupported platform, only Linux and MacOSX are supported at this time.")
endif()

# Build Options
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@climbfuji Would you take a quick look at these changes in CMakeLists.txt to see if they make sense? I basically copied the flag setting that you pointed to in ufs-weather-model/cmake/Intel.cmake and gnu.cmake and added the bit that sets CMAKE_Fortran_FLAGS_PHYSICS/DYNAMICS from ufs-weather-model/FV3/ccpp/CMakeLists.txt. I didn't attempt to do anything with the INSTALL command.

set(32BIT OFF CACHE BOOL "Enable 32BIT (single precision arithmetic in SCM)")
set(AVX2 ON CACHE BOOL "Enable AVX2 instruction set")
set(AVX OFF CACHE BOOL "Enable AVX-I instruction set")
set(SIMDMULTIARCH OFF CACHE BOOL "Enable multi-target SIMD instruction sets")

#------------------------------------------------------------------------------
# Set compile options
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
# Basic settings
#if CFLAGS, CXX_FLAGS, or FFLAGS are defined via environment variables, use them
if (DEFINED ENV{CFLAGS})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fPIC" CACHE STRING "" FORCE)
else (DEFINED ENV{CFLAGS})
set (CMAKE_C_FLAGS "-O0 -g -fPIC" CACHE STRING "" FORCE)
endif (DEFINED ENV{CFLAGS})
if (DEFINED ENV{CXXFLAGS})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -fPIC" CACHE STRING "" FORCE)
else (DEFINED ENV{CXXFLAGS})
set (CMAKE_CXX_FLAGS "-O0 -g -fPIC" CACHE STRING "" FORCE)
endif (DEFINED ENV{CXXFLAGS})
if (DEFINED ENV{FFLAGS})
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O0 -g -fPIC" CACHE STRING "" FORCE)
else (DEFINED ENV{FFLAGS})
set (CMAKE_Fortran_FLAGS "-O0 -g -fPIC" CACHE STRING "" FORCE)
endif (DEFINED ENV{FFLAGS})
# Compiler-dependent settings
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcheck=all -fbacktrace -ffpe-trap=zero -finit-real=nan -ggdb -ffree-line-length-none -cpp -fdefault-real-8 -fdefault-double-8 -fno-range-check")
if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ggdb -fbacktrace -cpp -fcray-pointer -ffree-line-length-none -fno-range-check")

if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
endif()

if(NOT 32BIT)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fdefault-double-8")
endif()

if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
endif()

set(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback -fpp -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -nowarn -sox -align array64byte -qno-opt-dynamic-align")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qno-opt-dynamic-align -sox -fp-model source")

if(NOT 32BIT)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real-size 64")
endif()

if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv -init=snan,arrays")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -ftrapuv")
else()
if(32BIT)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2 -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2 -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3 -no-prec-div -no-prec-sqrt")
endif()
elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -traceback")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -traceback")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpe0 -warn -traceback -debug extended -fpp -r8")
elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -traceback")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -traceback")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mnoipa -traceback -Mpreprocess -r8")
else (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
message (FATAL_ERROR "This program has only been compiled with gfortran, pgf90 and ifort. If another compiler is needed, the appropriate flags must be added in ${CMAKE_SOURCE_DIR}/CMakeLists.txt")
endif (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
elseif (${CMAKE_BUILD_TYPE} MATCHES "Release")
#if CFLAGS, CXX_FLAGS, or FFLAGS are defined via environment variables, use them
if (DEFINED ENV{CFLAGS})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -g -fPIC" CACHE STRING "" FORCE)
else (DEFINED ENV{CFLAGS})
set (CMAKE_C_FLAGS "-O2 -g -fPIC" CACHE STRING "" FORCE)
endif (DEFINED ENV{CFLAGS})
if (DEFINED ENV{CXXFLAGS})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -g -fPIC" CACHE STRING "" FORCE)
else (DEFINED ENV{CXXFLAGS})
set (CMAKE_CXX_FLAGS "-O2 -g -fPIC" CACHE STRING "" FORCE)
endif (DEFINED ENV{CXXFLAGS})
if (DEFINED ENV{FFLAGS})
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2 -g -fPIC" CACHE STRING "" FORCE)
else (DEFINED ENV{FFLAGS})
set (CMAKE_Fortran_FLAGS "-O2 -g -fPIC" CACHE STRING "" FORCE)
endif (DEFINED ENV{FFLAGS})
# Compiler-dependent settings
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none -cpp -fdefault-real-8 -fdefault-double-8 -fno-range-check")
if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -debug minimal")
set(FAST "-fast-transcendentals")
if(AVX2)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -march=core-avx2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=core-avx2")
elseif(SIMDMULTIARCH)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -axSSE4.2,CORE-AVX2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -axSSE4.2,CORE-AVX2")
elseif(AVX)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -march=core-avx-i")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=core-avx-i")
endif()
elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ftz -debug minimal -fpp -r8")
elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mipa=noconst -Mpreprocess -r8")
else (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
message (FATAL_ERROR "This program has only been compiled with gfortran, pgf90 and ifort. If another compiler is needed, the appropriate flags must be added in ${CMAKE_SOURCE_DIR}/CMakeLists.txt")
endif (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
endif (${CMAKE_BUILD_TYPE} MATCHES "Debug")
endif()

set(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
else (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
message (FATAL_ERROR "This program has only been compiled with gfortran and ifort. If another compiler is needed, the appropriate flags must be added in ${CMAKE_SOURCE_DIR}/CMakeLists.txt")
endif (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")


#------------------------------------------------------------------------------
# Set flag for 32bit dynamics build
if(32BIT)
message(STATUS "Compile CCPP slow physics with 64-bit precision, fast physics with 32-bit precision")
add_definitions(-DOVERLOAD_R4)
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
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_PHYSICS "-fdefault-real-8 -fdefault-double-8")
endif()
set(CMAKE_Fortran_FLAGS_DYNAMICS "")
else()
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()

#------------------------------------------------------------------------------
# Set netCDF flags for preprocessor, compiler and linker (if defined)
Expand Down Expand Up @@ -283,19 +306,6 @@ else (SIONLIB)
message (STATUS "Disable SIONlib support")
endif (SIONLIB)

#------------------------------------------------------------------------------
# The Fortran compiler/linker flag inserted by cmake to create shared libraries
# with the Intel compiler is deprecated (-i_dynamic), correct here.
# CMAKE_Fortran_COMPILER_ID = {"Intel", "PGI", "GNU", "Clang", "MSVC", ...}
if ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "Intel")
string(REPLACE "-i_dynamic" "-shared-intel"
CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS
"${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS}")
string(REPLACE "-i_dynamic" "-shared-intel"
CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS
"${CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS}")
endif()

#------------------------------------------------------------------------------
# CMake Modules
# Set the CMake module path
Expand Down
Loading