diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index ed7e56e94..8523a1845 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -7,3 +7,4 @@ find_package(soca REQUIRED) add_subdirectory(soca) add_subdirectory(ioda_example) +add_subdirectory(test) diff --git a/utils/ioda_example/CMakeLists.txt b/utils/ioda_example/CMakeLists.txt index 5e957569f..4ae18115f 100644 --- a/utils/ioda_example/CMakeLists.txt +++ b/utils/ioda_example/CMakeLists.txt @@ -1,6 +1,6 @@ -ecbuild_add_executable( TARGET gdas_dumpioda.x - SOURCES gdas_dumpioda.cc ) +ecbuild_add_executable( TARGET gdas_meanioda.x + SOURCES gdas_meanioda.cc ) -target_compile_features( gdas_dumpioda.x PUBLIC cxx_std_17) -target_link_libraries( gdas_dumpioda.x PUBLIC oops ioda) +target_compile_features( gdas_meanioda.x PUBLIC cxx_std_17) +target_link_libraries( gdas_meanioda.x PUBLIC oops ioda) diff --git a/utils/ioda_example/gdas_dumpioda.cc b/utils/ioda_example/gdas_meanioda.cc similarity index 91% rename from utils/ioda_example/gdas_dumpioda.cc rename to utils/ioda_example/gdas_meanioda.cc index a505eeee9..6fac6d2fb 100644 --- a/utils/ioda_example/gdas_dumpioda.cc +++ b/utils/ioda_example/gdas_meanioda.cc @@ -1,4 +1,4 @@ -#include "gdas_dumpioda.h" +#include "gdas_meanioda.h" #include "oops/runs/Run.h" // this is an example application that diff --git a/utils/ioda_example/gdas_dumpioda.h b/utils/ioda_example/gdas_meanioda.h similarity index 100% rename from utils/ioda_example/gdas_dumpioda.h rename to utils/ioda_example/gdas_meanioda.h diff --git a/utils/test/CMakeLists.txt b/utils/test/CMakeLists.txt new file mode 100644 index 000000000..6808b86fe --- /dev/null +++ b/utils/test/CMakeLists.txt @@ -0,0 +1,5 @@ +# Test example IODA utility that computes the mean of a variable +ecbuild_add_test( TARGET test_gdasapp_util_ioda_example + COMMAND ${CMAKE_BINARY_DIR}/bin/gdas_meanioda.x + ARGS "testinput/gdas_meanioda.yaml" + LIBS gdas-utils) \ No newline at end of file diff --git a/utils/test/testinput/gdas_meanioda.yaml b/utils/test/testinput/gdas_meanioda.yaml new file mode 100644 index 000000000..e7ece91bf --- /dev/null +++ b/utils/test/testinput/gdas_meanioda.yaml @@ -0,0 +1,11 @@ +window begin: 2020-11-01T09:00:00Z +window end: 2020-11-01T15:00:00Z +obs space: + name: amsua_n19 + obsdatain: + engine: + type: H5File + obsfile: Data/ufo/testinput_tier_1/instruments/radiance/amsua_n19_obs_2020110112_m.nc4 + simulated variables: [brightnessTemperature] + observed variables: [brightnessTemperature] + channel: 6