Skip to content

Commit

Permalink
Update to work with changes to UFO filters (#72)
Browse files Browse the repository at this point in the history
* ufo filterbase

* remove ufo ObsTraits
---------

Co-authored-by: mikecooke77 <[email protected]>
  • Loading branch information
ctgh and mikecooke77 authored Oct 22, 2024
1 parent 2dded66 commit 9d14f49
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
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);
}

0 comments on commit 9d14f49

Please sign in to comment.