Skip to content

Commit

Permalink
Clean up orography code (ufs-community#987)
Browse files Browse the repository at this point in the history
1) Remove unused subroutines and logic.
2) Move utility routines to their own module.
3) Move I/O routines to their own module.
4) Remove dependency on IP and SP libraries.
5) Add some unit testing.

Fixes ufs-community#970.
  • Loading branch information
GeorgeGayno-NOAA authored Sep 30, 2024
1 parent a3237fb commit 3be97cf
Show file tree
Hide file tree
Showing 10 changed files with 3,004 additions and 4,499 deletions.
14 changes: 3 additions & 11 deletions sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(lib_src netcdf_io.F90)
set(exe_src mtnlm7_oclsm.F)
set(lib_src io_utils.F90 orog_utils.F90)
set(exe_src mtnlm7_oclsm.F90)

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -convert big_endian -assume byterecl")
Expand All @@ -9,14 +9,11 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-invalid-boz")
endif()
endif()
if(ip_VERSION GREATER_EQUAL 4.0.0)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIP_V4")
endif()

set(exe_name orog)

add_library(orog_lib STATIC ${lib_src})
add_executable(${exe_name} mtnlm7_oclsm.F)
add_executable(${exe_name} mtnlm7_oclsm.F90)

set(mod_dir "${CMAKE_CURRENT_BINARY_DIR}/mod")
set_target_properties(orog_lib PROPERTIES Fortran_MODULE_DIRECTORY ${mod_dir})
Expand All @@ -27,13 +24,8 @@ target_link_libraries(
PUBLIC
bacio::bacio_4
w3emc::w3emc_d
ip::ip_d
NetCDF::NetCDF_Fortran)

if(sp_FOUND)
target_link_libraries(orog_lib PUBLIC sp::sp_d)
endif()

if(OpenMP_Fortran_FOUND)
target_link_libraries(orog_lib PUBLIC OpenMP::OpenMP_Fortran)
endif()
Expand Down
Loading

0 comments on commit 3be97cf

Please sign in to comment.