Skip to content

Commit

Permalink
convert the 2-D Wave Height and Wind Gust fields between Extended Sch…
Browse files Browse the repository at this point in the history
…imdt Gnomonic (ESG) grid and Rotated LatLon (RLL) grid for rrfs-based 3drtma #71
  • Loading branch information
GangZhao-NOAA authored Sep 13, 2024
1 parent 981f3e9 commit bed91f7
Show file tree
Hide file tree
Showing 17 changed files with 10,675 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ list(APPEND SUBLIST "PM")
list(APPEND SUBLIST "RADMON")
list(APPEND SUBLIST "REF2TTEN")
list(APPEND SUBLIST "RTMA_MINMAXTRH")
list(APPEND SUBLIST "RTMA_ESG_CONVERSION")
list(APPEND SUBLIST "UPDATE_BC")
list(APPEND SUBLIST "UPDATE_GVF")
list(APPEND SUBLIST "UPDATE_ICE")
Expand Down Expand Up @@ -86,6 +87,8 @@ find_package(gsi REQUIRED)
add_subdirectory(baselib/regional_esg_grid.fd)
add_subdirectory(baselib)

add_subdirectory(rtma_esg_conversion.fd/esg_lib.fd)

foreach(X IN LISTS SUBLIST)
if(${${X}})
string(TOLOWER ${X} x)
Expand Down
51 changes: 51 additions & 0 deletions rtma_esg_conversion.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
list(APPEND src_rll2esg
mod_rtma_regrid.F90
rtma_regrid_rll2esg.F90)

add_executable(rtma_regrid_rll2esg.exe ${src_rll2esg})
target_link_libraries(rtma_regrid_rll2esg.exe PRIVATE ${PROJECT_NAME}::pesglib2
PRIVATE bacio::bacio_4
PRIVATE g2::g2_4
PRIVATE g2tmpl::g2tmpl
PRIVATE ip::ip_d
PRIVATE sp::sp_d
PRIVATE w3emc::w3emc_4
PRIVATE NetCDF::NetCDF_Fortran
PRIVATE MPI::MPI_Fortran)
if(OpenMP_Fortran_FOUND)
target_link_libraries(rtma_regrid_rll2esg.exe PRIVATE OpenMP::OpenMP_Fortran)
endif()
list(APPEND ESG_CONVERSION_Targets rtma_regrid_rll2esg.exe)

list(APPEND src_esg2rll
mod_rtma_regrid.F90
rtma_regrid_esg2rll.F90)

add_executable(rtma_regrid_esg2rll.exe ${src_esg2rll})
target_link_libraries(rtma_regrid_esg2rll.exe PRIVATE ${PROJECT_NAME}::pesglib2
PRIVATE bacio::bacio_4
PRIVATE g2::g2_4
PRIVATE g2tmpl::g2tmpl
PRIVATE ip::ip_d
PRIVATE sp::sp_d
PRIVATE w3emc::w3emc_4
PRIVATE NetCDF::NetCDF_Fortran
PRIVATE MPI::MPI_Fortran)
if(OpenMP_Fortran_FOUND)
target_link_libraries(rtma_regrid_esg2rll.exe PRIVATE OpenMP::OpenMP_Fortran)
endif()
list(APPEND ESG_CONVERSION_Targets rtma_regrid_esg2rll.exe)

# if(ip_VERSION GREATER_EQUAL 4.0.0)
# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIP_V4")
# endif()
if(ip_VERSION LESS 4.0.0)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIP_V3")
endif()

install(
TARGETS ${ESG_CONVERSION_Targets}
EXPORT ${PROJECT_NAME}Exports
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
28 changes: 28 additions & 0 deletions rtma_esg_conversion.fd/esg_lib.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
list(APPEND src_esg_lib
pkind.f90
pietc.f90
pietc_s.f90
pmat.f90
pmat2.f90
pmat4.f90
pmat5.f90
pfun.f90
psym2.f90
pesg.f90
pbswi.f90)

set(module_dir "${CMAKE_CURRENT_BINARY_DIR}/include")
add_library(pesglib2 STATIC ${src_esg_lib})
add_library(${PROJECT_NAME}::pesglib2 ALIAS pesglib2)
# target_link_libraries(pesglib2 PUBLIC ${PROJECT_NAME}::ncio)
set_target_properties(pesglib2 PROPERTIES Fortran_MODULE_DIRECTORY "${module_dir}")
target_include_directories(pesglib2 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include DESTINATION ${CMAKE_INSTALL_PREFIX})

install(
TARGETS pesglib2
EXPORT ${PROJECT_NAME}Exports
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
Loading

0 comments on commit bed91f7

Please sign in to comment.