Skip to content

Commit

Permalink
Update to work with changes to UFO filters (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecooke77 authored Oct 22, 2024
1 parent fb7f33a commit 52ec5b6
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 37 deletions.
7 changes: 3 additions & 4 deletions src/opsinputs/CxWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
#include "ioda/ObsDataVector.h"
#include "oops/base/ObsVariables.h"
#include "oops/base/Variables.h"
#include "oops/interface/ObsFilterBase.h"
#include "oops/util/ObjectCounter.h"
#include "opsinputs/CxWriter.interface.h"
#include "opsinputs/CxWriterParameters.h"
#include "ufo/ObsTraits.h"
#include "ufo/ObsFilterBase.h"

namespace eckit {
class Configuration;
Expand All @@ -42,7 +41,7 @@ class LocalEnvironment;
/// Most of the implementation is in Fortran (opsinputs_cxwriter_mod.F90).
///
/// \see CxWriterParameters for the list of accepted configuration parameters.
class CxWriter : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
class CxWriter : public ufo::ObsFilterBase,
private util::ObjectCounter<CxWriter> {
public:
static const std::string classname() {return "opsinputs::CxWriter";}
Expand All @@ -62,7 +61,7 @@ class CxWriter : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
const ioda::ObsVector &hofx,
const ioda::ObsVector &bias,
const ufo::ObsDiagnostics & diags) 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/opsinputs/CxWriterParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
#include <string>
#include <vector>

#include "oops/generic/ObsFilterParametersBase.h"
#include "oops/util/parameters/OptionalParameter.h"
#include "oops/util/parameters/Parameter.h"
#include "ufo/ObsFilterParametersBase.h"
#include "ufo/utils/parameters/ParameterTraitsVariable.h"

namespace opsinputs {

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

public:
/// Determines OPS verbosity.
Expand Down
7 changes: 3 additions & 4 deletions src/opsinputs/VarObsWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
#include "ioda/ObsDataVector.h"
#include "oops/base/ObsVariables.h"
#include "oops/base/Variables.h"
#include "oops/interface/ObsFilterBase.h"
#include "oops/util/ObjectCounter.h"
#include "oops/util/Printable.h"
#include "opsinputs/VarObsWriter.interface.h"
#include "opsinputs/VarObsWriterParameters.h"
#include "ufo/ObsTraits.h"
#include "ufo/ObsFilterBase.h"

namespace eckit {
class Configuration;
Expand Down Expand Up @@ -51,7 +50,7 @@ class LocalEnvironment;
/// Ops_WriteVarobs).
///
/// \see VarObsWriterParameters for the list of accepted configuration parameters.
class VarObsWriter : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
class VarObsWriter : public ufo::ObsFilterBase,
private util::ObjectCounter<VarObsWriter> {
public:
static const std::string classname() {return "opsinputs::VarObsWriter";}
Expand All @@ -71,7 +70,7 @@ class VarObsWriter : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
const ioda::ObsVector &hofx,
const ioda::ObsVector &bias,
const ufo::ObsDiagnostics &diags) 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/opsinputs/VarObsWriterParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
#include <vector>

#include "eckit/exception/Exceptions.h"
#include "oops/generic/ObsFilterParametersBase.h"
#include "oops/util/parameters/OptionalParameter.h"
#include "oops/util/parameters/Parameter.h"
#include "oops/util/parameters/RequiredParameter.h"
#include "ufo/filters/Variable.h"
#include "ufo/ObsFilterParametersBase.h"
#include "ufo/utils/parameters/ParameterTraitsVariable.h"

namespace opsinputs {

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

public:
/// Determines OPS verbosity.
Expand Down
7 changes: 3 additions & 4 deletions src/opsinputs/instantiateObsFilterFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@

#include "opsinputs/instantiateObsFilterFactory.h"

#include "oops/interface/ObsFilterBase.h"
#include "opsinputs/CxWriter.h"
#include "opsinputs/VarObsWriter.h"
#include "ufo/ObsTraits.h"
#include "ufo/ObsFilterBase.h"

namespace opsinputs {

void instantiateObsFilterFactory() {
static oops::interface::FilterMaker<ufo::ObsTraits, VarObsWriter>
static ufo::FilterMaker<VarObsWriter>
makerVarObsWriter_("VarObs Writer");
static oops::interface::FilterMaker<ufo::ObsTraits, CxWriter>
static ufo::FilterMaker<CxWriter>
makerCxWriter_("Cx Writer");
}

Expand Down
6 changes: 3 additions & 3 deletions test/opsinputs/CxChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#include "ioda/ObsDataVector.h"
#include "oops/base/ObsVariables.h"
#include "oops/base/Variables.h"
#include "oops/interface/ObsFilterBase.h"
#include "oops/util/ObjectCounter.h"
#include "ufo/ObsFilterBase.h"
#include "ufo/ObsTraits.h"

namespace eckit {
Expand Down Expand Up @@ -48,7 +48,7 @@ namespace test {
/// from that output.
///
/// See CxCheckerParameters for a list of available options.
class CxChecker : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
class CxChecker : public ufo::ObsFilterBase,
private util::ObjectCounter<CxChecker> {
public:
static const std::string classname() {return "opsinputs::test::CxChecker";}
Expand All @@ -68,7 +68,7 @@ class CxChecker : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
const ioda::ObsVector &hofx,
const ioda::ObsVector &bias,
const ufo::ObsDiagnostics &) 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
4 changes: 2 additions & 2 deletions test/opsinputs/CxCheckerParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
#include <vector>

#include "eckit/exception/Exceptions.h"
#include "oops/generic/ObsFilterParametersBase.h"
#include "oops/util/parameters/OptionalParameter.h"
#include "oops/util/parameters/Parameter.h"
#include "ufo/ObsFilterParametersBase.h"

namespace opsinputs {

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

public:
Expand Down
6 changes: 3 additions & 3 deletions test/opsinputs/ResetFlagsToPass.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "ioda/ObsDataVector.h"
#include "oops/base/ObsVariables.h"
#include "oops/base/Variables.h"
#include "oops/interface/ObsFilterBase.h"
#include "oops/util/ObjectCounter.h"
#include "ufo/ObsFilterBase.h"
#include "ufo/ObsTraits.h"

namespace eckit {
Expand All @@ -40,7 +40,7 @@ namespace test {
/// \brief Resets observation QC flags to 'pass'.
///
/// See ResetFlagsToPassParameters for the available options.
class ResetFlagsToPass : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
class ResetFlagsToPass : public ufo::ObsFilterBase,
private util::ObjectCounter<ResetFlagsToPass> {
public:
static const std::string classname() {return "opsinputs::test::ResetFlagsToPass";}
Expand All @@ -60,7 +60,7 @@ class ResetFlagsToPass : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
const ioda::ObsVector &hofx,
const ioda::ObsVector &bias,
const ufo::ObsDiagnostics &) 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
4 changes: 2 additions & 2 deletions test/opsinputs/ResetFlagsToPassParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

#include <vector>

#include "oops/generic/ObsFilterParametersBase.h"
#include "oops/util/parameters/Parameter.h"
#include "ufo/ObsFilterParametersBase.h"

namespace opsinputs {

/// \brief ResetFlagsToPass filter's options.
class ResetFlagsToPassParameters : public oops::ObsFilterParametersBase {
class ResetFlagsToPassParameters : public ufo::ObsFilterParametersBase {
OOPS_CONCRETE_PARAMETERS(ResetFlagsToPassParameters, ObsFilterParametersBase)

public:
Expand Down
6 changes: 3 additions & 3 deletions test/opsinputs/VarObsChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "ioda/ObsDataVector.h"
#include "oops/base/ObsVariables.h"
#include "oops/base/Variables.h"
#include "oops/interface/ObsFilterBase.h"
#include "oops/util/ObjectCounter.h"
#include "ufo/ObsFilterBase.h"
#include "ufo/ObsTraits.h"

namespace eckit {
Expand Down Expand Up @@ -47,7 +47,7 @@ namespace test {
/// from that output.
///
/// See VarObsCheckerParameters for a list of available options.
class VarObsChecker : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
class VarObsChecker : public ufo::ObsFilterBase,
private util::ObjectCounter<VarObsChecker> {
public:
static const std::string classname() {return "opsinputs::test::VarObsChecker";}
Expand All @@ -67,7 +67,7 @@ class VarObsChecker : public oops::interface::ObsFilterBase<ufo::ObsTraits>,
const ioda::ObsVector &hofx,
const ioda::ObsVector &bias,
const ufo::ObsDiagnostics &) 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
4 changes: 2 additions & 2 deletions test/opsinputs/VarObsCheckerParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
#include <vector>

#include "eckit/exception/Exceptions.h"
#include "oops/generic/ObsFilterParametersBase.h"
#include "oops/util/parameters/OptionalParameter.h"
#include "oops/util/parameters/Parameter.h"
#include "oops/util/parameters/RequiredParameter.h"
#include "ufo/ObsFilterParametersBase.h"

namespace opsinputs {

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

public:
Expand Down
8 changes: 4 additions & 4 deletions test/opsinputs/instantiateObsFilterFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
#include "../opsinputs/CxChecker.h"
#include "../opsinputs/ResetFlagsToPass.h"
#include "../opsinputs/VarObsChecker.h"
#include "oops/interface/ObsFilterBase.h"
#include "ufo/ObsFilterBase.h"
#include "ufo/ObsTraits.h"

namespace opsinputs {
namespace test {

void instantiateObsFilterFactory() {
static oops::interface::FilterMaker<ufo::ObsTraits, VarObsChecker>
static ufo::FilterMaker<VarObsChecker>
varObsCheckerMaker("VarObs Checker");
static oops::interface::FilterMaker<ufo::ObsTraits, CxChecker>
static ufo::FilterMaker<CxChecker>
cxCheckerMaker("Cx Checker");
static oops::interface::FilterMaker<ufo::ObsTraits, ResetFlagsToPass>
static ufo::FilterMaker<ResetFlagsToPass>
resetFlagsToPassMaker("Reset Flags to Pass");
}

Expand Down

0 comments on commit 52ec5b6

Please sign in to comment.