Skip to content

Commit

Permalink
More changes to CMakelists
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed Jan 13, 2025
1 parent 2bbd4f6 commit 98f02f0
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 71 deletions.
2 changes: 1 addition & 1 deletion ccpp/framework
Submodule framework updated 45 files
+8 −5 scripts/ccpp_capgen.py
+5 −2 scripts/ccpp_prebuild.py
+73 −51 scripts/ccpp_suite.py
+6 −4 scripts/constituents.py
+17 −6 scripts/ddt_library.py
+1 −1 scripts/fortran_tools/fortran_write.py
+1 −1 scripts/framework_env.py
+7 −7 scripts/host_cap.py
+3 −0 scripts/host_model.py
+60 −42 scripts/metavar.py
+10 −6 scripts/mkcap.py
+6 −1 scripts/parse_tools/parse_checkers.py
+107 −32 scripts/suite_objects.py
+1 −1 test/capgen_test/run_test
+2 −1 test/capgen_test/test_host.F90
+1 −1 test/capgen_test/test_reports.py
+191 −0 test/ddthost_test/CMakeLists.txt
+6 −0 test/ddthost_test/README.md
+8 −0 test/ddthost_test/ddt_suite.xml
+2 −0 test/ddthost_test/ddt_suite_files.txt
+96 −0 test/ddthost_test/environ_conditions.F90
+110 −0 test/ddthost_test/environ_conditions.meta
+16 −0 test/ddthost_test/host_ccpp_ddt.F90
+31 −0 test/ddthost_test/host_ccpp_ddt.meta
+132 −0 test/ddthost_test/make_ddt.F90
+127 −0 test/ddthost_test/make_ddt.meta
+282 −0 test/ddthost_test/run_test
+24 −0 test/ddthost_test/setup_coeffs.F90
+29 −0 test/ddthost_test/setup_coeffs.meta
+84 −0 test/ddthost_test/temp_adjust.F90
+119 −0 test/ddthost_test/temp_adjust.meta
+95 −0 test/ddthost_test/temp_calc_adjust.F90
+87 −0 test/ddthost_test/temp_calc_adjust.meta
+4 −0 test/ddthost_test/temp_scheme_files.txt
+113 −0 test/ddthost_test/temp_set.F90
+181 −0 test/ddthost_test/temp_set.meta
+12 −0 test/ddthost_test/temp_suite.xml
+430 −0 test/ddthost_test/test_host.F90
+18 −0 test/ddthost_test/test_host.meta
+51 −0 test/ddthost_test/test_host_data.F90
+52 −0 test/ddthost_test/test_host_data.meta
+140 −0 test/ddthost_test/test_host_mod.F90
+98 −0 test/ddthost_test/test_host_mod.meta
+178 −0 test/ddthost_test/test_reports.py
+8 −0 test/run_fortran_tests.sh
81 changes: 39 additions & 42 deletions scm/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

cmake_minimum_required(VERSION 3.14)

project(scm
Expand All @@ -15,17 +16,32 @@ get_filename_component(CCPP_ROOT "${TEST_ROOT}" DIRECTORY)

#------------------------------------------------------------------------------
#
# Create list of SCHEME_FILES, HOST_FILES, and SUITE_FILES
# Create list of SCHEME_FILES and HOST_FILES
# Paths should be relative to CMAKE_SOURCE_DIR (this file's directory)
#
#------------------------------------------------------------------------------
LIST(APPEND SCHEME_FILES "${CCPP_ROOT}/ccpp/config/scheme_files.txt")
LIST(APPEND HOST_FILES "${CCPP_ROOT}/ccpp/config/host_files.txt")
LIST(APPEND SUITE_FILES "${CCPP_ROOT}/ccpp/suites/suite_SCM_GFS_v16.xml")
#LIST(APPEND SUITE_FILES "${CCPP_ROOT}/ccpp/suites/suite_SCM_GFS_v16_RRTMGP.xml")
#LIST(APPEND SUITE_FILES "${CCPP_ROOT}/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1.xml")
#LIST(APPEND SUITE_FILES "${CCPP_ROOT}/ccpp/suites/suite_SCM_HRRR_gf.xml")
#LIST(APPEND SUITE_FILES "${CCPP_ROOT}/ccpp/suites/suite_SCM_WoFS_v0.xml")

#------------------------------------------------------------------------------
#
# Which Suites are we building with?
#
#------------------------------------------------------------------------------
if(DEFINED CCPP_SUITES)
set(suite_string ${CCPP_SUITES})
message(STATUS "Calling CCPP code generator (ccpp_capgen.py) for suites ${suite_string} ...")
unset(CCPP_SUITES CACHE)
else()
execute_process(
COMMAND scm/src/suite_info.py
WORKING_DIRECTORY ${CCPP_ROOT}
OUTPUT_VARIABLE suite_string
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(_ccpp_suites_arg "--suites=${suite_string}")
message(STATUS "Calling CCPP code generator (ccpp_capgen.py) for suites listed in scm/src/suite_info.py: ${_ccpp_suites_arg}.")
endif()

#------------------------------------------------------------------------------
#
Expand All @@ -41,9 +57,6 @@ SET(CCPP_CAP_FILES "${CMAKE_BINARY_DIR}/ccpp" CACHE

SET(CCPP_FRAMEWORK ${CCPP_ROOT}/ccpp/framework/scripts)

# DJS2024: Haven't tested Capgen in DEBUG mode wtih SCM. *ToDo*
#ADD_COMPILE_OPTIONS(-O0)

if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
MESSAGE(STATUS "gfortran being used.")
ADD_COMPILE_OPTIONS(-ggdb)
Expand Down Expand Up @@ -104,10 +117,6 @@ FOREACH(FILE ${SCHEME_FILENAMES})
# Set character seperator
MATH(EXPR FCOUNT "${FCOUNT}+1")
set(SEPERATOR "")
# if (${FCOUNT} EQUAL ${NSCHEME_FILES})
# set(SEPERATOR "")
# endif()
# Source file list
string(CONCAT SCHEME_FILENAME ${CCPP_ROOT} "/" ${FILE} ${SEPERATOR} )
string(REGEX REPLACE "\n$" "" SCHEME_FILENAME "${SCHEME_FILENAME}")
list(APPEND SCHEME_SOURCE ${SCHEME_FILENAME})
Expand Down Expand Up @@ -136,9 +145,6 @@ FOREACH(FILE ${HOST_FILENAMES})
# Set character seperator
MATH(EXPR FCOUNT "${FCOUNT}+1")
set(SEPERATOR "")
# if (${FCOUNT} EQUAL ${NHOST_FILES})
# set(SEPERATOR "")
# endif()
string(CONCAT HOST_FILENAME ${CCPP_ROOT} "/" ${FILE} ${SEPERATOR} )
list(APPEND HOST_SOURCE ${HOST_FILENAME})
#
Expand All @@ -150,19 +156,30 @@ string(REPLACE ";" "," HOST_METADATA "${HOST_METADATA}")

#------------------------------------------------------------------------------
#
# Run ccpp_capgen
# Create SDF list from ${suite_string), which is provided via the command line,
# or comes from scm/src/suite_info.py
#
#------------------------------------------------------------------------------
string(REPLACE "," ";" suite_string "${suite_string}")
set(suite_list ${suite_string})
FOREACH(suite ${suite_list})
list(APPEND SUITES "${CCPP_ROOT}/ccpp/suites/suite_${suite}.xml")
ENDFOREACH(suite)
string(REPLACE ";" "," SUITES "${SUITES}")

string(REPLACE ";" "," SUITE_XML "${SUITE_FILES}")
#------------------------------------------------------------------------------
#
# Run ccpp_capgen
#
#------------------------------------------------------------------------------

set(CAPGEN_CMD "${CCPP_FRAMEWORK}/ccpp_capgen.py")
list(APPEND CAPGEN_CMD "--host-files")
list(APPEND CAPGEN_CMD ${HOST_METADATA})
list(APPEND CAPGEN_CMD "--scheme-files")
list(APPEND CAPGEN_CMD ${SCHEME_METADATA})
list(APPEND CAPGEN_CMD "--suites")
list(APPEND CAPGEN_CMD "${SUITE_XML}")
list(APPEND CAPGEN_CMD "${SUITES}")
list(APPEND CAPGEN_CMD "--host-name")
list(APPEND CAPGEN_CMD "SCM")
list(APPEND CAPGEN_CMD "--output-root")
Expand Down Expand Up @@ -196,27 +213,6 @@ else(RES EQUAL 0)
MESSAGE(FATAL_ERROR "CCPP cap generation FAILED: result = ${RES}")
endif(RES EQUAL 0)

#------------------------------------------------------------------------------
#
# Retrieve the list of files from datatable.xml and set to CCPP_CAPS
#
#------------------------------------------------------------------------------
set(DTABLE_CMD "${CCPP_FRAMEWORK}/ccpp_datafile.py")
list(APPEND DTABLE_CMD "${CCPP_CAP_FILES}/datatable.xml")
list(APPEND DTABLE_CMD "--ccpp-files")
list(APPEND DTABLE_CMD "--separator=\\;")
string(REPLACE ";" " " DTABLE_STRING "${DTABLE_CMD}")
MESSAGE(STATUS "Running: ${DTABLE_STRING}")
EXECUTE_PROCESS(COMMAND ${DTABLE_CMD} OUTPUT_VARIABLE CCPP_CAPS
RESULT_VARIABLE RES
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
message(STATUS "CCPP_CAPS = ${CCPP_CAPS}")
if (RES EQUAL 0)
MESSAGE(STATUS "CCPP cap files retrieved")
else(RES EQUAL 0)
MESSAGE(FATAL_ERROR "CCPP cap file retrieval FAILED: result = ${RES}")
endif(RES EQUAL 0)

MESSAGE(STATUS "CCPP capgen step complete")

####################################################################
Expand Down Expand Up @@ -393,8 +389,9 @@ SET(scm_source_files scm.F90
scm_output.F90
)

message(STATUS "${CCPP_CAPS}")
ADD_EXECUTABLE(scm ${scm_source_files} ${CCPP_CAPS})
include(${CCPP_ROOT}/scm/bin/ccpp/physics/CCPP_CAPS.cmake)
include(${CCPP_ROOT}/scm/src/CCPP_STATIC_API.cmake)
ADD_EXECUTABLE(scm ${scm_source_files} ${API})

if(OPENMP)
TARGET_LINK_LIBRARIES(scm PUBLIC OpenMP::OpenMP_Fortran)
Expand Down
56 changes: 28 additions & 28 deletions test/rt_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@
#----------------------------------------------------------------------------------------------------------------------------------------------
# Supported suites for CCPP Version 7 release
#----------------------------------------------------------------------------------------------------------------------------------------------
# {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
# {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
{"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v16"}, \
# {"case": "arm_sgp_summer_1997_A", "suite": "SCM_WoFS_v0"}, \
# {"case": "arm_sgp_summer_1997_A", "suite": "SCM_HRRR_gf"}, \
# {"case": "twpice", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
# {"case": "twpice", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "arm_sgp_summer_1997_A", "suite": "SCM_WoFS_v0"}, \
{"case": "arm_sgp_summer_1997_A", "suite": "SCM_HRRR_gf"}, \
{"case": "twpice", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
{"case": "twpice", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "twpice", "suite": "SCM_GFS_v16"}, \
# {"case": "twpice", "suite": "SCM_WoFS_v0"}, \
# {"case": "twpice", "suite": "SCM_HRRR_gf"}, \
# {"case": "bomex", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
# {"case": "bomex", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "twpice", "suite": "SCM_WoFS_v0"}, \
{"case": "twpice", "suite": "SCM_HRRR_gf"}, \
{"case": "bomex", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
{"case": "bomex", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "bomex", "suite": "SCM_GFS_v16"}, \
# {"case": "bomex", "suite": "SCM_WoFS_v0"}, \
# {"case": "bomex", "suite": "SCM_HRRR_gf"}, \
# {"case": "astex", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
# {"case": "astex", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "bomex", "suite": "SCM_WoFS_v0"}, \
{"case": "bomex", "suite": "SCM_HRRR_gf"}, \
{"case": "astex", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
{"case": "astex", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "astex", "suite": "SCM_GFS_v16"}, \
# {"case": "astex", "suite": "SCM_WoFS_v0"}, \
# {"case": "astex", "suite": "SCM_HRRR_gf"}, \
# {"case": "LASSO_2016051812", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
# {"case": "LASSO_2016051812", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "astex", "suite": "SCM_WoFS_v0"}, \
{"case": "astex", "suite": "SCM_HRRR_gf"}, \
{"case": "LASSO_2016051812", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
{"case": "LASSO_2016051812", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "LASSO_2016051812", "suite": "SCM_GFS_v16"}, \
# {"case": "LASSO_2016051812", "suite": "SCM_WoFS_v0"}, \
# {"case": "LASSO_2016051812", "suite": "SCM_HRRR_gf"}, \
# {"case": "COMBLE", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
# {"case": "COMBLE", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "LASSO_2016051812", "suite": "SCM_WoFS_v0"}, \
{"case": "LASSO_2016051812", "suite": "SCM_HRRR_gf"}, \
{"case": "COMBLE", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
{"case": "COMBLE", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "COMBLE", "suite": "SCM_GFS_v16"}, \
# {"case": "COMBLE", "suite": "SCM_WoFS_v0"}, \
# {"case": "COMBLE", "suite": "SCM_HRRR_gf"}, \
# {"case": "MOSAiC-AMPS", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
# {"case": "MOSAiC-AMPS", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "COMBLE", "suite": "SCM_WoFS_v0"}, \
{"case": "COMBLE", "suite": "SCM_HRRR_gf"}, \
{"case": "MOSAiC-AMPS", "suite": "SCM_GFS_v17_p8_ugwpv1"}, \
{"case": "MOSAiC-AMPS", "suite": "SCM_GFS_v16_RRTMGP"}, \
{"case": "MOSAiC-AMPS", "suite": "SCM_GFS_v16"}, \
# {"case": "MOSAiC-AMPS", "suite": "SCM_WoFS_v0"}, \
# {"case": "MOSAiC-AMPS", "suite": "SCM_HRRR_gf"}, \
{"case": "MOSAiC-AMPS", "suite": "SCM_WoFS_v0"}, \
{"case": "MOSAiC-AMPS", "suite": "SCM_HRRR_gf"}, \
{"case": "gabls3", "suite": "SCM_GFS_v16"}]

0 comments on commit 98f02f0

Please sign in to comment.