From 03790c7eb7e199d6a04f7ff105bff0d28224c0d7 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Thu, 24 Mar 2022 14:38:40 +0000 Subject: [PATCH 01/10] Swtich to mpi_f08 module. Add MPI_Comm DDT The changes were made by Dom Heinzeller --- src/ccpp_types.F90 | 11 +++++++++++ src/ccpp_types.meta | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/ccpp_types.F90 b/src/ccpp_types.F90 index 992646bd..9329e00d 100644 --- a/src/ccpp_types.F90 +++ b/src/ccpp_types.F90 @@ -19,6 +19,10 @@ ! module ccpp_types +#ifdef MPI + use mpi_f08, only: MPI_Comm +#endif + !! \section arg_table_ccpp_types !! \htmlinclude ccpp_types.html !! @@ -27,6 +31,13 @@ module ccpp_types private public :: ccpp_t, one + public :: MPI_Comm + +#ifndef MPI + type :: MPI_Comm + integer, parameter :: dummy = 0 + end type MPI_Comm +#endif !> @var Definition of constant one integer, parameter :: one = 1 diff --git a/src/ccpp_types.meta b/src/ccpp_types.meta index 963762cc..13c8ad93 100644 --- a/src/ccpp_types.meta +++ b/src/ccpp_types.meta @@ -45,6 +45,16 @@ dimensions = () type = integer +######################################################################## +[ccpp-table-properties] + name = MPI_Comm + type = ddt + dependencies = + +[ccpp-arg-table] + name = MPI_Comm + type = ddt + ######################################################################## [ccpp-table-properties] @@ -67,3 +77,9 @@ units = 1 dimensions = () type = integer +[MPI_Comm] + standard_name = MPI_Comm + long_name = definition of type MPI_Comm + units = DDT + dimensions = () + type = MPI_Comm From 47a1e9c1c067dce54a446c1cc03254b938b57aa4 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Wed, 28 Sep 2022 15:24:08 +0000 Subject: [PATCH 02/10] Fix local MPI_Comm type --- src/ccpp_types.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ccpp_types.F90 b/src/ccpp_types.F90 index 9329e00d..c87bbf45 100644 --- a/src/ccpp_types.F90 +++ b/src/ccpp_types.F90 @@ -35,7 +35,7 @@ module ccpp_types #ifndef MPI type :: MPI_Comm - integer, parameter :: dummy = 0 + integer :: dummy = 0 end type MPI_Comm #endif From 1e089274becb585777b577fc27061f568e0eb2f2 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 7 Nov 2022 11:24:36 -0700 Subject: [PATCH 03/10] If MPI is used, find package --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4daf855b..8ec0afc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,12 @@ set(PACKAGE "ccpp-framework") set(AUTHORS "Dom Heinzeller" "Grant Firl" "Mike Kavulich" "Steve Goldhaber") string(TIMESTAMP YEAR "%Y") +#------------------------------------------------------------------------------ +# Set MPI flags for C/C++/Fortran +if (MPI) + find_package(MPI REQUIRED C Fortran) +endif (OPENMP) + #------------------------------------------------------------------------------ # Set OpenMP flags for C/C++/Fortran if (OPENMP) From c3c4c7c8117e38cd52285ca298b458c4fd3129ed Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Fri, 18 Nov 2022 20:58:09 +0000 Subject: [PATCH 04/10] Fixed cmake if/endif mismatch --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ec0afc0..8b29b2b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ string(TIMESTAMP YEAR "%Y") # Set MPI flags for C/C++/Fortran if (MPI) find_package(MPI REQUIRED C Fortran) -endif (OPENMP) +endif (MPI) #------------------------------------------------------------------------------ # Set OpenMP flags for C/C++/Fortran From 2cee086e600ed7861f9bf0b91f9bafe276b9a377 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 23 Feb 2024 13:54:36 -0700 Subject: [PATCH 05/10] Make mpi_f08 a mandatory dependency of ccpp-framework --- CMakeLists.txt | 9 +++++---- src/ccpp_types.F90 | 8 -------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b29b2b3..f0e1ac1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,10 +11,11 @@ set(AUTHORS "Dom Heinzeller" "Grant Firl" "Mike Kavulich" "Steve Goldhaber") string(TIMESTAMP YEAR "%Y") #------------------------------------------------------------------------------ -# Set MPI flags for C/C++/Fortran -if (MPI) - find_package(MPI REQUIRED C Fortran) -endif (MPI) +# Set MPI flags for C/C++/Fortran with MPI F08 interface +find_package(MPI REQUIRED C Fortran) +if(NOT MPI_Fortran_HAVE_F08_MODULE) + message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface") +endif() #------------------------------------------------------------------------------ # Set OpenMP flags for C/C++/Fortran diff --git a/src/ccpp_types.F90 b/src/ccpp_types.F90 index a9d44b84..12faa75c 100644 --- a/src/ccpp_types.F90 +++ b/src/ccpp_types.F90 @@ -19,9 +19,7 @@ ! module ccpp_types -#ifdef MPI use mpi_f08, only: MPI_Comm -#endif !! \section arg_table_ccpp_types !! \htmlinclude ccpp_types.html @@ -33,12 +31,6 @@ module ccpp_types public :: ccpp_t, one public :: MPI_Comm -#ifndef MPI - type :: MPI_Comm - integer :: dummy = 0 - end type MPI_Comm -#endif - !> @var Definition of constant one integer, parameter :: one = 1 From a4524b5314a142177d68d1a1e4ed96c98839d3ea Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 23 Feb 2024 13:55:45 -0700 Subject: [PATCH 06/10] Update test_prebuild/test_blocked_data test_prebuild/test_chunked_data now that mpi_f08 is a mandatory dependency --- test_prebuild/test_blocked_data/CMakeLists.txt | 10 +++++++++- test_prebuild/test_blocked_data/README.md | 3 +++ test_prebuild/test_chunked_data/CMakeLists.txt | 10 +++++++++- test_prebuild/test_chunked_data/README.md | 3 +++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/test_prebuild/test_blocked_data/CMakeLists.txt b/test_prebuild/test_blocked_data/CMakeLists.txt index 921c87e6..a429e404 100644 --- a/test_prebuild/test_blocked_data/CMakeLists.txt +++ b/test_prebuild/test_blocked_data/CMakeLists.txt @@ -3,12 +3,19 @@ cmake_minimum_required(VERSION 3.0) project(ccpp_blocked_data VERSION 1.0.0 - LANGUAGES Fortran) + LANGUAGES C Fortran) #------------------------------------------------------------------------------ # Request a static build option(BUILD_SHARED_LIBS "Build a shared library" OFF) +#------------------------------------------------------------------------------ +# Set MPI flags for C/C++/Fortran with MPI F08 interface +find_package(MPI REQUIRED C Fortran) +if(NOT MPI_Fortran_HAVE_F08_MODULE) + message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface") +endif() + #------------------------------------------------------------------------------ # Set the sources: physics type definitions set(TYPEDEFS $ENV{CCPP_TYPEDEFS}) @@ -57,6 +64,7 @@ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O0 -fno-unsafe-math-optimizatio #------------------------------------------------------------------------------ add_library(ccpp_blocked_data STATIC ${SCHEMES} ${CAPS} ${API}) +target_link_libraries(ccpp_blocked_data PRIVATE MPI::MPI_Fortran) # Generate list of Fortran modules from defined sources foreach(source_f90 ${CAPS} ${API}) get_filename_component(tmp_source_f90 ${source_f90} NAME) diff --git a/test_prebuild/test_blocked_data/README.md b/test_prebuild/test_blocked_data/README.md index ad977913..ee7962e1 100644 --- a/test_prebuild/test_blocked_data/README.md +++ b/test_prebuild/test_blocked_data/README.md @@ -10,4 +10,7 @@ mkdir build cd build cmake .. 2>&1 | tee log.cmake make 2>&1 | tee log.make +./test_blocked_data.x +# On systems where linking against the MPI library requires a parallel launcher, +# use 'mpirun -np 1 ./test_blocked_data.x' or 'srun -n 1 ./test_blocked_data.x' etc. ``` diff --git a/test_prebuild/test_chunked_data/CMakeLists.txt b/test_prebuild/test_chunked_data/CMakeLists.txt index 0d055768..4d7456f1 100644 --- a/test_prebuild/test_chunked_data/CMakeLists.txt +++ b/test_prebuild/test_chunked_data/CMakeLists.txt @@ -3,12 +3,19 @@ cmake_minimum_required(VERSION 3.0) project(ccpp_chunked_data VERSION 1.0.0 - LANGUAGES Fortran) + LANGUAGES C Fortran) #------------------------------------------------------------------------------ # Request a static build option(BUILD_SHARED_LIBS "Build a shared library" OFF) +#------------------------------------------------------------------------------ +# Set MPI flags for C/C++/Fortran with MPI F08 interface +find_package(MPI REQUIRED C Fortran) +if(NOT MPI_Fortran_HAVE_F08_MODULE) + message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface") +endif() + #------------------------------------------------------------------------------ # Set the sources: physics type definitions set(TYPEDEFS $ENV{CCPP_TYPEDEFS}) @@ -57,6 +64,7 @@ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O0 -fno-unsafe-math-optimizatio #------------------------------------------------------------------------------ add_library(ccpp_chunked_data STATIC ${SCHEMES} ${CAPS} ${API}) +target_link_libraries(ccpp_chunked_data PRIVATE MPI::MPI_Fortran) # Generate list of Fortran modules from defined sources foreach(source_f90 ${CAPS} ${API}) get_filename_component(tmp_source_f90 ${source_f90} NAME) diff --git a/test_prebuild/test_chunked_data/README.md b/test_prebuild/test_chunked_data/README.md index 40812515..16db6fc5 100644 --- a/test_prebuild/test_chunked_data/README.md +++ b/test_prebuild/test_chunked_data/README.md @@ -10,4 +10,7 @@ mkdir build cd build cmake .. 2>&1 | tee log.cmake make 2>&1 | tee log.make +./test_chunked_data.x +# On systems where linking against the MPI library requires a parallel launcher, +# use 'mpirun -np 1 ./test_chunked_data.x' or 'srun -n 1 ./test_chunked_data.x' etc. ``` From 13ec1211058029d433eea2ab1fcc66b304f1fe0d Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 23 Feb 2024 14:04:59 -0700 Subject: [PATCH 07/10] Bump minimum cmake version required --- CMakeLists.txt | 2 +- test_prebuild/test_blocked_data/CMakeLists.txt | 2 +- test_prebuild/test_chunked_data/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0e1ac1e..6d9f56aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.10) project(ccpp_framework VERSION 5.0.0 diff --git a/test_prebuild/test_blocked_data/CMakeLists.txt b/test_prebuild/test_blocked_data/CMakeLists.txt index a429e404..fdd5f9af 100644 --- a/test_prebuild/test_blocked_data/CMakeLists.txt +++ b/test_prebuild/test_blocked_data/CMakeLists.txt @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.10) project(ccpp_blocked_data VERSION 1.0.0 diff --git a/test_prebuild/test_chunked_data/CMakeLists.txt b/test_prebuild/test_chunked_data/CMakeLists.txt index 4d7456f1..512a5a7e 100644 --- a/test_prebuild/test_chunked_data/CMakeLists.txt +++ b/test_prebuild/test_chunked_data/CMakeLists.txt @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.10) project(ccpp_chunked_data VERSION 1.0.0 From c911911cd4700a604f51d5e547a5999661918996 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Mon, 26 Feb 2024 23:59:00 +0000 Subject: [PATCH 08/10] Remove C from MPI find_package --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d9f56aa..4b7aff41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,8 @@ set(AUTHORS "Dom Heinzeller" "Grant Firl" "Mike Kavulich" "Steve Goldhaber") string(TIMESTAMP YEAR "%Y") #------------------------------------------------------------------------------ -# Set MPI flags for C/C++/Fortran with MPI F08 interface -find_package(MPI REQUIRED C Fortran) +# Set MPI flags for Fortran with MPI F08 interface +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() From 8dafc9458192f35ac1087eb5078b114dbd45bee4 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 18 Mar 2024 15:55:39 -0600 Subject: [PATCH 09/10] Add support for scheme w/o run phase (#548) Here we include a small fix to allow for schemes without run phases. Capgen assumes that all schemes have a run phase, which is not true in practice. During the "scheme analyze" section, if a scheme doesn't contain a run phase we set a flag to true (no_run_phase). Then this flag is queried later in the "scheme write" section. There are no interface changes. Addresses #543 Testing has been expanded to contain a scheme w/o a run phase. --- scripts/ccpp_datafile.py | 3 +++ scripts/suite_objects.py | 16 +++++++++----- test/capgen_test/run_test | 13 ++++++++---- test/capgen_test/setup_coeffs.F90 | 24 +++++++++++++++++++++ test/capgen_test/setup_coeffs.meta | 29 ++++++++++++++++++++++++++ test/capgen_test/temp_scheme_files.txt | 1 + test/capgen_test/temp_suite.xml | 1 + test/capgen_test/test_host.F90 | 9 +++++--- test/capgen_test/test_host_mod.F90 | 1 + test/capgen_test/test_host_mod.meta | 6 ++++++ test/capgen_test/test_reports.py | 5 ++++- 11 files changed, 95 insertions(+), 13 deletions(-) create mode 100644 test/capgen_test/setup_coeffs.F90 create mode 100644 test/capgen_test/setup_coeffs.meta diff --git a/scripts/ccpp_datafile.py b/scripts/ccpp_datafile.py index 3c5092ed..194a46ea 100755 --- a/scripts/ccpp_datafile.py +++ b/scripts/ccpp_datafile.py @@ -704,6 +704,9 @@ def _new_scheme_entry(parent, scheme, group_name, scheme_headers): emsg = "Scheme entry already exists for {} but name is {}" raise CCPPDatatableError(emsg.format(sch_name, pname)) # end if + # Special case: Scheme w/o run phase. + if not scheme._has_run_phase: + return else: phase_entry = ET.SubElement(sch_entry, sch_tag) phase_entry.set("name", sch_name) diff --git a/scripts/suite_objects.py b/scripts/suite_objects.py index 37978d54..f611c5d2 100755 --- a/scripts/suite_objects.py +++ b/scripts/suite_objects.py @@ -1098,6 +1098,7 @@ def __init__(self, scheme_xml, context, parent, run_env): self.__var_debug_checks = list() self.__forward_transforms = list() self.__reverse_transforms = list() + self._has_run_phase = True self.__optional_vars = list() super().__init__(name, context, parent, run_env, active_call_list=True) @@ -1143,6 +1144,9 @@ def analyze(self, phase, group, scheme_library, suite_vars, level): if phase in func: my_header = func[phase] self.__subroutine_name = my_header.title + else: + self._has_run_phase = False + return set() # end if else: estr = 'No schemes found for {}' @@ -1727,11 +1731,13 @@ def write(self, outfile, errcode, errmsg, indent): # # Write the scheme call. # - stmt = 'call {}({})' - outfile.write('',indent+1) - outfile.write('! Call scheme', indent+1) - outfile.write(stmt.format(self.subroutine_name, my_args), indent+1) - outfile.write('',indent+1) + if self._has_run_phase: + stmt = 'call {}({})' + outfile.write('',indent+1) + outfile.write('! Call scheme', indent+1) + outfile.write(stmt.format(self.subroutine_name, my_args), indent+1) + outfile.write('',indent+1) + # end if # # Copy any local pointers. # diff --git a/test/capgen_test/run_test b/test/capgen_test/run_test index 0d5d44f7..6798f584 100755 --- a/test/capgen_test/run_test +++ b/test/capgen_test/run_test @@ -129,7 +129,7 @@ ccpp_files="${ccpp_files},${build_dir}/ccpp/test_host_ccpp_cap.F90" ccpp_files="${ccpp_files},${build_dir}/ccpp/ccpp_ddt_suite_cap.F90" ccpp_files="${ccpp_files},${build_dir}/ccpp/ccpp_temp_suite_cap.F90" process_list="setter=temp_set,adjusting=temp_calc_adjust" -module_list="environ_conditions,make_ddt,temp_adjust,temp_calc_adjust,temp_set" +module_list="environ_conditions,make_ddt,setup_coeffs,temp_adjust,temp_calc_adjust,temp_set" dependencies="bar.F90,foo.F90,qux.F90" suite_list="ddt_suite;temp_suite" required_vars_ddt="ccpp_error_code,ccpp_error_message,horizontal_dimension" @@ -145,7 +145,9 @@ input_vars_ddt="${input_vars_ddt},model_times,number_of_model_times" input_vars_ddt="${input_vars_ddt},surface_air_pressure" output_vars_ddt="ccpp_error_code,ccpp_error_message" output_vars_ddt="${output_vars_ddt},model_times,number_of_model_times" -required_vars_temp="ccpp_error_code,ccpp_error_message,horizontal_dimension" +required_vars_temp="ccpp_error_code,ccpp_error_message" +required_vars_temp="${required_vars_temp},coefficients_for_interpolation" +required_vars_temp="${required_vars_temp},horizontal_dimension" required_vars_temp="${required_vars_temp},horizontal_loop_begin" required_vars_temp="${required_vars_temp},horizontal_loop_end" required_vars_temp="${required_vars_temp},index_of_water_vapor_specific_humidity" @@ -157,7 +159,8 @@ required_vars_temp="${required_vars_temp},time_step_for_physics" required_vars_temp="${required_vars_temp},vertical_interface_dimension" required_vars_temp="${required_vars_temp},vertical_layer_dimension" required_vars_temp="${required_vars_temp},water_vapor_specific_humidity" -input_vars_temp="horizontal_dimension" +input_vars_temp="coefficients_for_interpolation" +input_vars_temp="${input_vars_temp},horizontal_dimension" input_vars_temp="${input_vars_temp},horizontal_loop_begin" input_vars_temp="${input_vars_temp},horizontal_loop_end" input_vars_temp="${input_vars_temp},index_of_water_vapor_specific_humidity" @@ -168,7 +171,9 @@ input_vars_temp="${input_vars_temp},surface_air_pressure,time_step_for_physics" input_vars_temp="${input_vars_temp},vertical_interface_dimension" input_vars_temp="${input_vars_temp},vertical_layer_dimension" input_vars_temp="${input_vars_temp},water_vapor_specific_humidity" -output_vars_temp="ccpp_error_code,ccpp_error_message,potential_temperature" +output_vars_temp="ccpp_error_code,ccpp_error_message" +output_vars_temp="${output_vars_temp},coefficients_for_interpolation" +output_vars_temp="${output_vars_temp},potential_temperature" output_vars_temp="${output_vars_temp},potential_temperature_at_interface" output_vars_temp="${output_vars_temp},surface_air_pressure" output_vars_temp="${output_vars_temp},water_vapor_specific_humidity" diff --git a/test/capgen_test/setup_coeffs.F90 b/test/capgen_test/setup_coeffs.F90 new file mode 100644 index 00000000..09452780 --- /dev/null +++ b/test/capgen_test/setup_coeffs.F90 @@ -0,0 +1,24 @@ +module setup_coeffs + use ccpp_kinds, ONLY: kind_phys + implicit none + + public :: setup_coeffs_timestep_init + +contains + !> \section arg_table_setup_coeffs_timestep_init Argument Table + !! \htmlinclude arg_table_setup_coeffs_timestep_init.html + !! + subroutine setup_coeffs_timestep_init(coeffs, errmsg, errflg) + + real(kind_phys), intent(inout) :: coeffs(:) + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + errmsg = '' + errflg = 0 + + coeffs(:) = 1._kind_phys + + end subroutine setup_coeffs_timestep_init + +end module setup_coeffs diff --git a/test/capgen_test/setup_coeffs.meta b/test/capgen_test/setup_coeffs.meta new file mode 100644 index 00000000..8d0fc5f4 --- /dev/null +++ b/test/capgen_test/setup_coeffs.meta @@ -0,0 +1,29 @@ +[ccpp-table-properties] + name = setup_coeffs + type = scheme +[ccpp-arg-table] + name = setup_coeffs_timestep_init + type = scheme +[ coeffs ] + standard_name = coefficients_for_interpolation + long_name = coefficients for interpolation + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=512 + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out diff --git a/test/capgen_test/temp_scheme_files.txt b/test/capgen_test/temp_scheme_files.txt index c2b56c0f..6c831539 100644 --- a/test/capgen_test/temp_scheme_files.txt +++ b/test/capgen_test/temp_scheme_files.txt @@ -1,3 +1,4 @@ +setup_coeffs.meta temp_set.meta temp_adjust.meta temp_calc_adjust.meta diff --git a/test/capgen_test/temp_suite.xml b/test/capgen_test/temp_suite.xml index 6fa836db..7a4795c4 100644 --- a/test/capgen_test/temp_suite.xml +++ b/test/capgen_test/temp_suite.xml @@ -2,6 +2,7 @@ + setup_coeffs temp_set diff --git a/test/capgen_test/test_host.F90 b/test/capgen_test/test_host.F90 index 056b30a0..ec352ae6 100644 --- a/test/capgen_test/test_host.F90 +++ b/test/capgen_test/test_host.F90 @@ -358,23 +358,26 @@ program test character(len=cs), target :: test_parts1(2) = (/ 'physics1 ', & 'physics2 ' /) character(len=cs), target :: test_parts2(1) = (/ 'data_prep ' /) - character(len=cm), target :: test_invars1(6) = (/ & + character(len=cm), target :: test_invars1(7) = (/ & 'potential_temperature ', & 'potential_temperature_at_interface ', & + 'coefficients_for_interpolation ', & 'surface_air_pressure ', & 'water_vapor_specific_humidity ', & 'potential_temperature_increment ', & 'time_step_for_physics ' /) - character(len=cm), target :: test_outvars1(6) = (/ & + character(len=cm), target :: test_outvars1(7) = (/ & 'potential_temperature ', & 'potential_temperature_at_interface ', & + 'coefficients_for_interpolation ', & 'surface_air_pressure ', & 'water_vapor_specific_humidity ', & 'ccpp_error_code ', & 'ccpp_error_message ' /) - character(len=cm), target :: test_reqvars1(8) = (/ & + character(len=cm), target :: test_reqvars1(9) = (/ & 'potential_temperature ', & 'potential_temperature_at_interface ', & + 'coefficients_for_interpolation ', & 'surface_air_pressure ', & 'water_vapor_specific_humidity ', & 'potential_temperature_increment ', & diff --git a/test/capgen_test/test_host_mod.F90 b/test/capgen_test/test_host_mod.F90 index d2f91136..43be333a 100644 --- a/test/capgen_test/test_host_mod.F90 +++ b/test/capgen_test/test_host_mod.F90 @@ -17,6 +17,7 @@ module test_host_mod integer, parameter :: index_qv = 1 real(kind_phys), allocatable :: temp_midpoints(:,:) real(kind_phys) :: temp_interfaces(ncols, pverP) + real(kind_phys) :: coeffs(ncols) real(kind_phys), dimension(DiagDimStart:ncols, DiagDimStart:pver) :: & diag1, & diag2 diff --git a/test/capgen_test/test_host_mod.meta b/test/capgen_test/test_host_mod.meta index 0d53f320..a450ee67 100644 --- a/test/capgen_test/test_host_mod.meta +++ b/test/capgen_test/test_host_mod.meta @@ -90,3 +90,9 @@ dimensions = (number_of_model_times) type = integer allocatable = True +[ coeffs ] + standard_name = coefficients_for_interpolation + long_name = coefficients for interpolation + units = none + dimensions = (horizontal_dimension) + type = real | kind = kind_phys \ No newline at end of file diff --git a/test/capgen_test/test_reports.py b/test/capgen_test/test_reports.py index da02aeea..8682a7b0 100644 --- a/test/capgen_test/test_reports.py +++ b/test/capgen_test/test_reports.py @@ -68,7 +68,7 @@ def usage(errmsg=None): os.path.join(_BUILD_DIR, "ccpp", "ccpp_ddt_suite_cap.F90"), os.path.join(_BUILD_DIR, "ccpp", "ccpp_temp_suite_cap.F90")] _PROCESS_LIST = ["setter=temp_set", "adjusting=temp_calc_adjust"] -_MODULE_LIST = ["environ_conditions", "make_ddt", "temp_adjust", +_MODULE_LIST = ["environ_conditions", "make_ddt", "setup_coeffs", "temp_adjust", "temp_calc_adjust", "temp_set"] _SUITE_LIST = ["ddt_suite", "temp_suite"] _INPUT_VARS_DDT = ["model_times", "number_of_model_times", @@ -85,17 +85,20 @@ def usage(errmsg=None): _REQUIRED_VARS_TEMP = ["ccpp_error_code", "ccpp_error_message", "potential_temperature", "potential_temperature_at_interface", + "coefficients_for_interpolation", "potential_temperature_increment", "surface_air_pressure", "time_step_for_physics", "water_vapor_specific_humidity"] _INPUT_VARS_TEMP = ["potential_temperature", "potential_temperature_at_interface", + "coefficients_for_interpolation", "potential_temperature_increment", "surface_air_pressure", "time_step_for_physics", "water_vapor_specific_humidity"] _OUTPUT_VARS_TEMP = ["ccpp_error_code", "ccpp_error_message", "potential_temperature", "potential_temperature_at_interface", + "coefficients_for_interpolation", "surface_air_pressure", "water_vapor_specific_humidity"] def fields_string(field_type, field_list, sep): From 0f416a21050418aaaa5991492802a433a685e2a0 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 27 Mar 2024 13:48:02 -0600 Subject: [PATCH 10/10] Add openmpi install to CI (#551) This PR adds to the CCPP Prebuild CI test to install open-mpi v4.1.6, which is now a requirement for CCPP. --------- Co-authored-by: dustinswales --- .github/workflows/prebuild.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/prebuild.yaml b/.github/workflows/prebuild.yaml index 3f8085fb..f65e6811 100644 --- a/.github/workflows/prebuild.yaml +++ b/.github/workflows/prebuild.yaml @@ -31,6 +31,17 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install open mpi + run: | + wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz + tar -xvf v4.1.6.tar.gz + cd ompi-4.1.6 + ./autogen.pl + ./configure --prefix=/home/runner/ompi-4.1.6 + make -j4 + make install + echo "LD_LIBRARY_PATH=/home/runner/ompi-4.1.6/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV + echo "PATH=/home/runner/ompi-4.1.6/bin:$PATH" >> $GITHUB_ENV - name: ccpp-prebuild unit tests run: | export PYTHONPATH=$(pwd)/scripts:$(pwd)/scripts/parse_tools