Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some prep work for extdata2g vertical regridding development #2949

Merged
merged 4 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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