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

Update to work with changes to UFO filters #72

Merged
merged 5 commits into from
Oct 22, 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
7 changes: 3 additions & 4 deletions src/nemo-feedback/NemoFeedback.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@
#include "ioda/ObsDataVector.h"
#include "oops/base/Variables.h"
#include "oops/base/ObsVariables.h"
#include "oops/interface/ObsFilterBase.h"
#include "oops/util/ObjectCounter.h"
#include "oops/util/Printable.h"
#include "nemo-feedback/NemoFeedbackParameters.h"
#include "nemo-feedback/feedback_io/Writer.h"
#include "nemo-feedback/NemoFeedbackDataCreator.h"
#include "ufo/filters/ObsFilterData.h"
#include "ufo/ObsTraits.h"
#include "ufo/ObsFilterBase.h"
#include "ufo/utils/VariableNameMap.h"

namespace nemo_feedback {

/// \brief UFO filter for outputting data to NEMO feedback file
class NemoFeedback : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
class NemoFeedback : public ufo::ObsFilterBase,
private util::ObjectCounter<NemoFeedback> {
public:
static const std::string classname() {return "nemo_feedback::NemoFeedback";}
Expand All @@ -46,7 +45,7 @@ class NemoFeedback : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
const ioda::ObsVector &ov,
const ioda::ObsVector &bv,
const ufo::ObsDiagnostics &dv) override;
void checkFilterData(const oops::FilterStage filterStage) override {}
void checkFilterData(const ufo::FilterStage filterStage) override {}

oops::Variables requiredVars() const override {return geovars_;}
oops::ObsVariables requiredHdiagnostics() const override {return extradiagvars_;}
Expand Down
6 changes: 3 additions & 3 deletions src/nemo-feedback/NemoFeedbackParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#include <vector>

#include "eckit/exception/Exceptions.h"
#include "oops/generic/ObsFilterParametersBase.h"
#include "oops/util/parameters/Parameter.h"
#include "oops/util/parameters/OptionalParameter.h"
#include "oops/util/parameters/RequiredParameter.h"
#include "ufo/filters/processWhere.h"
#include "ufo/ObsFilterParametersBase.h"
#include "nemo-feedback/NemoFeedbackParameterTraitsOutputDtype.h"

namespace nemo_feedback {
Expand Down Expand Up @@ -43,9 +43,9 @@ class NemoFeedbackVariableParameters : public oops::Parameters {
};

/// \brief NemoFeedback options.
class NemoFeedbackParameters : public oops::ObsFilterParametersBase {
class NemoFeedbackParameters : public ufo::ObsFilterParametersBase {
OOPS_CONCRETE_PARAMETERS(NemoFeedbackParameters,
oops::ObsFilterParametersBase)
ufo::ObsFilterParametersBase)

public:
oops::Parameter<std::string> Filename{"filename", "nemo_fdbk_out.nc", this};
Expand Down
5 changes: 2 additions & 3 deletions src/nemo-feedback/instantiateObsFilterFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

#pragma once

#include "oops/interface/ObsFilterBase.h"
#include "nemo-feedback/NemoFeedback.h"
#include "ufo/ObsFilterBase.h"

namespace nemo_feedback {

template<typename OBS>
void instantiateObsFilterFactory() {
static oops::interface::FilterMaker<OBS, NemoFeedback>
static ufo::FilterMaker<NemoFeedback>
makerNemoFeedback_("NEMO Feedback Writer");
}

Expand Down
3 changes: 1 addition & 2 deletions src/tests/mains/TestObsFilters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
#include "oops/runs/Run.h"
#include "nemo-feedback/instantiateObsFilterFactory.h"
#include "ufo/instantiateObsFilterFactory.h"
#include "ufo/ObsTraits.h"

int main(int argc, char ** argv) {
oops::Run run(argc, argv);
ufo::instantiateObsFilterFactory();
nemo_feedback::instantiateObsFilterFactory<ufo::ObsTraits>();
nemo_feedback::instantiateObsFilterFactory();
ufo::test::ObsFilters tests;
return run.execute(tests);
}
Loading