Skip to content

Commit

Permalink
Merge pull request #2949 from GEOS-ESM/feature/bmauer/extdata_vertica…
Browse files Browse the repository at this point in the history
…l_prep

some prep work for extdata2g vertical regridding development
  • Loading branch information
tclune authored Aug 6, 2024
2 parents 0f7a649 + 9664ebe commit aa8511e
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 218 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Added new driver, CapDriver.x, to excerise the MAPL_Cap with the configuratable component also used by ExtDataDriver.x
- Added Fortran interface to UDUNITS2
- NOTE: This now means MAPL depends on UDUNITS2 (and transitively, expat)
- Improve mask sampler by adding an MPI step and a LS_chunk (intermediate step)
Expand Down
19 changes: 14 additions & 5 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
esma_set_this (OVERRIDE MAPL.test_utilities)

set(MODULE_DIRECTORY "${esma_include}/Tests")

set (srcs
ExtDataDriverGridComp.F90
ExtDataRoot_GridComp.F90
ExtDataDriver.F90
ExtDataDriverMod.F90
VarspecDescription.F90
)

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL NetCDF::NetCDF_Fortran NetCDF::NetCDF_C TYPE ${MAPL_LIBRARY_TYPE})

if (BUILD_WITH_FARGPARSE)

ecbuild_add_executable (TARGET ExtDataDriver.x SOURCES ${srcs})
target_link_libraries (ExtDataDriver.x PRIVATE MAPL FARGPARSE::fargparse ESMF::ESMF)
ecbuild_add_executable (TARGET ExtDataDriver.x SOURCES ExtDataDriver.F90 ExtDataDriverGridComp.F90 ExtDataDriverMod.F90)
target_link_libraries (ExtDataDriver.x PRIVATE MAPL MAPL.test_utilities FARGPARSE::fargparse ESMF::ESMF)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(ExtDataDriver.x PRIVATE OpenMP::OpenMP_Fortran)
Expand All @@ -35,4 +36,12 @@ if (BUILD_WITH_FARGPARSE)
endif ()
set_target_properties(MAPL_demo_fargparse.x PROPERTIES Fortran_MODULE_DIRECTORY ${MODULE_DIRECTORY})

ecbuild_add_executable (TARGET CapDriver.x SOURCES CapDriver.F90)
target_link_libraries (CapDriver.x PRIVATE MAPL MAPL.test_utilities FARGPARSE::fargparse ESMF::ESMF)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(CapDriver.x PRIVATE OpenMP::OpenMP_Fortran)
endif ()
set_target_properties(CapDriver.x PROPERTIES Fortran_MODULE_DIRECTORY ${MODULE_DIRECTORY})

endif ()
24 changes: 24 additions & 0 deletions Tests/CapDriver.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#define I_AM_MAIN

#include "MAPL_Generic.h"

program CapDriver_Main
use MPI
use MAPL
use ExtDataUtRoot_GridCompMod, only: ROOT_SetServices => SetServices
implicit none

character(len=*), parameter :: Iam="CapDriver_Main"
type (MAPL_Cap) :: cap
type (MAPL_FargparseCLI) :: cli
type (MAPL_CapOptions) :: cap_options
integer :: status

cli = MAPL_FargparseCLI()
cap_options = MAPL_CapOptions(cli)
cap = MAPL_Cap('Root', ROOT_SetServices, cap_options = cap_options)

call cap%run(_RC)

end program CapDriver_Main

Loading

0 comments on commit aa8511e

Please sign in to comment.