Skip to content

Commit

Permalink
Merge branch 'develop' into release/MAPL-v3
Browse files Browse the repository at this point in the history
# Conflicts:
#	Tests/CMakeLists.txt
#	gridcomps/ExtData2G/ExtDataGridCompNG.F90
  • Loading branch information
mathomp4 committed Aug 6, 2024
2 parents 38797d6 + aa8511e commit 5864359
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 217 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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,10 +1,9 @@
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
)

Expand All @@ -15,10 +14,12 @@ if (DUSTY)
PROPERTY COMPILE_FLAGS ${DUSTY})
endif ()

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

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 @@ -42,4 +43,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 5864359

Please sign in to comment.