diff --git a/.gitmodules b/.gitmodules index 09130b35b9..e69de29bb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "generic_tracers"] - path = src/access/generic_tracers - url = https://github.com/ACCESS-NRI/GFDL-generic-tracers.git diff --git a/bin/mkmf.template.ubuntu b/bin/mkmf.template.ubuntu index dceb222d67..726c00289c 100644 --- a/bin/mkmf.template.ubuntu +++ b/bin/mkmf.template.ubuntu @@ -20,7 +20,7 @@ MAKEFLAGS += --jobs=$(shell grep '^processor' /proc/cpuinfo | wc -l) FPPFLAGS := -FFLAGS := -fcray-pointer -fdefault-real-8 -ffree-line-length-none -fno-range-check -Waliasing -Wampersand -Warray-bounds -Wcharacter-truncation -Wconversion -Wline-truncation -Wintrinsics-std -Wsurprising -Wno-tabs -Wunderflow -Wunused-parameter -Wintrinsic-shadow -Wno-align-commons +FFLAGS := -fcray-pointer -fdefault-real-8 -ffree-line-length-none -fno-range-check -Waliasing -Wampersand -Warray-bounds -Wcharacter-truncation -Wconversion -Wline-truncation -Wintrinsics-std -Wsurprising -Wno-tabs -Wunderflow -Wunused-parameter -Wintrinsic-shadow -Wno-align-commons -fallow-argument-mismatch -fallow-invalid-boz FFLAGS += -I/usr/include/mpich2 -I/usr/include FFLAGS += -DGFORTRAN diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 14c7eff886..6e5a724d40 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1,133 +1,179 @@ -cmake_minimum_required(VERSION 3.6) -project(MOM5 C Fortran) +# Copyright ACCESS-NRI and contributors. See the top-level LICENSE file for details. -set(CMAKE_VERBOSE_MAKEFILE ON) +cmake_minimum_required(VERSION 3.18) -# make sure that the default is RELWITHDEBINFO -if (NOT CMAKE_BUILD_TYPE) - set (CMAKE_BUILD_TYPE RELWITHDEBINFO CACHE STRING - "Choose the type of build, options are: Debug Release Relwithdebinfo." - FORCE) +#[==============================================================================[ +# Basic project definition # +#]==============================================================================] + +project(MOM5 + DESCRIPTION "Modular Ocean Model 5" + HOMEPAGE_URL https://github.com/ACCESS-NRI/MOM5 + LANGUAGES C Fortran) + +#[==============================================================================[ +# Options # +#]==============================================================================] + +# CMake build type +if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo)$") + message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") + set(CMAKE_BUILD_TYPE + "RelWithDebInfo" + CACHE STRING "Choose the type of build." FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo") endif() -message("Build type: " ${CMAKE_BUILD_TYPE}) - -# If your system uses a bespoke MPI compiler wrapper then define this on the -# command line using the MPIFORT_EXE and MPICC_EXE environment variables -if ((DEFINED ENV{MPIFORT_EXE}) AND (DEFINED ENV{MPICC_EXE})) - message("mpifort executable defined: " $ENV{MPIFORT_EXE}) - message("Will assume system MPI implementation is sound. Remove MPIFORT_EXE from environment to automatically configure MPI") - set(CMAKE_Fortran_COMPILER $ENV{MPIFORT_EXE}) - message("mpicc executable found: " $ENV{MPICC_EXE}) - message("Will assume system MPI implementation is sound. Remove MPICC_EXE from environment to automatically configure MPI") - set(CMAKE_C_COMPILER $ENV{MPICC_EXE}) -else () - if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND (ENV{FC} STREQUAL "gfortran" AND ENV{CC} STREQUAL "gcc")) - # Use compiler wrappers if FC and CC are default values - SET( CMAKE_Fortran_COMPILER mpif90 ) - SET( CMAKE_C_COMPILER mpicc ) - endif() + +# MOM5 build types +set(MOM5_TYPE "MOM5_SOLO" CACHE STRING "Build type of the model") + +set(ALLOWED_TYPES MOM5_SOLO MOM5_SIS MOM5_ACCESS_CM MOM5_ACCESS_OM MOM5_ACCESS_ESM MOM5_ACCESS_OM_BGC) +if(NOT MOM5_TYPE IN_LIST ALLOWED_TYPES) + message(FATAL_ERROR "${MOM5_TYPE} is not a valid build type. Allowed types are: ${ALLOWED_TYPES}") endif() -find_package(MPI REQUIRED COMPONENTS Fortran) +message(STATUS "Build type = ${MOM5_TYPE}") -message("Using Fortran: ${MPI_Fortran_COMPILER} ${CMAKE_Fortran_COMPILER} and C: ${MPI_C_COMPILER} ${CMAKE_C_COMPILER}") +# Build options +option(MOM5_USE_NETCDF3 "Use netCDF3 rather than netCDF4. Only relevant for MOM5_TYPEs that use internal FMS" OFF) +option(MOM5_DETERMINISTIC "Deterministic build" OFF) -if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") - set(CMAKE_Fortran_FLAGS "-fno-alias -stack-temps -safe-cray-ptr -ftz -shared-intel -assume byterecl -i4 -r8 -nowarn -sox -traceback") - set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fp-model source") - set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELEASE} -g") - set(CMAKE_Fortran_FLAGS_DEBUG "-g -O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fpe0 -ftrapuv") +message(STATUS "Build options") +message(STATUS " - MOM5_USE_NETCDF3 ${MOM5_USE_NETCDF3}") +message(STATUS " - MOM5_DETERMINISTIC ${MOM5_DETERMINISTIC}" ) + +#[==============================================================================[ +# Project configuration # +#]==============================================================================] + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}) +include(CheckFortranCompilerFlag) + +# Fortran compiler flags +if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-alias -safe-cray-ptr -fpe0 -ftz -assume byterecl -i4 -r8 -nowarn -check noarg_temp_created -assume nobuffered_io -convert big_endian -grecord-gcc-switches -fp-model precise -fp-model source -align all") + if (MOM5_DETERMINISTIC) + set(CMAKE_Fortran_FLAGS_RELEASE "-g0 -O0 -xCORE-AVX2 -debug none -check none") + else() + set(CMAKE_Fortran_FLAGS_RELEASE "-g3 -O2 -xCORE-AVX2 -debug all -check none -traceback") + endif() + set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELEASE} -g") + set(CMAKE_Fortran_FLAGS_DEBUG "-g3 -O0 -debug all -check -check noarg_temp_created -check nopointer -warn -warn noerrors -ftrapuv -traceback") elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") - include(CheckFortranCompilerFlag) - set(CMAKE_Fortran_FLAGS "-fcray-pointer -fdefault-real-8 -fdefault-double-8 -Waliasing -ffree-line-length-none -fno-range-check -fbacktrace") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer -fdefault-real-8 -ffree-line-length-none -fno-range-check -Waliasing -Wampersand -Warray-bounds -Wcharacter-truncation -Wconversion -Wline-truncation -Wintrinsics-std -Wsurprising -Wno-tabs -Wunderflow -Wunused-parameter -Wintrinsic-shadow -Wno-align-commons") check_fortran_compiler_flag("-fallow-invalid-boz" _boz_flag) check_fortran_compiler_flag("-fallow-argument-mismatch" _argmis_flag) if(_boz_flag) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-invalid-boz" ) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-invalid-boz" ) endif() if(_argmis_flag) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch" ) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch" ) endif() - set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fbounds-check") - set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELEASE} -g") - set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -W -fbounds-check -ffpe-trap=invalid,zero,overflow") + set(CMAKE_Fortran_FLAGS_RELEASE "-O2") + set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELEASE} -g") + set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -W -fbounds-check") else () - message ("Unknown Fortran compiler default flags only...") + message(WARNING "Fortran compiler with ID ${CMAKE_Fortran_COMPILER_ID} will be used with CMake default options") endif() -execute_process(COMMAND nf-config --includedir OUTPUT_VARIABLE NETCDF_INCDIR OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND nf-config --flibs OUTPUT_VARIABLE NETCDF_FLIBS OUTPUT_STRIP_TRAILING_WHITESPACE) -set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -I${NETCDF_INCDIR}") -# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${NETCDF_FLIBS}") - -message("Linker flags: ${CMAKE_EXE_LINKER_FLAGS}") - -if(CMAKE_C_COMPILER_ID STREQUAL "Intel") - set(CMAKE_C_FLAGS "-sox -traceback") - set(CMAKE_C_FLAGS_DEBUG "-O0 -debug") - set(CMAKE_C_FLAGS_RELEASE "-O2 -debug minimal") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} -g") - add_compile_definitions(__IFC) +# C compiler flags +if(CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise") + if (MOM5_DETERMINISTIC) + set(CMAKE_C_FLAGS_RELEASE "-O0 -debug none -xCORE-AVX2") + else() + set(CMAKE_C_FLAGS_RELEASE "-O2 -debug minimal -xCORE-AVX2") + endif() + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} -g") + set(CMAKE_C_FLAGS_DEBUG "-O0 -g -ftrapuv -traceback") +elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise -fp-model source") + if (MOM5_DETERMINISTIC) + set(CMAKE_C_FLAGS_RELEASE "-O0 -debug none -xCORE-AVX2") + else() + set(CMAKE_C_FLAGS_RELEASE "-O2 -debug minimal -xCORE-AVX2") + endif() + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} -g") + set(CMAKE_C_FLAGS_DEBUG "-O0 -g -ftrapuv -traceback") elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU") - set(CMAKE_C_FLAGS "-frecord-gcc-switches") - set(CMAKE_C_FLAGS_DEBUG "-O0 -Werror -Wuninitialized -Wno-stringop-overflow") - set(CMAKE_C_FLAGS_RELEASE "-O2") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} -g") + set(CMAKE_C_FLAGS_RELEASE "-O2") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} -g") + set(CMAKE_C_FLAGS_DEBUG "-O0 -g") else () - message ("Unknown C compiler default flags only...") + message(WARNING "C compiler with ID ${CMAKE_C_COMPILER_ID} will be used with CMake default options") +endif() + +#[==============================================================================[ +# External packages # +#]==============================================================================] + +find_package(MPI REQUIRED COMPONENTS Fortran) + +if (MOM5_TYPE MATCHES "MOM5_ACCESS") + # External FMS, provides NetCDF interface + find_package(fms COMPONENTS R8 REQUIRED) + find_package(GFDLGTracers REQUIRED) +else() + # Internal FMS, requires NetCDF + find_package(NetCDF 4.7.3 REQUIRED Fortran) +endif() + +if (MOM5_TYPE STREQUAL "MOM5_ACCESS_OM" OR + MOM5_TYPE STREQUAL "MOM5_ACCESS_OM_BGC") + find_package(libaccessom2 REQUIRED) endif() -execute_process(COMMAND nc-config --cflags OUTPUT_VARIABLE NETCDF_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NETCDF_CFLAGS}") - -# Transfer command line setting of CPP defs to CMake -set(CPPDEFS - use_netCDF - use_netCDF3 - use_netCDF4 - use_libMPI - SPMD - ENABLE - ODA - USE_OCEAN_BGC - LAND_BND_TRACERS - OVERLOAD_C8 - OVERLOAD_C4 - OVERLOAD_R4 -) -foreach(VAR ${CPPDEFS}) - if(${VAR}) - message("Setting CPP def ${VAR}") - add_compile_definitions(${VAR}) - endif() -endforeach() -string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE) -message("Using Fortran flags: ${CMAKE_Fortran_FLAGS} ${CMAKE_Fortran_FLAGS_${BUILD_TYPE}}") +if (MOM5_TYPE STREQUAL "MOM5_ACCESS_ESM" OR + MOM5_TYPE STREQUAL "MOM5_ACCESS_CM") + find_package(PkgConfig REQUIRED) + pkg_check_modules(OASIS3MCT REQUIRED IMPORTED_TARGET "oasis3-mct") + pkg_check_modules(OASIS3MPEU REQUIRED IMPORTED_TARGET "oasis3-mpeu") + pkg_check_modules(OASIS3PSMILE REQUIRED IMPORTED_TARGET "oasis3-psmile.MPI1") + pkg_check_modules(OASIS3SCRIP REQUIRED IMPORTED_TARGET "oasis3-scrip") +endif() -set(CMAKE_DEBUG_TARGET_PROPERTIES - # INCLUDE_DIRECTORIES - # COMPILE_DEFINITIONS - # POSITION_INDEPENDENT_CODE - # CONTAINER_SIZE_REQUIRED - # LIB_VERSION - ) +#[==============================================================================[ +# Main definitions # +#]==============================================================================] set(SRC_DIR "${CMAKE_SOURCE_DIR}/../src") -add_subdirectory(version) -add_subdirectory(FMS) -add_subdirectory(ocean) -add_subdirectory(atmos_bg) -add_subdirectory(atmos_ebm) -add_subdirectory(atmos_fv) -add_subdirectory(atmos_null) -add_subdirectory(atmos_phys) -add_subdirectory(land_null) -add_subdirectory(land_lad) -add_subdirectory(land_lad2) -add_subdirectory(ice_sis) -add_subdirectory(MOM5_solo) -add_subdirectory(MOM5_SIS) -add_subdirectory(MOM5_CM2M) -add_subdirectory(MOM5_ESM2M) -add_subdirectory(MOM5_ICCM) -add_subdirectory(MOM5_EBM) +add_compile_definitions(use_netCDF use_libMPI __IFC) + +if (MOM5_USE_NETCDF3) + add_compile_definitions(use_netCDF3) +else () + add_compile_definitions(use_netCDF4) +endif() + +if (MOM5_TYPE STREQUAL "MOM5_ACCESS_OM") + set(ACCESS_COMPILE_DEFS ACCESS_OM USE_OCEAN_BGC) +elseif (MOM5_TYPE STREQUAL "MOM5_ACCESS_OM_BGC") + set(ACCESS_COMPILE_DEFS ACCESS_OM CSIRO_BGC) +elseif (MOM5_TYPE STREQUAL "MOM5_ACCESS_ESM") + set(ACCESS_COMPILE_DEFS ACCESS_CM USE_OCEAN_BGC) +elseif (MOM5_TYPE STREQUAL "MOM5_ACCESS_CM") + set(ACCESS_COMPILE_DEFS ACCESS_CM) +else() + add_compile_definitions(USE_OCEAN_BGC ENABLE_ODA SPMD LAND_BND_TRACERS) +endif() + +if (MOM5_TYPE STREQUAL "MOM5_SOLO") + add_subdirectory(fms_mom5) + add_subdirectory(ocean) + add_subdirectory(mom5_solo) +elseif (MOM5_TYPE STREQUAL "MOM5_SIS") + add_subdirectory(fms_mom5) + add_subdirectory(ocean) + add_subdirectory(ice_sis) + add_subdirectory(atmos_null) + add_subdirectory(land_null) + add_subdirectory(mom5_sis) +elseif (MOM5_TYPE STREQUAL "MOM5_ACCESS_OM" OR + MOM5_TYPE STREQUAL "MOM5_ACCESS_OM_BGC") + add_subdirectory(ocean_access) + add_subdirectory(mom5_access_om) +elseif (MOM5_TYPE STREQUAL "MOM5_ACCESS_ESM" OR + MOM5_TYPE STREQUAL "MOM5_ACCESS_CM") + add_subdirectory(ocean_access) + add_subdirectory(mom5_access_cm) +endif() diff --git a/cmake/FMS/CMakeLists.txt b/cmake/FMS/CMakeLists.txt deleted file mode 100644 index 3046865ba2..0000000000 --- a/cmake/FMS/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(FMS_DIR "${SRC_DIR}/shared") - -# FMS static library -file(GLOB_RECURSE FMS_SOURCE LIST_DIRECTORIES false - ${FMS_DIR}/*.[fF]90 ${FMS_DIR}/*.c) - -add_library(FMS ${FMS_SOURCE}) - -target_include_directories(FMS PRIVATE - ${FMS_DIR}/include - ${FMS_DIR}/mosaic - ${FMS_DIR}/drifters - ${FMS_DIR}/fms - ${FMS_DIR}/mpp/include -) \ No newline at end of file diff --git a/cmake/FindNetCDF.cmake b/cmake/FindNetCDF.cmake new file mode 100644 index 0000000000..1439ae8486 --- /dev/null +++ b/cmake/FindNetCDF.cmake @@ -0,0 +1,337 @@ +# (C) Copyright 2011- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation nor +# does it submit to any jurisdiction. + +# Try to find NetCDF includes and library. +# Supports static and shared libaries and allows each component to be found in sepearte prefixes. +# +# This module defines +# +# - NetCDF_FOUND - System has NetCDF +# - NetCDF_INCLUDE_DIRS - the NetCDF include directories +# - NetCDF_VERSION - the version of NetCDF +# - NetCDF_CONFIG_EXECUTABLE - the netcdf-config executable if found +# - NetCDF_PARALLEL - Boolean True if NetCDF4 has parallel IO support via hdf5 and/or pnetcdf +# - NetCDF_HAS_PNETCDF - Boolean True if NetCDF4 has pnetcdf support +# +# Deprecated Defines +# - NetCDF_LIBRARIES - [Deprecated] Use NetCDF::NetCDF_ targets instead. +# +# +# Following components are available: +# +# - C - C interface to NetCDF (netcdf) +# - CXX - CXX4 interface to NetCDF (netcdf_c++4) +# - Fortran - Fortran interface to NetCDF (netcdff) +# +# For each component the following are defined: +# +# - NetCDF__FOUND - whether the component is found +# - NetCDF__LIBRARIES - the libraries for the component +# - NetCDF__LIBRARY_SHARED - Boolean is true if libraries for component are shared +# - NetCDF__INCLUDE_DIRS - the include directories for specified component +# - NetCDF::NetCDF_ - target of component to be used with target_link_libraries() +# +# The following paths will be searched in order if set in CMake (first priority) or environment (second priority) +# +# - NetCDF_ROOT - root of NetCDF installation +# - NetCDF_PATH - root of NetCDF installation +# +# The search process begins with locating NetCDF Include headers. If these are in a non-standard location, +# set one of the following CMake or environment variables to point to the location: +# +# - NetCDF_INCLUDE_DIR or NetCDF_${comp}_INCLUDE_DIR +# - NetCDF_INCLUDE_DIRS or NetCDF_${comp}_INCLUDE_DIR +# +# Notes: +# +# - Use "NetCDF::NetCDF_" targets only. NetCDF_LIBRARIES exists for backwards compatibility and should not be used. +# - These targets have all the knowledge of include directories and library search directories, and a single +# call to target_link_libraries will provide all these transitive properties to your target. Normally all that is +# needed to build and link against NetCDF is, e.g.: +# target_link_libraries(my_c_tgt PUBLIC NetCDF::NetCDF_C) +# - "NetCDF" is always the preferred naming for this package, its targets, variables, and environment variables +# - For compatibility, some variables are also set/checked using alternate names NetCDF4, NETCDF, or NETCDF4 +# - Environments relying on these older environment variable names should move to using a "NetCDF_ROOT" environment variable +# - Preferred component capitalization follows the CMake LANGUAGES variables: i.e., C, Fortran, CXX +# - For compatibility, alternate capitalizations are supported but should not be used. +# - If no components are defined, all components will be searched +# + +list( APPEND _possible_components C CXX Fortran ) + +## Include names for each component +set( NetCDF_C_INCLUDE_NAME netcdf.h ) +set( NetCDF_CXX_INCLUDE_NAME netcdf ) +set( NetCDF_Fortran_INCLUDE_NAME netcdf.mod ) + +## Library names for each component +set( NetCDF_C_LIBRARY_NAME netcdf ) +set( NetCDF_CXX_LIBRARY_NAME netcdf_c++4 ) +set( NetCDF_Fortran_LIBRARY_NAME netcdff ) + +## Enumerate search components +foreach( _comp ${_possible_components} ) + string( TOUPPER "${_comp}" _COMP ) + set( _arg_${_COMP} ${_comp} ) + set( _name_${_COMP} ${_comp} ) +endforeach() + +set( _search_components C) +foreach( _comp ${${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS} ) + string( TOUPPER "${_comp}" _COMP ) + set( _arg_${_COMP} ${_comp} ) + list( APPEND _search_components ${_name_${_COMP}} ) + if( NOT _name_${_COMP} ) + message(SEND_ERROR "Find${CMAKE_FIND_PACKAGE_NAME}: COMPONENT ${_comp} is not a valid component. Valid components: ${_possible_components}" ) + endif() +endforeach() +list( REMOVE_DUPLICATES _search_components ) + +## Search hints for finding include directories and libraries +foreach( _comp IN ITEMS "_" "_C_" "_Fortran_" "_CXX_" ) + foreach( _name IN ITEMS NetCDF4 NetCDF NETCDF4 NETCDF ) + foreach( _var IN ITEMS ROOT PATH ) + list(APPEND _search_hints ${${_name}${_comp}${_var}} $ENV{${_name}${_comp}${_var}} ) + list(APPEND _include_search_hints + ${${_name}${_comp}INCLUDE_DIR} $ENV{${_name}${_comp}INCLUDE_DIR} + ${${_name}${_comp}INCLUDE_DIRS} $ENV{${_name}${_comp}INCLUDE_DIRS} ) + endforeach() + endforeach() +endforeach() +#Old-school HPC module env variable names +foreach( _name IN ITEMS NetCDF4 NetCDF NETCDF4 NETCDF ) + foreach( _comp IN ITEMS "_C" "_Fortran" "_CXX" ) + list(APPEND _search_hints ${${_name}} $ENV{${_name}}) + list(APPEND _search_hints ${${_name}${_comp}} $ENV{${_name}${_comp}}) + endforeach() +endforeach() + +## Find headers for each component +set(NetCDF_INCLUDE_DIRS) +set(_new_search_components) +foreach( _comp IN LISTS _search_components ) + if(NOT ${PROJECT_NAME}_NetCDF_${_comp}_FOUND) + list(APPEND _new_search_components ${_comp}) + endif() + find_file(NetCDF_${_comp}_INCLUDE_FILE + NAMES ${NetCDF_${_comp}_INCLUDE_NAME} + DOC "NetCDF ${_comp} include directory" + HINTS ${_include_search_hints} ${_search_hints} + PATH_SUFFIXES include include/netcdf + ) + mark_as_advanced(NetCDF_${_comp}_INCLUDE_FILE) + message(DEBUG "NetCDF_${_comp}_INCLUDE_FILE: ${NetCDF_${_comp}_INCLUDE_FILE}") + if( NetCDF_${_comp}_INCLUDE_FILE ) + get_filename_component(NetCDF_${_comp}_INCLUDE_FILE ${NetCDF_${_comp}_INCLUDE_FILE} ABSOLUTE) + get_filename_component(NetCDF_${_comp}_INCLUDE_DIR ${NetCDF_${_comp}_INCLUDE_FILE} DIRECTORY) + list(APPEND NetCDF_INCLUDE_DIRS ${NetCDF_${_comp}_INCLUDE_DIR}) + endif() +endforeach() +if(NetCDF_INCLUDE_DIRS) + list(REMOVE_DUPLICATES NetCDF_INCLUDE_DIRS) +endif() +set(NetCDF_INCLUDE_DIRS "${NetCDF_INCLUDE_DIRS}" CACHE STRING "NetCDF Include directory paths" FORCE) + +## Find n*-config executables for search components +foreach( _comp IN LISTS _search_components ) + if( _comp MATCHES "^(C)$" ) + set(_conf "c") + elseif( _comp MATCHES "^(Fortran)$" ) + set(_conf "f") + elseif( _comp MATCHES "^(CXX)$" ) + set(_conf "cxx4") + endif() + find_program( NetCDF_${_comp}_CONFIG_EXECUTABLE + NAMES n${_conf}-config + HINTS ${NetCDF_INCLUDE_DIRS} ${_include_search_hints} ${_search_hints} + PATH_SUFFIXES bin Bin ../bin ../../bin + DOC "NetCDF n${_conf}-config helper" ) + message(DEBUG "NetCDF_${_comp}_CONFIG_EXECUTABLE: ${NetCDF_${_comp}_CONFIG_EXECUTABLE}") +endforeach() + +set(_C_libs_flag --libs) +set(_Fortran_libs_flag --flibs) +set(_CXX_libs_flag --libs) +set(_C_includes_flag --includedir) +set(_Fortran_includes_flag --includedir) +set(_CXX_includes_flag --includedir) +function(netcdf_config exec flag output_var) + set(${output_var} False PARENT_SCOPE) + if( exec ) + execute_process( COMMAND ${exec} ${flag} RESULT_VARIABLE _ret OUTPUT_VARIABLE _val) + if( _ret EQUAL 0 ) + string( STRIP ${_val} _val ) + set( ${output_var} ${_val} PARENT_SCOPE ) + endif() + endif() +endfunction() + +## Find libraries for each component +set( NetCDF_LIBRARIES ) +foreach( _comp IN LISTS _search_components ) + string( TOUPPER "${_comp}" _COMP ) + + find_library( NetCDF_${_comp}_LIBRARY + NAMES ${NetCDF_${_comp}_LIBRARY_NAME} + DOC "NetCDF ${_comp} library" + HINTS ${NetCDF_${_comp}_INCLUDE_DIRS} ${_search_hints} + PATH_SUFFIXES lib64 lib ../lib64 ../lib ../../lib64 ../../lib ) + mark_as_advanced( NetCDF_${_comp}_LIBRARY ) + get_filename_component(NetCDF_${_comp}_LIBRARY ${NetCDF_${_comp}_LIBRARY} ABSOLUTE) + set(NetCDF_${_comp}_LIBRARY ${NetCDF_${_comp}_LIBRARY} CACHE STRING "NetCDF ${_comp} library" FORCE) + message(DEBUG "NetCDF_${_comp}_LIBRARY: ${NetCDF_${_comp}_LIBRARY}") + + if( NetCDF_${_comp}_LIBRARY ) + if( NetCDF_${_comp}_LIBRARY MATCHES ".a$" ) + set( NetCDF_${_comp}_LIBRARY_SHARED FALSE ) + set( _library_type STATIC) + else() + list( APPEND NetCDF_LIBRARIES ${NetCDF_${_comp}_LIBRARY} ) + set( NetCDF_${_comp}_LIBRARY_SHARED TRUE ) + set( _library_type SHARED) + endif() + endif() + + #Use nc-config to set per-component LIBRARIES variable if possible + netcdf_config( ${NetCDF_${_comp}_CONFIG_EXECUTABLE} ${_${_comp}_libs_flag} _val ) + if( _val ) + set( NetCDF_${_comp}_LIBRARIES ${_val} ) + if(NOT NetCDF_${_comp}_LIBRARY_SHARED AND NOT NetCDF_${_comp}_FOUND) #Static targets should use nc_config to get a proper link line with all necessary static targets. + list( APPEND NetCDF_LIBRARIES ${NetCDF_${_comp}_LIBRARIES} ) + endif() + else() + set( NetCDF_${_comp}_LIBRARIES ${NetCDF_${_comp}_LIBRARY} ) + if(NOT NetCDF_${_comp}_LIBRARY_SHARED) + message(SEND_ERROR "Unable to properly find NetCDF. Found static libraries at: ${NetCDF_${_comp}_LIBRARY} but could not run nc-config: ${NetCDF_CONFIG_EXECUTABLE}") + endif() + endif() + + #Use nc-config to set per-component INCLUDE_DIRS variable if possible + netcdf_config( ${NetCDF_${_comp}_CONFIG_EXECUTABLE} ${_${_comp}_includes_flag} _val ) + if( _val ) + string( REPLACE " " ";" _val ${_val} ) + set( NetCDF_${_comp}_INCLUDE_DIRS ${_val} ) + else() + set( NetCDF_${_comp}_INCLUDE_DIRS ${NetCDF_${_comp}_INCLUDE_DIR} ) + endif() + + if( NetCDF_${_comp}_LIBRARIES AND NetCDF_${_comp}_INCLUDE_DIRS ) + set( ${CMAKE_FIND_PACKAGE_NAME}_${_arg_${_COMP}}_FOUND TRUE ) + if (NOT TARGET NetCDF::NetCDF_${_comp}) + add_library(NetCDF::NetCDF_${_comp} ${_library_type} IMPORTED) + set_target_properties(NetCDF::NetCDF_${_comp} PROPERTIES + IMPORTED_LOCATION ${NetCDF_${_comp}_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES "${NetCDF_${_comp}_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES ${NetCDF_${_comp}_LIBRARIES} ) + endif() + endif() +endforeach() +if(NetCDF_LIBRARIES AND NetCDF_${_comp}_LIBRARY_SHARED) + list(REMOVE_DUPLICATES NetCDF_LIBRARIES) +endif() +set(NetCDF_LIBRARIES "${NetCDF_LIBRARIES}" CACHE STRING "NetCDF library targets" FORCE) + +## Find version via netcdf-config if possible +if (NetCDF_INCLUDE_DIRS) + if( NetCDF_C_CONFIG_EXECUTABLE ) + netcdf_config( ${NetCDF_C_CONFIG_EXECUTABLE} --version _vers ) + if( _vers ) + string(REGEX REPLACE ".* ((([0-9]+)\\.)+([0-9]+)).*" "\\1" NetCDF_VERSION "${_vers}" ) + endif() + else() + foreach( _dir IN LISTS NetCDF_INCLUDE_DIRS) + if( EXISTS "${_dir}/netcdf_meta.h" ) + file(STRINGS "${_dir}/netcdf_meta.h" _netcdf_version_lines + REGEX "#define[ \t]+NC_VERSION_(MAJOR|MINOR|PATCH|NOTE)") + string(REGEX REPLACE ".*NC_VERSION_MAJOR *\([0-9]*\).*" "\\1" _netcdf_version_major "${_netcdf_version_lines}") + string(REGEX REPLACE ".*NC_VERSION_MINOR *\([0-9]*\).*" "\\1" _netcdf_version_minor "${_netcdf_version_lines}") + string(REGEX REPLACE ".*NC_VERSION_PATCH *\([0-9]*\).*" "\\1" _netcdf_version_patch "${_netcdf_version_lines}") + string(REGEX REPLACE ".*NC_VERSION_NOTE *\"\([^\"]*\)\".*" "\\1" _netcdf_version_note "${_netcdf_version_lines}") + set(NetCDF_VERSION "${_netcdf_version_major}.${_netcdf_version_minor}.${_netcdf_version_patch}${_netcdf_version_note}") + unset(_netcdf_version_major) + unset(_netcdf_version_minor) + unset(_netcdf_version_patch) + unset(_netcdf_version_note) + unset(_netcdf_version_lines) + endif() + endforeach() + endif() +endif () + +## Detect additional package properties +netcdf_config(${NetCDF_C_CONFIG_EXECUTABLE} --has-parallel4 _val) +if( NOT _val MATCHES "^(yes|no)$" ) + netcdf_config(${NetCDF_C_CONFIG_EXECUTABLE} --has-parallel _val) +endif() +if( _val MATCHES "^(yes)$" ) + set(NetCDF_PARALLEL TRUE CACHE STRING "NetCDF has parallel IO capability via pnetcdf or hdf5." FORCE) +else() + set(NetCDF_PARALLEL FALSE CACHE STRING "NetCDF has no parallel IO capability." FORCE) +endif() + +## Finalize find_package +include(FindPackageHandleStandardArgs) + +if(NOT NetCDF_FOUND OR _new_search_components) + find_package_handle_standard_args( ${CMAKE_FIND_PACKAGE_NAME} + REQUIRED_VARS NetCDF_INCLUDE_DIRS NetCDF_LIBRARIES + VERSION_VAR NetCDF_VERSION + HANDLE_COMPONENTS ) +endif() + +foreach( _comp IN LISTS _search_components ) + if( NetCDF_${_comp}_FOUND ) + #Record found components to avoid duplication in NetCDF_LIBRARIES for static libraries + set(NetCDF_${_comp}_FOUND ${NetCDF_${_comp}_FOUND} CACHE BOOL "NetCDF ${_comp} Found" FORCE) + #Set a per-package, per-component found variable to communicate between multiple calls to find_package() + set(${PROJECT_NAME}_NetCDF_${_comp}_FOUND True) + endif() +endforeach() + +if( ${CMAKE_FIND_PACKAGE_NAME}_FOUND AND NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY AND _new_search_components) + message( STATUS "Find${CMAKE_FIND_PACKAGE_NAME} defines targets:" ) + message( STATUS " - NetCDF_VERSION [${NetCDF_VERSION}]") + message( STATUS " - NetCDF_PARALLEL [${NetCDF_PARALLEL}]") + foreach( _comp IN LISTS _new_search_components ) + string( TOUPPER "${_comp}" _COMP ) + message( STATUS " - NetCDF_${_comp}_CONFIG_EXECUTABLE [${NetCDF_${_comp}_CONFIG_EXECUTABLE}]") + if( ${CMAKE_FIND_PACKAGE_NAME}_${_arg_${_COMP}}_FOUND ) + get_filename_component(_root ${NetCDF_${_comp}_INCLUDE_DIR}/.. ABSOLUTE) + if( NetCDF_${_comp}_LIBRARY_SHARED ) + message( STATUS " - NetCDF::NetCDF_${_comp} [SHARED] [Root: ${_root}] Lib: ${NetCDF_${_comp}_LIBRARY} ") + else() + message( STATUS " - NetCDF::NetCDF_${_comp} [STATIC] [Root: ${_root}] Lib: ${NetCDF_${_comp}_LIBRARY} ") + endif() + endif() + endforeach() +endif() + +foreach( _prefix NetCDF NetCDF4 NETCDF NETCDF4 ${CMAKE_FIND_PACKAGE_NAME} ) + set( ${_prefix}_INCLUDE_DIRS ${NetCDF_INCLUDE_DIRS} ) + set( ${_prefix}_LIBRARIES ${NetCDF_LIBRARIES}) + set( ${_prefix}_VERSION ${NetCDF_VERSION} ) + set( ${_prefix}_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_FOUND} ) + set( ${_prefix}_CONFIG_EXECUTABLE ${NetCDF_CONFIG_EXECUTABLE} ) + set( ${_prefix}_PARALLEL ${NetCDF_PARALLEL} ) + + foreach( _comp ${_search_components} ) + string( TOUPPER "${_comp}" _COMP ) + set( _arg_comp ${_arg_${_COMP}} ) + set( ${_prefix}_${_comp}_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_${_arg_comp}_FOUND} ) + set( ${_prefix}_${_COMP}_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_${_arg_comp}_FOUND} ) + set( ${_prefix}_${_arg_comp}_FOUND ${${CMAKE_FIND_PACKAGE_NAME}_${_arg_comp}_FOUND} ) + + set( ${_prefix}_${_comp}_LIBRARIES ${NetCDF_${_comp}_LIBRARIES} ) + set( ${_prefix}_${_COMP}_LIBRARIES ${NetCDF_${_comp}_LIBRARIES} ) + set( ${_prefix}_${_arg_comp}_LIBRARIES ${NetCDF_${_comp}_LIBRARIES} ) + + set( ${_prefix}_${_comp}_INCLUDE_DIRS ${NetCDF_${_comp}_INCLUDE_DIRS} ) + set( ${_prefix}_${_COMP}_INCLUDE_DIRS ${NetCDF_${_comp}_INCLUDE_DIRS} ) + set( ${_prefix}_${_arg_comp}_INCLUDE_DIRS ${NetCDF_${_comp}_INCLUDE_DIRS} ) + endforeach() +endforeach() diff --git a/cmake/MOM5_CM2M/CMakeLists.txt b/cmake/MOM5_CM2M/CMakeLists.txt deleted file mode 100644 index ad1fc763b1..0000000000 --- a/cmake/MOM5_CM2M/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -# Coupled model driver -file(GLOB_RECURSE MOM5_CM2M_SOURCE LIST_DIRECTORIES false - ${SRC_DIR}/coupler/*.[fF]90) - -add_executable(MOM5_CM2M ${MOM5_CM2M_SOURCE}) - -target_include_directories(MOM5_CM2M PRIVATE - $ - $ - $ - $ - $ - $ - $ - ${SRC_DIR}/ocean_shared -) - -target_link_libraries(MOM5_CM2M - FMS - ocean - ice_sis - atmos_fv - atmos_phys - land_lad - version - ${NETCDF_FLIBS} -) diff --git a/cmake/MOM5_EBM/CMakeLists.txt b/cmake/MOM5_EBM/CMakeLists.txt deleted file mode 100644 index 8f0e6f1621..0000000000 --- a/cmake/MOM5_EBM/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Coupled model driver -file(GLOB_RECURSE MOM5_EBM_SOURCE LIST_DIRECTORIES false - ${SRC_DIR}/coupler/*.[fF]90) - -add_compile_definitions(OVERLOAD_C8 OVERLOAD_C4 OVERLOAD_R4) - -add_executable(MOM5_EBM ${MOM5_EBM_SOURCE}) - -target_include_directories(MOM5_EBM PRIVATE - $ - $ - $ - $ - $ - $ - ${MOM5_DIR}/ocean_core - ${FMS_DIR}/include/ - ${SRC_DIR}/ocean_shared -) - -target_link_libraries(MOM5_EBM - FMS - ocean - ice_sis - atmos_ebm - land_lad - version -) diff --git a/cmake/MOM5_ESM2M/CMakeLists.txt b/cmake/MOM5_ESM2M/CMakeLists.txt deleted file mode 100644 index 0db505aa17..0000000000 --- a/cmake/MOM5_ESM2M/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Coupled model driver -file(GLOB_RECURSE MOM5_ESM2M_SOURCE LIST_DIRECTORIES false - ${SRC_DIR}/coupler/*.[fF]90) - -add_executable(MOM5_ESM2M ${MOM5_ESM2M_SOURCE}) - -target_include_directories(MOM5_ESM2M PRIVATE - $ - $ - $ - $ - $ - $ - $ - ${SRC_DIR}/ocean_shared) - -target_link_libraries(MOM5_ESM2M - FMS - ocean - ice_sis - atmos_phys - atmos_fv - land_lad2 - version - ${NETCDF_FLIBS} -) diff --git a/cmake/MOM5_ICCM/CMakeLists.txt b/cmake/MOM5_ICCM/CMakeLists.txt deleted file mode 100644 index 57a14a6324..0000000000 --- a/cmake/MOM5_ICCM/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -# Coupled model driver -file(GLOB_RECURSE MOM5_ICCM_SOURCE LIST_DIRECTORIES false - ${SRC_DIR}/coupler/*.[fF]90) - -add_executable(MOM5_ICCM ${MOM5_ICCM_SOURCE}) - -target_include_directories(MOM5_ICCM PRIVATE - $ - $ - $ - $ - $ - $ - $ - $ - ${SRC_DIR}/ocean_shared -) - -target_link_libraries(MOM5_ICCM - FMS - ocean - ice_sis - atmos_phys - atmos_fv - atmos_bg - land_lad - version - ${NETCDF_FLIBS} -) diff --git a/cmake/MOM5_SIS/CMakeLists.txt b/cmake/MOM5_SIS/CMakeLists.txt deleted file mode 100644 index 6c1d067e2d..0000000000 --- a/cmake/MOM5_SIS/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Coupled model driver -file(GLOB_RECURSE MOM5_SIS_SOURCE LIST_DIRECTORIES false - ${SRC_DIR}/coupler/*.[fF]90) - -add_executable(MOM5_SIS ${MOM5_SIS_SOURCE}) - -target_include_directories(MOM5_SIS PRIVATE - $ - $ - $ - $ - $ - $ -) - -target_link_libraries(MOM5_SIS - FMS - ocean - ice_sis - atmos_null - land_null - version - ${NETCDF_FLIBS} -) diff --git a/cmake/MOM5_solo/CMakeLists.txt b/cmake/MOM5_solo/CMakeLists.txt deleted file mode 100644 index 1944ec3267..0000000000 --- a/cmake/MOM5_solo/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -set(MOM5_DIR "${SRC_DIR}/mom5") - -# MOM5 ocean only -set(MOM5_SOLO_SOURCE ${MOM5_DIR}/drivers/ocean_solo.F90) - -add_executable(MOM5_solo ${MOM5_SOLO_SOURCE}) - -target_include_directories(MOM5_solo PRIVATE - $ - $ - $) - -target_link_libraries(MOM5_solo - ocean - version - FMS - ${NETCDF_FLIBS} -) diff --git a/cmake/atmos_bg/CMakeLists.txt b/cmake/atmos_bg/CMakeLists.txt deleted file mode 100644 index 8d4f0c3303..0000000000 --- a/cmake/atmos_bg/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -set(ATMOS_DIR "${SRC_DIR}/atmos_bgrid") -set(ATMOS_COUPLED "${SRC_DIR}/atmos_coupled") -set(FMS_DIR "${SRC_DIR}/shared") - -# common files for both builds -file(GLOB_RECURSE ATMOS_SOURCE LIST_DIRECTORIES false FOLLOW_SYMLINKS - ${ATMOS_DIR}/tools/*.[fF]90 - ${ATMOS_DIR}/model/*.[fF]90 - ${ATMOS_DIR}/driver/coupled/*.[fF]90 - ${ATMOS_COUPLED}/*.[fF]90} - ) - -add_library(atmos_bg ${ATMOS_SOURCE}) -target_include_directories(atmos_bg PRIVATE - $ - $ - ${FMS_DIR}/include/ - ${ATMOS_DIR}/model/ -) - -target_link_libraries(atmos_bg FMS) -add_dependencies(atmos_bg atmos_phys) diff --git a/cmake/atmos_ebm/CMakeLists.txt b/cmake/atmos_ebm/CMakeLists.txt deleted file mode 100644 index 727df3345f..0000000000 --- a/cmake/atmos_ebm/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -set(ATMOS_DIR "${SRC_DIR}/atmos_ebm") -set(ATMOS_PARAM_DIR "${SRC_DIR}/atmos_param") -set(ATMOS_SHARED_DIR "${SRC_DIR}/atmos_shared") -set(ATMOS_COUPLED_DIR "${SRC_DIR}/atmos_coupled") -set(ATMOS_SPECTRAL_DIR "${SRC_DIR}/atmos_spectral") -set(FMS_DIR "${SRC_DIR}/shared") - -add_compile_definitions(OVERLOAD_C8 OVERLOAD_C4 OVERLOAD_R4) - -# Gather source files -file(GLOB_RECURSE ATMOS_SOURCE CONFIGURE_DEPENDS - ${ATMOS_DIR}/*.[fF]90 ${ATMOS_PARAM_DIR}/*.[fF]90 - ${ATMOS_SHARED_DIR}/*.[fF]90 ${ATMOS_SHARED_DIR}/*.[fF]90 - ${ATMOS_SPECTRAL_DIR}/tools/*.[fF]90 ) - -# message(STATUS "ATMOS_SOURCE ${ATMOS_SOURCE}") - -add_library(atmos_ebm ${ATMOS_SOURCE}) -target_include_directories(atmos_ebm PRIVATE - $ ${FMS_DIR}/include/ ${ATMOS_PARAM_DIR}/cosp ) - -target_link_libraries(atmos_ebm FMS) diff --git a/cmake/atmos_fv/CMakeLists.txt b/cmake/atmos_fv/CMakeLists.txt deleted file mode 100644 index d2eb1dd4b1..0000000000 --- a/cmake/atmos_fv/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -set(ATMOS_DIR "${SRC_DIR}/atmos_fv_dynamics") -set(ATMOS_COUPLED "${SRC_DIR}/atmos_coupled") -set(FMS_DIR "${SRC_DIR}/shared") - -# common files for both builds -file(GLOB_RECURSE ATMOS_SOURCE LIST_DIRECTORIES false FOLLOW_SYMLINKS - ${ATMOS_DIR}/tools/*.[fF]90 - ${ATMOS_DIR}/model/*.[fF]90 - ${ATMOS_DIR}/driver/coupled/*.[fF]90 - ${ATMOS_COUPLED}/*.[fF]90 ) - -add_library(atmos_fv ${ATMOS_SOURCE}) -target_include_directories(atmos_fv PRIVATE - $ - ${FMS_DIR}/include/ - ${FMS_DIR}/include/ - ${ATMOS_DIR}/model/ - $) - -target_link_libraries(atmos_fv atmos_phys FMS) diff --git a/cmake/atmos_null/CMakeLists.txt b/cmake/atmos_null/CMakeLists.txt index 952a85900a..eff3398ef9 100644 --- a/cmake/atmos_null/CMakeLists.txt +++ b/cmake/atmos_null/CMakeLists.txt @@ -1,20 +1,19 @@ -set(ATMOS_DIR "${SRC_DIR}/atmos_null") -set(ATMOS_PARAM_DIR "${SRC_DIR}/atmos_param") -set(ATMOS_SHARED_DIR "${SRC_DIR}/atmos_shared") -set(FMS_DIR "${SRC_DIR}/shared") +# Copyright ACCESS-NRI and contributors. See the top-level LICENSE file for details. -# common files for both builds -file(GLOB_RECURSE ATMOS_SOURCE LIST_DIRECTORIES false FOLLOW_SYMLINKS - ${ATMOS_DIR}/*.[fF]90 - ${ATMOS_SHARED_DIR}/diag_integral/*.[fF]90 - ${ATMOS_PARAM_DIR}/diag_integral/*.[fF]90 - ${ATMOS_PARAM_DIR}/monin_obukhov/*.[fF]90 ) +add_library(atmos_null STATIC) -add_library(atmos_null ${ATMOS_SOURCE}) target_include_directories(atmos_null PRIVATE - $ - ${FMS_DIR}/include/ - ${FMS_DIR}/include/ - ${ATMOS_PARAM_DIR}/cosp) + $ + ${SRC_DIR}/shared/include/ + ${SRC_DIR}/atmos_param/cosp +) -target_link_libraries(atmos_null FMS) +target_link_libraries(atmos_null PRIVATE fms_mom5) + +target_sources(atmos_null PRIVATE + ${SRC_DIR}/atmos_null/atmos_model.F90 + ${SRC_DIR}/atmos_null/atmos_tracer_driver.F90 + ${SRC_DIR}/atmos_param/diag_integral/diag_integral.F90 + ${SRC_DIR}/atmos_param/monin_obukhov/monin_obukhov.F90 + ${SRC_DIR}/atmos_param/monin_obukhov/monin_obukhov_kernel.F90 +) \ No newline at end of file diff --git a/cmake/atmos_phys/CMakeLists.txt b/cmake/atmos_phys/CMakeLists.txt deleted file mode 100644 index 787433217b..0000000000 --- a/cmake/atmos_phys/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(ATMOS_PARAM_DIR "${SRC_DIR}/atmos_param") -set(ATMOS_SHARED_DIR "${SRC_DIR}/atmos_shared") -set(FMS_DIR "${SRC_DIR}/shared") - -# common files for both builds -file(GLOB_RECURSE ATMOS_SOURCE CONFIGURE_DEPENDS - ${ATMOS_PARAM_DIR}/*.[fF]90 - ${ATMOS_PARAM_DIR}/*.[fF] - ${ATMOS_SHARED_DIR}/*.[fF]90 ) - -add_library(atmos_phys ${ATMOS_SOURCE}) -target_include_directories(atmos_phys PRIVATE - $ ${FMS_DIR}/include/ ${ATMOS_PARAM_DIR}/cosp) - -target_link_libraries(atmos_phys FMS) diff --git a/cmake/fms_mom5/CMakeLists.txt b/cmake/fms_mom5/CMakeLists.txt new file mode 100644 index 0000000000..9b6672446a --- /dev/null +++ b/cmake/fms_mom5/CMakeLists.txt @@ -0,0 +1,137 @@ +# Copyright ACCESS-NRI and contributors. See the top-level LICENSE file for details. + +add_library(fms_mom5) + +target_include_directories(fms_mom5 PRIVATE + ${SRC_DIR}/shared/include + ${SRC_DIR}/shared/mosaic + ${SRC_DIR}/shared/drifters + ${SRC_DIR}/shared/fms + ${SRC_DIR}/shared/mpp/include +) + +target_link_libraries(fms_mom5 PUBLIC + NetCDF::NetCDF_C + NetCDF::NetCDF_Fortran + MPI::MPI_Fortran +) + +target_sources(fms_mom5 PRIVATE + ${SRC_DIR}/shared/amip_interp/amip_interp.F90 + + ${SRC_DIR}/shared/astronomy/astronomy.F90 + + ${SRC_DIR}/shared/axis_utils/axis_utils.F90 + + ${SRC_DIR}/shared/block_control/block_control.F90 + + ${SRC_DIR}/shared/column_diagnostics/column_diagnostics.F90 + + ${SRC_DIR}/shared/constants/constants.F90 + + ${SRC_DIR}/shared/coupler/atmos_ocean_fluxes.F90 + ${SRC_DIR}/shared/coupler/coupler_types.F90 + ${SRC_DIR}/shared/coupler/ensemble_manager.F90 + + ${SRC_DIR}/shared/data_override/data_override.F90 + + ${SRC_DIR}/shared/diag_manager/diag_axis.F90 + ${SRC_DIR}/shared/diag_manager/diag_data.F90 + ${SRC_DIR}/shared/diag_manager/diag_grid.F90 + ${SRC_DIR}/shared/diag_manager/diag_manager.F90 + ${SRC_DIR}/shared/diag_manager/diag_manifest.F90 + ${SRC_DIR}/shared/diag_manager/diag_output.F90 + ${SRC_DIR}/shared/diag_manager/diag_table.F90 + ${SRC_DIR}/shared/diag_manager/diag_util.F90 + + ${SRC_DIR}/shared/drifters/cloud_interpolator.F90 + ${SRC_DIR}/shared/drifters/drifters_comm.F90 + ${SRC_DIR}/shared/drifters/drifters_core.F90 + ${SRC_DIR}/shared/drifters/drifters.F90 + ${SRC_DIR}/shared/drifters/drifters_input.F90 + ${SRC_DIR}/shared/drifters/drifters_io.F90 + ${SRC_DIR}/shared/drifters/quicksort.F90 + + ${SRC_DIR}/shared/exchange/stock_constants.F90 + ${SRC_DIR}/shared/exchange/test_xgrid.F90 + ${SRC_DIR}/shared/exchange/xgrid.F90 + + ${SRC_DIR}/shared/fft/fft99.F90 + ${SRC_DIR}/shared/fft/fft.F90 + + ${SRC_DIR}/shared/field_manager/field_manager.F90 + ${SRC_DIR}/shared/field_manager/fm_util.F90 + + ${SRC_DIR}/shared/fms/fms.F90 + ${SRC_DIR}/shared/fms/fms_io.F90 + ${SRC_DIR}/shared/fms/test_fms_io.F90 + ${SRC_DIR}/shared/fms/test_unstructured_fms_io.F90 + + ${SRC_DIR}/shared/horiz_interp/horiz_interp_bicubic.F90 + ${SRC_DIR}/shared/horiz_interp/horiz_interp_bilinear.F90 + ${SRC_DIR}/shared/horiz_interp/horiz_interp_conserve.F90 + ${SRC_DIR}/shared/horiz_interp/horiz_interp.F90 + ${SRC_DIR}/shared/horiz_interp/horiz_interp_spherical.F90 + ${SRC_DIR}/shared/horiz_interp/horiz_interp_type.F90 + ${SRC_DIR}/shared/horiz_interp/test_horiz_interp.F90 + + ${SRC_DIR}/shared/interpolator/interpolator.F90 + + ${SRC_DIR}/shared/memutils/memuse.c + ${SRC_DIR}/shared/memutils/memutils.F90 + + ${SRC_DIR}/shared/mosaic/create_xgrid.c + ${SRC_DIR}/shared/mosaic/gradient.F90 + ${SRC_DIR}/shared/mosaic/gradient_c2l.c + ${SRC_DIR}/shared/mosaic/grid.F90 + ${SRC_DIR}/shared/mosaic/interp.c + ${SRC_DIR}/shared/mosaic/mosaic.F90 + ${SRC_DIR}/shared/mosaic/mosaic_util.c + ${SRC_DIR}/shared/mosaic/read_mosaic.c + + ${SRC_DIR}/shared/mpp/affinity.c + ${SRC_DIR}/shared/mpp/mpp_data.F90 + ${SRC_DIR}/shared/mpp/mpp_domains.F90 + ${SRC_DIR}/shared/mpp/mpp_efp.F90 + ${SRC_DIR}/shared/mpp/mpp.F90 + ${SRC_DIR}/shared/mpp/mpp_io.F90 + ${SRC_DIR}/shared/mpp/mpp_memutils.F90 + ${SRC_DIR}/shared/mpp/mpp_parameter.F90 + ${SRC_DIR}/shared/mpp/mpp_pset.F90 + ${SRC_DIR}/shared/mpp/mpp_utilities.F90 + ${SRC_DIR}/shared/mpp/nsclock.c + ${SRC_DIR}/shared/mpp/test_mpp_domains.F90 + ${SRC_DIR}/shared/mpp/test_mpp.F90 + ${SRC_DIR}/shared/mpp/test_mpp_io.F90 + ${SRC_DIR}/shared/mpp/test_mpp_pset.F90 + ${SRC_DIR}/shared/mpp/threadloc.c + + ${SRC_DIR}/shared/oda_tools/oda_core_ecda.F90 + ${SRC_DIR}/shared/oda_tools/oda_core.F90 + ${SRC_DIR}/shared/oda_tools/oda_types.F90 + ${SRC_DIR}/shared/oda_tools/write_ocean_data.F90 + ${SRC_DIR}/shared/oda_tools/xbt_drop_rate_adjust.f90 + + ${SRC_DIR}/shared/platform/platform.F90 + + ${SRC_DIR}/shared/random_numbers/MersenneTwister.F90 + ${SRC_DIR}/shared/random_numbers/random_numbers.F90 + + ${SRC_DIR}/shared/sat_vapor_pres/sat_vapor_pres.F90 + ${SRC_DIR}/shared/sat_vapor_pres/sat_vapor_pres_k.F90 + + ${SRC_DIR}/shared/station_data/station_data.F90 + + ${SRC_DIR}/shared/time_interp/time_interp_external.F90 + ${SRC_DIR}/shared/time_interp/time_interp.F90 + + ${SRC_DIR}/shared/time_manager/get_cal_time.F90 + ${SRC_DIR}/shared/time_manager/time_manager.F90 + + ${SRC_DIR}/shared/topography/gaussian_topog.F90 + ${SRC_DIR}/shared/topography/topography.F90 + + ${SRC_DIR}/shared/tracer_manager/tracer_manager.F90 + + ${SRC_DIR}/shared/tridiagonal/tridiagonal.F90 +) \ No newline at end of file diff --git a/cmake/ice_sis/CMakeLists.txt b/cmake/ice_sis/CMakeLists.txt index c9d8ed92c0..7e9bfead3b 100644 --- a/cmake/ice_sis/CMakeLists.txt +++ b/cmake/ice_sis/CMakeLists.txt @@ -1,12 +1,25 @@ -set(SIS_DIR "${SRC_DIR}/ice_sis") -set(ICE_PARAM_DIR "${SRC_DIR}/ice_param") +# Copyright ACCESS-NRI and contributors. See the top-level LICENSE file for details. -# common files for both builds -file(GLOB_RECURSE SIS_SOURCE LIST_DIRECTORIES false FOLLOW_SYMLINKS - ${SIS_DIR}/*.[fF]90 ${ICE_PARAM_DIR}/*.[fF]90 ) +add_library(ice_sis) -add_library(ice_sis ${SIS_SOURCE} ${OCEANSHARED_SOURCE}) target_include_directories(ice_sis PRIVATE - $ ${FMS_DIR}/include/ ) + $ + ${SRC_DIR}/shared/include/ +) -target_link_libraries(ice_sis FMS) +target_link_libraries(ice_sis PRIVATE fms_mom5) + +target_sources(ice_sis PRIVATE + ${SRC_DIR}/ice_sis/ice_bergs.F90 + ${SRC_DIR}/ice_sis/ice_dyn.F90 + ${SRC_DIR}/ice_sis/ice_grid.F90 + ${SRC_DIR}/ice_sis/ice_model.F90 + ${SRC_DIR}/ice_sis/ice_spec.F90 + ${SRC_DIR}/ice_sis/ice_thm.F90 + ${SRC_DIR}/ice_sis/ice_type.F90 + ${SRC_DIR}/ice_sis/mask.F90 + ${SRC_DIR}/ice_sis/rot.F90 + ${SRC_DIR}/ice_param/ice_albedo.F90 + ${SRC_DIR}/ice_param/ocean_albedo.F90 + ${SRC_DIR}/ice_param/ocean_rough.F90 +) \ No newline at end of file diff --git a/cmake/land_lad/CMakeLists.txt b/cmake/land_lad/CMakeLists.txt deleted file mode 100644 index 298c70b30c..0000000000 --- a/cmake/land_lad/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(LAND_DIR "${SRC_DIR}/land_lad") -set(LAND_PARAM_DIR "${SRC_DIR}/land_param") -set(FMS_DIR "${SRC_DIR}/shared") - -# common files for both builds -file(GLOB_RECURSE LAND_SOURCE LIST_DIRECTORIES false FOLLOW_SYMLINKS - ${LAND_DIR}/*.[fF]90 ${LAND_PARAM_DIR}/*.[fF]90 ) - -add_library(land_lad ${LAND_SOURCE}) - -target_include_directories(land_lad PRIVATE - $ ${FMS_DIR}/include/) - -target_link_libraries(land_lad FMS) diff --git a/cmake/land_lad2/CMakeLists.txt b/cmake/land_lad2/CMakeLists.txt deleted file mode 100644 index c717ae17a2..0000000000 --- a/cmake/land_lad2/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(LAND_DIR "${SRC_DIR}/land_lad2") -set(FMS_DIR "${SRC_DIR}/shared") - -add_compile_definitions(USE_LOG_DIAG_FIELD_INFO) - -# common files for both builds -file(GLOB_RECURSE LAND_SOURCE LIST_DIRECTORIES false FOLLOW_SYMLINKS - ${LAND_DIR}/*.[fF]90 ) - -add_library(land_lad2 ${LAND_SOURCE}) - -target_include_directories(land_lad2 PRIVATE - $ ${FMS_DIR}/include/) - -target_link_libraries(land_lad2 FMS) diff --git a/cmake/land_null/CMakeLists.txt b/cmake/land_null/CMakeLists.txt index 4bac568a5b..a9e9f45a12 100644 --- a/cmake/land_null/CMakeLists.txt +++ b/cmake/land_null/CMakeLists.txt @@ -1,15 +1,14 @@ -set(LAND_DIR "${SRC_DIR}/land_null") -set(LAND_PARAM_DIR "${SRC_DIR}/land_param") -set(FMS_DIR "${SRC_DIR}/shared") +# Copyright ACCESS-NRI and contributors. See the top-level LICENSE file for details. -# common files for both builds -file(GLOB_RECURSE LAND_SOURCE LIST_DIRECTORIES false FOLLOW_SYMLINKS - ${LAND_DIR}/*.[fF]90 ${LAND_PARAM_DIR}/*.[fF]90 ) +add_library(land_null) -add_library(land_null ${LAND_SOURCE}) +target_include_directories(land_null PRIVATE + $ +) -target_include_directories(land_null PRIVATE $) +target_link_libraries(land_null PRIVATE fms_mom5) -# $ ${FMS_DIR}/include/) - -target_link_libraries(land_null FMS) +target_sources(land_null PRIVATE + ${SRC_DIR}/land_null/land_model.F90 + ${SRC_DIR}/land_param/climap_albedo.F90 +) \ No newline at end of file diff --git a/cmake/mom5_access_cm/CMakeLists.txt b/cmake/mom5_access_cm/CMakeLists.txt new file mode 100644 index 0000000000..5da7a3e581 --- /dev/null +++ b/cmake/mom5_access_cm/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright ACCESS-NRI and contributors. See the top-level LICENSE file for details. + +add_executable(mom5_access_cm) + +target_include_directories(mom5_access_cm PRIVATE + $ + ) + +target_link_libraries(mom5_access_cm PRIVATE + PkgConfig::OASIS3PSMILE + PkgConfig::OASIS3MCT + PkgConfig::OASIS3MPEU + PkgConfig::OASIS3SCRIP + ocean_access +) + +target_sources(mom5_access_cm PRIVATE + ${SRC_DIR}/access/accesscm_coupler/cpl_netcdf_setup.F90 + ${SRC_DIR}/access/accesscm_coupler/mom_oasis3_interface.F90 + ${SRC_DIR}/access/accesscm_coupler/ocean_solo.F90 +) + +install(TARGETS mom5_access_cm RUNTIME) \ No newline at end of file diff --git a/cmake/mom5_access_om/CMakeLists.txt b/cmake/mom5_access_om/CMakeLists.txt new file mode 100644 index 0000000000..7296350ded --- /dev/null +++ b/cmake/mom5_access_om/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright ACCESS-NRI and contributors. See the top-level LICENSE file for details. + +add_executable(mom5_access_om) + +target_include_directories(mom5_access_om PRIVATE + $ +) + +target_link_libraries(mom5_access_om PRIVATE + libaccessom2::accessom2 + ocean_access +) + +target_compile_definitions(mom5_access_om PRIVATE ${ACCESS_COMPILE_DEFS}) + +target_sources(mom5_access_om PRIVATE + ${SRC_DIR}/access/accessom_coupler/cpl_netcdf_setup.F90 + ${SRC_DIR}/access/accessom_coupler/mom_oasis3_interface.F90 + ${SRC_DIR}/access/accessom_coupler/ocean_solo.F90 +) + +install(TARGETS mom5_access_om RUNTIME) \ No newline at end of file diff --git a/cmake/mom5_sis/CMakeLists.txt b/cmake/mom5_sis/CMakeLists.txt new file mode 100644 index 0000000000..d342402663 --- /dev/null +++ b/cmake/mom5_sis/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright ACCESS-NRI and contributors. See the top-level LICENSE file for details. + +add_executable(mom5_sis) + +target_include_directories(mom5_sis PRIVATE + $ + $ + $ + $ + $ +) + +target_link_libraries(mom5_sis PRIVATE + ocean + ice_sis + atmos_null + land_null +) + +target_sources(mom5_sis PRIVATE + ${SRC_DIR}/coupler/coupler_main.F90 + ${SRC_DIR}/coupler/flux_exchange.F90 + ${SRC_DIR}/coupler/surface_flux.F90 +) + +install(TARGETS mom5_sis RUNTIME) \ No newline at end of file diff --git a/cmake/mom5_solo/CMakeLists.txt b/cmake/mom5_solo/CMakeLists.txt new file mode 100644 index 0000000000..31307af658 --- /dev/null +++ b/cmake/mom5_solo/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright ACCESS-NRI and contributors. See the top-level LICENSE file for details. + +add_executable(mom5_solo ${SRC_DIR}/mom5/drivers/ocean_solo.F90) + +target_include_directories(mom5_solo PRIVATE + $ + $ +) + +target_link_libraries(mom5_solo PRIVATE + ocean +) + +install(TARGETS mom5_solo RUNTIME) \ No newline at end of file diff --git a/cmake/ocean/CMakeLists.txt b/cmake/ocean/CMakeLists.txt index 7b26c1d27b..a5dc06b5ad 100644 --- a/cmake/ocean/CMakeLists.txt +++ b/cmake/ocean/CMakeLists.txt @@ -1,27 +1,191 @@ -set(MOM5_DIR "${SRC_DIR}/mom5") -set(FMS_DIR "${SRC_DIR}/shared") - -# common files for both builds -file(GLOB_RECURSE MOM5_SOURCE LIST_DIRECTORIES false FOLLOW_SYMLINKS - ${MOM5_DIR}/ocean_blobs/*.[fF]90 - ${MOM5_DIR}/ocean_bgc/*.[fF]90 - ${MOM5_DIR}/ocean_core/*.[fF]90 - ${MOM5_DIR}/ocean_diag/*.[fF]90 - ${MOM5_DIR}/ocean_param/*.[fF]90 - ${MOM5_DIR}/ocean_tracers/*.[fF]90 - ${MOM5_DIR}/ocean_wave/*.[fF]90 - ${SRC_DIR}/ocean_shared/generic_tracers/*.[fF]90 -) +# Copyright ACCESS-NRI and contributors. See the top-level LICENSE file for details. -set(MOM5_DIR "${SRC_DIR}/mom5") +add_library(ocean) -add_library(ocean ${MOM5_SOURCE} ${OCEANSHARED_SOURCE}) target_include_directories(ocean PRIVATE - $ - $ - ${MOM5_DIR}/ocean_param/gotm-4.0/include - ${MOM5_DIR}/ocean_core - ${FMS_DIR}/include/ + $ + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/include + ${SRC_DIR}/mom5/ocean_core + ${SRC_DIR}/shared/include/ +) + +target_link_libraries(ocean + PUBLIC fms_mom5 ) -target_link_libraries(ocean FMS version) +target_sources(ocean PRIVATE + ${SRC_DIR}/mom5/ocean_bgc/ocean_bgc_restore.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocean_generic_tracer.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocean_ibgc.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocean_pert_co2.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocean_po4_pre.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocmip2_abiotic.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocmip2_biotic.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocmip2_cfc.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocmip2_co2calc.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocmip2_he.F90 + + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_diag.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_dynamic_bottom.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_dynamic_free.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_static_bottom.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_static_free.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_util.F90 + + ${SRC_DIR}/mom5/ocean_core/ocean_advection_velocity.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_barotropic.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_bbc.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_coriolis.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_density.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_domains.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_grids.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_model.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_obc_barotrop.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_obc.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_operators.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_parameters.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_pressure.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_sbc.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_thickness.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_topog.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_types.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_util.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_velocity_advect.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_velocity.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_workspace.F90 + ${SRC_DIR}/mom5/ocean_core/oda_driver.F90 + + ${SRC_DIR}/mom5/ocean_diag/ocean_adv_vel_diag.F90 + ${SRC_DIR}/mom5/ocean_diag/ocean_diagnostics.F90 + ${SRC_DIR}/mom5/ocean_diag/ocean_drifters.F90 + ${SRC_DIR}/mom5/ocean_diag/ocean_tracer_diag.F90 + ${SRC_DIR}/mom5/ocean_diag/ocean_tracer_util.F90 + ${SRC_DIR}/mom5/ocean_diag/ocean_velocity_diag.F90 + + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/algebraiclength.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/alpha_mnb.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_a.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_b.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_c.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_d.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_ma.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_rf.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_sg.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/compute_cpsi3.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/compute_rist.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/dissipationeq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/epsbalgebraic.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/fk_craig.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/genericeq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/gotm_lib_version.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/internal_wave.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/ispralength.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/kbalgebraic.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/kbeq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/kpp.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/lengthscaleeq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/potentialml.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/production.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/q2over2eq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/r_ratio.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/tkealgebraic.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/tkeeq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/turbulence.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/variances.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/adv_center.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/convert_fluxes.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/diff_center.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/diff_face.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/eqstate.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/gridinterpol.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/lagrange.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/ode_solvers.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/time.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/tridiagonal_gotm.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/util.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_bihcgrid_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_bihcst_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_bih_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_bihgen_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_bih_tracer.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_lapcgrid_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_lapcst_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_lap_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_lapgen_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_lap_tracer.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_mixdownslope.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_sigma_transport.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_submesoscale.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysicsA.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysicsB.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysicsC.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_diff.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_flux.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_new.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_skew.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_tensor.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_util.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_util_new.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_increment_eta.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_increment_tracer.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_increment_velocity.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_momentum_source.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_overexchange.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_overflow.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_overflow_OFP.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_rivermix.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_riverspread.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_shortwave_csiro.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_shortwave.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_shortwave_gfdl.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_shortwave_jerlov.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_sponges_eta.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_sponges_tracer.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_sponges_velocity.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_xlandinsert.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_xlandmix.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_convect.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_form_drag.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_chen.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_const.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_gotm.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_kpp_mom4p0.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_kpp_mom4p1.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_kpp_test.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_mix.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_pp.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_tidal.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_tidal_test.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_util.F90 + + ${SRC_DIR}/mom5/ocean_tracers/ocean_age_tracer.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_frazil.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_passive.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_residency.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_residency_integrand.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_residency_meta.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_residency_ml.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_residency_range.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_tempsalt.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_tpm.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_tpm_util.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_tracer_advect.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_tracer.F90 + ${SRC_DIR}/mom5/ocean_tracers/transport_matrix.F90 + + ${SRC_DIR}/mom5/ocean_wave/ocean_wave.F90 + ${SRC_DIR}/mom5/ocean_wave/ocean_wave_type.F90 + + ${SRC_DIR}/ocean_shared/generic_tracers/FMS_coupler_util.F90 + ${SRC_DIR}/ocean_shared/generic_tracers/FMS_ocmip2_co2calc.F90 + ${SRC_DIR}/ocean_shared/generic_tracers/generic_BLING.F90 + ${SRC_DIR}/ocean_shared/generic_tracers/generic_CFC.F90 + ${SRC_DIR}/ocean_shared/generic_tracers/generic_COBALT.F90 + ${SRC_DIR}/ocean_shared/generic_tracers/generic_ERGOM.F90 + ${SRC_DIR}/ocean_shared/generic_tracers/generic_miniBLING.F90 + ${SRC_DIR}/ocean_shared/generic_tracers/generic_TOPAZ.F90 + ${SRC_DIR}/ocean_shared/generic_tracers/generic_tracer.F90 + ${SRC_DIR}/ocean_shared/generic_tracers/generic_tracer_utils.F90 +) \ No newline at end of file diff --git a/cmake/ocean_access/CMakeLists.txt b/cmake/ocean_access/CMakeLists.txt new file mode 100644 index 0000000000..2ddb0d49e5 --- /dev/null +++ b/cmake/ocean_access/CMakeLists.txt @@ -0,0 +1,190 @@ +# Copyright ACCESS-NRI and contributors. See the top-level LICENSE file for details. + +add_library(ocean_access) + +target_include_directories(ocean_access PRIVATE + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/include + ${SRC_DIR}/mom5/ocean_core +) + +target_link_libraries(ocean_access + PUBLIC FMS::fms_r8 + PRIVATE + GFDLGTracers::gtracers +) + +target_compile_definitions(ocean_access PRIVATE ${ACCESS_COMPILE_DEFS}) + +target_sources(ocean_access PRIVATE + ${SRC_DIR}/access/shared/gtracer_flux.F90 + + ${SRC_DIR}/mom5/ocean_access/auscom_ice.F90 + ${SRC_DIR}/mom5/ocean_access/auscom_ice_parameters.F90 + + ${SRC_DIR}/mom5/ocean_bgc/ocean_bgc_restore.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocean_generic_tracer.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocean_ibgc.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocean_pert_co2.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocean_po4_pre.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocmip2_abiotic.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocmip2_biotic.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocmip2_cfc.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocmip2_co2calc.F90 + ${SRC_DIR}/mom5/ocean_bgc/ocmip2_he.F90 + + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_diag.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_dynamic_bottom.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_dynamic_free.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_static_bottom.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_static_free.F90 + ${SRC_DIR}/mom5/ocean_blobs/ocean_blob_util.F90 + + ${SRC_DIR}/mom5/ocean_core/ocean_advection_velocity.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_barotropic.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_bbc.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_coriolis.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_density.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_domains.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_grids.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_model.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_obc_barotrop.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_obc.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_operators.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_parameters.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_pressure.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_sbc.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_thickness.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_topog.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_types.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_util.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_velocity_advect.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_velocity.F90 + ${SRC_DIR}/mom5/ocean_core/ocean_workspace.F90 + ${SRC_DIR}/mom5/ocean_core/oda_driver.F90 + + ${SRC_DIR}/mom5/ocean_csiro_bgc/csiro_bgc.F90 + ${SRC_DIR}/mom5/ocean_csiro_bgc/ocmip2_co2calc.F90 + + ${SRC_DIR}/mom5/ocean_diag/ocean_adv_vel_diag.F90 + ${SRC_DIR}/mom5/ocean_diag/ocean_diagnostics.F90 + ${SRC_DIR}/mom5/ocean_diag/ocean_drifters.F90 + ${SRC_DIR}/mom5/ocean_diag/ocean_tracer_diag.F90 + ${SRC_DIR}/mom5/ocean_diag/ocean_tracer_util.F90 + ${SRC_DIR}/mom5/ocean_diag/ocean_velocity_diag.F90 + + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/algebraiclength.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/alpha_mnb.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_a.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_b.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_c.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_d.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_ma.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_rf.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/cmue_sg.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/compute_cpsi3.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/compute_rist.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/dissipationeq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/epsbalgebraic.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/fk_craig.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/genericeq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/gotm_lib_version.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/internal_wave.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/ispralength.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/kbalgebraic.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/kbeq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/kpp.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/lengthscaleeq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/potentialml.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/production.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/q2over2eq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/r_ratio.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/tkealgebraic.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/tkeeq.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/turbulence.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/turbulence/variances.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/adv_center.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/convert_fluxes.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/diff_center.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/diff_face.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/eqstate.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/gridinterpol.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/lagrange.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/ode_solvers.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/time.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/tridiagonal_gotm.F90 + ${SRC_DIR}/mom5/ocean_param/gotm-4.0/util/util.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_bihcgrid_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_bihcst_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_bih_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_bihgen_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_bih_tracer.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_lapcgrid_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_lapcst_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_lap_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_lapgen_friction.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_lap_tracer.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_mixdownslope.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_sigma_transport.F90 + ${SRC_DIR}/mom5/ocean_param/lateral/ocean_submesoscale.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysicsA.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysicsB.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysicsC.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_diff.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_flux.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_new.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_skew.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_tensor.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_util.F90 + ${SRC_DIR}/mom5/ocean_param/neutral/ocean_nphysics_util_new.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_increment_eta.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_increment_tracer.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_increment_velocity.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_momentum_source.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_overexchange.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_overflow.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_overflow_OFP.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_rivermix.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_riverspread.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_shortwave_csiro.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_shortwave.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_shortwave_gfdl.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_shortwave_jerlov.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_sponges_eta.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_sponges_tracer.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_sponges_velocity.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_xlandinsert.F90 + ${SRC_DIR}/mom5/ocean_param/sources/ocean_xlandmix.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_convect.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_form_drag.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_chen.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_const.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_gotm.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_kpp_mom4p0.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_kpp_mom4p1.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_kpp_test.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_mix.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_pp.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_tidal.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_tidal_test.F90 + ${SRC_DIR}/mom5/ocean_param/vertical/ocean_vert_util.F90 + + ${SRC_DIR}/mom5/ocean_tracers/ocean_age_tracer.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_frazil.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_passive.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_residency.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_residency_integrand.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_residency_meta.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_residency_ml.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_residency_range.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_tempsalt.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_tpm.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_tpm_util.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_tracer_advect.F90 + ${SRC_DIR}/mom5/ocean_tracers/ocean_tracer.F90 + ${SRC_DIR}/mom5/ocean_tracers/transport_matrix.F90 + + ${SRC_DIR}/mom5/ocean_wave/ocean_wave.F90 + ${SRC_DIR}/mom5/ocean_wave/ocean_wave_type.F90 +) \ No newline at end of file diff --git a/cmake/version/CMakeLists.txt b/cmake/version/CMakeLists.txt deleted file mode 100644 index 5cd758ef60..0000000000 --- a/cmake/version/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -set(VERSION_DIR "${SRC_DIR}/version") - -add_library(version ${VERSION_DIR}/version.F90) \ No newline at end of file diff --git a/exp/MOM_compile.csh b/exp/MOM_compile.csh index 3145b6b927..bfb8769ba5 100755 --- a/exp/MOM_compile.csh +++ b/exp/MOM_compile.csh @@ -57,10 +57,8 @@ if ( $help ) then echo " EBM : ocean-seaice-land-atmosphere coupled model with energy balance atmosphere" echo " ACCESS-CM : ocean component of ACCESS-CM model." echo " ACCESS-OM : ocean component of ACCESS-OM model." - echo " ACCESS-ESM : ocean component of ACCESS-ESM model with support for generic tracer WOMBATlite." - echo " ACCESS-OM-BGC: ocean component of ACCESS-OM model with CSIRO BGC (Wombat). Wombat has now been" - echo " implemented as a generic tracer and is available in the ACCESS-OM model type." - echo " ACCESS-OM-BGC is retained only for legacy." + echo " ACCESS-ESM : ocean component of ACCESS-ESM model with CSIRO BGC (Wombat)." + echo " ACCESS-OM-BGC: ocean component of ACCESS-OM model with CSIRO BGC (Wombat)." echo echo "--platform followed by the platform name that has a corresponding environ file in the ../bin dir, default is gfortran" echo @@ -106,13 +104,13 @@ endif if ( $type == EBM ) then set cppDefs = ( "-Duse_netCDF -Duse_netCDF3 -Duse_libMPI -DLAND_BND_TRACERS -DOVERLOAD_C8 -DOVERLOAD_C4 -DOVERLOAD_R4" ) else if( $type == ACCESS-OM ) then - set cppDefs = ( "-Duse_netCDF -Duse_libMPI -DACCESS_OM -DUSE_OCEAN_BGC" ) + set cppDefs = ( "-Duse_netCDF -Duse_libMPI -DACCESS_OM" ) else if( $type == ACCESS-OM-BGC ) then set cppDefs = ( "-Duse_netCDF -Duse_libMPI -DACCESS_OM -DCSIRO_BGC" ) else if( $type == ACCESS-CM ) then set cppDefs = ( "-Duse_netCDF -Duse_libMPI -DACCESS_CM" ) else if( $type == ACCESS-ESM ) then - set cppDefs = ( "-Duse_netCDF -Duse_libMPI -DACCESS_CM -DUSE_OCEAN_BGC" ) + set cppDefs = ( "-Duse_netCDF -Duse_libMPI -DACCESS_CM" ) endif if ( $unit_testing ) then @@ -256,7 +254,7 @@ else exit 1 endif -if( $type == ACCESS-OM || $type == ACCESS-ESM) then +if( $type =~ ACCESS-* ) then set srcList = ( $srcList access/shared ) endif diff --git a/exp/ocean_compile.csh b/exp/ocean_compile.csh index fbfcd09ad4..6afc21216d 100644 --- a/exp/ocean_compile.csh +++ b/exp/ocean_compile.csh @@ -8,8 +8,6 @@ if( $type == ACCESS-OM || $type == ACCESS-CM || $type == ACCESS-OM-BGC || $type set srcList = ( $srcList mom5/ocean_access ) if( $type == ACCESS-OM-BGC ) then set srcList = ( $srcList mom5/ocean_csiro_bgc ) - else if ( $type == ACCESS-OM || $type == ACCESS-ESM ) then - set srcList = ( $srcList mom5/ocean_bgc access/generic_tracers/generic_tracers access/generic_tracers/mocsy/src ) endif mkdir -p $executable:h:h/$type/$lib_name cd $executable:h:h/$type/$lib_name diff --git a/exp/update_version.csh b/exp/update_version.csh index 08305abeae..e32b7f7c84 100755 --- a/exp/update_version.csh +++ b/exp/update_version.csh @@ -1,6 +1,8 @@ #!/usr/bin/env csh -set root = $cwd:h # The directory you created when you checkout +set curr = `dirname $0` +set abs_curr = `cd $curr && pwd` +set root = $abs_curr:h # The directory you created when you checkout set code_dir = $root/src # source code directory # Set up the version string @@ -10,8 +12,12 @@ set code_dir = $root/src # source code directory # strings | grep 'MOM_COMMIT_HASH=' setenv GIT_CONFIG_NOGLOBAL 'yes' -set old_hash=`grep 'public :: MOM_COMMIT_HASH' ../src/version/version.F90 | cut -d '"' -f 2 | cut -d '=' -f 2` -set new_hash=`git rev-parse HEAD` +if ( -f $code_dir/version/version.F90 ) then + set old_hash=`grep 'public :: MOM_COMMIT_HASH' $code_dir/version/version.F90 | cut -d '"' -f 2 | cut -d '=' -f 2` +else + set old_hash="" +endif +set new_hash=`git -C $abs_curr rev-parse HEAD` if ( $old_hash != $new_hash ) then echo "Current version hash: $old_hash" diff --git a/src/access/generic_tracers b/src/access/generic_tracers deleted file mode 160000 index 6dcadbbaef..0000000000 --- a/src/access/generic_tracers +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6dcadbbaef22c8c7b20f7ed5cf75df37dbade3b8 diff --git a/src/access/shared/gtracer_flux.F90 b/src/access/shared/gtracer_flux.F90 index 4e264ac344..0ae12a12e9 100644 --- a/src/access/shared/gtracer_flux.F90 +++ b/src/access/shared/gtracer_flux.F90 @@ -89,6 +89,11 @@ subroutine flux_exchange_init (Time, Ocean, Ocean_state, Ice_ocean_boundary, atm #if defined(ACCESS_CM) allocate(Ice_ocean_boundary%co2(isc:iec,jsc:jec)) #endif +#if defined(ACCESS_OM) && defined(CSIRO_BGC) + allocate( & + Ice_ocean_boundary%iof_nit(isc:iec,jsc:jec), & + Ice_ocean_boundary%iof_alg(isc:iec,jsc:jec)) +#endif Ice_ocean_boundary%u_flux = 0.0 Ice_ocean_boundary%v_flux = 0.0 @@ -115,6 +120,10 @@ subroutine flux_exchange_init (Time, Ocean, Ocean_state, Ice_ocean_boundary, atm #if defined(ACCESS_CM) Ice_ocean_boundary%co2 = 0.0 #endif +#if defined(ACCESS_OM) && defined(CSIRO_BGC) + Ice_ocean_boundary%iof_nit = 0.0 + Ice_ocean_boundary%iof_alg = 0.0 +#endif ! Spawn 2D Ocean%fields FMS coupler type from 1D gas_fields_ocn call coupler_type_spawn(gas_fields_ocn, Ocean%fields, (/isc,isc,iec,iec/), &