From 6475375bf3d90f4e74fa13680c64e9a3ab893ec0 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 13 May 2026 20:38:29 -0600 Subject: [PATCH 01/28] Step 1 of updating .gitmodules and ccpp/framework --- .gitmodules | 14 +++++++++----- ccpp/framework-ORIGINAL | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) create mode 160000 ccpp/framework-ORIGINAL diff --git a/.gitmodules b/.gitmodules index b9de8d317..6f79a4853 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,11 +1,15 @@ [submodule "ccpp-framework"] - path = ccpp/framework - url = https://github.com/NCAR/ccpp-framework - branch = develop + path = ccpp/framework-ORIGINAL + #url = https://github.com/NCAR/ccpp-framework + #branch = develop + url = https://github.com/climbfuji/ccpp-framework + branch = feature/capgen-ng [submodule "ccpp-physics"] path = ccpp/physics - url = https://github.com/NCAR/ccpp-physics - branch = scm/dev + #url = https://github.com/NCAR/ccpp-physics + #branch = scm/dev + url = https://github.com/climbfuji/ccpp-physics + branch = feature/capgen-ng [submodule "CMakeModules"] path = CMakeModules url = https://github.com/noaa-emc/CMakeModules diff --git a/ccpp/framework-ORIGINAL b/ccpp/framework-ORIGINAL new file mode 160000 index 000000000..22bc1a5de --- /dev/null +++ b/ccpp/framework-ORIGINAL @@ -0,0 +1 @@ +Subproject commit 22bc1a5de8a19996310aedc3482931616cd74a1b From 16b3741de1e5a40e7ec3bc284c9e5baaaa724c6d Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 13 May 2026 20:44:32 -0600 Subject: [PATCH 02/28] Initial commit to support capgen-ng --- .gitmodules | 2 +- CMakeLists.txt | 282 ++++++++++++++++ ccpp/CMakeLists.txt | 205 ++++++++++++ ccpp/framework | 2 +- ccpp/framework-ORIGINAL | 1 - ccpp/physics | 2 +- ccpp/suites/suite_SCM_GFS_v17_p8.xml | 6 +- ccpp/suites/suite_SCM_GFS_v17_p8_ps.xml | 4 +- cmake/ccpp_capgen.cmake | 295 +++++++++++++++++ scm/src/CCPP_typedefs.meta | 41 +-- scm/src/CMakeLists.txt | 412 +----------------------- scm/src/GFS_typedefs.meta | 227 +++++-------- scm/src/run_scm.py | 4 +- scm/src/scm.F90 | 148 +++++---- scm/src/scm_kinds.meta | 4 +- scm/src/scm_physical_constants.meta | 4 +- scm/src/scm_time_integration.F90 | 64 ++-- scm/src/scm_time_integration.meta | 65 ++++ scm/src/scm_type_defs.F90 | 3 - scm/src/scm_type_defs.meta | 56 ++-- 20 files changed, 1111 insertions(+), 716 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 ccpp/CMakeLists.txt delete mode 160000 ccpp/framework-ORIGINAL create mode 100644 cmake/ccpp_capgen.cmake create mode 100644 scm/src/scm_time_integration.meta diff --git a/.gitmodules b/.gitmodules index 6f79a4853..94d2978c5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "ccpp-framework"] - path = ccpp/framework-ORIGINAL + path = ccpp/framework #url = https://github.com/NCAR/ccpp-framework #branch = develop url = https://github.com/climbfuji/ccpp-framework diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..e52bd9757 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,282 @@ +cmake_minimum_required(VERSION 3.20) + +project(scm + VERSION 8.0.0 + LANGUAGES C Fortran) +set(PROJECT "CCPP-SCM") + +enable_testing() +include(cmake/ccpp_capgen.cmake) + +SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeModules/Modules) + +find_package(NetCDF REQUIRED COMPONENTS C Fortran) +find_package(bacio REQUIRED) +# Use ip@5 or later if available, fall back to sp +find_package(ip 5) +if(NOT ip_FOUND) + find_package(sp REQUIRED) +endif() +find_package(w3emc REQUIRED) + +find_package(MPI REQUIRED Fortran) +if(NOT MPI_Fortran_HAVE_F08_MODULE) + message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface") +endif() + +# Use rpaths on MacOSX +set(CMAKE_MACOSX_RPATH 1) + +#------------------------------------------------------------------------------ +# Set a default build type if none was specified +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'Release' as none was specified.") + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) + + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release") +endif() + +#------------------------------------------------------------------------------ +# Add required preprocessor flags for build type +if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + ADD_DEFINITIONS(-DDEBUG) +endif () + +#------------------------------------------------------------------------------ +# Add -DCCPP preprocessor flag (needed to preprocess GFS_typedefs.F90 from FV3) +ADD_DEFINITIONS(-DCCPP) + +#------------------------------------------------------------------------------ +# Add host-model specific preprocessor flag (needed for some physics schemes) +ADD_DEFINITIONS(-DSCM) +ADD_DEFINITIONS(-DMPI) + +#------------------------------------------------------------------------------ +# Add model-specific flags for C/C++/Fortran preprocessor +ADD_DEFINITIONS(-DMOIST_CAPPA -DUSE_COND -DNEMS_GSM) +#ADD_DEFINITIONS(-DINTERNAL_FILE_NML) + +#------------------------------------------------------------------------------ +# Detect OS and set preprocessor flags +if(APPLE) + ADD_DEFINITIONS(-DMACOSX) +elseif(UNIX) + ADD_DEFINITIONS(-DLINUX) +else () + message (FATAL_ERROR "Unsupported platform, only Linux and MacOSX are supported at this time.") +endif() + +# Build Options +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(RRTMGP_32BIT OFF CACHE BOOL "Enable 32BIT (single precision arithmetic in rte-rrtmgp radiation)") + +##------------------------------------------------------------------------------ +## Set compile options +#if (32BIT) +# add_definitions(-DSINGLE_PREC) +# add_definitions(-DRTE_USE_SP) +#endif() + +#------------------------------------------------------------------------------ +# GNU +#------------------------------------------------------------------------------ +if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") + message(STATUS "Compile using GNU") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fPIC -ggdb -fbacktrace -cpp -fcray-pointer -ffree-line-length-none -fno-range-check") + #set(CMAKE_Fortran_FLAGS_OPENMP_OFF "-fno-openmp") + + 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_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE) + #set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) + #set(CMAKE_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) +##------------------------------------------------------------------------------ +## Intel oneAPI +##------------------------------------------------------------------------------ +# elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "IntelLLVM") +# message(STATUS "Compile using Intel OneAPI") +# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback -fpp -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -nowarn -align array64byte -qno-opt-dynamic-align") +# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qno-opt-dynamic-align -sox -fp-model source") +# set(CMAKE_Fortran_FLAGS_OPENMP_OFF "-fno-openmp") +# +# 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 -fstack-protector-all -fpe0 -debug -ftrapuv -init=snan,arrays") +# set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fpe0 -debug") +# 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") +# endif() +# 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() +# endif() +# set(CMAKE_C_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_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) +##------------------------------------------------------------------------------ +## Intel Classic +##------------------------------------------------------------------------------ +# elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel") +# message(STATUS "Compile using Intel Classic") +# 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") +# set(CMAKE_Fortran_FLAGS_OPENMP_OFF "-fno-openmp") +# +# 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} -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3") +# else() +# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3 -no-prec-div") +# endif() +# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -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() +# endif() +# +# set(CMAKE_C_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_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) +# +##------------------------------------------------------------------------------ +## Nvidia HPC stack +##------------------------------------------------------------------------------ +#elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "NVHPC") +# message(STATUS "Compile using Nvidia HPC Stack") +# if(ENABLE_NVIDIA_OPENACC MATCHES "true") +# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -acc -Minfo=accel") +# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -acc -Minfo=accel") +# else() +# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}") +# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +# endif() +# set(CMAKE_Fortran_FLAGS_OPENMP_OFF "-nomp") +# +# if(NOT 32BIT) +# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8") +# endif() +# +# if (${CMAKE_BUILD_TYPE} MATCHES "Debug") +# set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -g") +# set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g") +# else() +# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2") +# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") +# endif() +# +# set(MPI_C_COMPILER mpicc) +# set(MPI_CXX_COMPILER mpicxx) +# set(MPI_Fortran_COMPILER mpif90) +# +# set(CMAKE_C_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_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) +else() + 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() + +##------------------------------------------------------------------------------ +## 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") +# 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 flags for rte-rrtmgp radiation +#if(RRTMGP_32BIT) +# message(STATUS "Compile CCPP RTE-RRTMGP with 32-bit precision") +# add_definitions(-DRTE_USE_SP) +# if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") +# set(CMAKE_Fortran_FLAGS_RTERRTMGP "-real-size 32") +# elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") +# set(CMAKE_Fortran_FLAGS_RTERRTMGP "-fno-default-real-8 -fdefault-double-8") +# endif() +#else() +# message(STATUS "Compile CCPP RTE-RRTMGP with 64-bit precision") +# remove_definitions(-DRTE_USE_SP) +# set(CMAKE_Fortran_FLAGS_RTERRTMGP ${CMAKE_Fortran_FLAGS_PHYSICS}) +#endif() +# +##------------------------------------------------------------------------------ +## Set netCDF flags for preprocessor +#ADD_DEFINITIONS(-DNETCDF) +# +## Set OpenMP flags for C/C++/Fortran +#if (OPENMP) +# # Clang compiler does not support OpenMP out of the box +# if(CMAKE_CXX_COMPILER_ID MATCHES "Clang*") +# message(FATAL_ERROR "OpenMP not supported for Apple/LLVM Clang compilers") +# endif() +# find_package(OpenMP REQUIRED) +#endif() + +add_subdirectory(ccpp) +add_subdirectory(scm/src) diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt new file mode 100644 index 000000000..cbdad562d --- /dev/null +++ b/ccpp/CMakeLists.txt @@ -0,0 +1,205 @@ +#------------------------------------------------------------------------------ +# +# Create list of SCHEME_FILES, HOST_FILES, and SUITE_FILES +# Paths should be relative to CMAKE_SOURCE_DIR (this file's directory) +# +#------------------------------------------------------------------------------ + +set(SCHEME_FILES_DIR "${CMAKE_SOURCE_DIR}/ccpp/physics/physics") +set(SCHEME_METADATA_FILES + # time-vary + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/module_ccpp_suite_simulator.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_ccpp_suite_sim_pre.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.scm.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta" + # radiation + "${SCHEME_FILES_DIR}/Radiation/RRTMG/radsw_param.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta" + "${SCHEME_FILES_DIR}/Radiation/RRTMG/rad_sw_pre.meta" + "${SCHEME_FILES_DIR}/Radiation/RRTMG/radsw_main.meta" + "${SCHEME_FILES_DIR}/Radiation/RRTMG/rrtmg_sw_post.meta" + "${SCHEME_FILES_DIR}/Radiation/RRTMG/radlw_main.meta" + "${SCHEME_FILES_DIR}/Radiation/RRTMG/rrtmg_lw_post.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_post.meta" + # physics + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_reset.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.meta" + "${SCHEME_FILES_DIR}/tools/get_prs_fv3.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_1.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_inter.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part1.meta" + "${SCHEME_FILES_DIR}/SFC_Layer/UFS/sfc_diff.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/scm_sfc_flux_spec.meta" + "${SCHEME_FILES_DIR}/SFC_Models/Land/Noahmp/lnd_iau_mod.meta" + "${SCHEME_FILES_DIR}/SFC_Layer/UFS/sfc_nst_pre.meta" + "${SCHEME_FILES_DIR}/SFC_Layer/UFS/sfc_nst.meta" + "${SCHEME_FILES_DIR}/SFC_Layer/UFS/sfc_nst_post.meta" + "${SCHEME_FILES_DIR}/SFC_Models/Land/Noahmp/noahmpdrv.meta" + "${SCHEME_FILES_DIR}/SFC_Models/SeaIce/CICE/sfc_sice.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part2.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta" + "${SCHEME_FILES_DIR}/SFC_Layer/UFS/sfc_diag.meta" + "${SCHEME_FILES_DIR}/SFC_Layer/UFS/sfc_diag_post.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta" + "${SCHEME_FILES_DIR}/PBL/SATMEDMF/satmedmfvdifq.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta" + "${SCHEME_FILES_DIR}/GWD/unified_ugwp.meta" + "${SCHEME_FILES_DIR}/GWD/unified_ugwp_post.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_photochemistry.meta" + "${SCHEME_FILES_DIR}/tools/get_phi_fv3.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta" + "${SCHEME_FILES_DIR}/CONV/SAMF/samfdeepcnv.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta" + "${SCHEME_FILES_DIR}/CONV/SAMF/samfshalcnv.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_pre.meta" + "${SCHEME_FILES_DIR}/MP/Thompson/mp_thompson_pre.meta" + "${SCHEME_FILES_DIR}/MP/Thompson/mp_thompson.meta" + "${SCHEME_FILES_DIR}/MP/Thompson/mp_thompson_post.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta" +) + +## DH* TEST +## Run ccpp_validator +#ccpp_validator(VERBOSITY ${CCPP_VERBOSITY} +# SOURCE_FILES "${SCHEME_FILES_DIR}/SFC_Layer/UFS/sfc_diff.f" +# METADATA_FILES "${SCHEME_FILES_DIR}/SFC_Layer/UFS/sfc_diff.meta") +## *DH + +# Create list of scheme source files from metadata files +ccpp_source_files(SCHEME_FORTRAN_FILES ${SCHEME_METADATA_FILES}) + +set(HOST_FILES_DIR "${CMAKE_SOURCE_DIR}/scm/src") +set(HOST_METADATA_FILES + "${HOST_FILES_DIR}/scm_kinds.meta" + "${HOST_FILES_DIR}/scm_physical_constants.meta" + "${HOST_FILES_DIR}/scm_type_defs.meta" + "${HOST_FILES_DIR}/CCPP_typedefs.meta" + "${HOST_FILES_DIR}/GFS_typedefs.meta" + "${HOST_FILES_DIR}/scm_time_integration.meta" +) + +ccpp_source_files(HOST_FORTRAN_FILES ${HOST_METADATA_FILES}) +message(INFO "${HOST_METADATA_FILES} --> ${HOST_FORTRAN_FILES}") + +set(SUITE_FILES_DIR "${CMAKE_SOURCE_DIR}/ccpp/suites") +set(SUITE_FILES + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ps.xml" +) + +set(HOST "ccpp-scm") + +set(CCPP_VERBOSITY "2" CACHE STRING "Verbosity level of output (default: 0)") + +# By default, generated caps go in ccpp subdir +set(OUTPUT_ROOT "${CMAKE_CURRENT_BINARY_DIR}/ccpp") + +# Run ccpp_validator +ccpp_validator(VERBOSITY ${CCPP_VERBOSITY} + SOURCE_FILES ${SCHEME_FORTRAN_FILES} + METADATA_FILES ${SCHEME_METADATA_FILES}) +ccpp_validator(VERBOSITY ${CCPP_VERBOSITY} + SOURCE_FILES ${HOST_FORTRAN_FILES} + METADATA_FILES ${HOST_METADATA_FILES}) + +# Run ccpp_capgen_ng +ccpp_capgen(VERBOSITY ${CCPP_VERBOSITY} + HOSTFILES ${HOST_METADATA_FILES} + SCHEMEFILES ${SCHEME_METADATA_FILES} + SUITES ${SUITE_FILES} + HOST_NAME ${HOST} + OUTPUT_ROOT "${OUTPUT_ROOT}") + +# Retrieve the list of Fortran files required for test host from datatable.xml; +# this includes capgen-generated files and dependencies inferred from metadata +ccpp_datafile(DATATABLE "${OUTPUT_ROOT}/datatable.xml" + REPORT_NAME "--dependencies") +set(CAPGEN_DEPENDENCIES ${CCPP_FILES}) +ccpp_datafile(DATATABLE "${OUTPUT_ROOT}/datatable.xml" + REPORT_NAME "--scheme-files") +set(SCHEME_FORTRAN_FILES ${CCPP_FILES}) +ccpp_datafile(DATATABLE "${OUTPUT_ROOT}/datatable.xml" + REPORT_NAME "--capgen-files") +set(CAPGEN_FILES ${CCPP_FILES}) + +message(STATUS "List of capgen dependencies: ${CAPGEN_DEPENDENCIES}") +message(STATUS "List of filtered scheme files: ${SCHEME_FORTRAN_FILES}") +message(STATUS "List of capgen-generated files: ${CAPGEN_FILES}") + +# Temporary: manually added dependencies because of working on a subset of schemes only +set(EXTRA_FILES + "${SCHEME_FILES_DIR}/Radiation/RRTMG/radlw_datatb.f" + "${SCHEME_FILES_DIR}/Radiation/RRTMG/radsw_datatb.f" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/module_ccpp_suite_simulator.F90" +) +# End temporary + +add_library(scm-ccpp STATIC + ${EXTRA_FILES} + ${CAPGEN_DEPENDENCIES} + ${SCHEME_FORTRAN_FILES} + ${HOST_FORTRAN_FILES} + ${CAPGEN_FILES} +) + +#set_target_properties(scm-ccpp PROPERTIES LINKER_LANGUAGE Fortran) + +target_link_libraries(scm-ccpp MPI::MPI_Fortran) +if(OPENMP) + target_link_libraries(scm-ccpp OpenMP::OpenMP_Fortran) +endif() +target_link_libraries(scm-ccpp NetCDF::NetCDF_Fortran) +if(TARGET bacio::bacio) + set(BACIO_TARGET bacio::bacio) +elseif(TARGET bacio::bacio_4) + set(BACIO_TARGET bacio::bacio_4) +else() + message(FATAL_ERROR + "bacio found but expected target not exported (bacio::bacio or bacio::bacio_4)") +endif() +target_link_libraries(scm-ccpp ${BACIO_TARGET}) +if(ip_FOUND) + target_link_libraries(scm-ccpp ip::ip_d) +else() + target_link_libraries(scm-ccpp sp::sp_d) +endif() +target_link_libraries(scm-ccpp w3emc::w3emc_d) + +set_target_properties(scm-ccpp PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}) +target_include_directories(scm-ccpp PUBLIC $) + +#message(FATAL_ERROR "xxx") +# +#add_executable(test_chunked_data.x +# ${CAPGEN_DEPENDENCIES} +# ${SCHEME_FORTRAN_FILES} +# ${HOST_FORTRAN_FILES} +# ${CAPGEN_FILES} +#) +#target_link_libraries(test_chunked_data.x PRIVATE MPI::MPI_Fortran) +#if(OPENMP) +# target_link_libraries(test_chunked_data.x PRIVATE OpenMP::OpenMP_Fortran) +#endif() +#set_target_properties(test_chunked_data.x PROPERTIES LINKER_LANGUAGE Fortran) +# +## Add executable to be called with ctest +#add_test(NAME test_chunked_data +# COMMAND test_chunked_data.x) +# \ No newline at end of file diff --git a/ccpp/framework b/ccpp/framework index 22bc1a5de..f2c591859 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 22bc1a5de8a19996310aedc3482931616cd74a1b +Subproject commit f2c5918597179a807ff1a15da465828c58cb184e diff --git a/ccpp/framework-ORIGINAL b/ccpp/framework-ORIGINAL deleted file mode 160000 index 22bc1a5de..000000000 --- a/ccpp/framework-ORIGINAL +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 22bc1a5de8a19996310aedc3482931616cd74a1b diff --git a/ccpp/physics b/ccpp/physics index bdccfdd9c..1ff31daba 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit bdccfdd9cd474e440ad668b4732d4daacb85e357 +Subproject commit 1ff31dabade1db4e07300270214a1de9f1f7674a diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8.xml b/ccpp/suites/suite_SCM_GFS_v17_p8.xml index 4501026c8..1c67a1238 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8.xml @@ -1,7 +1,6 @@ - - + GFS_time_vary_pre @@ -79,12 +78,11 @@ mp_thompson - + mp_thompson_post GFS_MP_generic_post maximum_hourly_diagnostics GFS_physics_post - diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ps.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ps.xml index 0f214aff6..586b7271d 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ps.xml @@ -1,7 +1,6 @@ - - + GFS_time_vary_pre @@ -67,5 +66,4 @@ GFS_physics_post - diff --git a/cmake/ccpp_capgen.cmake b/cmake/ccpp_capgen.cmake new file mode 100644 index 000000000..8cae2fbd7 --- /dev/null +++ b/cmake/ccpp_capgen.cmake @@ -0,0 +1,295 @@ +# CMake function to collect source files referenced by metadata files +# +# Usage: +# ccpp_source_files(OUT_VAR ${META_FILES}) +# +# Example: +# ccpp_source_files(CCPP_SRCS ${META_FILES}) +# +# Result: +# OUT_VAR contains all matching source files +# +function(ccpp_source_files OUT_VAR) + set(result) + foreach(meta_file IN LISTS ARGN) + # Metadata directory + get_filename_component(meta_dir + "${meta_file}" + DIRECTORY + ABSOLUTE) + + # Read metadata file + file(READ "${meta_file}" meta_contents) + + # Extract: source_path = something + string(REGEX MATCH + "source_path[ \t]*=[ \t]*([^\r\n]+)" + _match + "${meta_contents}" + ) + + # If no source_path exists, use directory of metadata file + if(NOT _match) + set(source_dir ${meta_dir}) + else() + # Extract just the path + string(REGEX REPLACE + "source_path[ \t]*=[ \t]*" + "" + source_path + "${_match}" + ) + string(STRIP "${source_path}" source_path) + # Absolute directory containing source + get_filename_component( + source_dir + "${meta_dir}/${source_path}" + ABSOLUTE + ) + endif() + + # Try supported Fortran suffixes + foreach(ext + f + F + f90 + F90 + F95 + f95 + ) + string(REGEX REPLACE + "\\.meta$" + ".${ext}" + candidate + "${meta_file}" + ) + if(EXISTS "${candidate}") + list(APPEND result "${candidate}") + break() + endif() + endforeach() + endforeach() + + # Remove duplicates and return + list(REMOVE_DUPLICATES result) + set(${OUT_VAR} + ${result} + PARENT_SCOPE) +endfunction() + + +# CMake wrapper for ccpp_validator.py +# +# SOURCE_FILES - CMake list of Fortran source files +# METADATA_FILES - CMake list of corresponding metadata files +function(ccpp_validator) + set(optionalArgs) + set(oneValueArgs VERBOSITY) + set(multi_value_keywords SOURCE_FILES METADATA_FILES) + cmake_parse_arguments(arg "${optionalArgs}" "${oneValueArgs}" "${multi_value_keywords}" ${ARGN}) + + # Error if script file not found. + set(CCPP_VALIDATOR_CMD_LIST "${CMAKE_SOURCE_DIR}/ccpp/framework/capgen-ng/ccpp_validator.py") + if(NOT EXISTS ${CCPP_VALIDATOR_CMD_LIST}) + message(FATAL_ERROR "function(ccpp_validator): Could not find ccpp_validator.py. Looked for ${CCPP_VALIDATOR_CMD_LIST}.") + endif() + + # Interpret parsed arguments + if(NOT DEFINED arg_SOURCE_FILES) + message(FATAL_ERROR "function(ccpp_capgen): SOURCE_FILES not set.") + endif() + list(JOIN arg_SOURCE_FILES "," SOURCE_FILES_SEPARATED) + list(APPEND CCPP_VALIDATOR_CMD_LIST "--source-files" "${SOURCE_FILES_SEPARATED}") + + if(NOT DEFINED arg_METADATA_FILES) + message(FATAL_ERROR "function(ccpp_capgen): METADATA_FILES not set.") + endif() + list(JOIN arg_METADATA_FILES "," METADATA_FILES_SEPARATED) + list(APPEND CCPP_VALIDATOR_CMD_LIST "--scheme-files" "${METADATA_FILES_SEPARATED}") + + if(DEFINED arg_VERBOSITY) + string(REPEAT "--verbose " ${arg_VERBOSITY} VERBOSE_PARAMS_SEPARATED) + separate_arguments(VERBOSE_PARAMS UNIX_COMMAND "${VERBOSE_PARAMS_SEPARATED}") + list(APPEND CCPP_VALIDATOR_CMD_LIST ${VERBOSE_PARAMS}) + endif() + + # DH* 20260513 TEMPORARY: add --legacy-mode to allow parsing + # of horizontal_loop_extent for scheme run phase metadata + list(APPEND CCPP_VALIDATOR_CMD_LIST "--legacy-mode") + # *DH + + message(STATUS "Running ccpp_validator.py from ${CMAKE_CURRENT_SOURCE_DIR}") + + unset(VALIDATOR_OUT) + execute_process(COMMAND ${CCPP_VALIDATOR_CMD_LIST} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + OUTPUT_VARIABLE VALIDATOR_OUT + ERROR_VARIABLE VALIDATOR_OUT + RESULT_VARIABLE RES + COMMAND_ECHO STDOUT) + if(RES EQUAL 0) + message(STATUS "ccpp-validator stdout: ${VALIDATOR_OUT}") + else() + message(STATUS "${CCPP_VALIDATOR_CMD_LIST} FAILED: result = ${RES}") + message(STATUS "ccpp-validator stdout: ${VALIDATOR_OUT}") + message(FATAL_ERROR "Validation of source files failed, abort.") + endif() + +endfunction() + + +# CMake wrapper for ccpp_capgen_ng.py +# +# CAPGEN_EXPECT_THROW_ERROR - ON/OFF (Default: OFF) - Scans ccpp_capgen.py log for error string and errors if not found. +# HOST_NAME - String name of host +# OUTPUT_ROOT - String path to put generated caps +# VERBOSITY - Number of --verbose flags to pass to capgen +# HOSTFILES - CMake list of host metadata filenames +# SCHEMEFILES - CMake list of scheme metadata files +# SUITES - CMake list of suite xml files +function(ccpp_capgen) + set(optionalArgs CAPGEN_EXPECT_THROW_ERROR) + set(oneValueArgs HOST_NAME OUTPUT_ROOT VERBOSITY KIND_SPECS) + set(multi_value_keywords HOSTFILES SCHEMEFILES SUITES) + + cmake_parse_arguments(arg "${optionalArgs}" "${oneValueArgs}" "${multi_value_keywords}" ${ARGN}) + + # Error if script file not found. + set(CCPP_CAPGEN_CMD_LIST "${CMAKE_SOURCE_DIR}/ccpp/framework/capgen-ng/ccpp_capgen_ng.py") + if(NOT EXISTS ${CCPP_CAPGEN_CMD_LIST}) + message(FATAL_ERROR "function(ccpp_capgen): Could not find ccpp_capgen_ng.py. Looked for ${CCPP_CAPGEN_CMD_LIST}.") + endif() + + # Interpret parsed arguments + if(NOT DEFINED arg_HOSTFILES) + message(FATAL_ERROR "function(ccpp_capgen): HOSTFILES not set.") + endif() + list(JOIN arg_HOSTFILES "," HOSTFILES_SEPARATED) + list(APPEND CCPP_CAPGEN_CMD_LIST "--host-files" "${HOSTFILES_SEPARATED}") + + if(NOT DEFINED arg_SCHEMEFILES) + message(FATAL_ERROR "function(ccpp_capgen): SCHEMEFILES not set.") + endif() + list(JOIN arg_SCHEMEFILES "," SCHEMEFILES_SEPARATED) + list(APPEND CCPP_CAPGEN_CMD_LIST "--scheme-files" "${SCHEMEFILES_SEPARATED}") + + if(NOT DEFINED arg_SUITES) + message(FATAL_ERROR "function(ccpp_capgen): SUITES not set.") + endif() + list(JOIN arg_SUITES "," SUITES_SEPARATED) + list(APPEND CCPP_CAPGEN_CMD_LIST "--suites" "${SUITES_SEPARATED}") + + if(NOT DEFINED arg_HOST_NAME) + message(FATAL_ERROR "function(ccpp_capgen): HOSTNAME not set.") + endif() + list(APPEND CCPP_CAPGEN_CMD_LIST "--host-name" "${arg_HOST_NAME}") + + if(NOT DEFINED arg_OUTPUT_ROOT) + message(FATAL_ERROR "function(ccpp_capgen): OUTPUT_ROOT not set.") + endif() + #file(MAKE_DIRECTORY "${arg_OUTPUT_ROOT}") + list(APPEND CCPP_CAPGEN_CMD_LIST "--output-root" "${arg_OUTPUT_ROOT}") + + if(DEFINED arg_VERBOSITY) + string(REPEAT "--verbose " ${arg_VERBOSITY} VERBOSE_PARAMS_SEPARATED) + separate_arguments(VERBOSE_PARAMS UNIX_COMMAND "${VERBOSE_PARAMS_SEPARATED}") + list(APPEND CCPP_CAPGEN_CMD_LIST ${VERBOSE_PARAMS}) + endif() + + if(DEFINED arg_KIND_SPECS) + string(REPLACE "," ";" KIND_SPEC_LIST "${arg_KIND_SPECS}") + set(KIND_ARGS "") # start empty + foreach(pair IN LISTS KIND_SPEC_LIST) + # Append each pair prefixed with --kind-type and quoted. + # The surrounding double‑quotes are added explicitly so the + # resulting string contains them. + set(KIND_ARGS "${KIND_ARGS}--kind-type \"${pair}\"") + string(STRIP "${KIND_ARGS}" KIND_ARGS) + endforeach() + list(APPEND CCPP_CAPGEN_CMD_LIST ${KIND_SPEC_PARAMS}) + endif() + + # DH* 20260513 TEMPORARY: add --legacy-mode to allow parsing + # of horizontal_loop_extent for scheme run phase metadata + list(APPEND CCPP_CAPGEN_CMD_LIST "--legacy-mode") + # *DH + + message(STATUS "Running ccpp_capgen.py from ${CMAKE_CURRENT_SOURCE_DIR}") + + # Unset CAPGEN_OUT to prevent incorrect output on subsequent ccpp_capgen(...) calls + unset(CAPGEN_OUT) + execute_process(COMMAND ${CCPP_CAPGEN_CMD_LIST} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + OUTPUT_VARIABLE CAPGEN_OUT + ERROR_VARIABLE CAPGEN_OUT + RESULT_VARIABLE RES + COMMAND_ECHO STDOUT) + + message(STATUS "ccpp-capgen stdout: ${CAPGEN_OUT}") + + if(arg_CAPGEN_EXPECT_THROW_ERROR) + # Determine if the process succeeded but had an expected string in the process log. + string(FIND "${CAPGEN_OUT}" "Variables of type ccpp_constituent_properties_t only allowed in register phase" ERROR_INDEX) + + if (ERROR_INDEX GREATER -1) + message(STATUS "Capgen build produces expected error message.") + else() + message(FATAL_ERROR "CCPP cap generation did not generate expected error. Expected 'Variables of type constituent_properties_t only allowed in register phase.") + endif() + else() + if(RES EQUAL 0) + message(STATUS "ccpp-capgen completed successfully") + else() + message(FATAL_ERROR "CCPP cap generation FAILED: result = ${RES}") + endif() + endif() +endfunction() + + +# CMake wrapper for ccpp_datafile.py +# +# DATATABLE - Path to generated datatable.xml file +# REPORT_NAME - String report name to get list of generated files form capgen (typically --ccpp-files) +function(ccpp_datafile) + set(mandatoryArgs DATATABLE REPORT_NAME) + cmake_parse_arguments(arg "" "${mandatoryArgs}" "" ${ARGN}) + + set(CCPP_DATAFILE_CMD "${CMAKE_SOURCE_DIR}/ccpp/framework/capgen-ng/ccpp_datafile.py") + + if(NOT EXISTS ${CCPP_DATAFILE_CMD}) + message(FATAL_ERROR "function(ccpp_datafile): Could not find ccpp_datafile.py. Looked for ${CCPP_DATAFILE_CMD}.") + endif() + + if(NOT DEFINED arg_REPORT_NAME) + message(FATAL_ERROR "function(ccpp_datafile): REPORT_NAME not set.") + endif() + list(APPEND CCPP_DATAFILE_CMD "${arg_REPORT_NAME}") + + if(NOT DEFINED arg_DATATABLE) + message(FATAL_ERROR "function(ccpp_datafile): DATATABLE not set.") + endif() + list(APPEND CCPP_DATAFILE_CMD "${arg_DATATABLE}") + + message(STATUS "Running ccpp_datafile from ${CMAKE_CURRENT_SOURCE_DIR}") + + # Unset CCPP_FILES to prevent incorrect output on subsequent ccpp_datafile(...) calls + unset(CCPP_FILES) + execute_process(COMMAND ${CCPP_DATAFILE_CMD} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + OUTPUT_VARIABLE CCPP_FILES + RESULT_VARIABLE RES + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + COMMAND_ECHO STDOUT) + #message(STATUS "CCPP_FILES = ${CCPP_FILES}") + if(RES EQUAL 0) + message(STATUS "CCPP files retrieved") + else() + message(FATAL_ERROR "CCPP file retrieval FAILED: result = ${RES}") + endif() + if(CCPP_FILES) + # Convert "," separated list from python back to ";" separated list for CMake + string(REPLACE "," ";" CCPP_FILES ${CCPP_FILES}) + endif() + set(CCPP_FILES "${CCPP_FILES}" PARENT_SCOPE) +endfunction() diff --git a/scm/src/CCPP_typedefs.meta b/scm/src/CCPP_typedefs.meta index 4fbf96a5b..cc406519c 100644 --- a/scm/src/CCPP_typedefs.meta +++ b/scm/src/CCPP_typedefs.meta @@ -1,7 +1,9 @@ [ccpp-table-properties] name = GFS_interstitial_type type = ddt - dependencies = + dependencies_path = ../../ccpp/physics/physics + dependencies = hooks/machine.F,photochem/module_ozphys.F90 + dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f [ccpp-arg-table] name = GFS_interstitial_type @@ -1737,6 +1739,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys + active = (index_of_mass_number_concentration_of_cloud_droplets_in_tracer_concentration_array > 0) [save_q(:,:,index_of_mass_number_concentration_of_cloud_ice_in_tracer_concentration_array)] standard_name = ice_cloud_number_concentration_save long_name = ice cloud number concentration before entering a physics scheme @@ -1744,6 +1747,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys + active = (index_of_mass_number_concentration_of_cloud_ice_in_tracer_concentration_array > 0) [save_q] standard_name = tracer_concentration_save long_name = tracer concentration before entering a physics scheme @@ -2754,20 +2758,21 @@ kind = kind_phys active = (flag_for_CCPP_suite_simulator) -######################################################################## -[ccpp-table-properties] - name = CCPP_typedefs - type = module - dependencies_path = ../../ccpp/physics/physics - dependencies = hooks/machine.F,photochem/module_ozphys.F90 - dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f - -[ccpp-arg-table] - name = CCPP_typedefs - type = module -[GFS_interstitial_type] - standard_name = GFS_interstitial_type - long_name = definition of type GFS_interstitial_type - units = DDT - dimensions = () - type = GFS_interstitial_type +######################################################################### +#[ccpp-table-properties] +# name = CCPP_typedefs +# type = host +# dependencies_path = ../../ccpp/physics/physics +# dependencies = hooks/machine.F,photochem/module_ozphys.F90 +# dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f +# +#[ccpp-arg-table] +# name = CCPP_typedefs +# type = host +#[GFS_interstitial_type] +# standard_name = GFS_interstitial_type +# long_name = definition of type GFS_interstitial_type +# units = DDT +# dimensions = () +# type = GFS_interstitial_type +# \ No newline at end of file diff --git a/scm/src/CMakeLists.txt b/scm/src/CMakeLists.txt index badbf7e65..93f03e92b 100644 --- a/scm/src/CMakeLists.txt +++ b/scm/src/CMakeLists.txt @@ -1,416 +1,28 @@ -cmake_minimum_required(VERSION 3.14) - -project(scm - VERSION 5.0.0 - LANGUAGES C Fortran) -set(PROJECT "CCPP-SCM") - -#################################################################### -# Begin CCPP prebuild step # -#################################################################### -if(DEFINED CCPP_SUITES) - if (${CCPP_SUITES} MATCHES "ALL") - message("Calling CCPP code generator (ccpp_prebuild.py) for all available suites ...") - else() - set(_ccpp_suites_arg "--suites=${CCPP_SUITES}") - message("Calling CCPP code generator (ccpp_prebuild.py) for suites ${_ccpp_suites_arg} ...") - endif() - unset(CCPP_SUITES CACHE) -else() - if(DEFINED RL) - execute_process( - COMMAND scm/src/suite_info.py --fc "${CMAKE_Fortran_COMPILER_ID}" --rl ${RL} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../.. - OUTPUT_VARIABLE suite_string - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - else() - execute_process( - COMMAND scm/src/suite_info.py --fc "${CMAKE_Fortran_COMPILER_ID}" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../.. - OUTPUT_VARIABLE suite_string - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - endif() - set(_ccpp_suites_arg "--suites=${suite_string}") - message("Calling CCPP code generator (ccpp_prebuild.py) for suites listed in scm/src/suite_info.py: ${_ccpp_suites_arg}.") -endif() -# Run CCPP prebuild.py -message (STATUS "Running ccpp_prebuild.py for CCPP") -# Make the directories where the ccpp_prebuild.py script wants to write caps and make snippets -file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ccpp/physics/physics) -if (NOT EXISTS "${CMAKE_SOURCE_DIR}/../../ccpp/framework/scripts/ccpp_prebuild.py") - message( FATAL_ERROR "ccpp_prebuild.py script does not exist, did you check out the code recursively?" ) -endif() -if (${CMAKE_BUILD_TYPE} MATCHES "Debug") - execute_process( - COMMAND ccpp/framework/scripts/ccpp_prebuild.py --config=ccpp/config/ccpp_prebuild_config.py ${_ccpp_suites_arg} --builddir=${CMAKE_CURRENT_BINARY_DIR} --debug --verbose - OUTPUT_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.out - ERROR_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.err - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../.. - RESULT_VARIABLE return_code - ) -else() - execute_process( - COMMAND ccpp/framework/scripts/ccpp_prebuild.py --config=ccpp/config/ccpp_prebuild_config.py ${_ccpp_suites_arg} --builddir=${CMAKE_CURRENT_BINARY_DIR} - OUTPUT_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.out - ERROR_FILE ${PROJECT_BINARY_DIR}/ccpp_prebuild.err - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../.. - RESULT_VARIABLE return_code - ) -endif() - -# Check return code from CCPP prebuild.py -if(return_code EQUAL 0) - message (STATUS "CCPP prebuild step completed successfully") -else(return_code EQUAL 0) - message (FATAL_ERROR "CCPP prebuild step failed, check ccpp_prebuild.out/ccpp_prebuild.err") -endif(return_code EQUAL 0) -#################################################################### -# End CCPP prebuild step # -#################################################################### - -ENABLE_LANGUAGE(Fortran) - -include(CMakeForceCompiler) - -SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/../../CMakeModules/Modules) - -find_package(NetCDF REQUIRED COMPONENTS C Fortran) -find_package(bacio REQUIRED) -# Use ip@5 or later if available, fall back to sp -find_package(ip 5) -if(NOT ip_FOUND) - find_package(sp REQUIRED) -endif() -find_package(w3emc REQUIRED) -find_package(MPI REQUIRED) -if(NOT MPI_Fortran_HAVE_F08_MODULE) - message(FATAL_ERROR "MPI_F08 Required") -endif() - -find_package(MPI REQUIRED Fortran) -if(NOT MPI_Fortran_HAVE_F08_MODULE) - message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface") -endif() - -message(STATUS "MPI Include Path: ${MPI_INCLUDE_PATH}") -message(STATUS "MPI Libraries: ${MPI_LIBRARIES}") - -SET(CCPP_FRAMEWORK_SRC ${CMAKE_SOURCE_DIR}/../../ccpp/framework) -SET(CCPP_PHYSICS_SRC ${CMAKE_SOURCE_DIR}/../../ccpp/physics) - -# Use rpaths on MacOSX -set(CMAKE_MACOSX_RPATH 1) - -#------------------------------------------------------------------------------ -# Set a default build type if none was specified -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to 'Release' as none was specified.") - set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) - - # Set the possible values of build type for cmake-gui - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release") -endif() - -INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/ccpp/framework/src) -INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/ccpp/physics) -include_directories(${MPI_Fortran_INCLUDE_PATH}) - -#------------------------------------------------------------------------------ -# Add required preprocessor flags for build type -if (${CMAKE_BUILD_TYPE} MATCHES "Debug") - ADD_DEFINITIONS(-DDEBUG) -endif () - -#------------------------------------------------------------------------------ -# Add -DCCPP preprocessor flag (needed to preprocess GFS_typedefs.F90 from FV3) -ADD_DEFINITIONS(-DCCPP) - -#------------------------------------------------------------------------------ -# Add host-model specific preprocessor flag (needed for some physics schemes) -ADD_DEFINITIONS(-DSCM) - -ADD_DEFINITIONS(-DMPI) - - -#------------------------------------------------------------------------------ -# Add model-specific flags for C/C++/Fortran preprocessor -ADD_DEFINITIONS(-DMOIST_CAPPA -DUSE_COND -DNEMS_GSM) -#ADD_DEFINITIONS(-DINTERNAL_FILE_NML) - -#------------------------------------------------------------------------------ -# Detect OS and set preprocessor flags -if(APPLE) - ADD_DEFINITIONS(-DMACOSX) -elseif(UNIX) - ADD_DEFINITIONS(-DLINUX) -else () - message (FATAL_ERROR "Unsupported platform, only Linux and MacOSX are supported at this time.") -endif() - -# Build Options -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(RRTMGP_32BIT OFF CACHE BOOL "Enable 32BIT (single precision arithmetic in rte-rrtmgp radiation)") - -#------------------------------------------------------------------------------ -# Set compile options -if (32BIT) - add_definitions(-DSINGLE_PREC) - add_definitions(-DRTE_USE_SP) -endif() - -#------------------------------------------------------------------------------ -# GNU -#------------------------------------------------------------------------------ -if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") - message(STATUS "Compile using GNU") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ggdb -fbacktrace -cpp -fcray-pointer -ffree-line-length-none -fno-range-check") - set(CMAKE_Fortran_FLAGS_OPENMP_OFF "-fno-openmp") - - 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_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE) - set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) - set(CMAKE_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) -#------------------------------------------------------------------------------ -# Intel oneAPI -#------------------------------------------------------------------------------ - elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "IntelLLVM") - message(STATUS "Compile using Intel OneAPI") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback -fpp -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -nowarn -align array64byte -qno-opt-dynamic-align") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qno-opt-dynamic-align -sox -fp-model source") - set(CMAKE_Fortran_FLAGS_OPENMP_OFF "-fno-openmp") - - 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 -fstack-protector-all -fpe0 -debug -ftrapuv -init=snan,arrays") - set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fpe0 -debug") - 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") - endif() - 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() - endif() - set(CMAKE_C_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_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) -#------------------------------------------------------------------------------ -# Intel Classic -#------------------------------------------------------------------------------ - elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel") - message(STATUS "Compile using Intel Classic") - 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") - set(CMAKE_Fortran_FLAGS_OPENMP_OFF "-fno-openmp") - - 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} -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3 -no-prec-div") - endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -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() - endif() - - set(CMAKE_C_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_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) - -#------------------------------------------------------------------------------ -# Nvidia HPC stack -#------------------------------------------------------------------------------ -elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "NVHPC") - message(STATUS "Compile using Nvidia HPC Stack") - if(ENABLE_NVIDIA_OPENACC MATCHES "true") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -acc -Minfo=accel") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -acc -Minfo=accel") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - endif() - set(CMAKE_Fortran_FLAGS_OPENMP_OFF "-nomp") - - if(NOT 32BIT) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8") - endif() - - if (${CMAKE_BUILD_TYPE} MATCHES "Debug") - set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -g") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") - endif() - - set(MPI_C_COMPILER mpicc) - set(MPI_CXX_COMPILER mpicxx) - set(MPI_Fortran_COMPILER mpif90) - - set(CMAKE_C_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_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") - 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 flags for rte-rrtmgp radiation -if(RRTMGP_32BIT) - message(STATUS "Compile CCPP RTE-RRTMGP with 32-bit precision") - add_definitions(-DRTE_USE_SP) - if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") - set(CMAKE_Fortran_FLAGS_RTERRTMGP "-real-size 32") - elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") - set(CMAKE_Fortran_FLAGS_RTERRTMGP "-fno-default-real-8 -fdefault-double-8") - endif() -else() - message(STATUS "Compile CCPP RTE-RRTMGP with 64-bit precision") - remove_definitions(-DRTE_USE_SP) - set(CMAKE_Fortran_FLAGS_RTERRTMGP ${CMAKE_Fortran_FLAGS_PHYSICS}) -endif() - -#------------------------------------------------------------------------------ -# Set netCDF flags for preprocessor -ADD_DEFINITIONS(-DNETCDF) - -# Set OpenMP flags for C/C++/Fortran -if (OPENMP) - # Clang compiler does not support OpenMP out of the box - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang*") - message(FATAL_ERROR "OpenMP not supported for Apple/LLVM Clang compilers") - endif() - find_package(OpenMP REQUIRED) -endif() - -# How about using proper compile targets etc? -#------------------------------------------------------------------------------ -# Configure sources - -set(BUILD_SHARED_LIBS OFF) -ADD_SUBDIRECTORY(${CCPP_FRAMEWORK_SRC} ${CMAKE_BINARY_DIR}/ccpp/framework) -ADD_SUBDIRECTORY(${CCPP_PHYSICS_SRC} ${CMAKE_BINARY_DIR}/ccpp/physics) -ADD_DEPENDENCIES(ccpp_physics ccpp_framework) +# +# CCPP SCM source code +# SET(scm_source_files scm.F90 scm_input.F90 - scm_utils.F90 + #scm_utils.F90 scm_vgrid.F90 scm_setup.F90 - scm_forcing.F90 - scm_time_integration.F90 + #scm_forcing.F90 + #scm_time_integration.F90 scm_output.F90 ) -ADD_EXECUTABLE(scm ${scm_source_files} ccpp_static_api.F90) +add_executable(scm ${scm_source_files}) + +target_link_libraries(scm scm-ccpp) if(OPENMP) target_link_libraries(scm OpenMP::OpenMP_Fortran) endif() target_link_libraries(scm NetCDF::NetCDF_Fortran) -if(TARGET bacio::bacio) - set(BACIO_TARGET bacio::bacio) -elseif(TARGET bacio::bacio_4) - set(BACIO_TARGET bacio::bacio_4) -else() - message(FATAL_ERROR - "bacio found but expected target not exported (bacio::bacio or bacio::bacio_4)") -endif() -target_link_libraries(scm ${BACIO_TARGET}) -if(ip_FOUND) - target_link_libraries(scm ip::ip_d) -else() - target_link_libraries(scm sp::sp_d) -endif() -TARGET_LINK_LIBRARIES(scm w3emc::w3emc_d) -TARGET_LINK_LIBRARIES(scm ccpp_framework) -TARGET_LINK_LIBRARIES(scm ccpp_physics) - -SET_TARGET_PROPERTIES(scm PROPERTIES - COMPILE_FLAGS "${CMAKE_Fortran_FLAGS}" - LINK_FLAGS "${CMAKE_Fortran_FLAGS}") -ADD_CUSTOM_COMMAND( +add_custom_command( TARGET scm POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_SOURCE_DIR}/run_scm.py - ${CMAKE_CURRENT_BINARY_DIR}/run_scm.py) + ${CMAKE_CURRENT_SOURCE_DIR}/run_scm.py + ${CMAKE_BINARY_DIR}/run_scm.py) diff --git a/scm/src/GFS_typedefs.meta b/scm/src/GFS_typedefs.meta index b057faa1c..118c18f85 100644 --- a/scm/src/GFS_typedefs.meta +++ b/scm/src/GFS_typedefs.meta @@ -1,3 +1,26 @@ +######################################################################## +[ccpp-table-properties] + name = GFS_typedefs + type = host + dependencies_path = ../../ccpp/physics/physics + dependencies = hooks/machine.F,hooks/physcons.F90 + dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f + dependencies = MP/TEMPO/TEMPO/module_mp_tempo_params.F90 + dependencies = photochem/module_ozphys.F90,photochem/module_h2ophys.F90 + dependencies = SFC_Models/Land/Noahmp/lnd_iau_mod.F90 + dependencies = Interstitials/UFS_SCM_NEPTUNE/GFS_ccpp_suite_sim_pre.F90 + +[ccpp-arg-table] + name = GFS_typedefs + type = host +[LTP] + standard_name = extra_top_layer + long_name = extra top layer for radiation + units = count + dimensions = () + type = integer + + [ccpp-table-properties] name = GFS_statein_type type = ddt @@ -3508,12 +3531,6 @@ units = count dimensions = () type = integer -[nthreads] - standard_name = number_of_openmp_threads - long_name = number of OpenMP threads available for physics schemes - units = count - dimensions = () - type = integer [nlunit] standard_name = iounit_of_namelist long_name = fortran unit number for file opens @@ -3703,60 +3720,60 @@ units = count dimensions = () type = integer -[nblks] - standard_name = ccpp_block_count - long_name = for explicit data blocking: number of blocks - units = count - dimensions = () - type = integer -[blksz] - standard_name = ccpp_block_sizes - long_name = for explicit data blocking: block sizes of all blocks - units = count - dimensions = (ccpp_block_count) - type = integer -[blksz(ccpp_block_number)] - standard_name = horizontal_loop_extent - long_name = horizontal loop extent - units = count - dimensions = () - type = integer +#[nblks] +# standard_name = ccpp_block_count +# long_name = for explicit data blocking: number of blocks +# units = count +# dimensions = () +# type = integer +#[blksz] +# standard_name = ccpp_block_sizes +# long_name = for explicit data blocking: block sizes of all blocks +# units = count +# dimensions = (ccpp_block_count) +# type = integer +#[blksz(ccpp_block_number)] +# standard_name = horizontal_loop_extent +# long_name = horizontal loop extent +# units = count +# dimensions = () +# type = integer [ncols] standard_name = horizontal_dimension long_name = horizontal dimension units = count dimensions = () type = integer -[nchunks] - standard_name = ccpp_chunk_extent - long_name = number of chunks of array data used in run phase - units = count - dimensions = () - type = integer -[chunk_begin] - standard_name = horizontal_loop_begin_all_chunks - long_name = first index for horizontal loop extent in run phase - units = index - dimensions = (ccpp_chunk_extent) - type = integer -[chunk_begin(ccpp_chunk_number)] - standard_name = horizontal_loop_begin - long_name = first index for horizontal loop extent in run phase - units = index - dimensions = () - type = integer -[chunk_end] - standard_name = horizontal_loop_end_all_chunks - long_name = last index for horizontal loop extent in run phase - units = index - dimensions = (ccpp_chunk_extent) - type = integer -[chunk_end(ccpp_chunk_number)] - standard_name = horizontal_loop_end - long_name = last index for horizontal loop extent in run phase - units = index - dimensions = () - type = integer +#[nchunks] +# standard_name = ccpp_chunk_extent +# long_name = number of chunks of array data used in run phase +# units = count +# dimensions = () +# type = integer +#[chunk_begin] +# standard_name = horizontal_loop_begin_all_chunks +# long_name = first index for horizontal loop extent in run phase +# units = index +# dimensions = (ccpp_chunk_extent) +# type = integer +#[chunk_begin(ccpp_chunk_number)] +# standard_name = horizontal_loop_begin +# long_name = first index for horizontal loop extent in run phase +# units = index +# dimensions = () +# type = integer +#[chunk_end] +# standard_name = horizontal_loop_end_all_chunks +# long_name = last index for horizontal loop extent in run phase +# units = index +# dimensions = (ccpp_chunk_extent) +# type = integer +#[chunk_end(ccpp_chunk_number)] +# standard_name = horizontal_loop_end +# long_name = last index for horizontal loop extent in run phase +# units = index +# dimensions = () +# type = integer [dycore_active] standard_name = control_for_dynamical_core long_name = choice of dynamical core @@ -3938,13 +3955,13 @@ [nsswr] standard_name = number_of_timesteps_between_shortwave_radiation_calls long_name = number of timesteps between shortwave radiation calls - units = + units = count dimensions = () type = integer [nslwr] standard_name = number_of_timesteps_between_longwave_radiation_calls long_name = number of timesteps between longwave radiation calls - units = + units = count dimensions = () type = integer [fhswr] @@ -5780,7 +5797,7 @@ [shcnvcw] standard_name = flag_for_saving_shallow_convective_cloud_area_fraction long_name = flag for shallow convective cloud - units = + units = flag dimensions = () type = logical [redrag] @@ -7462,43 +7479,43 @@ [nT2delt] standard_name = index_of_air_temperature_two_timesteps_back_in_xyz_dimensioned_restart_array long_name = the index of air temperature two timesteps back in phy f3d - units = + units = index dimensions = () type = integer [nTdelt] standard_name = index_of_air_temperature_on_previous_timestep_in_xyz_dimensioned_restart_array long_name = the index of air temperature at previous timestep in phy f3d - units = + units = index dimensions = () type = integer [nqv2delt] standard_name = index_of_specific_humidity_two_timesteps_back_in_xyz_dimensioned_restart_array long_name = the index of specific humidity two timesteps back in phy f3d - units = + units = index dimensions = () type = integer [nqvdelt] standard_name = index_of_specific_humidity_on_previous_timestep_in_xyz_dimensioned_restart_array long_name = the index of specific humidity at previous timestep in phy f3d - units = + units = index dimensions = () type = integer [nps2delt] standard_name = index_of_surface_air_pressure_two_timesteps_back_in_xyz_dimensioned_tracer_array long_name = the index of surface air pressure two timesteps back in phy f2d - units = + units = index dimensions = () type = integer [npsdelt] standard_name = index_of_surface_air_pressure_on_previous_timestep_in_xyz_dimensioned_restart_array long_name = the index of surface air pressure at previous timestep in phy f2d - units = + units = index dimensions = () type = integer [ncnvwind] standard_name = index_of_enhancement_to_wind_speed_at_surface_adjacent_layer_due_to_convection_in_xy_dimensioned_restart_array long_name = the index of surface wind enhancement due to convection in phy f2d - units = + units = index dimensions = () type = integer [debug] @@ -10687,85 +10704,3 @@ kind = kind_phys intent = inout active = (do_lightning_threat_index_calculations) - -######################################################################## -[ccpp-table-properties] - name = GFS_typedefs - type = module - dependencies_path = ../../ccpp/physics/physics - dependencies = hooks/machine.F,hooks/physcons.F90 - dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f - dependencies = MP/TEMPO/TEMPO/module_mp_tempo_params.F90 - dependencies = photochem/module_ozphys.F90,photochem/module_h2ophys.F90 - dependencies = SFC_Models/Land/Noahmp/lnd_iau_mod.F90 - dependencies = Interstitials/UFS_SCM_NEPTUNE/GFS_ccpp_suite_sim_pre.F90 - -[ccpp-arg-table] - name = GFS_typedefs - type = module -[GFS_cldprop_type] - standard_name = GFS_cldprop_type - long_name = definition of type GFS_cldprop_type - units = DDT - dimensions = () - type = GFS_cldprop_type -[GFS_control_type] - standard_name = GFS_control_type - long_name = definition of type GFS_control_type - units = DDT - dimensions = () - type = GFS_control_type -[GFS_coupling_type] - standard_name = GFS_coupling_type - long_name = definition of type GFS_coupling_type - units = DDT - dimensions = () - type = GFS_coupling_type -[GFS_diag_type] - standard_name = GFS_diag_type - long_name = definition of type GFS_diag_type - units = DDT - dimensions = () - type = GFS_diag_type -[GFS_grid_type] - standard_name = GFS_grid_type - long_name = definition of type GFS_grid_type - units = DDT - dimensions = () - type = GFS_grid_type -[GFS_radtend_type] - standard_name = GFS_radtend_type - long_name = definition of type GFS_radtend_type - units = DDT - dimensions = () - type = GFS_radtend_type -[GFS_sfcprop_type] - standard_name = GFS_sfcprop_type - long_name = definition of type GFS_sfcprop_type - units = DDT - dimensions = () - type = GFS_sfcprop_type -[GFS_statein_type] - standard_name = GFS_statein_type - long_name = definition of type GFS_statein_type - units = DDT - dimensions = () - type = GFS_statein_type -[GFS_stateout_type] - standard_name = GFS_stateout_type - long_name = definition of type GFS_stateout_type - units = DDT - dimensions = () - type = GFS_stateout_type -[GFS_tbd_type] - standard_name = GFS_tbd_type - long_name = definition of type GFS_tbd_type - units = DDT - dimensions = () - type = GFS_tbd_type -[LTP] - standard_name = extra_top_layer - long_name = extra top layer for radiation - units = count - dimensions = () - type = integer diff --git a/scm/src/run_scm.py b/scm/src/run_scm.py index 364dbd91a..ae59d339b 100755 --- a/scm/src/run_scm.py +++ b/scm/src/run_scm.py @@ -710,11 +710,11 @@ def setup_rundir(self): # Move executable to run dir if COPY_EXECUTABLE: logging.debug('Copying executable to run directory') - cmd = 'cp {0} {1}'.format(os.path.join(SCM_ROOT, SCM_BIN, EXECUTABLE_NAME), os.path.join(SCM_RUN, EXECUTABLE_NAME)) + cmd = 'cp {0} {1}'.format(os.path.join(SCM_ROOT, SCM_BIN, "scm", "src", EXECUTABLE_NAME), os.path.join(SCM_RUN, EXECUTABLE_NAME)) execute(cmd) else: logging.debug('Linking executable to run directory') - cmd = 'ln -sf {0} {1}'.format(os.path.join(SCM_ROOT, SCM_BIN, EXECUTABLE_NAME), os.path.join(SCM_RUN, EXECUTABLE_NAME)) + cmd = 'ln -sf {0} {1}'.format(os.path.join(SCM_ROOT, SCM_BIN, "scm", "src", EXECUTABLE_NAME), os.path.join(SCM_RUN, EXECUTABLE_NAME)) execute(cmd) #Inform user of timestep and output intervals diff --git a/scm/src/scm.F90 b/scm/src/scm.F90 index 6d673c204..55e720e2f 100644 --- a/scm/src/scm.F90 +++ b/scm/src/scm.F90 @@ -13,18 +13,26 @@ subroutine scm_main_sub() use scm_vgrid use scm_setup use scm_forcing - use scm_time_integration + use scm_time_integration, only: do_time_step, filter use scm_output use scm_type_defs use mpi_f08 - use :: ccpp_static_api, & - only: ccpp_physics_init, & - ccpp_physics_timestep_init, & - ccpp_physics_run, & - ccpp_physics_timestep_finalize, & - ccpp_physics_finalize - + ! Import CCPP control variables from scm_time_integration + ! and define CPP directive for fixed control values. + use scm_time_integration, only: errmsg, errflg +#define CCPP_PHYSICS_STATIC_ARGS lb=1, ub=1, mythread=1, nthreads=1, nphys_threads=1 +#define CCPP_PHYSICS_NPHYS_THREADS 1 + + use :: ccpp_static_api, & + only: ccpp_register, & + ccpp_init, & + ccpp_physics_init, & + ccpp_physics_timestep_init, & + ccpp_physics_run, & + ccpp_physics_timestep_final, & + ccpp_physics_final , & + ccpp_final implicit none @@ -34,23 +42,20 @@ subroutine scm_main_sub() type(MPI_Comm) :: fcst_mpi_comm - integer :: i, j, kdt_rad, idtend, itrac, n_tasks, n_threads + integer :: i, j, kdt_rad, idtend, itrac, n_tasks real(kind=8) :: rinc(5) !(DAYS, HOURS, MINUTES, SECONDS, MILLISECONDS) integer :: jdat(1:8) - integer :: cdata_time_index - integer :: ierr character(len=16) :: logfile_name - logical :: in_spinup + logical :: in_spinup - call MPI_INIT(ierr) - if (ierr/=0) then - write(error_unit,*) 'An error occurred in MPI_INIT: ', ierr + call MPI_INIT(errflg) + if (errflg/=0) then + write(error_unit,*) 'An error occurred in MPI_INIT: ', errflg error stop end if fcst_mpi_comm = MPI_COMM_WORLD n_tasks = 1 - n_threads = 1 call get_config_nml(scm_state) @@ -68,8 +73,6 @@ subroutine scm_main_sub() call get_FV3_vgrid(scm_input_instance, scm_state) - !allocate(cdata_cols(scm_state%n_cols)) - call set_state(scm_input_instance, scm_reference, scm_state) call calc_geopotential(1, scm_state) @@ -85,22 +88,10 @@ subroutine scm_main_sub() call interpolate_forcing(scm_input_instance, scm_state, in_spinup) - call physics%create(scm_state%n_cols, n_threads) + call physics%create(scm_state%n_cols, CCPP_PHYSICS_NPHYS_THREADS) !physics initialization section - !set the array index of the time level of the state variables that the cdata - !points to (this is the time level that will be updated during ipd_run; - !if suite returns tendencies, SCM must apply them to this time level) - select case(scm_state%time_scheme) - case(1) - cdata_time_index = 1 - case(2) - cdata_time_index = 2 - case default - cdata_time_index = 2 - end select - !open a logfile if (physics%Init_parm%me == physics%Init_parm%master .and. physics%Init_parm%logunit>=0) then write (logfile_name, '(A7,I0.5,A4)') 'logfile.out' @@ -134,7 +125,7 @@ subroutine scm_main_sub() call GFS_suite_setup(physics%Model, physics%Statein, physics%Stateout, & physics%Sfcprop, physics%Coupling, physics%Grid, & physics%Tbd, physics%Cldprop, physics%Radtend, & - physics%Diag, n_tasks, n_threads, & + physics%Diag, n_tasks, CCPP_PHYSICS_NPHYS_THREADS, & physics%Init_parm, scm_state%n_cols, scm_state%lon, & scm_state%lat, scm_state%area) @@ -177,11 +168,6 @@ subroutine scm_main_sub() lcm(scm_state%n_itt_out,physics%Model%nslwr)*scm_state%dt," seconds." end if - cdata%blk_no = 1 - cdata%chunk_no = 1 - cdata%thrd_no = 1 - cdata%thrd_cnt = 1 - call physics%associate(scm_state) call physics%set(scm_input_instance, scm_state) @@ -194,20 +180,31 @@ subroutine scm_main_sub() physics%Stateout%gq0 = physics%Statein%qgrs endif - !initialize the column's physics + ! Initialize the column's CCPP physics. Three steps: register, init, physics_init + + call ccpp_register(suite_name=scm_state%physics_suite_name, errmsg=errmsg, errflg=errflg) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_register: ' // trim(errmsg) // '. Exiting...' + error stop + end if + + call ccpp_init(suite_name=scm_state%physics_suite_name, errmsg=errmsg, errflg=errflg) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_init: ' // trim(errmsg) // '. Exiting...' + error stop + end if - write(*,'(a,i0,a)') "Calling ccpp_physics_init with suite '" // trim(trim(adjustl(scm_state%physics_suite_name))) // "'" - call ccpp_physics_init(cdata, suite_name=trim(trim(adjustl(scm_state%physics_suite_name))), ierr=ierr) - write(*,'(a,i0,a,i0)') "Called ccpp_physics_init with suite '" // trim(trim(adjustl(scm_state%physics_suite_name))) // "', ierr=", ierr - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_init: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_init(suite_name=scm_state%physics_suite_name, group_name='all', & + errmsg=errmsg, errflg=errflg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_init: ' // trim(errmsg) // '. Exiting...' error stop end if physics%Model%first_time_step = .true. call output_init(scm_state, physics) - if (n_threads == 1) then + if (CCPP_PHYSICS_NPHYS_THREADS == 1) then call physics%Interstitial(1)%create(ixs=1, ixe=1, model=physics%Model) else write(error_unit,*) ' CCPP SCM is only set up to use one thread - shutting down' @@ -228,7 +225,7 @@ subroutine scm_main_sub() if (.not. scm_state%model_ics) call calc_pres_exner_geopotential(1, scm_state) !pass in state variables to be modified by forcing and physics - call do_time_step(scm_state, physics, cdata, in_spinup) + call do_time_step(scm_state, physics, in_spinup) else if (scm_state%time_scheme == 2) then ! !if using the leapfrog scheme, we initialize by taking one half forward time step and one half (unfiltered) leapfrog time step to get to the end of the first time step @@ -253,7 +250,7 @@ subroutine scm_main_sub() call apply_forcing_DEPHY(scm_state, in_spinup) end if - !apply_forcing_forward_Euler updates state variables time level 1, so must copy this data to time_level 2 (where cdata points) + !apply_forcing_forward_Euler updates state variables time level 1, so must copy this data to time_level 2 scm_state%state_T(:,:,2) = scm_state%state_T(:,:,1) scm_state%state_tracer(:,:,:,2) = scm_state%state_tracer(:,:,:,1) scm_state%state_u(:,:,2) = scm_state%state_u(:,:,1) @@ -294,9 +291,10 @@ subroutine scm_main_sub() endif end do - call ccpp_physics_timestep_init(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_init: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_timestep_init(suite_name=scm_state%physics_suite_name, group_name='all', & + errmsg=errmsg, errflg=errflg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_init: ' // trim(errmsg) // '. Exiting...' error stop end if @@ -321,28 +319,32 @@ subroutine scm_main_sub() ! time_vary group doesn't have any run phase (omitted) ! radiation group call physics%Interstitial(1)%create(ixs=1, ixe=1, model=physics%Model) - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="radiation", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group radiation: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_run(suite_name=scm_state%physics_suite_name, group_name="radiation", & + errmsg=errmsg, errflg=errflg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group radiation: ' // trim(errmsg) // '. Exiting...' error stop end if ! process-split physics call physics%Interstitial(1)%reset(physics%Model) - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="phys_ps", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ps: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_run(suite_name=scm_state%physics_suite_name, group_name="phys_ps", & + errmsg=errmsg, errflg=errflg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ps: ' // trim(errmsg) // '. Exiting...' error stop end if ! time-split physics - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="phys_ts", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ts: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_run(suite_name=scm_state%physics_suite_name, group_name="phys_ts", & + errmsg=errmsg, errflg=errflg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ts: ' // trim(errmsg) // '. Exiting...' error stop end if - call ccpp_physics_timestep_finalize(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_finalize: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_timestep_final(suite_name=scm_state%physics_suite_name, group_name='all', & + errmsg=errmsg, errflg=errflg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_final: ' // trim(errmsg) // '. Exiting...' error stop end if @@ -367,7 +369,7 @@ subroutine scm_main_sub() scm_state%state_tracer(:,:,:,1) = scm_state%temp_tracer(:,:,:,1) !go forward one leapfrog time step - call do_time_step(scm_state, physics, cdata, in_spinup) + call do_time_step(scm_state, physics, in_spinup) !for filtered-leapfrog scheme, call the filtering routine to calculate values of the state variables to save in slot 1 using slot 2 vars (updated, unfiltered) output from the physics call filter(scm_state) @@ -430,7 +432,7 @@ subroutine scm_main_sub() !call physics%Diag%phys_zero(physics%Model) !pass in state variables to be modified by forcing and physics - call do_time_step(scm_state, physics, cdata, in_spinup) + call do_time_step(scm_state, physics, in_spinup) if (scm_state%time_scheme == 2) then !for filtered-leapfrog scheme, call the filtering routine to calculate values of the state variables to save in slot 1 using slot 2 vars (updated, unfiltered) output from the physics @@ -456,16 +458,24 @@ subroutine scm_main_sub() call physics%Interstitial(1)%destroy(physics%Model) end do - call ccpp_physics_finalize(cdata, suite_name=trim(trim(adjustl(scm_state%physics_suite_name))), ierr=ierr) + ! Finalize CCPP. Two steps: finalize physics, finalize framework + + call ccpp_physics_final(suite_name=scm_state%physics_suite_name, group_name='all', & + errmsg=errmsg, errflg=errflg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_final: ' // trim(errmsg) // '. Exiting...' + error stop + end if - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_finalize: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_final(suite_name=scm_state%physics_suite_name, errmsg=errmsg, errflg=errflg) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_final: ' // trim(errmsg) // '. Exiting...' error stop end if - call MPI_FINALIZE(ierr) - if (ierr/=0) then - write(error_unit,*) 'An error occurred in MPI_FINALIZE: ', ierr + call MPI_FINALIZE(errflg) + if (errflg/=0) then + write(error_unit,*) 'An error occurred in MPI_FINALIZE: ', errflg error stop end if diff --git a/scm/src/scm_kinds.meta b/scm/src/scm_kinds.meta index bf150f92e..77af18f56 100644 --- a/scm/src/scm_kinds.meta +++ b/scm/src/scm_kinds.meta @@ -1,11 +1,11 @@ [ccpp-table-properties] name = scm_kinds - type = module + type = host dependencies = [ccpp-arg-table] name = scm_kinds - type = module + type = host [kind_sp] standard_name = kind_sp long_name = definition of kind_sp diff --git a/scm/src/scm_physical_constants.meta b/scm/src/scm_physical_constants.meta index dd820f7c0..ede4e52da 100644 --- a/scm/src/scm_physical_constants.meta +++ b/scm/src/scm_physical_constants.meta @@ -1,11 +1,11 @@ [ccpp-table-properties] name = scm_physical_constants - type = module + type = host dependencies = scm_kinds.F90 [ccpp-arg-table] name = scm_physical_constants - type = module + type = host [con_zero] standard_name = constant_zero long_name = definition of constant zero diff --git a/scm/src/scm_time_integration.F90 b/scm/src/scm_time_integration.F90 index 5bb319033..0ac7ca62c 100644 --- a/scm/src/scm_time_integration.F90 +++ b/scm/src/scm_time_integration.F90 @@ -7,15 +7,21 @@ module scm_time_integration use scm_kinds, only: sp, dp, qp use scm_forcing -use ccpp_types, only: ccpp_t -use :: ccpp_static_api, & - only: ccpp_physics_timestep_init, & - ccpp_physics_run, & - ccpp_physics_timestep_finalize - +use :: ccpp_static_api, & + only: ccpp_physics_timestep_init, & + ccpp_physics_run, & + ccpp_physics_timestep_final implicit none + ! CCPP control variables declared as module variables so that + ! scm.F90 can import them. OK since SCM doesn't use multiple + ! instances and doesn't use OpenMP threading in the host. + ! Fixed CCPP control values are passed via a CPP directive. + character(len=512) :: errmsg + integer :: errflg +#define CCPP_PHYSICS_STATIC_ARGS lb=1, ub=1, mythread=1, nthreads=1, nphys_threads=1 + contains !> \ingroup SCM @@ -54,15 +60,14 @@ subroutine filter(scm_state) !! The subroutine nuopc_rad_update calculates the time-dependent parameters required to run radiation, and nuopc_rad_run calculates the radiative heating rate (but does not apply it). The !! subroutine apply_forcing_leapfrog advances the state variables forward using the leapfrog method and nuopc_phys_run further changes the state variables using the forward method. By the end of !! this subroutine, the unfiltered state variables will have been stepped forward in time. -subroutine do_time_step(scm_state, physics, cdata, in_spinup) +subroutine do_time_step(scm_state, physics, in_spinup) use scm_type_defs, only: scm_state_type, physics_type type(scm_state_type), intent(inout) :: scm_state type(physics_type), intent(inout) :: physics - type(ccpp_t), intent(inout) :: cdata logical, intent(in) :: in_spinup - integer :: i, ierr, kdt_rad, idtend, itrac + integer :: i, kdt_rad, idtend, itrac !> \section do_time_step_alg Algorithm !! @{ @@ -91,7 +96,7 @@ subroutine do_time_step(scm_state, physics, cdata, in_spinup) end select if (scm_state%time_scheme == 2) then - !IPD cdata points to time level 2 for updating state variables; update time level 2 state variables with those where the forcing has been applied this time step + ! TODO UPDATE COMMENT IPD cdata points to time level 2 for updating state variables; update time level 2 state variables with those where the forcing has been applied this time step scm_state%state_T(:,:,2) = scm_state%state_T(:,:,1) scm_state%state_tracer(:,:,:,2) = scm_state%state_tracer(:,:,:,1) scm_state%state_u(:,:,2) = scm_state%state_u(:,:,1) @@ -133,10 +138,11 @@ subroutine do_time_step(scm_state, physics, cdata, in_spinup) endif enddo - call ccpp_physics_timestep_init(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_init: ' // trim(cdata%errmsg) // '. Exiting...' - error stop trim(cdata%errmsg) + call ccpp_physics_timestep_init(suite_name=scm_state%physics_suite_name, group_name='all', & + errflg=errflg, errmsg=errmsg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_init: ' // trim(errmsg) // '. Exiting...' + error stop trim(errmsg) end if !--- determine if radiation diagnostics buckets need to be cleared @@ -161,28 +167,32 @@ subroutine do_time_step(scm_state, physics, cdata, in_spinup) ! radiation group call physics%Interstitial(1)%create(ixs=1, ixe=1, model=physics%Model) - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="radiation", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group radiation: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_run(suite_name=scm_state%physics_suite_name, group_name="radiation", & + errflg=errflg, errmsg=errmsg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group radiation: ' // trim(errmsg) // '. Exiting...' error stop end if ! process-split physics call physics%Interstitial(1)%reset(physics%Model) - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="phys_ps", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ps: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_run(suite_name=scm_state%physics_suite_name, group_name="phys_ps", & + errflg=errflg, errmsg=errmsg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ps: ' // trim(errmsg) // '. Exiting...' error stop end if ! time-split physics - call ccpp_physics_run(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), group_name="phys_ts", ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ts: ' // trim(cdata%errmsg) // '. Exiting...' + call ccpp_physics_run(suite_name=scm_state%physics_suite_name, group_name="phys_ts", & + errflg=errflg, errmsg=errmsg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_run for group phys_ts: ' // trim(errmsg) // '. Exiting...' error stop end if - call ccpp_physics_timestep_finalize(cdata, suite_name=trim(adjustl(scm_state%physics_suite_name)), ierr=ierr) - if (ierr/=0) then - write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_finalize: ' // trim(cdata%errmsg) // '. Exiting...' - error stop trim(cdata%errmsg) + call ccpp_physics_timestep_final(suite_name=scm_state%physics_suite_name, group_name='all', & + errflg=errflg, errmsg=errmsg, CCPP_PHYSICS_STATIC_ARGS) + if (errflg/=0) then + write(error_unit,'(a,i0,a)') 'An error occurred in ccpp_physics_timestep_finalize: ' // trim(errmsg) // '. Exiting...' + error stop trim(errmsg) end if !if no physics call, need to transfer state_variables(:,:,1) to state_variables (:,:,2) diff --git a/scm/src/scm_time_integration.meta b/scm/src/scm_time_integration.meta new file mode 100644 index 000000000..dbfa22f06 --- /dev/null +++ b/scm/src/scm_time_integration.meta @@ -0,0 +1,65 @@ +[ccpp-table-properties] + name = scm_time_integration + type = control + dependencies = scm_forcing.F90 + +[ccpp-arg-table] + name = scm_time_integration + type = control +[ suite_name ] + standard_name = suite_name + long_name = name of the CCPP suite to dispatch to + units = none + dimensions = () + type = character + kind = len=256 +[ group_name ] + standard_name = group_name + long_name = name of the CCPP group to dispatch to + units = none + dimensions = () + type = character + kind = len=256 +[ lb ] + standard_name = horizontal_loop_begin + long_name = start of horizontal range for this phase + units = index + dimensions = () + type = integer +[ ub ] + standard_name = horizontal_loop_end + long_name = end of horizontal range for this phase + units = index + dimensions = () + type = integer +[ mythread ] + standard_name = thread_number + long_name = current thread number + units = index + dimensions = () + type = integer +[ nthreads ] + standard_name = number_of_threads + long_name = total number of OpenMP threads + units = count + dimensions = () + type = integer +[ nphys_threads ] + standard_name = number_of_physics_threads + long_name = thread budget for physics-internal OpenMP + units = count + dimensions = () + type = integer +[ errmsg ] + standard_name = ccpp_error_message + long_name = error message for CCPP error handling + units = none + dimensions = () + type = character + kind = len=512 +[ errflg ] + standard_name = ccpp_error_code + long_name = error flag for CCPP error handling + units = 1 + dimensions = () + type = integer diff --git a/scm/src/scm_type_defs.F90 b/scm/src/scm_type_defs.F90 index a06e49e81..f78790dc6 100644 --- a/scm/src/scm_type_defs.F90 +++ b/scm/src/scm_type_defs.F90 @@ -23,7 +23,6 @@ module scm_type_defs get_tracer_index use CCPP_typedefs, only: GFS_interstitial_type use machine, only: kind_phys - use ccpp_types, only: ccpp_t implicit none @@ -444,8 +443,6 @@ module scm_type_defs type(physics_type), target :: physics - type(ccpp_t), target :: cdata - contains subroutine scm_state_create(scm_state, n_columns, n_levels, n_soil, n_snow, n_time_levels, tracers, tracer_types) diff --git a/scm/src/scm_type_defs.meta b/scm/src/scm_type_defs.meta index 0950d4568..8ae0605a3 100644 --- a/scm/src/scm_type_defs.meta +++ b/scm/src/scm_type_defs.meta @@ -1,3 +1,21 @@ +[ccpp-table-properties] + name = scm_type_defs + type = host + dependencies = scm_kinds.F90,scm_utils.F90,GFS_typedefs.F90,CCPP_typedefs.F90 + dependencies = ../../ccpp/physics/physics/hooks/machine.F + +[ccpp-arg-table] + name = scm_type_defs + type = host +[physics] + standard_name = physics_type_instance + long_name = instance of derived data type physics_type + units = DDT + dimensions = () + type = physics_type + +######################################################################## + [ccpp-table-properties] name = physics_type type = ddt @@ -66,43 +84,9 @@ units = DDT dimensions = () type = GFS_tbd_type -[Interstitial(ccpp_thread_number)] - standard_name = GFS_interstitial_type_instance - long_name = instance of derived type GFS_interstitial_type - units = DDT - dimensions = () - type = GFS_interstitial_type [Interstitial] - standard_name = GFS_interstitial_type_instance_all_threads + standard_name = GFS_interstitial_type_instance long_name = instance of derived type GFS_interstitial_type units = DDT - dimensions = (number_of_openmp_threads) + dimensions = (number_of_threads) type = GFS_interstitial_type - -######################################################################## -[ccpp-table-properties] - name = scm_type_defs - type = module - dependencies = scm_kinds.F90,GFS_typedefs.F90,CCPP_typedefs.F90,../../ccpp/physics/physics/hooks/machine.F - -[ccpp-arg-table] - name = scm_type_defs - type = module -[physics_type] - standard_name = physics_type - long_name = definition of type physics_type - units = DDT - dimensions = () - type = physics_type -[physics] - standard_name = physics_type_instance - long_name = instance of derived data type physics_type - units = DDT - dimensions = () - type = physics_type -[cdata] - standard_name = ccpp_t_instance - long_name = instance of derived data type ccpp_t - units = DDT - dimensions = () - type = ccpp_t From 06286dcdee114bdb9f9c51886d46fca6e71d7152 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 14 May 2026 11:48:31 -0600 Subject: [PATCH 03/28] Update ccpp suites, ccpp/CMakeLists.txt, cmake/ccpp_capgen.cmake --- ccpp/CMakeLists.txt | 18 ++++++++++++++++++ ccpp/physics | 2 +- ccpp/suites/suite_HAFS_v0_hwrf.xml | 2 +- ccpp/suites/suite_HAFS_v0_hwrf_ps.xml | 2 +- ccpp/suites/suite_HAFS_v0_hwrf_thompson.xml | 2 +- ccpp/suites/suite_HAFS_v0_hwrf_thompson_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_ACM_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_FA.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_MYJ.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_YSU_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_no_nsst.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_no_nsst_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_noahmp.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke.xml | 2 +- .../suites/suite_SCM_GFS_v15p2_ntiedtke_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v15p2_saYSU_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v16.xml | 2 +- ccpp/suites/suite_SCM_GFS_v16_RRTMGP.xml | 2 +- ccpp/suites/suite_SCM_GFS_v16_RRTMGP_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v16_debug.xml | 2 +- ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3.xml | 2 +- ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v16_no_nsst.xml | 2 +- ccpp/suites/suite_SCM_GFS_v16_no_nsst_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v16_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml | 2 +- ccpp/suites/suite_SCM_GFS_v17_p8_c3.xml | 2 +- ccpp/suites/suite_SCM_GFS_v17_p8_c3_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1.xml | 2 +- .../suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml | 2 +- .../suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml | 2 +- ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml | 2 +- .../suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml | 2 +- .../suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml | 2 +- ccpp/suites/suite_SCM_GSD_v1.xml | 2 +- ccpp/suites/suite_SCM_GSD_v1_ps.xml | 2 +- ccpp/suites/suite_SCM_GSD_v1nssl.xml | 2 +- ccpp/suites/suite_SCM_GSD_v1nssl_ps.xml | 2 +- ccpp/suites/suite_SCM_HRRR.xml | 2 +- ccpp/suites/suite_SCM_HRRR_gf.xml | 2 +- ccpp/suites/suite_SCM_HRRR_gf_ps.xml | 2 +- ccpp/suites/suite_SCM_HRRR_ps.xml | 2 +- ccpp/suites/suite_SCM_RAP.xml | 2 +- ccpp/suites/suite_SCM_RAP_ps.xml | 2 +- ccpp/suites/suite_SCM_RRFS_v1alpha.xml | 2 +- ccpp/suites/suite_SCM_RRFS_v1alpha_ps.xml | 2 +- ccpp/suites/suite_SCM_RRFS_v1beta.xml | 2 +- ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst.xml | 2 +- .../suite_SCM_RRFS_v1beta_no_nsst_ps.xml | 2 +- ccpp/suites/suite_SCM_RRFS_v1beta_ps.xml | 2 +- ccpp/suites/suite_SCM_RRFS_v1nssl.xml | 2 +- ccpp/suites/suite_SCM_WoFS_v0.xml | 2 +- ccpp/suites/suite_SCM_WoFS_v0_ps.xml | 2 +- ccpp/suites/suite_SCM_csawmg.xml | 2 +- ccpp/suites/suite_SCM_csawmg_ps.xml | 2 +- cmake/ccpp_capgen.cmake | 4 ++++ 61 files changed, 81 insertions(+), 59 deletions(-) diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index cbdad562d..c6fad4071 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -73,6 +73,16 @@ set(SCHEME_METADATA_FILES "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta" "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta" "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta" + "${SCHEME_FILES_DIR}/CONV/C3/cu_c3_driver.meta" + "${SCHEME_FILES_DIR}/CONV/C3/cu_c3_driver_post.meta" + "${SCHEME_FILES_DIR}/CONV/C3/cu_c3_driver_pre.meta" + "${SCHEME_FILES_DIR}/GWD/ugwpv1_gsldrag.meta" + "${SCHEME_FILES_DIR}/GWD/ugwpv1_gsldrag_post.meta" + "${SCHEME_FILES_DIR}/SFC_Models/Ocean/UFS/sfc_ocean.meta" + "${SCHEME_FILES_DIR}/MP/TEMPO/mp_tempo_post.meta" + "${SCHEME_FILES_DIR}/MP/TEMPO/mp_tempo.meta" + "${SCHEME_FILES_DIR}/MP/TEMPO/mp_tempo_pre.meta" + "${SCHEME_FILES_DIR}/MP/TEMPO/TEMPO/module_mp_tempo_params.meta" ) ## DH* TEST @@ -102,6 +112,14 @@ set(SUITE_FILES_DIR "${CMAKE_SOURCE_DIR}/ccpp/suites") set(SUITE_FILES "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8.xml" "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_c3.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_c3_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml" ) set(HOST "ccpp-scm") diff --git a/ccpp/physics b/ccpp/physics index 1ff31daba..cf1664daa 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 1ff31dabade1db4e07300270214a1de9f1f7674a +Subproject commit cf1664daaed3dd1f6f3877c3ca6e9e94909202bc diff --git a/ccpp/suites/suite_HAFS_v0_hwrf.xml b/ccpp/suites/suite_HAFS_v0_hwrf.xml index 76111175a..e09c3ce60 100644 --- a/ccpp/suites/suite_HAFS_v0_hwrf.xml +++ b/ccpp/suites/suite_HAFS_v0_hwrf.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_HAFS_v0_hwrf_ps.xml b/ccpp/suites/suite_HAFS_v0_hwrf_ps.xml index 602b3aeb6..99e85ad26 100644 --- a/ccpp/suites/suite_HAFS_v0_hwrf_ps.xml +++ b/ccpp/suites/suite_HAFS_v0_hwrf_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_HAFS_v0_hwrf_thompson.xml b/ccpp/suites/suite_HAFS_v0_hwrf_thompson.xml index d8bfb8311..86dd39675 100644 --- a/ccpp/suites/suite_HAFS_v0_hwrf_thompson.xml +++ b/ccpp/suites/suite_HAFS_v0_hwrf_thompson.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_HAFS_v0_hwrf_thompson_ps.xml b/ccpp/suites/suite_HAFS_v0_hwrf_thompson_ps.xml index 62d188709..c79bdf295 100644 --- a/ccpp/suites/suite_HAFS_v0_hwrf_thompson_ps.xml +++ b/ccpp/suites/suite_HAFS_v0_hwrf_thompson_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v15p2.xml b/ccpp/suites/suite_SCM_GFS_v15p2.xml index 2b881738e..a723286a6 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_ACM_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_ACM_ps.xml index 6e9ec3504..41f7d70ec 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_ACM_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_ACM_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_FA.xml b/ccpp/suites/suite_SCM_GFS_v15p2_FA.xml index 886a8768b..215294c6c 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_FA.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_FA.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_MYJ.xml b/ccpp/suites/suite_SCM_GFS_v15p2_MYJ.xml index 2632e40f5..b3ce19987 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_MYJ.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_MYJ.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP.xml b/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP.xml index d198a9737..8e1c15622 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP_ps.xml index e5d22a3d7..3df77dde6 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_RRTMGP_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_YSU_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_YSU_ps.xml index 1febad374..6cd20c40c 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_YSU_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_YSU_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst.xml b/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst.xml index 330f20946..57459c8d5 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst_ps.xml index 5915ecd4f..b431fc41b 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_no_nsst_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_noahmp.xml b/ccpp/suites/suite_SCM_GFS_v15p2_noahmp.xml index 87553bd40..0ffbae1bd 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_noahmp.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_noahmp.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke.xml b/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke.xml index a32a78fb6..282b51c1a 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke_ps.xml index bbe13cdfb..2b47ea2f9 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_ntiedtke_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_ps.xml index 1634d4214..440dde273 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v15p2_saYSU_ps.xml b/ccpp/suites/suite_SCM_GFS_v15p2_saYSU_ps.xml index 9450b42f3..365377298 100644 --- a/ccpp/suites/suite_SCM_GFS_v15p2_saYSU_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v15p2_saYSU_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16.xml b/ccpp/suites/suite_SCM_GFS_v16.xml index b98d0f8ce..72d2a952d 100644 --- a/ccpp/suites/suite_SCM_GFS_v16.xml +++ b/ccpp/suites/suite_SCM_GFS_v16.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_RRTMGP.xml b/ccpp/suites/suite_SCM_GFS_v16_RRTMGP.xml index 3b585c411..af0a1d9da 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_RRTMGP.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_RRTMGP.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_RRTMGP_ps.xml b/ccpp/suites/suite_SCM_GFS_v16_RRTMGP_ps.xml index 1c1e5d437..1368a1a58 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_RRTMGP_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_RRTMGP_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_debug.xml b/ccpp/suites/suite_SCM_GFS_v16_debug.xml index 71d003efe..d4dd7704c 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_debug.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_debug.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml b/ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml index 2e94e8ca0..828892c73 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3.xml b/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3.xml index e4febfe24..38d7e1d3d 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3_ps.xml b/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3_ps.xml index d5fe0bd16..30a3789fa 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_gfdlmpv3_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v16_no_nsst.xml b/ccpp/suites/suite_SCM_GFS_v16_no_nsst.xml index ec15e151f..67f169e6a 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_no_nsst.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_no_nsst.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_no_nsst_ps.xml b/ccpp/suites/suite_SCM_GFS_v16_no_nsst_ps.xml index b7decd982..0439c0174 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_no_nsst_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_no_nsst_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_ps.xml b/ccpp/suites/suite_SCM_GFS_v16_ps.xml index 90962bb25..8b0c42fed 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml b/ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml index 7858601b9..e2c1afb9d 100644 --- a/ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml +++ b/ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_c3.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_c3.xml index e700c7e55..019662b8e 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_c3.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_c3.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_c3_ps.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_c3_ps.xml index 0ca378b15..e58d0dd68 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_c3_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_c3_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1.xml index e4e8eb2ba..c387a4460 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml index 75644d368..7bca99001 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml index eaf5d18b7..75a8b935e 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml index 772816157..f1fc19b05 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml index 64b58cfd2..652d6663f 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml index 032cfe411..3816828b5 100644 --- a/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml +++ b/ccpp/suites/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GSD_v1.xml b/ccpp/suites/suite_SCM_GSD_v1.xml index 2d2674f57..57053040b 100644 --- a/ccpp/suites/suite_SCM_GSD_v1.xml +++ b/ccpp/suites/suite_SCM_GSD_v1.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GSD_v1_ps.xml b/ccpp/suites/suite_SCM_GSD_v1_ps.xml index b366de869..6222f2963 100644 --- a/ccpp/suites/suite_SCM_GSD_v1_ps.xml +++ b/ccpp/suites/suite_SCM_GSD_v1_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GSD_v1nssl.xml b/ccpp/suites/suite_SCM_GSD_v1nssl.xml index f7e538b30..0f11bb6a1 100644 --- a/ccpp/suites/suite_SCM_GSD_v1nssl.xml +++ b/ccpp/suites/suite_SCM_GSD_v1nssl.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_GSD_v1nssl_ps.xml b/ccpp/suites/suite_SCM_GSD_v1nssl_ps.xml index eca2a4050..981a69a0d 100644 --- a/ccpp/suites/suite_SCM_GSD_v1nssl_ps.xml +++ b/ccpp/suites/suite_SCM_GSD_v1nssl_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_HRRR.xml b/ccpp/suites/suite_SCM_HRRR.xml index 676b86ae8..ffca230e6 100644 --- a/ccpp/suites/suite_SCM_HRRR.xml +++ b/ccpp/suites/suite_SCM_HRRR.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_HRRR_gf.xml b/ccpp/suites/suite_SCM_HRRR_gf.xml index 3d2b0ea59..da5d28503 100644 --- a/ccpp/suites/suite_SCM_HRRR_gf.xml +++ b/ccpp/suites/suite_SCM_HRRR_gf.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_HRRR_gf_ps.xml b/ccpp/suites/suite_SCM_HRRR_gf_ps.xml index ca05b5a21..2a4216534 100644 --- a/ccpp/suites/suite_SCM_HRRR_gf_ps.xml +++ b/ccpp/suites/suite_SCM_HRRR_gf_ps.xml @@ -1,6 +1,6 @@ - + GFS_time_vary_pre diff --git a/ccpp/suites/suite_SCM_HRRR_ps.xml b/ccpp/suites/suite_SCM_HRRR_ps.xml index 36fbe6063..109fa3f30 100644 --- a/ccpp/suites/suite_SCM_HRRR_ps.xml +++ b/ccpp/suites/suite_SCM_HRRR_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RAP.xml b/ccpp/suites/suite_SCM_RAP.xml index 91dd01455..9373acae7 100644 --- a/ccpp/suites/suite_SCM_RAP.xml +++ b/ccpp/suites/suite_SCM_RAP.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RAP_ps.xml b/ccpp/suites/suite_SCM_RAP_ps.xml index 94611ee37..bbf27da57 100644 --- a/ccpp/suites/suite_SCM_RAP_ps.xml +++ b/ccpp/suites/suite_SCM_RAP_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1alpha.xml b/ccpp/suites/suite_SCM_RRFS_v1alpha.xml index c66e3f647..ec70bbd84 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1alpha.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1alpha.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1alpha_ps.xml b/ccpp/suites/suite_SCM_RRFS_v1alpha_ps.xml index 35525ae70..12fc22ef1 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1alpha_ps.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1alpha_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1beta.xml b/ccpp/suites/suite_SCM_RRFS_v1beta.xml index 8fa5959ac..acdcd4036 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1beta.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1beta.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst.xml b/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst.xml index c91560ba0..6ca701785 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst_ps.xml b/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst_ps.xml index 68ef0ccbd..3127c10a3 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst_ps.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1beta_no_nsst_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1beta_ps.xml b/ccpp/suites/suite_SCM_RRFS_v1beta_ps.xml index b8f0420b2..2c2405ea7 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1beta_ps.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1beta_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_RRFS_v1nssl.xml b/ccpp/suites/suite_SCM_RRFS_v1nssl.xml index 74338b179..848a7121d 100644 --- a/ccpp/suites/suite_SCM_RRFS_v1nssl.xml +++ b/ccpp/suites/suite_SCM_RRFS_v1nssl.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_WoFS_v0.xml b/ccpp/suites/suite_SCM_WoFS_v0.xml index 8a0023899..99426626f 100644 --- a/ccpp/suites/suite_SCM_WoFS_v0.xml +++ b/ccpp/suites/suite_SCM_WoFS_v0.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_WoFS_v0_ps.xml b/ccpp/suites/suite_SCM_WoFS_v0_ps.xml index 943996c7a..95146758a 100644 --- a/ccpp/suites/suite_SCM_WoFS_v0_ps.xml +++ b/ccpp/suites/suite_SCM_WoFS_v0_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_csawmg.xml b/ccpp/suites/suite_SCM_csawmg.xml index 286b03cf2..dc7d18399 100644 --- a/ccpp/suites/suite_SCM_csawmg.xml +++ b/ccpp/suites/suite_SCM_csawmg.xml @@ -1,6 +1,6 @@ - + diff --git a/ccpp/suites/suite_SCM_csawmg_ps.xml b/ccpp/suites/suite_SCM_csawmg_ps.xml index 3884e38fc..cf1cad757 100644 --- a/ccpp/suites/suite_SCM_csawmg_ps.xml +++ b/ccpp/suites/suite_SCM_csawmg_ps.xml @@ -1,6 +1,6 @@ - + diff --git a/cmake/ccpp_capgen.cmake b/cmake/ccpp_capgen.cmake index 8cae2fbd7..3857d6c65 100644 --- a/cmake/ccpp_capgen.cmake +++ b/cmake/ccpp_capgen.cmake @@ -213,6 +213,10 @@ function(ccpp_capgen) # of horizontal_loop_extent for scheme run phase metadata list(APPEND CCPP_CAPGEN_CMD_LIST "--legacy-mode") # *DH + # DH* 20260514 TEMPORARY: add --no-host-introspection to + # suppress writing lists of variables etc to ccpp_static_api + list(APPEND CCPP_CAPGEN_CMD_LIST "--no-host-introspection") + # *DH message(STATUS "Running ccpp_capgen.py from ${CMAKE_CURRENT_SOURCE_DIR}") From 288041abceb8c2a5c7491c1dffa266bcbe7c5a4b Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 14 May 2026 11:48:56 -0600 Subject: [PATCH 04/28] Update submodule pointer for ccpp/framework --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index f2c591859..8fd7b3ecc 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit f2c5918597179a807ff1a15da465828c58cb184e +Subproject commit 8fd7b3ecc8b23284c4d6c10ed42177b4f22a7391 From ba61c419e3fe147d39d1f4da76f941c144b7a96c Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 14 May 2026 15:00:16 -0600 Subject: [PATCH 05/28] GFS v16 and HWRF suites in SCM --- ccpp/CMakeLists.txt | 30 ++++++++ ccpp/framework | 2 +- ccpp/framework-symlink/capgen-ng | 1 + ccpp/physics | 2 +- ccpp/suites/suite_SCM_GFS_v16_debug.xml | 87 ---------------------- ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml | 68 ----------------- ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml | 81 -------------------- 7 files changed, 33 insertions(+), 238 deletions(-) create mode 120000 ccpp/framework-symlink/capgen-ng delete mode 100644 ccpp/suites/suite_SCM_GFS_v16_debug.xml delete mode 100644 ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml delete mode 100644 ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index c6fad4071..5c345f6ba 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -83,6 +83,23 @@ set(SCHEME_METADATA_FILES "${SCHEME_FILES_DIR}/MP/TEMPO/mp_tempo.meta" "${SCHEME_FILES_DIR}/MP/TEMPO/mp_tempo_pre.meta" "${SCHEME_FILES_DIR}/MP/TEMPO/TEMPO/module_mp_tempo_params.meta" + "${SCHEME_FILES_DIR}/SFC_Models/Land/Noah/lsm_noah.meta" + "${SCHEME_FILES_DIR}/GWD/cires_ugwp.meta" + "${SCHEME_FILES_DIR}/GWD/cires_ugwp_post.meta" + "${SCHEME_FILES_DIR}/MP/GFDL/v1_2019/gfdl_cloud_microphys.meta" + "${SCHEME_FILES_DIR}/MP/GFDL/fv_sat_adj.meta" + "${SCHEME_FILES_DIR}/MP/GFDL/v3_2022/gfdl_cloud_microphys_v3.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta" + "${SCHEME_FILES_DIR}/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta" + "${SCHEME_FILES_DIR}/Radiation/RRTMGP/rrtmgp_sw_main.meta" + "${SCHEME_FILES_DIR}/Radiation/RRTMGP/rrtmgp_lw_main.meta" + "${SCHEME_FILES_DIR}/PBL/HEDMF/hedmf.meta" + "${SCHEME_FILES_DIR}/MP/Ferrier_Aligo/mp_fer_hires.meta" + "${SCHEME_FILES_DIR}/SFC_Layer/GFDL/gfdl_sfc_layer.meta" ) ## DH* TEST @@ -110,6 +127,19 @@ message(INFO "${HOST_METADATA_FILES} --> ${HOST_FORTRAN_FILES}") set(SUITE_FILES_DIR "${CMAKE_SOURCE_DIR}/ccpp/suites") set(SUITE_FILES + "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf_ps.xml" + "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf_thompson_ps.xml" + "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf_thompson.xml" + "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf.xml" + # skipping csawmg and GFS v15 suites + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_gfdlmpv3.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_gfdlmpv3_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_no_nsst.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_no_nsst_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_RRTMGP.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_RRTMGP_ps.xml" "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8.xml" "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ps.xml" "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_c3.xml" diff --git a/ccpp/framework b/ccpp/framework index 8fd7b3ecc..687f58533 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 8fd7b3ecc8b23284c4d6c10ed42177b4f22a7391 +Subproject commit 687f5853373630bffc001e6a76bf7910b092b925 diff --git a/ccpp/framework-symlink/capgen-ng b/ccpp/framework-symlink/capgen-ng new file mode 120000 index 000000000..abf9e65c9 --- /dev/null +++ b/ccpp/framework-symlink/capgen-ng @@ -0,0 +1 @@ +/home/dom/work/ccpp-f-capgen-ng/capgen-ng \ No newline at end of file diff --git a/ccpp/physics b/ccpp/physics index cf1664daa..71740fd5f 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit cf1664daaed3dd1f6f3877c3ca6e9e94909202bc +Subproject commit 71740fd5f00ca069c5b61ab59e64e6dc5e755883 diff --git a/ccpp/suites/suite_SCM_GFS_v16_debug.xml b/ccpp/suites/suite_SCM_GFS_v16_debug.xml deleted file mode 100644 index d4dd7704c..000000000 --- a/ccpp/suites/suite_SCM_GFS_v16_debug.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - GFS_time_vary_pre - GFS_rrtmg_setup - GFS_rad_time_vary - GFS_phys_time_vary - - - - - GFS_rrtmg_pre - GFS_radiation_surface - rad_sw_pre - rrtmg_sw - rrtmg_sw_post - rrtmg_lw - rrtmg_lw_post - GFS_radiation_post - - - - - GFS_suite_stateout_reset - get_prs_fv3 - GFS_suite_interstitial_1 - GFS_surface_generic_pre - GFS_surface_composites_pre - dcyc2t3 - GFS_surface_composites_inter - GFS_suite_interstitial_2 - - - - sfc_diff - GFS_surface_loop_control_part1 - sfc_nst_pre - sfc_nst - sfc_nst_post - lsm_noah - sfc_sice - GFS_surface_loop_control_part2 - - - - GFS_surface_composites_post - sfc_diag - sfc_diag_post - GFS_surface_generic_post - GFS_PBL_generic_pre - satmedmfvdifq - GFS_PBL_generic_post - GFS_GWD_generic_pre - cires_ugwp - cires_ugwp_post - GFS_GWD_generic_post - GFS_suite_stateout_update - - - - - GFS_photochemistry - get_phi_fv3 - GFS_suite_interstitial_3 - GFS_DCNV_generic_pre - samfdeepcnv - GFS_DCNV_generic_post - GFS_SCNV_generic_pre - samfshalcnv - GFS_SCNV_generic_post - GFS_suite_interstitial_4 - cnvc90 - GFS_MP_generic_pre - gfdl_cloud_microphys - GFS_MP_generic_post - maximum_hourly_diagnostics - GFS_physics_post - GFS_diagtoscreen - GFS_interstitialtoscreen - GFS_checkland - GFS_checktracers - - - - diff --git a/ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml b/ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml deleted file mode 100644 index 828892c73..000000000 --- a/ccpp/suites/suite_SCM_GFS_v16_debug_ps.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - GFS_time_vary_pre - GFS_rrtmg_setup - GFS_rad_time_vary - GFS_phys_time_vary - - - - - GFS_rrtmg_pre - GFS_radiation_surface - rad_sw_pre - rrtmg_sw - rrtmg_sw_post - rrtmg_lw - rrtmg_lw_post - GFS_radiation_post - - - - - GFS_suite_stateout_reset - get_prs_fv3 - GFS_suite_interstitial_1 - GFS_surface_generic_pre - scm_sfc_flux_spec - dcyc2t3 - GFS_suite_interstitial_2 - GFS_PBL_generic_pre - satmedmfvdifq - GFS_PBL_generic_post - GFS_GWD_generic_pre - cires_ugwp - cires_ugwp_post - GFS_GWD_generic_post - GFS_suite_stateout_update - - - - - GFS_photochemistry - get_phi_fv3 - GFS_suite_interstitial_3 - GFS_DCNV_generic_pre - samfdeepcnv - GFS_DCNV_generic_post - GFS_SCNV_generic_pre - samfshalcnv - GFS_SCNV_generic_post - GFS_suite_interstitial_4 - cnvc90 - GFS_MP_generic_pre - gfdl_cloud_microphys - GFS_MP_generic_post - maximum_hourly_diagnostics - GFS_physics_post - GFS_diagtoscreen - GFS_interstitialtoscreen - GFS_checkland - GFS_checktracers - - - - diff --git a/ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml b/ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml deleted file mode 100644 index e2c1afb9d..000000000 --- a/ccpp/suites/suite_SCM_GFS_v16_ugwpv1.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - GFS_time_vary_pre - GFS_rrtmg_setup - GFS_rad_time_vary - GFS_phys_time_vary - - - - - GFS_rrtmg_pre - GFS_radiation_surface - rad_sw_pre - rrtmg_sw - rrtmg_sw_post - rrtmg_lw - rrtmg_lw_post - GFS_radiation_post - - - - - GFS_suite_stateout_reset - get_prs_fv3 - GFS_suite_interstitial_1 - GFS_surface_generic_pre - GFS_surface_composites_pre - dcyc2t3 - GFS_surface_composites_inter - GFS_suite_interstitial_2 - - - - sfc_diff - GFS_surface_loop_control_part1 - sfc_nst_pre - sfc_nst - sfc_nst_post - lsm_noah - sfc_sice - GFS_surface_loop_control_part2 - - - - GFS_surface_composites_post - sfc_diag - sfc_diag_post - GFS_surface_generic_post - GFS_PBL_generic_pre - satmedmfvdifq - GFS_PBL_generic_post - GFS_GWD_generic_pre - ugwpv1_gsldrag - ugwpv1_gsldrag_post - GFS_GWD_generic_post - GFS_suite_stateout_update - - - - - GFS_photochemistry - get_phi_fv3 - GFS_suite_interstitial_3 - GFS_DCNV_generic_pre - samfdeepcnv - GFS_DCNV_generic_post - GFS_SCNV_generic_pre - samfshalcnv - GFS_SCNV_generic_post - GFS_suite_interstitial_4 - cnvc90 - GFS_MP_generic_pre - gfdl_cloud_microphys - GFS_MP_generic_post - maximum_hourly_diagnostics - - - \ No newline at end of file From 6535f1deb879b353d012c900bb63a1a04c339ab6 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 14 May 2026 19:52:00 -0600 Subject: [PATCH 06/28] Minor updates to compile last suites --- ccpp/CMakeLists.txt | 63 +++++++++++++++++++++++++++++++- ccpp/framework | 2 +- ccpp/suites/suite.xsd | 38 ------------------- ccpp/suites/suite_SCM_GSD_v1.xml | 2 +- 4 files changed, 64 insertions(+), 41 deletions(-) delete mode 100644 ccpp/suites/suite.xsd diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index 5c345f6ba..a1a416939 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -100,6 +100,33 @@ set(SCHEME_METADATA_FILES "${SCHEME_FILES_DIR}/PBL/HEDMF/hedmf.meta" "${SCHEME_FILES_DIR}/MP/Ferrier_Aligo/mp_fer_hires.meta" "${SCHEME_FILES_DIR}/SFC_Layer/GFDL/gfdl_sfc_layer.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta" + "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpost.meta" + "${SCHEME_FILES_DIR}/PBL/MYNN_EDMF/mynnedmf_wrapper.meta" + "${SCHEME_FILES_DIR}/CONV/Grell_Freitas/cu_gf_driver_pre.meta" + "${SCHEME_FILES_DIR}/CONV/Grell_Freitas/cu_gf_driver.meta" + "${SCHEME_FILES_DIR}/CONV/Grell_Freitas/cu_gf_driver_post.meta" + "${SCHEME_FILES_DIR}/MP/NSSL/mp_nssl.meta" + "${SCHEME_FILES_DIR}/SFC_Models/Land/RUC/lsm_ruc.meta" + "${SCHEME_FILES_DIR}/smoke_dust/rrfs_smoke_wrapper.meta" + "${SCHEME_FILES_DIR}/smoke_dust/rrfs_smoke_postpbl.meta" + "${SCHEME_FILES_DIR}/GWD/drag_suite.meta" + "${SCHEME_FILES_DIR}/SFC_Layer/MYNN/MYNN/CCPP/module_sf_mynnsfc_driver.meta" + "${SCHEME_FILES_DIR}/SFC_Models/Lake/CLM/clm_lake.meta" + "${SCHEME_FILES_DIR}/CONV/Chikira_Sugiyama/cs_conv_pre.meta" + "${SCHEME_FILES_DIR}/CONV/Chikira_Sugiyama/cs_conv.meta" + "${SCHEME_FILES_DIR}/CONV/Chikira_Sugiyama/cs_conv_post.meta" + "${SCHEME_FILES_DIR}/MP/Morrison_Gettelman/m_micro_pre.meta" + "${SCHEME_FILES_DIR}/MP/Morrison_Gettelman/m_micro.meta" + "${SCHEME_FILES_DIR}/MP/Morrison_Gettelman/m_micro_post.meta" + "${SCHEME_FILES_DIR}/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta" + "${SCHEME_FILES_DIR}/SFC_Layer/MYJ/myjsfc_wrapper.meta" + "${SCHEME_FILES_DIR}/PBL/MYJ/myjpbl_wrapper.meta" + "${SCHEME_FILES_DIR}/CONV/nTiedtke/cu_ntiedtke.meta" + "${SCHEME_FILES_DIR}/CONV/nTiedtke/cu_ntiedtke_pre.meta" + "${SCHEME_FILES_DIR}/CONV/nTiedtke/cu_ntiedtke_post.meta" + "${SCHEME_FILES_DIR}/PBL/saYSU/shinhongvdif.meta" + "${SCHEME_FILES_DIR}/PBL/YSU/ysuvdif.meta" ) ## DH* TEST @@ -131,7 +158,22 @@ set(SUITE_FILES "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf_thompson_ps.xml" "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf_thompson.xml" "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf.xml" - # skipping csawmg and GFS v15 suites + "${SUITE_FILES_DIR}/suite_SCM_csawmg_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_csawmg.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ACM_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_FA.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_MYJ.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_noahmp.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_no_nsst_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_no_nsst.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ntiedtke_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ntiedtke.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_RRTMGP_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_RRTMGP.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_saYSU_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_YSU_ps.xml" "${SUITE_FILES_DIR}/suite_SCM_GFS_v16.xml" "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_ps.xml" "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_gfdlmpv3.xml" @@ -150,6 +192,25 @@ set(SUITE_FILES "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml" "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml" "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GSD_v1nssl_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GSD_v1nssl.xml" + "${SUITE_FILES_DIR}/suite_SCM_GSD_v1_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GSD_v1.xml" + "${SUITE_FILES_DIR}/suite_SCM_HRRR_gf_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_HRRR_gf.xml" + "${SUITE_FILES_DIR}/suite_SCM_HRRR_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_HRRR.xml" + "${SUITE_FILES_DIR}/suite_SCM_RAP_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_RAP.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1alpha_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1alpha.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta_no_nsst_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta_no_nsst.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1nssl.xml" + "${SUITE_FILES_DIR}/suite_SCM_WoFS_v0_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_WoFS_v0.xml" ) set(HOST "ccpp-scm") diff --git a/ccpp/framework b/ccpp/framework index 687f58533..e25e253af 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 687f5853373630bffc001e6a76bf7910b092b925 +Subproject commit e25e253afcc5152fc9c27ba6e0595bdf2f59b72c diff --git a/ccpp/suites/suite.xsd b/ccpp/suites/suite.xsd deleted file mode 100644 index cab9c05ab..000000000 --- a/ccpp/suites/suite.xsd +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ccpp/suites/suite_SCM_GSD_v1.xml b/ccpp/suites/suite_SCM_GSD_v1.xml index 57053040b..9034568db 100644 --- a/ccpp/suites/suite_SCM_GSD_v1.xml +++ b/ccpp/suites/suite_SCM_GSD_v1.xml @@ -24,7 +24,7 @@ GFS_radiation_post - + GFS_suite_stateout_reset get_prs_fv3 From 142141c12858d764c0b0f582dd675bd2df53789f Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 15 May 2026 16:17:28 -0600 Subject: [PATCH 07/28] More updates for capgen-ng --- ccpp/CMakeLists.txt | 9 ++-- ccpp/framework | 2 +- cmake/ccpp_capgen.cmake | 71 ++++++++++++++++---------------- scm/src/scm.F90 | 2 +- scm/src/scm_time_integration.F90 | 2 +- 5 files changed, 42 insertions(+), 44 deletions(-) diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index a1a416939..2f10c7d26 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -213,7 +213,7 @@ set(SUITE_FILES "${SUITE_FILES_DIR}/suite_SCM_WoFS_v0.xml" ) -set(HOST "ccpp-scm") +set(HOST "scm") set(CCPP_VERBOSITY "2" CACHE STRING "Verbosity level of output (default: 0)") @@ -252,13 +252,12 @@ message(STATUS "List of capgen dependencies: ${CAPGEN_DEPENDENCIES}") message(STATUS "List of filtered scheme files: ${SCHEME_FORTRAN_FILES}") message(STATUS "List of capgen-generated files: ${CAPGEN_FILES}") -# Temporary: manually added dependencies because of working on a subset of schemes only +# Extra files that do not make it through the capgen scheme filter set(EXTRA_FILES - "${SCHEME_FILES_DIR}/Radiation/RRTMG/radlw_datatb.f" - "${SCHEME_FILES_DIR}/Radiation/RRTMG/radsw_datatb.f" +# "${SCHEME_FILES_DIR}/Radiation/RRTMG/radlw_datatb.f" +# "${SCHEME_FILES_DIR}/Radiation/RRTMG/radsw_datatb.f" "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/module_ccpp_suite_simulator.F90" ) -# End temporary add_library(scm-ccpp STATIC ${EXTRA_FILES} diff --git a/ccpp/framework b/ccpp/framework index e25e253af..104366683 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit e25e253afcc5152fc9c27ba6e0595bdf2f59b72c +Subproject commit 1043666832b2ede09e9663325656580161702dfb diff --git a/cmake/ccpp_capgen.cmake b/cmake/ccpp_capgen.cmake index 3857d6c65..56d60c9a2 100644 --- a/cmake/ccpp_capgen.cmake +++ b/cmake/ccpp_capgen.cmake @@ -12,11 +12,18 @@ function(ccpp_source_files OUT_VAR) set(result) foreach(meta_file IN LISTS ARGN) - # Metadata directory - get_filename_component(meta_dir - "${meta_file}" - DIRECTORY - ABSOLUTE) + # Convert meta_file to an absolute path first + get_filename_component( + meta_file + "${meta_file}" + ABSOLUTE + ) + # Then extract the directory + get_filename_component( + meta_dir + "${meta_file}" + DIRECTORY + ) # Read metadata file file(READ "${meta_file}" meta_contents) @@ -140,15 +147,21 @@ endfunction() # CMake wrapper for ccpp_capgen_ng.py # -# CAPGEN_EXPECT_THROW_ERROR - ON/OFF (Default: OFF) - Scans ccpp_capgen.py log for error string and errors if not found. -# HOST_NAME - String name of host -# OUTPUT_ROOT - String path to put generated caps -# VERBOSITY - Number of --verbose flags to pass to capgen -# HOSTFILES - CMake list of host metadata filenames -# SCHEMEFILES - CMake list of scheme metadata files -# SUITES - CMake list of suite xml files +# TRACE - ON/OFF (Default: OFF) - Add --trace flag to capgen call +# HOST_NAME - String name of host (drives _ccpp_cap.F90 filename +# and module name; required) +# OUTPUT_ROOT - String path to put generated caps +# VERBOSITY - Number of --verbose flags to pass to capgen +# HOSTFILES - CMake list of host metadata filenames +# SCHEMEFILES - CMake list of scheme metadata files +# SUITES - CMake list of suite xml files +# KIND_SPECS - Comma-separated kind mappings, e.g. "kind_phys=REAL32" or +# "kind_phys=my_mod:kind_r4,kind_dyn=REAL64". Each pair is +# forwarded as `--kind-type ` to capgen-ng (see the +# capgen-ng docstring for the `=[:]` +# grammar; bare ISO specs default to iso_fortran_env). function(ccpp_capgen) - set(optionalArgs CAPGEN_EXPECT_THROW_ERROR) + set(optionalArgs TRACE) set(oneValueArgs HOST_NAME OUTPUT_ROOT VERBOSITY KIND_SPECS) set(multi_value_keywords HOSTFILES SCHEMEFILES SUITES) @@ -197,16 +210,18 @@ function(ccpp_capgen) endif() if(DEFINED arg_KIND_SPECS) + # Accept either a comma-separated string ("kind_phys=REAL64,kind_dyn=REAL32") + # or a CMake list of pairs. Each pair becomes a separate + # `--kind-type ` argv pair so capgen-ng's argparse sees one + # `--kind-type` per pair (the flag is `action='append'`). string(REPLACE "," ";" KIND_SPEC_LIST "${arg_KIND_SPECS}") - set(KIND_ARGS "") # start empty foreach(pair IN LISTS KIND_SPEC_LIST) - # Append each pair prefixed with --kind-type and quoted. - # The surrounding double‑quotes are added explicitly so the - # resulting string contains them. - set(KIND_ARGS "${KIND_ARGS}--kind-type \"${pair}\"") - string(STRIP "${KIND_ARGS}" KIND_ARGS) + list(APPEND CCPP_CAPGEN_CMD_LIST "--kind-type" "${pair}") endforeach() - list(APPEND CCPP_CAPGEN_CMD_LIST ${KIND_SPEC_PARAMS}) + endif() + + if(arg_TRACE) + list(APPEND CCPP_CAPGEN_CMD_LIST "--trace") endif() # DH* 20260513 TEMPORARY: add --legacy-mode to allow parsing @@ -231,22 +246,6 @@ function(ccpp_capgen) message(STATUS "ccpp-capgen stdout: ${CAPGEN_OUT}") - if(arg_CAPGEN_EXPECT_THROW_ERROR) - # Determine if the process succeeded but had an expected string in the process log. - string(FIND "${CAPGEN_OUT}" "Variables of type ccpp_constituent_properties_t only allowed in register phase" ERROR_INDEX) - - if (ERROR_INDEX GREATER -1) - message(STATUS "Capgen build produces expected error message.") - else() - message(FATAL_ERROR "CCPP cap generation did not generate expected error. Expected 'Variables of type constituent_properties_t only allowed in register phase.") - endif() - else() - if(RES EQUAL 0) - message(STATUS "ccpp-capgen completed successfully") - else() - message(FATAL_ERROR "CCPP cap generation FAILED: result = ${RES}") - endif() - endif() endfunction() diff --git a/scm/src/scm.F90 b/scm/src/scm.F90 index 55e720e2f..1f47062a9 100644 --- a/scm/src/scm.F90 +++ b/scm/src/scm.F90 @@ -24,7 +24,7 @@ subroutine scm_main_sub() #define CCPP_PHYSICS_STATIC_ARGS lb=1, ub=1, mythread=1, nthreads=1, nphys_threads=1 #define CCPP_PHYSICS_NPHYS_THREADS 1 - use :: ccpp_static_api, & + use :: scm_ccpp_cap, & only: ccpp_register, & ccpp_init, & ccpp_physics_init, & diff --git a/scm/src/scm_time_integration.F90 b/scm/src/scm_time_integration.F90 index 0ac7ca62c..9f2c2d9a2 100644 --- a/scm/src/scm_time_integration.F90 +++ b/scm/src/scm_time_integration.F90 @@ -7,7 +7,7 @@ module scm_time_integration use scm_kinds, only: sp, dp, qp use scm_forcing -use :: ccpp_static_api, & +use :: scm_ccpp_cap, & only: ccpp_physics_timestep_init, & ccpp_physics_run, & ccpp_physics_timestep_final From 82b6a7de72ae371c16eb2e6c22f82f22ee2372ee Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 15 May 2026 20:49:46 -0600 Subject: [PATCH 08/28] Update submodule pointer for ccpp-framework --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index 104366683..2704aea28 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 1043666832b2ede09e9663325656580161702dfb +Subproject commit 2704aea28435abe814460a811f03f45d9de8f4df From 792c6e6823f7f60d593d05e459dd9165d4d1a8ef Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 18 May 2026 20:27:56 -0600 Subject: [PATCH 09/28] Update submodule pointer for ccpp-framework --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index 2704aea28..523ac77ba 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 2704aea28435abe814460a811f03f45d9de8f4df +Subproject commit 523ac77ba1ee5c763bf9ccaddcee85f1ded4077e From 18adc05879a4aec4aee3787363a16dc927357f15 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 19 May 2026 07:37:25 -0600 Subject: [PATCH 10/28] Update submodule pointer for ccpp-framework --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index 523ac77ba..eae0d4850 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 523ac77ba1ee5c763bf9ccaddcee85f1ded4077e +Subproject commit eae0d48505710a8319cc423361f8327047eab58e From 7782b6ffb378ec89388068c850581250e6910bfd Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 19 May 2026 07:55:57 -0600 Subject: [PATCH 11/28] Update submodule pointer for ccpp-framework --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index eae0d4850..f4c0ef17f 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit eae0d48505710a8319cc423361f8327047eab58e +Subproject commit f4c0ef17f14994c2307aaf77595abdc1ffdb4271 From a2d9d314a4703553324189de4cd8059143f4d770 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 20 May 2026 05:35:38 -0600 Subject: [PATCH 12/28] Update submodule pointer for ccpp-framework --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index f4c0ef17f..80b0d1703 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit f4c0ef17f14994c2307aaf77595abdc1ffdb4271 +Subproject commit 80b0d170397fa7360f0e12b8a73f0556fbdc54e1 From 7c72c77767b779057d52880f5eb5db6d28baa3f7 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 21 May 2026 05:49:37 -0600 Subject: [PATCH 13/28] Fix dimensions in scm/src/GFS_typedefs.meta; add legacy switch --gfs-dim-names to capgen call --- ccpp/framework | 2 +- ccpp/physics | 2 +- cmake/ccpp_capgen.cmake | 6 ++++++ scm/src/GFS_typedefs.meta | 6 +++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ccpp/framework b/ccpp/framework index 80b0d1703..b21b6acb0 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 80b0d170397fa7360f0e12b8a73f0556fbdc54e1 +Subproject commit b21b6acb03daeb5cd6fbcd2433ea1b2853f9864f diff --git a/ccpp/physics b/ccpp/physics index 71740fd5f..724bcb3d2 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 71740fd5f00ca069c5b61ab59e64e6dc5e755883 +Subproject commit 724bcb3d22b493fb81975f073d2a5668e078060a diff --git a/cmake/ccpp_capgen.cmake b/cmake/ccpp_capgen.cmake index 56d60c9a2..9bdfdcede 100644 --- a/cmake/ccpp_capgen.cmake +++ b/cmake/ccpp_capgen.cmake @@ -228,6 +228,12 @@ function(ccpp_capgen) # of horizontal_loop_extent for scheme run phase metadata list(APPEND CCPP_CAPGEN_CMD_LIST "--legacy-mode") # *DH + + # DH* 20260521 TEMPORARY: add --gfs-dim-aliases so that + # capgen considers specific dimension names as equal + list(APPEND CCPP_CAPGEN_CMD_LIST "--gfs-dim-aliases") + # *DH + # DH* 20260514 TEMPORARY: add --no-host-introspection to # suppress writing lists of variables etc to ccpp_static_api list(APPEND CCPP_CAPGEN_CMD_LIST "--no-host-introspection") diff --git a/scm/src/GFS_typedefs.meta b/scm/src/GFS_typedefs.meta index 118c18f85..a3da16868 100644 --- a/scm/src/GFS_typedefs.meta +++ b/scm/src/GFS_typedefs.meta @@ -1680,7 +1680,7 @@ standard_name = temperature_in_surface_snow long_name = temperature_in_surface_snow units = K - dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:constant_zero) + dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:upper_bound_of_vertical_dimension_of_surface_snow) type = real kind = kind_phys active = (control_for_land_surface_scheme == identifier_for_noahmp_land_surface_scheme) @@ -1696,7 +1696,7 @@ standard_name = lwe_thickness_of_ice_in_surface_snow long_name = snow layer ice units = mm - dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:constant_zero) + dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:upper_bound_of_vertical_dimension_of_surface_snow) type = real kind = kind_phys active = (control_for_land_surface_scheme == identifier_for_noahmp_land_surface_scheme) @@ -1704,7 +1704,7 @@ standard_name = lwe_thickness_of_liquid_water_in_surface_snow long_name = snow layer liquid water units = mm - dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:constant_zero) + dimensions = (horizontal_dimension, lower_bound_of_vertical_dimension_of_surface_snow:upper_bound_of_vertical_dimension_of_surface_snow) type = real kind = kind_phys active = (control_for_land_surface_scheme == identifier_for_noahmp_land_surface_scheme) From 7fa238e9509a624e924547c8aa209988ad0f21bf Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 21 May 2026 09:51:37 -0600 Subject: [PATCH 14/28] Update submodule pointer for ccpp-physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 724bcb3d2..354b18db9 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 724bcb3d22b493fb81975f073d2a5668e078060a +Subproject commit 354b18db9df329a2fe1a7294eb95e257b8a6ff20 From 87199acf9ea87dda003e9af4ca915c1a4745ad17 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 29 May 2026 13:42:21 -0700 Subject: [PATCH 15/28] Cleanup --- ccpp/CMakeLists.txt | 30 ------------------------ scm/src/CCPP_typedefs.meta | 19 --------------- scm/src/GFS_typedefs.meta | 48 -------------------------------------- 3 files changed, 97 deletions(-) diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index e4bf2bded..6df98abc3 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -130,13 +130,6 @@ set(SCHEME_METADATA_FILES "${SCHEME_FILES_DIR}/PBL/SATMEDMF/canopy_driver.meta" ) -## DH* TEST -## Run ccpp_validator -#ccpp_validator(VERBOSITY ${CCPP_VERBOSITY} -# SOURCE_FILES "${SCHEME_FILES_DIR}/SFC_Layer/UFS/sfc_diff.f" -# METADATA_FILES "${SCHEME_FILES_DIR}/SFC_Layer/UFS/sfc_diff.meta") -## *DH - # Create list of scheme source files from metadata files ccpp_source_files(SCHEME_FORTRAN_FILES ${SCHEME_METADATA_FILES}) @@ -255,8 +248,6 @@ message(STATUS "List of capgen-generated files: ${CAPGEN_FILES}") # Extra files that do not make it through the capgen scheme filter set(EXTRA_FILES -# "${SCHEME_FILES_DIR}/Radiation/RRTMG/radlw_datatb.f" -# "${SCHEME_FILES_DIR}/Radiation/RRTMG/radsw_datatb.f" "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/module_ccpp_suite_simulator.F90" ) @@ -268,8 +259,6 @@ add_library(scm-ccpp STATIC ${CAPGEN_FILES} ) -#set_target_properties(scm-ccpp PROPERTIES LINKER_LANGUAGE Fortran) - target_link_libraries(scm-ccpp MPI::MPI_Fortran) if(OPENMP) target_link_libraries(scm-ccpp OpenMP::OpenMP_Fortran) @@ -293,22 +282,3 @@ target_link_libraries(scm-ccpp w3emc::w3emc_d) set_target_properties(scm-ccpp PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}) target_include_directories(scm-ccpp PUBLIC $) - -#message(FATAL_ERROR "xxx") -# -#add_executable(test_chunked_data.x -# ${CAPGEN_DEPENDENCIES} -# ${SCHEME_FORTRAN_FILES} -# ${HOST_FORTRAN_FILES} -# ${CAPGEN_FILES} -#) -#target_link_libraries(test_chunked_data.x PRIVATE MPI::MPI_Fortran) -#if(OPENMP) -# target_link_libraries(test_chunked_data.x PRIVATE OpenMP::OpenMP_Fortran) -#endif() -#set_target_properties(test_chunked_data.x PROPERTIES LINKER_LANGUAGE Fortran) -# -## Add executable to be called with ctest -#add_test(NAME test_chunked_data -# COMMAND test_chunked_data.x) -# \ No newline at end of file diff --git a/scm/src/CCPP_typedefs.meta b/scm/src/CCPP_typedefs.meta index cc406519c..b2af88314 100644 --- a/scm/src/CCPP_typedefs.meta +++ b/scm/src/CCPP_typedefs.meta @@ -2757,22 +2757,3 @@ type = real kind = kind_phys active = (flag_for_CCPP_suite_simulator) - -######################################################################### -#[ccpp-table-properties] -# name = CCPP_typedefs -# type = host -# dependencies_path = ../../ccpp/physics/physics -# dependencies = hooks/machine.F,photochem/module_ozphys.F90 -# dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f -# -#[ccpp-arg-table] -# name = CCPP_typedefs -# type = host -#[GFS_interstitial_type] -# standard_name = GFS_interstitial_type -# long_name = definition of type GFS_interstitial_type -# units = DDT -# dimensions = () -# type = GFS_interstitial_type -# \ No newline at end of file diff --git a/scm/src/GFS_typedefs.meta b/scm/src/GFS_typedefs.meta index 28707c5a4..99767600e 100644 --- a/scm/src/GFS_typedefs.meta +++ b/scm/src/GFS_typedefs.meta @@ -3720,60 +3720,12 @@ units = count dimensions = () type = integer -#[nblks] -# standard_name = ccpp_block_count -# long_name = for explicit data blocking: number of blocks -# units = count -# dimensions = () -# type = integer -#[blksz] -# standard_name = ccpp_block_sizes -# long_name = for explicit data blocking: block sizes of all blocks -# units = count -# dimensions = (ccpp_block_count) -# type = integer -#[blksz(ccpp_block_number)] -# standard_name = horizontal_loop_extent -# long_name = horizontal loop extent -# units = count -# dimensions = () -# type = integer [ncols] standard_name = horizontal_dimension long_name = horizontal dimension units = count dimensions = () type = integer -#[nchunks] -# standard_name = ccpp_chunk_extent -# long_name = number of chunks of array data used in run phase -# units = count -# dimensions = () -# type = integer -#[chunk_begin] -# standard_name = horizontal_loop_begin_all_chunks -# long_name = first index for horizontal loop extent in run phase -# units = index -# dimensions = (ccpp_chunk_extent) -# type = integer -#[chunk_begin(ccpp_chunk_number)] -# standard_name = horizontal_loop_begin -# long_name = first index for horizontal loop extent in run phase -# units = index -# dimensions = () -# type = integer -#[chunk_end] -# standard_name = horizontal_loop_end_all_chunks -# long_name = last index for horizontal loop extent in run phase -# units = index -# dimensions = (ccpp_chunk_extent) -# type = integer -#[chunk_end(ccpp_chunk_number)] -# standard_name = horizontal_loop_end -# long_name = last index for horizontal loop extent in run phase -# units = index -# dimensions = () -# type = integer [dycore_active] standard_name = control_for_dynamical_core long_name = choice of dynamical core From 12d2c2c91818ae96cff97fb0553c95ff4d15ee37 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 1 Jun 2026 09:00:27 -0600 Subject: [PATCH 16/28] Update submodule pointer for ccpp-framework --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index 020415383..43c17613e 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 020415383c357b37071a9c8b41f2f01298b0f550 +Subproject commit 43c17613e3b03041273840a1775502c3c27485fa From c061fdb7046fc6e06837539ff015323d0511982d Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 2 Jun 2026 20:25:59 -0600 Subject: [PATCH 17/28] Get CI tests to run (#4) Changes to get the SCM tests to run: * clm_lake was included in a SDF, but not used. In the Cap, there is a (new?) check to see if the active conditions are met before calling the scheme. This was causing a runtime error. CLM Lake returns if not turned on, so having this new runtime check beforehand triggered the failure before entering the scheme. I removed the unused CLM Lake from the SDF and it worked fine. * Remove GFS_v16_debug SDFs from test list. (I see these were removed from the CCPP SCM?) * Add snippet to ccpp/CMakeLists to build only requested SDFs (i.e., -DCCPP_SUITES). * Uncomment and test 32-bit and Intel oneAPI in CMakeLists. --- .github/workflows/ci_run_scm_DEPHY.yml | 4 +- .github/workflows/create_rt_baselines.yml | 4 +- .github/workflows/run_scm_rts.yml | 7 +- CMakeLists.txt | 112 +++++++++--------- ccpp/CMakeLists.txt | 135 ++++++++++++---------- ccpp/suites/suite_SCM_HRRR.xml | 1 - test/rt_test_cases.py | 16 ++- 7 files changed, 146 insertions(+), 133 deletions(-) diff --git a/.github/workflows/ci_run_scm_DEPHY.yml b/.github/workflows/ci_run_scm_DEPHY.yml index ac80c0d63..c6feee19f 100644 --- a/.github/workflows/ci_run_scm_DEPHY.yml +++ b/.github/workflows/ci_run_scm_DEPHY.yml @@ -138,14 +138,14 @@ jobs: run: | cd ${SCM_ROOT}/scm mkdir bin && cd bin - cmake -DCCPP_SUITES=${suites} ../src + cmake -DCCPP_SUITES=${suites} ../.. - name: Configure build with CMake (Debug) if: contains(matrix.build-type, 'Debug') run: | cd ${SCM_ROOT}/scm mkdir bin && cd bin - cmake -DCCPP_SUITES=${suites} -DCMAKE_BUILD_TYPE=Debug ../src + cmake -DCCPP_SUITES=${suites} -DCMAKE_BUILD_TYPE=Debug ../.. - name: Build SCM run: | diff --git a/.github/workflows/create_rt_baselines.yml b/.github/workflows/create_rt_baselines.yml index 560318d4d..e576b54c6 100644 --- a/.github/workflows/create_rt_baselines.yml +++ b/.github/workflows/create_rt_baselines.yml @@ -103,14 +103,14 @@ jobs: run: | cd ${SCM_ROOT}/scm mkdir bin && cd bin - cmake -DCCPP_SUITES=${{steps.set_sdfs.outputs.suites}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ../src + cmake -DCCPP_SUITES=${{steps.set_sdfs.outputs.suites}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ../.. - name: Configure Build with CMake (32-bit) if: matrix.run_lists == 'sp' run: | cd ${SCM_ROOT}/scm mkdir bin && cd bin - cmake -DCCPP_SUITES=${{steps.set_sdfs.outputs.suites}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -D32BIT=1 ../src + cmake -DCCPP_SUITES=${{steps.set_sdfs.outputs.suites}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -D32BIT=1 ../.. - name: Build SCM run: | diff --git a/.github/workflows/run_scm_rts.yml b/.github/workflows/run_scm_rts.yml index ba042db71..bed6ed771 100644 --- a/.github/workflows/run_scm_rts.yml +++ b/.github/workflows/run_scm_rts.yml @@ -49,7 +49,8 @@ jobs: - name: Install Required Tools run: | - apt-get update + apt-get update -qq && apt-get install -qq -y --no-install-recommends \ + libxml2-utils - name: Initialize Submodules run: | @@ -111,14 +112,14 @@ jobs: run: | cd ${SCM_ROOT}/scm mkdir bin && cd bin - cmake -DCCPP_SUITES=${{steps.set_sdfs.outputs.suites}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ../src + cmake -DCCPP_SUITES=${{steps.set_sdfs.outputs.suites}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ../.. - name: Configure Build with CMake (32-bit) if: matrix.run_lists == 'sp' run: | cd ${SCM_ROOT}/scm mkdir bin && cd bin - cmake -DCCPP_SUITES=${{steps.set_sdfs.outputs.suites}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -D32BIT=1 ../src + cmake -DCCPP_SUITES=${{steps.set_sdfs.outputs.suites}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -D32BIT=1 ../.. - name: Build SCM run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index e52bd9757..d00032cd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,10 +76,10 @@ set(32BIT OFF CACHE BOOL "Enable 32BIT (single precision arithmetic in ##------------------------------------------------------------------------------ ## Set compile options -#if (32BIT) -# add_definitions(-DSINGLE_PREC) +if (32BIT) + add_definitions(-DSINGLE_PREC) # add_definitions(-DRTE_USE_SP) -#endif() +endif() #------------------------------------------------------------------------------ # GNU @@ -109,42 +109,42 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") #set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE) #set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) #set(CMAKE_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE) -##------------------------------------------------------------------------------ -## Intel oneAPI -##------------------------------------------------------------------------------ -# elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "IntelLLVM") -# message(STATUS "Compile using Intel OneAPI") -# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback -fpp -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -nowarn -align array64byte -qno-opt-dynamic-align") -# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qno-opt-dynamic-align -sox -fp-model source") -# set(CMAKE_Fortran_FLAGS_OPENMP_OFF "-fno-openmp") -# -# 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 -fstack-protector-all -fpe0 -debug -ftrapuv -init=snan,arrays") -# set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fpe0 -debug") -# 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") -# endif() -# 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() -# endif() +#------------------------------------------------------------------------------ +# Intel oneAPI +#------------------------------------------------------------------------------ +elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "IntelLLVM") + message(STATUS "Compile using Intel OneAPI") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback -fpp -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -nowarn -align array64byte -qno-opt-dynamic-align") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qno-opt-dynamic-align -sox -fp-model source") + set(CMAKE_Fortran_FLAGS_OPENMP_OFF "-fno-openmp") + + 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 -fstack-protector-all -fpe0 -debug -ftrapuv -init=snan,arrays") + set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fpe0 -debug") + 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") + endif() + 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() + endif() # set(CMAKE_C_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) @@ -231,23 +231,23 @@ endif() ##------------------------------------------------------------------------------ ## 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") -# 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() +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") + 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 flags for rte-rrtmgp radiation diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index 6df98abc3..d2cd46bac 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -147,66 +147,76 @@ ccpp_source_files(HOST_FORTRAN_FILES ${HOST_METADATA_FILES}) message(INFO "${HOST_METADATA_FILES} --> ${HOST_FORTRAN_FILES}") set(SUITE_FILES_DIR "${CMAKE_SOURCE_DIR}/ccpp/suites") -set(SUITE_FILES - "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf_ps.xml" - "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf_thompson_ps.xml" - "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf_thompson.xml" - "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf.xml" - "${SUITE_FILES_DIR}/suite_SCM_csawmg_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_csawmg.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ACM_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_FA.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_MYJ.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_noahmp.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_no_nsst_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_no_nsst.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ntiedtke_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ntiedtke.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_RRTMGP_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_RRTMGP.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_saYSU_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_YSU_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v16.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_gfdlmpv3.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_gfdlmpv3_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_no_nsst.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_no_nsst_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_RRTMGP.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_RRTMGP_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_c3.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_c3_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml" - "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GSD_v1nssl_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GSD_v1nssl.xml" - "${SUITE_FILES_DIR}/suite_SCM_GSD_v1_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_GSD_v1.xml" - "${SUITE_FILES_DIR}/suite_SCM_HRRR_gf_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_HRRR_gf.xml" - "${SUITE_FILES_DIR}/suite_SCM_HRRR_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_HRRR.xml" - "${SUITE_FILES_DIR}/suite_SCM_RAP_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_RAP.xml" - "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1alpha_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1alpha.xml" - "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta_no_nsst_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta_no_nsst.xml" - "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta.xml" - "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1nssl.xml" - "${SUITE_FILES_DIR}/suite_SCM_WoFS_v0_ps.xml" - "${SUITE_FILES_DIR}/suite_SCM_WoFS_v0.xml" +if(DEFINED CCPP_SUITES) + # Take comma seperated string containing SDF names , + # append as file prefix, append ".xml" file suffix, + # and replace "," with ";" + set(SUITE_FILES ${SUITE_FILES_DIR}/suite_${CCPP_SUITES}) + string(REPLACE "," ".xml;${SUITE_FILES_DIR}/suite_" SUITE_FILES "${SUITE_FILES}") + set(SUITE_FILES "${SUITE_FILES}.xml") +else() + set(SUITE_FILES + "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf_ps.xml" + "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf_thompson_ps.xml" + "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf_thompson.xml" + "${SUITE_FILES_DIR}/suite_HAFS_v0_hwrf.xml" + "${SUITE_FILES_DIR}/suite_SCM_csawmg_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_csawmg.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ACM_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_FA.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_MYJ.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_noahmp.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_no_nsst_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_no_nsst.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ntiedtke_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ntiedtke.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_RRTMGP_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_RRTMGP.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_saYSU_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v15p2_YSU_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_gfdlmpv3.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_gfdlmpv3_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_no_nsst.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_no_nsst_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_RRTMGP.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v16_RRTMGP_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_c3.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_c3_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_no_nsst_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_tempo.xml" + "${SUITE_FILES_DIR}/suite_SCM_GFS_v17_p8_ugwpv1_tempo_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GSD_v1nssl_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GSD_v1nssl.xml" + "${SUITE_FILES_DIR}/suite_SCM_GSD_v1_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_GSD_v1.xml" + "${SUITE_FILES_DIR}/suite_SCM_HRRR_gf_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_HRRR_gf.xml" + "${SUITE_FILES_DIR}/suite_SCM_HRRR_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_HRRR.xml" + "${SUITE_FILES_DIR}/suite_SCM_RAP_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_RAP.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1alpha_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1alpha.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta_no_nsst_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta_no_nsst.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1beta.xml" + "${SUITE_FILES_DIR}/suite_SCM_RRFS_v1nssl.xml" + "${SUITE_FILES_DIR}/suite_SCM_WoFS_v0_ps.xml" + "${SUITE_FILES_DIR}/suite_SCM_WoFS_v0.xml" ) - +endif() +message(STATUS "Compiling the following SDFs: ${SUITE_FILES}") + set(HOST "scm") set(CCPP_VERBOSITY "2" CACHE STRING "Verbosity level of output (default: 0)") @@ -222,13 +232,18 @@ ccpp_validator(VERBOSITY ${CCPP_VERBOSITY} SOURCE_FILES ${HOST_FORTRAN_FILES} METADATA_FILES ${HOST_METADATA_FILES}) +if (32BIT) + set(CCPP_KINDS "kind_phys=REAL32") + message(STATUS "Building physics with 32-bit") +endif() # Run ccpp_capgen_ng ccpp_capgen(VERBOSITY ${CCPP_VERBOSITY} HOSTFILES ${HOST_METADATA_FILES} SCHEMEFILES ${SCHEME_METADATA_FILES} SUITES ${SUITE_FILES} HOST_NAME ${HOST} - OUTPUT_ROOT "${OUTPUT_ROOT}") + OUTPUT_ROOT "${OUTPUT_ROOT}" + KIND_SPECS "${CCPP_KINDS}") # Retrieve the list of Fortran files required for test host from datatable.xml; # this includes capgen-generated files and dependencies inferred from metadata diff --git a/ccpp/suites/suite_SCM_HRRR.xml b/ccpp/suites/suite_SCM_HRRR.xml index ffca230e6..5a1deaa40 100644 --- a/ccpp/suites/suite_SCM_HRRR.xml +++ b/ccpp/suites/suite_SCM_HRRR.xml @@ -43,7 +43,6 @@ sfc_nst sfc_nst_post lsm_ruc - clm_lake GFS_surface_loop_control_part2 diff --git a/test/rt_test_cases.py b/test/rt_test_cases.py index efa8d49d0..09bc146fc 100644 --- a/test/rt_test_cases.py +++ b/test/rt_test_cases.py @@ -93,32 +93,30 @@ # Developmental suites, (w/ supported cases). #---------------------------------------------------------------------------------------------------------------------------------------------------------- suites_dev_gfortran = [\ - " SCM_GFS_v16_no_nsst", "SCM_GFS_v17_p8_ugwpv1_no_nsst", "SCM_RRFS_v1beta_no_nsst", "SCM_GFS_v17_p8_ugwpv1_tempo", \ + "SCM_GFS_v16_no_nsst", "SCM_GFS_v17_p8_ugwpv1_no_nsst", "SCM_RRFS_v1beta_no_nsst", "SCM_GFS_v17_p8_ugwpv1_tempo", \ "SCM_GFS_v16_no_nsst_ps", "SCM_GFS_v17_p8_ugwpv1_no_nsst_ps", "SCM_RRFS_v1beta_no_nsst_ps", "SCM_GFS_v17_p8_ugwpv1_tempo_ps", \ - "SCM_GFS_v16_gfdlmpv3", "SCM_GFS_v15p2_ntiedtke", "SCM_GFS_v16_debug", \ - "SCM_GFS_v16_gfdlmpv3_ps","SCM_GFS_v15p2_ntiedtke_ps", "SCM_GFS_v16_debug_ps"] + "SCM_GFS_v16_gfdlmpv3", "SCM_GFS_v15p2_ntiedtke", \ + "SCM_GFS_v16_gfdlmpv3_ps","SCM_GFS_v15p2_ntiedtke_ps"] run_list_dev_gfortran = [\ {"case": "atomic_Jan16T22Jan18T06", "suite": "SCM_GFS_v16_no_nsst"}, \ {"case": "atomic_Jan16T22Jan18T06", "suite": "SCM_GFS_v17_p8_ugwpv1_no_nsst"}, \ {"case": "atomic_Jan16T22Jan18T06", "suite": "SCM_RRFS_v1beta_no_nsst"}, \ {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v17_p8_ugwpv1_tempo"}, \ {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v16_gfdlmpv3"}, \ - {"case": "twpice", "suite": "SCM_GFS_v15p2_ntiedtke"}, \ - {"case": "bomex", "suite": "SCM_GFS_v16_debug"}] + {"case": "twpice", "suite": "SCM_GFS_v15p2_ntiedtke"}] # suites_dev_ifx = [\ "SCM_GFS_v16_no_nsst", "SCM_GFS_v17_p8_ugwpv1_no_nsst", "SCM_RRFS_v1beta_no_nsst", \ "SCM_GFS_v16_no_nsst_ps", "SCM_GFS_v17_p8_ugwpv1_no_nsst_ps", "SCM_RRFS_v1beta_no_nsst_ps", \ - "SCM_GFS_v16_gfdlmpv3", "SCM_GFS_v15p2_ntiedtke", "SCM_GFS_v16_debug", \ - "SCM_GFS_v16_gfdlmpv3_ps", "SCM_GFS_v15p2_ntiedtke_ps", "SCM_GFS_v16_debug_ps"] + "SCM_GFS_v16_gfdlmpv3", "SCM_GFS_v15p2_ntiedtke", \ + "SCM_GFS_v16_gfdlmpv3_ps", "SCM_GFS_v15p2_ntiedtke_ps"] run_list_dev_ifx = [\ {"case": "atomic_Jan16T22Jan18T06", "suite": "SCM_GFS_v16_no_nsst"}, \ {"case": "atomic_Jan16T22Jan18T06", "suite": "SCM_GFS_v17_p8_ugwpv1_no_nsst"}, \ {"case": "atomic_Jan16T22Jan18T06", "suite": "SCM_RRFS_v1beta_no_nsst"}, \ #{"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v17_p8_ugwpv1_tempo"}, \ {"case": "arm_sgp_summer_1997_A", "suite": "SCM_GFS_v16_gfdlmpv3"}, \ - {"case": "twpice", "suite": "SCM_GFS_v15p2_ntiedtke"}, \ - {"case": "bomex", "suite": "SCM_GFS_v16_debug"}] + {"case": "twpice", "suite": "SCM_GFS_v15p2_ntiedtke"}] #---------------------------------------------------------------------------------------------------------------------------------------------------------- # Legacy suites, (w/ supported cases). From a8612350a3b1091e7638cfd14e25260dc74b022c Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 3 Jun 2026 09:31:49 -0600 Subject: [PATCH 18/28] Update ccpp-framework, enable full validation of host and scheme data; fix metadata-fortran inconsistencies, fix GitHub actions take 1 --- .github/workflows/ci_run_scm_DEPHY.yml | 5 +- .github/workflows/ci_scm_ccpp_prebuild.yml | 37 --------- ccpp/CMakeLists.txt | 7 +- ccpp/framework | 2 +- cmake/ccpp_capgen.cmake | 23 +++++- scm/src/CCPP_typedefs.meta | 7 -- scm/src/GFS_typedefs.meta | 32 ++------ scm/src/scm_kinds.F90 | 1 + scm/src/scm_kinds.meta | 26 ------ scm/src/scm_physical_constants.meta | 94 +++++++++++----------- 10 files changed, 80 insertions(+), 154 deletions(-) delete mode 100644 .github/workflows/ci_scm_ccpp_prebuild.yml delete mode 100644 scm/src/scm_kinds.meta diff --git a/.github/workflows/ci_run_scm_DEPHY.yml b/.github/workflows/ci_run_scm_DEPHY.yml index c6feee19f..4dcf5f4e1 100644 --- a/.github/workflows/ci_run_scm_DEPHY.yml +++ b/.github/workflows/ci_run_scm_DEPHY.yml @@ -37,7 +37,8 @@ jobs: libnetcdff-dev \ libxml2 \ openmpi-bin \ - libopenmpi-dev + libopenmpi-dev \ + libxml2-utils ####################################################################################### # Python setup @@ -49,7 +50,7 @@ jobs: - name: Install NetCDF Python libraries run: | - pip install f90nml h5py netCDF4 + pip install f90nml h5py netCDF4 pytest - name: Environment for openmpi compiler run: | diff --git a/.github/workflows/ci_scm_ccpp_prebuild.yml b/.github/workflows/ci_scm_ccpp_prebuild.yml deleted file mode 100644 index c50de5436..000000000 --- a/.github/workflows/ci_scm_ccpp_prebuild.yml +++ /dev/null @@ -1,37 +0,0 @@ -# CI test to run SCM ccpp_prebuild script -name: build - -on: [push, pull_request, workflow_dispatch] - -jobs: - build-linux: - if: github.repository == 'NCAR/ccpp-scm' - - # The type of runner that the job will run on - runs-on: ubuntu-latest - - steps: - - - name: Checkout code - uses: actions/checkout@v6 - - - name: Initialize submodules - run: git submodule update --init --recursive - - - name: Set up Python 3.11.7 - uses: actions/setup-python@v6 - with: - python-version: 3.11.7 - - - name: Add conda to system path - run: | - # $CONDA is an environment variable pointing to the root of the miniconda directory - echo $CONDA/bin >> $GITHUB_PATH - - - name: Update system packages - run: sudo apt-get update - - - name: Run ccpp_prebuild.py - run: | - mkdir -p /home/runner/work/ccpp-scm/ccpp-scm/scm/bin/ccpp/physics/physics/ - ./ccpp/framework/scripts/ccpp_prebuild.py --config ccpp/config/ccpp_prebuild_config.py diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index d2cd46bac..f2dd61cee 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -135,7 +135,6 @@ ccpp_source_files(SCHEME_FORTRAN_FILES ${SCHEME_METADATA_FILES}) set(HOST_FILES_DIR "${CMAKE_SOURCE_DIR}/scm/src") set(HOST_METADATA_FILES - "${HOST_FILES_DIR}/scm_kinds.meta" "${HOST_FILES_DIR}/scm_physical_constants.meta" "${HOST_FILES_DIR}/scm_type_defs.meta" "${HOST_FILES_DIR}/CCPP_typedefs.meta" @@ -227,10 +226,12 @@ set(OUTPUT_ROOT "${CMAKE_CURRENT_BINARY_DIR}/ccpp") # Run ccpp_validator ccpp_validator(VERBOSITY ${CCPP_VERBOSITY} SOURCE_FILES ${SCHEME_FORTRAN_FILES} - METADATA_FILES ${SCHEME_METADATA_FILES}) + METADATA_FILES ${SCHEME_METADATA_FILES} + TYPE "SCHEME") ccpp_validator(VERBOSITY ${CCPP_VERBOSITY} SOURCE_FILES ${HOST_FORTRAN_FILES} - METADATA_FILES ${HOST_METADATA_FILES}) + METADATA_FILES ${HOST_METADATA_FILES} + TYPE "HOST") if (32BIT) set(CCPP_KINDS "kind_phys=REAL32") diff --git a/ccpp/framework b/ccpp/framework index 43c17613e..a99ca8a94 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 43c17613e3b03041273840a1775502c3c27485fa +Subproject commit a99ca8a9448bf54dac283e30b2859d7c2473509c diff --git a/cmake/ccpp_capgen.cmake b/cmake/ccpp_capgen.cmake index 9bdfdcede..99bcdd822 100644 --- a/cmake/ccpp_capgen.cmake +++ b/cmake/ccpp_capgen.cmake @@ -89,9 +89,10 @@ endfunction() # # SOURCE_FILES - CMake list of Fortran source files # METADATA_FILES - CMake list of corresponding metadata files +# TYPE - "HOST" or "SCHEME" (case-insensitive) function(ccpp_validator) set(optionalArgs) - set(oneValueArgs VERBOSITY) + set(oneValueArgs VERBOSITY TYPE) set(multi_value_keywords SOURCE_FILES METADATA_FILES) cmake_parse_arguments(arg "${optionalArgs}" "${oneValueArgs}" "${multi_value_keywords}" ${ARGN}) @@ -103,16 +104,30 @@ function(ccpp_validator) # Interpret parsed arguments if(NOT DEFINED arg_SOURCE_FILES) - message(FATAL_ERROR "function(ccpp_capgen): SOURCE_FILES not set.") + message(FATAL_ERROR "function(ccpp_validator): SOURCE_FILES not set.") endif() list(JOIN arg_SOURCE_FILES "," SOURCE_FILES_SEPARATED) list(APPEND CCPP_VALIDATOR_CMD_LIST "--source-files" "${SOURCE_FILES_SEPARATED}") if(NOT DEFINED arg_METADATA_FILES) - message(FATAL_ERROR "function(ccpp_capgen): METADATA_FILES not set.") + message(FATAL_ERROR "function(ccpp_validator): METADATA_FILES not set.") endif() list(JOIN arg_METADATA_FILES "," METADATA_FILES_SEPARATED) - list(APPEND CCPP_VALIDATOR_CMD_LIST "--scheme-files" "${METADATA_FILES_SEPARATED}") + + if(NOT DEFINED arg_TYPE) + message(FATAL_ERROR "function(ccpp_validator): TYPE must be HOST or SCHEME") + endif() + string(TOUPPER "${arg_TYPE}" _type) + if(NOT (_type MATCHES "^(HOST|SCHEME)$")) + message(FATAL_ERROR "function(ccpp_validator): TYPE must be HOST or SCHEME") + endif() + + if(_type MATCHES "^HOST$") + list(APPEND CCPP_VALIDATOR_CMD_LIST "--host-files" "${METADATA_FILES_SEPARATED}") + endif() + if(_type MATCHES "^SCHEME$") + list(APPEND CCPP_VALIDATOR_CMD_LIST "--scheme-files" "${METADATA_FILES_SEPARATED}") + endif() if(DEFINED arg_VERBOSITY) string(REPEAT "--verbose " ${arg_VERBOSITY} VERBOSE_PARAMS_SEPARATED) diff --git a/scm/src/CCPP_typedefs.meta b/scm/src/CCPP_typedefs.meta index b2af88314..cc8d5d8ba 100644 --- a/scm/src/CCPP_typedefs.meta +++ b/scm/src/CCPP_typedefs.meta @@ -1676,13 +1676,6 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys -[rho1] - standard_name = air_density_at_lowest_model_layer - long_name = air density at lowest model layer - units = kg m-3 - dimensions = (horizontal_dimension) - type = real - kind = kind_phys [runoff] standard_name = surface_runoff_flux long_name = surface runoff flux diff --git a/scm/src/GFS_typedefs.meta b/scm/src/GFS_typedefs.meta index 99767600e..de52aa6fb 100644 --- a/scm/src/GFS_typedefs.meta +++ b/scm/src/GFS_typedefs.meta @@ -3273,22 +3273,6 @@ type = real kind = kind_phys active = (do_smoke_coupling) -[smoke_ext] - standard_name = extinction_coefficient_in_air_due_to_smoke - long_name = extinction coefficient in air due to smoke - units = various - dimensions = (horizontal_dimension,vertical_layer_dimension) - type = real - kind = kind_phys - active = (do_smoke_coupling) -[dust_ext] - standard_name = extinction_coefficient_in_air_due_to_dust - long_name = extinction coefficient in air due to dust - units = various - dimensions = (horizontal_dimension,vertical_layer_dimension) - type = real - kind = kind_phys - active = (do_smoke_coupling) [chem3d] standard_name = chem3d_mynn_pbl_transport long_name = mynn pbl transport of smoke and dust @@ -3563,7 +3547,7 @@ units = none dimensions = (number_of_lines_in_internal_namelist) type = character - kind = len=256 + kind = len=: [logunit] standard_name = iounit_of_log long_name = fortran unit number for logfile @@ -3690,12 +3674,14 @@ units = Pa dimensions = (vertical_interface_dimension) type = real + kind = kind_phys [bk] standard_name = sigma_pressure_hybrid_coordinate_b_coefficient long_name = b parameter for sigma pressure level calculations units = none dimensions = (vertical_interface_dimension) type = real + kind = kind_phys [levsp1] standard_name = vertical_interface_dimension long_name = number of vertical levels plus one @@ -4607,6 +4593,7 @@ units = km dimensions = () type = real + kind = kind_phys [psautco] standard_name = autoconversion_to_snow_coefficient long_name = auto conversion coeff from ice to snow @@ -7535,13 +7522,6 @@ units = flag dimensions = () type = logical -[suite_sim_data] - standard_name = filename_for_CCPP_suite_simulator - long_name = filename for cccpp suite simulator data file - units = none - dimensions = () - type = character - kind = len=256 [nprg_active] standard_name = number_of_prognostics_varaibles_in_CCPP_suite_simulator long_name = number of prognostic variables used in CCPP suite simulator @@ -7907,6 +7887,7 @@ units = 1 dimensions = () type = real + kind = kind_phys [icloud_bl] standard_name = control_for_sgs_cloud_radiation_coupling_in_mellor_yamamda_nakanishi_niino_pbl_scheme long_name = flag for coupling sgs clouds to radiation @@ -10663,7 +10644,6 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout active = (do_lightning_threat_index_calculations) [ltg2_max] standard_name = lightning_threat_index_2 @@ -10672,7 +10652,6 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout active = (do_lightning_threat_index_calculations) [ltg3_max] standard_name = lightning_threat_index_3 @@ -10681,5 +10660,4 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout active = (do_lightning_threat_index_calculations) diff --git a/scm/src/scm_kinds.F90 b/scm/src/scm_kinds.F90 index 1aad857e1..1d49aabb8 100644 --- a/scm/src/scm_kinds.F90 +++ b/scm/src/scm_kinds.F90 @@ -14,6 +14,7 @@ module scm_kinds integer, parameter :: dp = sp integer, parameter :: qp = sp #endif + integer, parameter :: kind_phys = dp ! these types exists to allow generic interface compilation in scm_utils.F90 integer, parameter :: kind_scm_sp = selected_real_kind(P= 6,R=37) diff --git a/scm/src/scm_kinds.meta b/scm/src/scm_kinds.meta deleted file mode 100644 index 77af18f56..000000000 --- a/scm/src/scm_kinds.meta +++ /dev/null @@ -1,26 +0,0 @@ -[ccpp-table-properties] - name = scm_kinds - type = host - dependencies = - -[ccpp-arg-table] - name = scm_kinds - type = host -[kind_sp] - standard_name = kind_sp - long_name = definition of kind_sp - units = none - dimensions = () - type = integer -[kind_dp] - standard_name = kind_dp - long_name = definition of kind_dp - units = none - dimensions = () - type = integer -[kind_qp] - standard_name = kind_qp - long_name = definition of kind_qp - units = none - dimensions = () - type = integer diff --git a/scm/src/scm_physical_constants.meta b/scm/src/scm_physical_constants.meta index ede4e52da..0b59c4e56 100644 --- a/scm/src/scm_physical_constants.meta +++ b/scm/src/scm_physical_constants.meta @@ -18,326 +18,326 @@ units = J kg-1 K-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_csol] standard_name = specific_heat_of_ice_at_constant_pressure long_name = specific heat of ice at constant pressure units = J kg-1 K-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_cp] standard_name = specific_heat_of_dry_air_at_constant_pressure long_name = specific heat of dry air at constant pressure units = J kg-1 K-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_cvap] standard_name = specific_heat_of_water_vapor_at_constant_pressure long_name = specific heat of water vapor at constant pressure units = J kg-1 K-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_eps] standard_name = ratio_of_dry_air_to_water_vapor_gas_constants long_name = rd/rv units = none dimensions = () type = real - kind = kind_phys + kind = dp [con_epsqs] standard_name = minimum_value_of_saturation_mixing_ratio long_name = floor value for saturation mixing ratio units = kg kg-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_epsm1] standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one long_name = (rd/rv) - 1 units = none dimensions = () type = real - kind = kind_phys + kind = dp [con_1ovg] standard_name = one_divided_by_the_gravitational_acceleration long_name = inverse of gravitational acceleration units = s2 m-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_rocp] standard_name = ratio_of_gas_constant_dry_air_to_specific_heat_of_dry_air_at_constant_pressure long_name = (rd/cp) units = none dimensions = () type = real - kind = kind_phys + kind = dp [con_rog] standard_name = ratio_of_gas_constant_dry_air_to_gravitational_acceleration long_name = (rd/g) units = J s2 K-1 kg-1 m-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_fvirt] standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) units = none dimensions = () type = real - kind = kind_phys + kind = dp [con_g] standard_name = gravitational_acceleration long_name = gravitational acceleration units = m s-2 dimensions = () type = real - kind = kind_phys + kind = dp [con_hfus] standard_name = latent_heat_of_fusion_of_water_at_0C long_name = latent heat of fusion units = J kg-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_psat] standard_name = saturation_pressure_at_triple_point_of_water long_name = saturation pressure at triple point of water units = Pa dimensions = () type = real - kind = kind_phys + kind = dp [con_hvap] standard_name = latent_heat_of_vaporization_of_water_at_0C long_name = latent heat of evaporation/sublimation units = J kg-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_pi] standard_name = pi long_name = ratio of a circle's circumference to its diameter units = none dimensions = () type = real - kind = kind_phys + kind = dp [con_rd] standard_name = gas_constant_of_dry_air long_name = ideal gas constant for dry air units = J kg-1 K-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_rv] standard_name = gas_constant_water_vapor long_name = ideal gas constant for water vapor units = J kg-1 K-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_t0c] standard_name = temperature_at_zero_celsius long_name = temperature at 0 degrees Celsius units = K dimensions = () type = real - kind = kind_phys + kind = dp [con_ttp] standard_name = triple_point_temperature_of_water long_name = triple point temperature of water units = K dimensions = () type = real - kind = kind_phys + kind = dp [con_epsq] standard_name = minimum_value_of_specific_humidity long_name = floor value for specific humidity units = kg kg-1 dimensions = () type = real - kind = kind_phys + kind = dp [karman] standard_name = von_karman_constant long_name = Von Karman constant units = none dimensions = () type = real - kind = kind_phys + kind = dp [cimin] standard_name = minimum_sea_ice_concentration long_name = minimum sea ice concentration units = frac dimensions = () type = real - kind = kind_phys + kind = dp [rainmin] standard_name = lwe_thickness_of_minimum_rain_amount long_name = liquid water equivalent thickness of minimum rain amount units = m dimensions = () type = real - kind = kind_phys + kind = dp [rlapse] standard_name = air_temperature_lapse_rate_constant long_name = environmental air temperature lapse rate constant units = K m-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_jcal] standard_name = joules_per_calorie_constant long_name = joules per calorie constant units = J cal-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_rhw0] standard_name = sea_water_reference_density long_name = sea water reference density units = kg m-3 dimensions = () type = real - kind = kind_phys + kind = dp [con_sbc] standard_name = stefan_boltzmann_constant long_name = Steffan-Boltzmann constant units = W m-2 K-4 dimensions = () type = real - kind = kind_phys + kind = dp [con_tice] standard_name = freezing_point_temperature_of_seawater long_name = freezing point temperature of seawater units = K dimensions = () type = real - kind = kind_phys + kind = dp [con_p0] standard_name = standard_atmospheric_pressure long_name = standard atmospheric pressure units = Pa dimensions = () type = real - kind = kind_phys + kind = dp [rhowater] standard_name = fresh_liquid_water_density_at_0c long_name = density of liquid water units = kg m-3 dimensions = () type = real - kind = kind_phys + kind = dp [rholakeice] standard_name = density_of_ice_on_lake long_name = density of ice on a lake units = kg m-3 dimensions = () type = real - kind = kind_phys + kind = dp [con_omega] standard_name = angular_velocity_of_earth long_name = angular velocity of earth units = s-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_rerth] standard_name = radius_of_earth long_name = radius of earth units = m dimensions = () type = real - kind = kind_phys + kind = dp [con_c] standard_name = speed_of_light_in_vacuum long_name = speed of light in vacuum units = m s-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_plnk] standard_name = planck_constant long_name = Planck constant units = J s-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_boltz] standard_name = boltzmann_constant long_name = Boltzmann constant units = J K-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_solr_2008] standard_name = solar_constant_2008 long_name = solar constant Tim 2008 units = W m-2 dimensions = () type = real - kind = kind_phys + kind = dp [con_solr_2002] standard_name = solar_constant_2002 long_name= solar constant Liu 2002 units = W m-2 dimensions = () type = real - kind = kind_phys + kind = dp [con_thgni] standard_name = temperature_ice_nucleation_starts long_name = temperature the H.G.Nuc. ice starts units = K dimensions = () type = real - kind = kind_phys + kind = dp [con_rgas] standard_name = molar_gas_constant long_name = universal ideal molar gas constant units = J K-1 mol-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_avgd] standard_name = avogadro_constant long_name = Avogadro constant units = mol-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_amd] standard_name = molecular_weight_of_dry_air long_name = molecular weight of dry air units = g mol-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_amw] standard_name = molecular_weight_of_water_vapor long_name = molecular weight of water vapor units = g mol-1 dimensions = () type = real - kind = kind_phys + kind = dp [con_one] standard_name = constant_one long_name = mathematical constant of one units = 1 dimensions = () type = real - kind = kind_phys + kind = dp [con_p001] standard_name = constant_one_hundredth long_name = mathematical constant for one hundredth units = 1 dimensions = () type = real - kind = kind_phys + kind = dp [con_secinday] standard_name = seconds_in_a_day long_name = number of seconds in a day units = s dimensions = () type = real - kind = kind_phys \ No newline at end of file + kind = dp \ No newline at end of file From 968a0ce8e59bcc5dde789516211f6d97f69b7aca Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 3 Jun 2026 21:03:20 -0600 Subject: [PATCH 19/28] Update ccpp-framework --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index a99ca8a94..047741269 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit a99ca8a9448bf54dac283e30b2859d7c2473509c +Subproject commit 047741269b1001b7b43547f587a7e64d26bd3fd1 From 119568f523599447d559337b8b5f2c8da6f63db1 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 4 Jun 2026 20:45:18 -0600 Subject: [PATCH 20/28] Update framework submodule pointer --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index 047741269..007a0ea3d 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 047741269b1001b7b43547f587a7e64d26bd3fd1 +Subproject commit 007a0ea3dbae750a2ff4e2a39de550fbede505c4 From d89ce7d3472d5975fe1ef39a7d700b177b7f4bac Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 5 Jun 2026 10:17:15 -0600 Subject: [PATCH 21/28] Update ccpp-framework --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index 007a0ea3d..04acc29bc 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 007a0ea3dbae750a2ff4e2a39de550fbede505c4 +Subproject commit 04acc29bccf7ce0db349af89f97ec54f614ba2aa From 05c4699e8b36d08514aca013b94777515c331584 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 5 Jun 2026 19:20:27 -0600 Subject: [PATCH 22/28] Update submodule pointer for ccpp-framework --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index 04acc29bc..b576b357f 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 04acc29bccf7ce0db349af89f97ec54f614ba2aa +Subproject commit b576b357f49b8ff538ae530a3384e61f54499c5a From 0eafa4100b4e0d326e6d29fe9a7eb8f2810add27 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 8 Jun 2026 15:29:19 -0600 Subject: [PATCH 23/28] Update submodule pointers for CCPP framework and physics --- ccpp/framework | 2 +- ccpp/physics | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/framework b/ccpp/framework index a1d9a007a..44eb383ea 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit a1d9a007abe40bab7b241e441fd9bc0145911718 +Subproject commit 44eb383eafb5bba9f8c888da391ea1e75b0cbaec diff --git a/ccpp/physics b/ccpp/physics index 783f20c6b..198bdd707 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 783f20c6bcbbecd7e8eb98eab1302403785c3fc3 +Subproject commit 198bdd707d6514793b8406e8bcc6af720967792f From 2ab544fd82ed8dbb2a3c7efc364573a0d0a542bd Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 8 Jun 2026 17:27:28 -0600 Subject: [PATCH 24/28] Update ccpp-framework --- ccpp/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/framework b/ccpp/framework index 44eb383ea..cda7b9a4b 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit 44eb383eafb5bba9f8c888da391ea1e75b0cbaec +Subproject commit cda7b9a4b4846a4a161883dc1b59c9e6c960201f From 0de131fd7299bcd181a1097b599cd038dfff6fce Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 23 Jun 2026 07:53:43 -0600 Subject: [PATCH 25/28] Simplify scm/src/scm.F90 and scm/src/scm_time_integration.{F90,meta} --- ccpp/framework | 2 +- ccpp/framework-symlink/capgen-ng | 1 - ccpp/physics | 2 +- scm/src/scm.F90 | 2 +- scm/src/scm_time_integration.F90 | 2 +- scm/src/scm_time_integration.meta | 12 ------------ 6 files changed, 4 insertions(+), 17 deletions(-) delete mode 120000 ccpp/framework-symlink/capgen-ng diff --git a/ccpp/framework b/ccpp/framework index cda7b9a4b..d568a4433 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit cda7b9a4b4846a4a161883dc1b59c9e6c960201f +Subproject commit d568a4433662603fe2b3884d6e3ec4aa11703dbe diff --git a/ccpp/framework-symlink/capgen-ng b/ccpp/framework-symlink/capgen-ng deleted file mode 120000 index abf9e65c9..000000000 --- a/ccpp/framework-symlink/capgen-ng +++ /dev/null @@ -1 +0,0 @@ -/home/dom/work/ccpp-f-capgen-ng/capgen-ng \ No newline at end of file diff --git a/ccpp/physics b/ccpp/physics index 198bdd707..61a42c23b 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 198bdd707d6514793b8406e8bcc6af720967792f +Subproject commit 61a42c23bae778299adfa700da4494df5eeb2a69 diff --git a/scm/src/scm.F90 b/scm/src/scm.F90 index 1f47062a9..b0d0fd70b 100644 --- a/scm/src/scm.F90 +++ b/scm/src/scm.F90 @@ -21,7 +21,7 @@ subroutine scm_main_sub() ! Import CCPP control variables from scm_time_integration ! and define CPP directive for fixed control values. use scm_time_integration, only: errmsg, errflg -#define CCPP_PHYSICS_STATIC_ARGS lb=1, ub=1, mythread=1, nthreads=1, nphys_threads=1 +#define CCPP_PHYSICS_STATIC_ARGS lb=1, ub=1, nphys_threads=1 #define CCPP_PHYSICS_NPHYS_THREADS 1 use :: scm_ccpp_cap, & diff --git a/scm/src/scm_time_integration.F90 b/scm/src/scm_time_integration.F90 index 9f2c2d9a2..c7cc65ecd 100644 --- a/scm/src/scm_time_integration.F90 +++ b/scm/src/scm_time_integration.F90 @@ -20,7 +20,7 @@ module scm_time_integration ! Fixed CCPP control values are passed via a CPP directive. character(len=512) :: errmsg integer :: errflg -#define CCPP_PHYSICS_STATIC_ARGS lb=1, ub=1, mythread=1, nthreads=1, nphys_threads=1 +#define CCPP_PHYSICS_STATIC_ARGS lb=1, ub=1, nphys_threads=1 contains diff --git a/scm/src/scm_time_integration.meta b/scm/src/scm_time_integration.meta index dbfa22f06..061326dc0 100644 --- a/scm/src/scm_time_integration.meta +++ b/scm/src/scm_time_integration.meta @@ -32,18 +32,6 @@ units = index dimensions = () type = integer -[ mythread ] - standard_name = thread_number - long_name = current thread number - units = index - dimensions = () - type = integer -[ nthreads ] - standard_name = number_of_threads - long_name = total number of OpenMP threads - units = count - dimensions = () - type = integer [ nphys_threads ] standard_name = number_of_physics_threads long_name = thread budget for physics-internal OpenMP From a13dc7206ce1095af8b2b489f51841713e4ec2df Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 23 Jun 2026 08:15:45 -0600 Subject: [PATCH 26/28] Update ccpp/CMakeLists.txt --- ccpp/CMakeLists.txt | 6 +++--- ccpp/physics | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index 711467ad1..ac058bd15 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -68,9 +68,9 @@ set(SCHEME_METADATA_FILES "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta" "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta" "${SCHEME_FILES_DIR}/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta" - "${SCHEME_FILES_DIR}/CONV/C3/cu_c3_driver.meta" - "${SCHEME_FILES_DIR}/CONV/C3/cu_c3_driver_post.meta" - "${SCHEME_FILES_DIR}/CONV/C3/cu_c3_driver_pre.meta" + "${SCHEME_FILES_DIR}/CONV/C3/CCPP/cu_c3_driver_ccpp.meta" + "${SCHEME_FILES_DIR}/CONV/C3/CCPP/cu_c3_driver_post.meta" + "${SCHEME_FILES_DIR}/CONV/C3/CCPP/cu_c3_driver_pre.meta" "${SCHEME_FILES_DIR}/GWD/ugwpv1_gsldrag.meta" "${SCHEME_FILES_DIR}/GWD/ugwpv1_gsldrag_post.meta" "${SCHEME_FILES_DIR}/SFC_Models/Ocean/UFS/sfc_ocean.meta" diff --git a/ccpp/physics b/ccpp/physics index 61a42c23b..1ed02306c 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 61a42c23bae778299adfa700da4494df5eeb2a69 +Subproject commit 1ed02306c204e1dd112b13b403749579ba285fd3 From 17d1cf4a661cdcc49340d6aeeeed4685f0469357 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 23 Jun 2026 10:51:31 -0600 Subject: [PATCH 27/28] Update submodule pointer for ccpp/physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 1ed02306c..3de6efae7 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 1ed02306c204e1dd112b13b403749579ba285fd3 +Subproject commit 3de6efae740ed673406cfe1cbc8cb2b334c13801 From aa60ae8201f1450e8b3ba7de4ec93c062b9f1bed Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 23 Jun 2026 12:24:22 -0600 Subject: [PATCH 28/28] Bug fixes in scm/src/CCPP_typedefs.meta: add missing active conditions --- scm/src/CCPP_typedefs.meta | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scm/src/CCPP_typedefs.meta b/scm/src/CCPP_typedefs.meta index d5ed092e4..2a1c2db54 100644 --- a/scm/src/CCPP_typedefs.meta +++ b/scm/src/CCPP_typedefs.meta @@ -581,6 +581,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys + active = ( index_of_rain_mixing_ratio_in_tracer_concentration_array > 0 ) [dqdt(:,:,index_of_snow_mixing_ratio_in_tracer_concentration_array)] standard_name = process_split_cumulative_tendency_of_snow_mixing_ratio long_name = ratio of mass of snow water tendency to mass of dry air plus vapor (without condensates) due to model physics @@ -588,6 +589,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys + active = ( index_of_snow_mixing_ratio_in_tracer_concentration_array > 0 ) [dqdt(:,:,index_of_graupel_mixing_ratio_in_tracer_concentration_array)] standard_name = process_split_cumulative_tendency_of_graupel_mixing_ratio long_name = ratio of mass of graupel tendency to mass of dry air plus vapor (without condensates) due to model physics @@ -595,6 +597,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys + active = ( index_of_graupel_mixing_ratio_in_tracer_concentration_array > 0 ) [dqdt(:,:,index_of_turbulent_kinetic_energy_in_tracer_concentration_array)] standard_name = process_split_cumulative_tendency_of_turbulent_kinetic_energy long_name = turbulent kinetic energy tendency due to model physics @@ -602,6 +605,7 @@ dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys + active = ( index_of_turbulent_kinetic_energy_in_tracer_concentration_array > 0 ) [dqsfc1] standard_name = instantaneous_surface_upward_latent_heat_flux long_name = surface upward latent heat flux