@@ -22,7 +22,7 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
2222
2323# Define the CMake project
2424project (FMS
25- VERSION 2026.01.0
25+ VERSION 2026.01.01
2626 DESCRIPTION "GFDL FMS Library"
2727 HOMEPAGE_URL "https://www.gfdl.noaa.gov/fms"
2828 LANGUAGES C Fortran )
@@ -65,18 +65,17 @@ option(PORTABLE_KINDS "Enable compiler definition -DPORTABLE_KINDS"
6565option (GFS_PHYS "Enable compiler definition -DGFS_PHYS" OFF )
6666option (LARGEFILE "Enable compiler definition -Duse_LARGEFILE" OFF )
6767option (WITH_YAML "Enable compiler definition -Duse_yaml" OFF )
68- option (USE_DEPRECATED_IO "THIS OPTION HAS NO EFFECT AND WILL BE REMOVED IN A FUTURE RELEASE" OFF )
6968
7069if (32BIT)
7170 list (APPEND kinds "r4" )
71+ message (STATUS "Building library with 4-byte real defaults (with mixed precision real support for most modules)." )
7272endif ()
7373if (64BIT)
7474 list (APPEND kinds "r8" )
75+ message (STATUS "Building library with 8-byte real defaults (with mixed precision real support for most modules)." )
7576endif ()
7677if (NOT kinds)
77- message (STATUS "Single Precision 32BIT: ${32BIT} " )
78- message (STATUS "Double Precision 64BIT: ${64BIT} " )
79- message (STATUS "No kind specified, building default double precision (with mixed precision support). Real size will not be included in built library name." )
78+ message (STATUS "Building library with 8-byte real defaults (with mixed precision 4-byte real support for most modules). Real size will not be included in built library name." )
8079endif ()
8180
8281# Find dependencies
@@ -181,6 +180,8 @@ list(APPEND fms_fortran_src_files
181180 mpp/mpp_memutils.F90
182181 mpp/mpp_parameter.F90
183182 mpp/mpp_utilities.F90
183+ offloading/offloading_io.F90
184+ offloading/metadata_transfer.F90
184185 parser/yaml_parser.F90
185186 parser/fms_yaml_output.F90
186187 platform/platform.F90
@@ -276,11 +277,6 @@ if(LARGEFILE)
276277 list (APPEND fms_defs use_LARGEFILE)
277278endif ()
278279
279- # Precision-based compiler definitions
280- if (32BIT)
281- list (APPEND r4_defs OVERLOAD_R4 OVERLOAD_R8)
282- endif ()
283-
284280# Add platform specific compiler definitions
285281if (APPLE )
286282 list (APPEND fms_defs __APPLE__)
@@ -291,7 +287,7 @@ include(fms_compiler_flags)
291287
292288# If netCDF was not built with HDF5 parallel I/O features, set up the macro -DNO_NC_PARALLEL4
293289IF (NOT NetCDF_PARALLEL)
294- MESSAGE (WARNING "netCDF was not build with HDF5 parallel I/O features, so collective netcdf io is not allowed" )
290+ MESSAGE (WARNING "netCDF was not build with HDF5 parallel I/O features, so parallel netcdf io is not allowed" )
295291 list (APPEND fms_defs NO_NC_PARALLEL4)
296292ENDIF ()
297293
@@ -347,7 +343,7 @@ foreach(kind ${kinds})
347343 amip_interp/include )
348344 target_compile_definitions (${libTgt} _f PRIVATE "${fms_defs} " )
349345 target_compile_definitions (${libTgt} _f PRIVATE "${${kind} _defs}" )
350- set_target_properties (${libTgt} _f PROPERTIES COMPILE_FLAGS ${${kind} _flags})
346+ set_target_properties (${libTgt} _f PROPERTIES COMPILE_FLAGS " ${${kind} _flags}" )
351347 set_target_properties (${libTgt} _f PROPERTIES Fortran_MODULE_DIRECTORY
352348 ${moduleDir} )
353349 target_link_libraries (${libTgt} _f PRIVATE NetCDF::NetCDF_Fortran
@@ -594,6 +590,14 @@ include(CTest)
594590set (MPI_LAUNCHER "mpirun" )
595591# used in the test-lib.sh.in to make it behave differently when parsed by cmake
596592set (USING_CMAKE "true" )
593+ # set the fms library to link tests with based on whats built
594+ if (NOT kinds)
595+ set (fmsLibraryName FMS::fms)
596+ elseif (64BIT)
597+ set (fmsLibraryName FMS::fms_r8)
598+ elseif (32BIT)
599+ set (fmsLibraryName FMS::fms_r4)
600+ endif ()
597601
598602# parse and add build info to test script util file
599603configure_file (${CMAKE_CURRENT_SOURCE_DIR } /test_fms/test-lib.sh.in ${CMAKE_CURRENT_SOURCE_DIR } /test-lib.sh
@@ -617,7 +621,7 @@ list(APPEND TEST_MODS_SRC
617621 test_fms/mpp/test_system_clock.F90)
618622
619623add_library (testLibs "${TEST_MODS_SRC} " )
620- target_link_libraries (testLibs FMS::fms )
624+ target_link_libraries (testLibs ${fmsLibraryName} )
621625target_compile_definitions (testLibs PRIVATE TEST_MOS_KIND_=r8_kind )
622626target_include_directories (testLibs PRIVATE ${CMAKE_CURRENT_BINARY_DIR } /include
623627 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR } /test_fms/common/include
@@ -701,6 +705,7 @@ list(APPEND TEST_SRC_SINGLE_TARGET
701705 test_fms/fms2_io/test_domain_io.F90
702706 test_fms/fms2_io/test_collective_io.F90
703707 test_fms/fms2_io/test_generalized_indices.F90
708+ test_fms/fms2_io/test_parallel_writes.F90
704709 test_fms/fms/test_fms.F90
705710 test_fms/interpolator/test_interpolator.F90
706711 test_fms/mpp/test_clock_init.F90
@@ -754,6 +759,8 @@ list(APPEND TEST_SRC_SINGLE_TARGET
754759 test_fms/parser/generic_blocks.F90
755760 test_fms/string_utils/test_string_utils.F90
756761 test_fms/time_manager/test_time_manager.F90
762+ test_fms/offloading/test_metadata_transfer.F90
763+ test_fms/offloading/test_io_offloading.F90
757764 )
758765# list any test sources that are used for two executables (r4 and r8)
759766list (APPEND TEST_SRC_TWO_TARGETS
@@ -778,6 +785,7 @@ list(APPEND TEST_SRC_TWO_TARGETS
778785 test_fms/sat_vapor_pres/test_sat_vapor_pres.F90
779786 test_fms/time_interp/test_time_interp.F90
780787 test_fms/time_interp/test_time_interp_external.F90
788+ test_fms/time_interp/test_time_interp_conservative_hi.F90
781789 test_fms/topography/test_topography.F90
782790 test_fms/tracer_manager/test_tracer_manager.F90
783791 test_fms/tridiagonal/test_tridiagonal.F90
@@ -789,14 +797,17 @@ list(APPEND TEST_SRC_FOUR_TARGETS
789797
790798# add all the test executables and set up linking + compile flags
791799foreach (testFile ${TEST_SRC_SINGLE_TARGET} )
792- get_filename_component (TName ${testFile} NAME_WE )
793800
801+ get_filename_component (TName ${testFile} NAME_WE )
794802 add_executable (${TName} ${testFile} )
795- target_compile_definitions (${TName} PRIVATE "${r8_defs} " )
796- set_target_properties (${TName} PROPERTIES COMPILE_FLAGS ${r8_flags} )
797- target_link_libraries (${TName} PUBLIC FMS::fms
798- PRIVATE testLibs
799- )
803+ target_link_libraries (${TName} PUBLIC ${fmsLibraryName}
804+ PRIVATE testLibs )
805+ if (32BIT)
806+ target_compile_definitions (${TName} PRIVATE "${r4_defs} ${fms_defs} " )
807+ else ()
808+ target_compile_definitions (${TName} PRIVATE "${r8_defs} ${fms_defs} " )
809+ set_target_properties (${TName} PROPERTIES COMPILE_FLAGS ${r8_flags} )
810+ endif ()
800811
801812 if (WITH_YAML)
802813 target_link_libraries (${TName} PRIVATE PkgConfig::YAML )
@@ -820,18 +831,16 @@ foreach (testFile ${TEST_SRC_TWO_TARGETS})
820831 get_filename_component (TName ${testFile} NAME_WE )
821832
822833 add_executable (${TName} _r8 ${testFile} )
823- target_compile_definitions (${TName} _r8 PRIVATE "${r8_defs} " )
834+ target_compile_definitions (${TName} _r8 PRIVATE "${r8_defs} ${fms_defs} " )
824835 set_target_properties (${TName} _r8 PROPERTIES COMPILE_FLAGS ${r8_flags} )
825- target_link_libraries (${TName} _r8 PUBLIC FMS::fms
826- PRIVATE testLibs
827- )
828-
836+ target_link_libraries (${TName} _r8 PUBLIC ${fmsLibraryName}
837+ PRIVATE testLibs )
829838 add_executable (${TName} _r4 ${testFile} )
830- target_compile_definitions (${TName} _r4 PRIVATE "${r4_defs} " )
839+ target_compile_definitions (${TName} _r4 PRIVATE "${r4_defs} ${fms_defs} " )
831840 # seems counterintuitive but r4 tests use r8 default
832841 # they specify kind values explicitly with the preprocessor where needed (TEST_FMS_KIND_)
833842 set_target_properties (${TName} _r4 PROPERTIES COMPILE_FLAGS ${r8_flags} )
834- target_link_libraries (${TName} _r4 PUBLIC FMS::fms
843+ target_link_libraries (${TName} _r4 PUBLIC ${fmsLibraryName}
835844 PRIVATE testLibs
836845 )
837846
@@ -984,8 +993,16 @@ foreach (testScript ${TEST_SCRIPTS})
984993 ENVIRONMENT "parser_skip=skip"
985994 )
986995 endif ()
996+
987997endforeach ()
988998
999+ # skip parallel netcdf tests if its not enabled in given install
1000+ IF (NOT NetCDF_PARALLEL)
1001+ set_tests_properties (test_collective_io PROPERTIES
1002+ ENVIRONMENT "parallel_skip=skip"
1003+ )
1004+ endif ()
1005+
9891006set (CMAKE_CTEST_ARGUMENTS "--output-on-failure" )
9901007
9911008### Package config
0 commit comments