diff --git a/.gitignore b/.gitignore index 2dc827ccf..c9d3f6e12 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,8 @@ # USE CAUTION WHEN ADDING WILDCARDS, as some builds use different filename # # conventions than others # ############################################################################## -build/ -install/ +build*/ +install*/ *.[aox] *.mod diff --git a/.gitmodules b/.gitmodules index 2c09fa095..742a824df 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ -[submodule "sorc/post_gtg.fd"] - path = sorc/post_gtg.fd - url = https://github.com/NCAR/UPP_GTG - update = none +[submodule "post_gtg.fd"] + path = sorc/ncep_post.fd/post_gtg.fd + url = https://github.com/NCAR/UPP_GTG + update = none diff --git a/CMakeLists.txt b/CMakeLists.txt index ff311e9d0..8100dd0d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") option(OPENMP "use OpenMP threading" ON) option(BUILD_POSTEXEC "Build NCEPpost executable" ON) option(BUILD_WITH_WRFIO "Build NCEPpost with WRF-IO library" OFF) +option(BUILD_WITH_GTG "Build NCEPpost with NCAR/GTG" OFF) option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF) if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") @@ -47,7 +48,9 @@ find_package(bacio REQUIRED) find_package(crtm REQUIRED) find_package(g2 REQUIRED) find_package(g2tmpl REQUIRED) -find_package(ip REQUIRED) +if(BUILD_WITH_GTG) + find_package(ip REQUIRED) +endif() if(BUILD_POSTEXEC) find_package(nemsio REQUIRED) diff --git a/sorc/ncep_post.fd/CMakeLists.txt b/sorc/ncep_post.fd/CMakeLists.txt index 8dc6fae37..5fba419fc 100644 --- a/sorc/ncep_post.fd/CMakeLists.txt +++ b/sorc/ncep_post.fd/CMakeLists.txt @@ -63,20 +63,12 @@ list(APPEND LIB_SRC GPVS.f grib2_module.f GRIDSPEC.f - gtg_algo.F90 - gtg_compute.F90 - gtg_config.F90 - gtg_ctlblk.F90 - gtg_filter.F90 - gtg_indices.F90 - gtg_smoothseams.F90 ICAOHEIGHT.f kinds_mod.F LFMFLD.f LFMFLD_GFS.f LOOKUP.f machine.f - map_routines.F90 MAPSSLP.f MASKS_mod.f MDL2AGL.f @@ -137,6 +129,22 @@ list(APPEND LIB_SRC xml_perl_data.f ZENSUN.f) +list(APPEND GTG_LIB_SRC + gtg_algo.F90 + gtg_compute.F90 + gtg_config.F90 + gtg_ctlblk.F90 + gtg_filter.F90 + gtg_indices.F90 + gtg_smoothseams.F90 + map_routines.F90) + +if(BUILD_WITH_GTG) + list(TRANSFORM GTG_LIB_SRC PREPEND post_gtg.fd/) +endif() + +list(APPEND LIB_SRC ${GTG_LIB_SRC}) + list(APPEND EXE_SRC ASSIGNNEMSIOVAR.f GETNEMSNDSCATTER.f @@ -200,10 +208,14 @@ target_link_libraries(${LIBNAME} PUBLIC crtm::crtm g2::g2_4 g2tmpl::g2tmpl - ip::ip_4 MPI::MPI_Fortran NetCDF::NetCDF_Fortran) +if(BUILD_WITH_GTG) + target_link_libraries(${LIBNAME} PUBLIC + ip::ip_4) +endif() + if(OpenMP_Fortran_FOUND) target_link_libraries(${LIBNAME} PUBLIC OpenMP::OpenMP_Fortran) endif() diff --git a/sorc/post_gtg.fd b/sorc/ncep_post.fd/post_gtg.fd similarity index 100% rename from sorc/post_gtg.fd rename to sorc/ncep_post.fd/post_gtg.fd