Skip to content

Commit

Permalink
Merge branch 'develop' into feature/mods4coastalapp
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen committed Nov 14, 2024
2 parents d4911ec + ac0172e commit 3aaec72
Show file tree
Hide file tree
Showing 183 changed files with 9,930 additions and 5,640 deletions.
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Please delete what is not needed.
* MOM6 -
* NOAHMP -
* WW3 -
* fire_behavior
* stochastic_physics -
```

Expand Down Expand Up @@ -89,6 +90,7 @@ Example:
* MOM6:
* NOAHMP:
* WW3:
* fire_behavior:
* stochastic_physics:
* None

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ tests/fv3_conf/compile_slurm.IN
tests/fv3_conf/compile_qsub.IN
tests/fv3_conf/fv3_slurm.IN
tests/fv3_conf/fv3_qsub.IN
tests/rt_temp.conf
build*.log*
rocoto_workflow*
fail_compile_*
Expand Down
10 changes: 9 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
[submodule "CICE"]
path = CICE-interface/CICE
url = https://github.com/NOAA-EMC/CICE
branch = emc/develop
branch = develop
[submodule "CDEPS"]
path = CDEPS-interface/CDEPS
url = https://github.com/NOAA-EMC/CDEPS
Expand All @@ -48,3 +48,11 @@
path = NOAHMP-interface/noahmp
url = https://github.com/NOAA-EMC/noahmp
branch = develop
[submodule "LM4-driver"]
path = LM4-driver
url = https://github.com/NOAA-GFDL/LM4-NUOPC-driver
branch = develop
[submodule "fire_behavior"]
path = fire_behavior
url = https://github.com/NOAA-EMC/fire_behavior
branch = emc/develop
2 changes: 1 addition & 1 deletion CICE-interface/CICE
Submodule CICE updated 105 files
225 changes: 118 additions & 107 deletions CICE-interface/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,107 +1,118 @@
### CICE Fortran compiler flags
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -fbacktrace")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-none ")
if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
endif()
set(CMAKE_Fortran_FLAGS_RELEASE "-O2")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -Wall -Wextra -fcheck=bounds -ffpe-trap=invalid,zero,overflow,underflow" )
set(CMAKE_Fortran_LINK_FLAGS "" )
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -FR -convert big_endian -assume byterecl -ftz -align array64byte")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fp-model precise")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created -init=snan,arrays")
set(CMAKE_Fortran_LINK_FLAGS "")
else()
message(WARNING "Fortran compiler with ID ${CMAKE_Fortran_COMPILER_ID} will be used with CMake default options")
endif()

### CICE C compiler flags
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_C_FLAGS_DEBUG "-O0")
set(CMAKE_C_LINK_FLAGS "")
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -traceback")
set( CMAKE_C_FLAGS_RELEASE "-O2 -fp-model precise")
set( CMAKE_C_FLAGS_DEBUG "-O0 -ftrapuv")
set( CMAKE_C_LINK_FLAGS "")
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set( CMAKE_C_FLAGS_RELEASE "-O3" )
set( CMAKE_C_FLAGS_DEBUG "-O0" )
set( CMAKE_C_LINK_FLAGS "" )
else()
message(WARNING "C compiler with ID ${CMAKE_C_COMPILER_ID} will be used with CMake default options")
endif()

# Configuration Options
set(CICE_IO "PIO" CACHE STRING "CICE OPTIONS: Choose IO options.")
set_property(CACHE CICE_IO PROPERTY STRINGS "NetCDF" "PIO" "Binary")

# Too many files to list, so include them via this file
include("cice_files.cmake")

# Collect source files for library
list(APPEND lib_src_files
${cice_shared_files}
${cice_shared_files_c}
${icepack_files}
${cice_mpi_comm_files}
${cice_nuopc_cmeps_driver_files}
${cice_cdeps_inline_files})

list(APPEND _cice_defs FORTRANUNDERSCORE
coupled)

# Select IO source files based on CICE_IO
if(CICE_IO MATCHES "NetCDF")
list(APPEND lib_src_files ${cice_netcdf_io_files})
list(APPEND _cice_defs USE_NETCDF)
elseif(CICE_IO MATCHES "PIO")
list(APPEND lib_src_files ${cice_pio2_io_files})
list(APPEND _cice_defs USE_NETCDF)
elseif(CICE_IO MATCHES "Binary")
list(APPEND lib_src_files ${cice_binary_io_files})
endif()

### Create target library and set PUBLIC interfaces on the library
add_library(cice STATIC ${lib_src_files})
set_target_properties(cice PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_compile_definitions(cice PUBLIC "${_cice_defs}")
target_include_directories(cice PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
target_link_libraries(cice PUBLIC esmf)
if(CICE_IO MATCHES "^(NetCDF|PIO)$")
target_link_libraries(cice PUBLIC NetCDF::NetCDF_Fortran)
if(CICE_IO MATCHES "PIO")
target_link_libraries(cice PUBLIC PIO::PIO_Fortran)
endif()
endif()
if(OpenMP_Fortran_FOUND)
target_link_libraries(cice PRIVATE OpenMP::OpenMP_Fortran)
endif()

# ice prescribed
add_dependencies(cice cdeps::cdeps)
target_compile_definitions(cice PUBLIC "DISABLE_FoX")
target_link_libraries(cice PUBLIC cdeps::cdeps)

###############################################################################
### Install
###############################################################################

install(
TARGETS cice
EXPORT cice-config
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
COMPONENT Library)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod DESTINATION ${CMAKE_INSTALL_PREFIX}/CICE)

install(EXPORT cice-config
DESTINATION lib/cmake)
### CICE Fortran compiler flags
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -fbacktrace")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian -ffree-line-length-none ")
if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
endif()
set(CMAKE_Fortran_FLAGS_RELEASE "-O2")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -Wall -Wextra -fcheck=bounds -ffpe-trap=invalid,zero,overflow,underflow" )
set(CMAKE_Fortran_LINK_FLAGS "" )
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -FR -convert big_endian -assume byterecl -ftz -align array64byte")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fp-model precise")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created -init=snan,arrays")
set(CMAKE_Fortran_LINK_FLAGS "")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -FR -convert big_endian -assume byterecl -ftz -align array64byte")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fp-model precise")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created -init=snan,arrays")
set(CMAKE_Fortran_LINK_FLAGS "")
else()
message(WARNING "Fortran compiler with ID ${CMAKE_Fortran_COMPILER_ID} will be used with CMake default options")
endif()

### CICE C compiler flags
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_C_FLAGS_DEBUG "-O0")
set(CMAKE_C_LINK_FLAGS "")
elseif(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$")
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -traceback")
set( CMAKE_C_FLAGS_RELEASE "-O2 -fp-model precise")
set( CMAKE_C_FLAGS_DEBUG "-O0 -ftrapuv")
set( CMAKE_C_LINK_FLAGS "")
elseif(CMAKE_C_COMPILER_ID MATCHES "^(IntelLLVM)$")
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -traceback")
set( CMAKE_C_FLAGS_RELEASE "-O2 -fp-model precise")
set( CMAKE_C_FLAGS_DEBUG "-O0")
set( CMAKE_C_LINK_FLAGS "")
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set( CMAKE_C_FLAGS_RELEASE "-O3" )
set( CMAKE_C_FLAGS_DEBUG "-O0" )
set( CMAKE_C_LINK_FLAGS "" )
else()
message(WARNING "C compiler with ID ${CMAKE_C_COMPILER_ID} will be used with CMake default options")
endif()

# Configuration Options
set(CICE_IO "PIO" CACHE STRING "CICE OPTIONS: Choose IO options.")
set_property(CACHE CICE_IO PROPERTY STRINGS "NetCDF" "PIO" "Binary")

# Too many files to list, so include them via this file
include("cice_files.cmake")

# Collect source files for library
list(APPEND lib_src_files
${cice_shared_files}
${cice_shared_files_c}
${icepack_files}
${cice_mpi_comm_files}
${cice_nuopc_cmeps_driver_files}
${cice_cdeps_inline_files})

list(APPEND _cice_defs FORTRANUNDERSCORE
coupled)

# Select IO source files based on CICE_IO
if(CICE_IO MATCHES "NetCDF")
list(APPEND lib_src_files ${cice_netcdf_io_files})
list(APPEND _cice_defs USE_NETCDF)
elseif(CICE_IO MATCHES "PIO")
list(APPEND lib_src_files ${cice_pio2_io_files})
list(APPEND _cice_defs USE_NETCDF)
elseif(CICE_IO MATCHES "Binary")
list(APPEND lib_src_files ${cice_binary_io_files})
endif()

### Create target library and set PUBLIC interfaces on the library
add_library(cice STATIC ${lib_src_files})
set_target_properties(cice PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_compile_definitions(cice PUBLIC "${_cice_defs}")
target_include_directories(cice PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
target_link_libraries(cice PUBLIC esmf)
if(CICE_IO MATCHES "^(NetCDF|PIO)$")
target_link_libraries(cice PUBLIC NetCDF::NetCDF_Fortran)
if(CICE_IO MATCHES "PIO")
target_link_libraries(cice PUBLIC PIO::PIO_Fortran)
endif()
endif()
if(OpenMP_Fortran_FOUND)
target_link_libraries(cice PRIVATE OpenMP::OpenMP_Fortran)
endif()

# ice prescribed
add_dependencies(cice cdeps::cdeps)
target_compile_definitions(cice PUBLIC "DISABLE_FoX")
target_link_libraries(cice PUBLIC cdeps::cdeps)

###############################################################################
### Install
###############################################################################

install(
TARGETS cice
EXPORT cice-config
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
COMPONENT Library)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod DESTINATION ${CMAKE_INSTALL_PREFIX}/CICE)

install(EXPORT cice-config
DESTINATION lib/cmake)
2 changes: 1 addition & 1 deletion CMEPS-interface/CMEPS
35 changes: 32 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules/Modules)
###############################################################################

# Valid applications and choices
list(APPEND VALID_APPS ATM ATMAERO ATMAQ ATMW ATMWM ATML LND S2S S2SA S2SW S2SWA S2SWAL ATM_DS2S ATM_DS2S-PCICE HAFS HAFSW HAFS-MOM6 HAFS-MOM6W HAFS-ALL NG-GODAS)
list(APPEND VALID_APPS ATM ATMAERO ATMAQ ATMW ATMWM ATML ATMF LND LND-LM4 S2S S2SA S2SW S2SWA S2SWAL ATM_DS2S ATM_DS2S-PCICE HAFS HAFSW HAFS-MOM6 HAFS-MOM6W HAFS-ALL NG-GODAS)
set(APP NONE CACHE BOOL "Application Name")
if(NOT (APP IN_LIST VALID_APPS))
message(FATAL_ERROR "${APP} is not a valid application.\nValid Applications are: ${VALID_APPS}")
Expand All @@ -29,11 +29,13 @@ set(UFS_GOCART OFF CACHE BOOL "Enable GOCART")
set(MOM6 OFF CACHE BOOL "Enable MOM6")
set(HYCOM OFF CACHE BOOL "Enable HYCOM")
set(CICE6 OFF CACHE BOOL "Enable CICE6")
set(LM4 OFF CACHE BOOL "Enable LM4")
set(WW3 OFF CACHE BOOL "Enable WW3")
set(STOCH_PHYS OFF CACHE BOOL "Enable Stochastic Physics")
set(CMEPS OFF CACHE BOOL "Enable CMEPS")
set(CDEPS OFF CACHE BOOL "Enable CDEPS")
set(NOAHMP OFF CACHE BOOL "Enable NOAHMP")
set(FIRE_BEHAVIOR OFF CACHE BOOL "Enable Fire Behavior")

# Configure selected application specific components
message("")
Expand All @@ -47,11 +49,13 @@ message("GOCART ........... ${UFS_GOCART}")
message("MOM6 ............. ${MOM6}")
message("HYCOM ............ ${HYCOM}")
message("CICE6 ............ ${CICE6}")
message("LM4 .............. ${LM4}")
message("WW3 .............. ${WW3}")
message("STOCH_PHYS ....... ${STOCH_PHYS}")
message("CDEPS ............ ${CDEPS}")
message("CMEPS ............ ${CMEPS}")
message("NOAHMP ........... ${NOAHMP}")
message("FIRE_BEHAVIOR .... ${FIRE_BEHAVIOR}")

###############################################################################
### Build Options
Expand Down Expand Up @@ -156,7 +160,7 @@ if(FMS)
elseif (APP MATCHES "^(S2S|S2SA|S2SW|S2SWA|S2SWAL|ATM_DS2S|ATM_DS2S-PCICE|NG-GODAS|HAFS-MOM6|HAFS-MOM6W)$")
add_library(fms ALIAS FMS::fms_r8)
endif()
if(APP MATCHES "^(ATM|ATMAERO|ATMAQ|ATMWM|ATMW|ATML|HAFS|HAFS-ALL)$")
if(APP MATCHES "^(ATM|ATMAERO|ATMAQ|ATMWM|ATMW|ATML|ATMF|ATML-LM4|LND-LM4|HAFS|HAFS-ALL)$")
if(32BIT)
add_library(fms ALIAS FMS::fms_r4)
else()
Expand Down Expand Up @@ -259,12 +263,25 @@ if(CDEPS)
endif()

###############################################################################
### Land Components [NOAHMP]
### Land Components [NOAHMP and LM4]
###############################################################################

if (LM4)
add_subdirectory(LM4-driver)
endif()

if(NOAHMP)
add_subdirectory(NOAHMP-interface)
endif()

###############################################################################
### Fire Components [FIRE_BEHAVIOR]
###############################################################################
if(FIRE_BEHAVIOR)
set(NUOPC "ON" CACHE STRING "Build fire_behavior with NUOPC cap" FORCE)
add_subdirectory(fire_behavior)
endif()

###############################################################################
### UFS Library
###############################################################################
Expand Down Expand Up @@ -324,6 +341,12 @@ if(CICE6)
list(APPEND _ufs_libs_public cice)
endif()

if (LM4)
add_dependencies(ufs lm4)
list(APPEND _ufs_defs_private FRONT_LM4=lm4_cap_mod)
list(APPEND _ufs_libs_public lm4)
endif()

if(CMEPS)
add_dependencies(ufs cmeps)
list(APPEND _ufs_defs_private CMEPS FRONT_CMEPS=MED)
Expand All @@ -344,6 +367,12 @@ if(NOAHMP)
list(APPEND _ufs_libs_public noahmp)
endif()

if(FIRE_BEHAVIOR)
add_dependencies(ufs fire_behavior_nuopc)
list(APPEND _ufs_defs_private FRONT_FIRE_BEHAVIOR=fire_behavior_nuopc)
list(APPEND _ufs_libs_public fire_behavior_nuopc)
endif()

target_compile_definitions(ufs PRIVATE "${_ufs_defs_private}")
target_link_libraries(ufs PUBLIC "${_ufs_libs_public}")

Expand Down
Loading

0 comments on commit 3aaec72

Please sign in to comment.