-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00cfdc5
commit 072b63d
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ find_package(atlas REQUIRED) | |
find_package(soca REQUIRED) | ||
|
||
add_subdirectory(soca) | ||
add_subdirectory(ioda_example) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ecbuild_add_executable( TARGET gdas_dumpioda.x | ||
SOURCES gdas_dumpioda.cc ) | ||
|
||
target_compile_features( gdas_dumpioda.x PUBLIC cxx_std_17) | ||
target_link_libraries( gdas_dumpioda.x PUBLIC oops ioda) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "gdas_dumpioda.h" | ||
#include "oops/runs/Run.h" | ||
|
||
// this is an example application that | ||
// will use IODA to read a file and print something | ||
// it is intended to be very bare bones | ||
|
||
int main(int argc, char ** argv) { | ||
oops::Run run(argc, argv); | ||
gdasapp::IodaExample iodaexample; | ||
return run.execute(iodaexample); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include <iostream> | ||
#include "eckit/config/LocalConfiguration.h" | ||
#include "ioda/Group.h" | ||
#include "ioda/ObsSpace.h" | ||
#include "ioda/ObsVector.h" | ||
#include "oops/base/PostProcessor.h" | ||
#include "oops/mpi/mpi.h" | ||
#include "oops/runs/Application.h" | ||
#include "oops/util/DateTime.h" | ||
#include "oops/util/Duration.h" | ||
#include "oops/util/Logger.h" | ||
|
||
namespace gdasapp { | ||
|
||
class IodaExample : public oops::Application { | ||
public: | ||
explicit IodaExample(const eckit::mpi::Comm & comm = oops::mpi::world()) | ||
: Application(comm) {} | ||
static const std::string classname() {return "gdasapp::IodaExample";} | ||
|
||
int execute(const eckit::Configuration & fullConfig, bool /*validate*/) const { | ||
|
||
// get the obs space configuration | ||
const eckit::LocalConfiguration obsConfig(fullConfig, "obs space"); | ||
ioda::ObsTopLevelParameters obsparams; | ||
obsparams.validateAndDeserialize(obsConfig); | ||
oops::Log::info() << "obs space: " << std::endl << obsConfig << std::endl; | ||
|
||
// read the obs space | ||
std::string winbegin; | ||
std::string winend; | ||
fullConfig.get("window begin", winbegin); | ||
fullConfig.get("window end", winend); | ||
ioda::ObsSpace ospace(obsparams, oops::mpi::world(), util::DateTime(winbegin), util::DateTime(winend), oops::mpi::myself()); | ||
const size_t nlocs = ospace.nlocs(); | ||
oops::Log::info() << "nlocs =" << nlocs << std::endl; | ||
|
||
return 0; | ||
} | ||
// ----------------------------------------------------------------------------- | ||
private: | ||
std::string appname() const { | ||
return "gdasapp::IodaExample"; | ||
} | ||
// ----------------------------------------------------------------------------- | ||
}; | ||
|
||
} // namespace gdasapp |