From e23e79cb5e97ae991bd54e86a448524b92ea4d24 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Mon, 19 Aug 2024 20:43:45 +0000 Subject: [PATCH] Update build for unit tests. Fixes #879. --- tests/chgres_cube/CMakeLists.txt | 2 +- tests/cpld_gridgen/CMakeLists.txt | 2 +- tests/emcsfc_snow2mdl/CMakeLists.txt | 2 +- tests/filter_topo/CMakeLists.txt | 4 ++-- tests/fre-nctools/shared_lib/CMakeLists.txt | 6 ------ tests/fre-nctools/shared_lib/tst_create_xgrid.c | 5 ++++- tests/fvcom_tools/CMakeLists.txt | 2 +- tests/global_cycle/CMakeLists.txt | 2 +- tests/ocnice_prep/CMakeLists.txt | 2 +- tests/sfc_climo_gen/CMakeLists.txt | 2 +- 10 files changed, 13 insertions(+), 16 deletions(-) diff --git a/tests/chgres_cube/CMakeLists.txt b/tests/chgres_cube/CMakeLists.txt index a5bb4ffff..55ebe2b96 100644 --- a/tests/chgres_cube/CMakeLists.txt +++ b/tests/chgres_cube/CMakeLists.txt @@ -20,7 +20,7 @@ endforeach() include (LibMPI) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/cpld_gridgen/CMakeLists.txt b/tests/cpld_gridgen/CMakeLists.txt index 62bffce77..2554db027 100644 --- a/tests/cpld_gridgen/CMakeLists.txt +++ b/tests/cpld_gridgen/CMakeLists.txt @@ -9,7 +9,7 @@ set(GRID_FILE "ocean_hgrid.nc") PULL_DATA(${CPLDGRIDGEN_URL} ${GRID_FILE}) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/emcsfc_snow2mdl/CMakeLists.txt b/tests/emcsfc_snow2mdl/CMakeLists.txt index ae43bf418..788423eb1 100644 --- a/tests/emcsfc_snow2mdl/CMakeLists.txt +++ b/tests/emcsfc_snow2mdl/CMakeLists.txt @@ -3,7 +3,7 @@ # # George Gayno -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/filter_topo/CMakeLists.txt b/tests/filter_topo/CMakeLists.txt index 0928b3e24..33bd0039a 100644 --- a/tests/filter_topo/CMakeLists.txt +++ b/tests/filter_topo/CMakeLists.txt @@ -3,8 +3,8 @@ # # George Gayno, Ed Hartnett -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real-size 64 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") endif() diff --git a/tests/fre-nctools/shared_lib/CMakeLists.txt b/tests/fre-nctools/shared_lib/CMakeLists.txt index 5827563c2..8054a6482 100644 --- a/tests/fre-nctools/shared_lib/CMakeLists.txt +++ b/tests/fre-nctools/shared_lib/CMakeLists.txt @@ -8,9 +8,3 @@ include_directories(${CMAKE_SOURCE_DIR}/sorc/fre-nctools.fd/shared_lib) add_executable(tst_create_xgrid tst_create_xgrid.c) add_test(NAME fre-nctools-tst_create_xgrid COMMAND tst_create_xgrid) target_link_libraries(tst_create_xgrid NetCDF::NetCDF_C shared_lib m) - - - - - - diff --git a/tests/fre-nctools/shared_lib/tst_create_xgrid.c b/tests/fre-nctools/shared_lib/tst_create_xgrid.c index 7fd0ae58b..561d76026 100644 --- a/tests/fre-nctools/shared_lib/tst_create_xgrid.c +++ b/tests/fre-nctools/shared_lib/tst_create_xgrid.c @@ -4,6 +4,9 @@ #include #include +#include "mosaic_util.h" +#include "create_xgrid.h" + #define D2R (M_PI/180) #define R2D (180/M_PI) #define MAXPOINT 1000 @@ -495,7 +498,7 @@ int main(int argc, char* argv[]) } area1 = (double *)malloc((nlon1)*(nlat1)*sizeof(double)); - get_grid_great_circle_area_(&nlon1, &nlat1, lon1_in, lat1_in, area1); + get_grid_great_circle_area(&nlon1, &nlat1, lon1_in, lat1_in, area1); printf("xgrid area sum is %g, grid 1 area is %g\n", area_sum, area1[0]); } diff --git a/tests/fvcom_tools/CMakeLists.txt b/tests/fvcom_tools/CMakeLists.txt index 125d2c956..dc3ccb41c 100644 --- a/tests/fvcom_tools/CMakeLists.txt +++ b/tests/fvcom_tools/CMakeLists.txt @@ -12,7 +12,7 @@ foreach(THE_FILE IN LISTS FVCOM_FILE SFCDATA_FILE) PULL_DATA(${FVCOM_URL} ${THE_FILE}) endforeach() -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/global_cycle/CMakeLists.txt b/tests/global_cycle/CMakeLists.txt index 7937d229c..2396f97d3 100644 --- a/tests/global_cycle/CMakeLists.txt +++ b/tests/global_cycle/CMakeLists.txt @@ -19,7 +19,7 @@ endforeach() # Include cmake to allow parallel I/O tests. include (LibMPI) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/ocnice_prep/CMakeLists.txt b/tests/ocnice_prep/CMakeLists.txt index 622d647d0..de13267e6 100644 --- a/tests/ocnice_prep/CMakeLists.txt +++ b/tests/ocnice_prep/CMakeLists.txt @@ -3,7 +3,7 @@ # # George Gayno, Ed Hartnett -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/sfc_climo_gen/CMakeLists.txt b/tests/sfc_climo_gen/CMakeLists.txt index 0067900d7..2c6dccf3b 100644 --- a/tests/sfc_climo_gen/CMakeLists.txt +++ b/tests/sfc_climo_gen/CMakeLists.txt @@ -20,7 +20,7 @@ PULL_DATA(${SFCGEN2_URL} ${VEG_FILE}) # Include cmake to allow parallel I/O tests. include (LibMPI) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8")