diff --git a/src/opsinputs/CxWriter.cc b/src/opsinputs/CxWriter.cc index 2018f867..1ca7058a 100644 --- a/src/opsinputs/CxWriter.cc +++ b/src/opsinputs/CxWriter.cc @@ -13,7 +13,6 @@ #include "ioda/ObsDataVector.h" #include "ioda/ObsSpace.h" #include "ioda/ObsVector.h" -#include "oops/base/Variables.h" #include "oops/util/Logger.h" #include "opsinputs/CxWriterParameters.h" #include "opsinputs/LocalEnvironment.h" @@ -93,7 +92,7 @@ void CxWriter::postFilter(const ufo::GeoVaLs & gv, ufo::Variables filtervars; for (const ufo::Variable &var : parameters_.variables_for_qc.value().get()) filtervars += var; - ioda::ObsDataVector flags(obsdb_, filtervars.toOopsVariables()); + ioda::ObsDataVector flags(obsdb_, filtervars.toOopsObsVariables()); for (int ivar = 0; ivar < flags.nvars(); ivar++) { const std::string varname = flags.varnames()[ivar]; flags[varname] = flags_->operator[](varname); diff --git a/src/opsinputs/CxWriter.h b/src/opsinputs/CxWriter.h index b9891821..c0ece6da 100644 --- a/src/opsinputs/CxWriter.h +++ b/src/opsinputs/CxWriter.h @@ -11,6 +11,7 @@ #include #include "ioda/ObsDataVector.h" +#include "oops/base/ObsVariables.h" #include "oops/base/Variables.h" #include "oops/interface/ObsFilterBase.h" #include "oops/util/ObjectCounter.h" @@ -64,7 +65,7 @@ class CxWriter : public oops::interface::ObsFilterBase, void checkFilterData(const oops::FilterStage filterStage) override {} oops::Variables requiredVars() const override {return geovars_;} - oops::Variables requiredHdiagnostics() const override {return extradiagvars_;} + oops::ObsVariables requiredHdiagnostics() const override {return extradiagvars_;} private: void print(std::ostream &) const override; @@ -77,7 +78,7 @@ class CxWriter : public oops::interface::ObsFilterBase, ioda::ObsSpace & obsdb_; oops::Variables geovars_; - oops::Variables extradiagvars_; + oops::ObsVariables extradiagvars_; std::shared_ptr> flags_; std::shared_ptr> obsErrors_; diff --git a/src/opsinputs/CxWriter.interface.F90 b/src/opsinputs/CxWriter.interface.F90 index f5cf7e73..7728fb0d 100644 --- a/src/opsinputs/CxWriter.interface.F90 +++ b/src/opsinputs/CxWriter.interface.F90 @@ -10,6 +10,7 @@ module opsinputs_cxwriter_mod_c c_bool, & c_int, & c_ptr +use obs_variables_mod, only: obs_variables use oops_variables_mod, only: oops_variables use opsinputs_cxwriter_mod, only: & opsinputs_cxwriter, & @@ -112,13 +113,13 @@ subroutine opsinputs_cxwriter_post_c(c_self, c_obspace, c_geovals, c_flags, & type(opsinputs_cxwriter), pointer :: self type(ufo_geovals), pointer :: geovals -type(oops_variables) :: f_varnames +type(obs_variables) :: f_varnames call opsinputs_cxwriter_registry%get(c_self, self) call ufo_geovals_registry%get(c_geovals, geovals) ! Obtain simulated variable names. -f_varnames = oops_variables(c_varnames) +f_varnames = obs_variables(c_varnames) call opsinputs_cxwriter_post(self, c_obspace, geovals, c_flags, & f_varnames, c_hofx) diff --git a/src/opsinputs/CxWriter.interface.h b/src/opsinputs/CxWriter.interface.h index 96d4cfe9..d8fe3d4f 100644 --- a/src/opsinputs/CxWriter.interface.h +++ b/src/opsinputs/CxWriter.interface.h @@ -7,6 +7,7 @@ #define OPSINPUTS_CXWRITER_INTERFACE_H_ #include "ioda/ObsSpace.h" +#include "oops/base/ObsVariables.h" #include "oops/base/Variables.h" #include "ufo/Fortran.h" @@ -37,7 +38,7 @@ extern "C" { const ufo::F90goms &, const ioda::ObsDataVector &flags, const int &nvars, const int &nlocs, - const oops::Variables &varnames, const double *hofx); + const oops::ObsVariables &varnames, const double *hofx); } // extern C } // namespace opsinputs diff --git a/src/opsinputs/VarObsWriter.cc b/src/opsinputs/VarObsWriter.cc index 69e350e2..d254f145 100644 --- a/src/opsinputs/VarObsWriter.cc +++ b/src/opsinputs/VarObsWriter.cc @@ -15,7 +15,6 @@ #include "ioda/ObsDataVector.h" #include "ioda/ObsSpace.h" #include "ioda/ObsVector.h" -#include "oops/base/Variables.h" #include "oops/mpi/mpi.h" #include "oops/util/IntSetParser.h" #include "oops/util/Logger.h" @@ -121,7 +120,7 @@ void VarObsWriter::postFilter(const ufo::GeoVaLs & gv, ufo::Variables filtervars; for (const ufo::Variable &var : parameters_.variables_for_qc.value().get()) filtervars += var; - ioda::ObsDataVector flags(obsdb_, filtervars.toOopsVariables()); + ioda::ObsDataVector flags(obsdb_, filtervars.toOopsObsVariables()); for (int ivar = 0; ivar < flags.nvars(); ivar++) { std::string varname = flags.varnames()[ivar]; flags[varname] = flags_->operator[](varname); diff --git a/src/opsinputs/VarObsWriter.h b/src/opsinputs/VarObsWriter.h index 585dbb42..6c4d214b 100644 --- a/src/opsinputs/VarObsWriter.h +++ b/src/opsinputs/VarObsWriter.h @@ -13,6 +13,7 @@ #include #include "ioda/ObsDataVector.h" +#include "oops/base/ObsVariables.h" #include "oops/base/Variables.h" #include "oops/interface/ObsFilterBase.h" #include "oops/util/ObjectCounter.h" @@ -73,7 +74,7 @@ class VarObsWriter : public oops::interface::ObsFilterBase, void checkFilterData(const oops::FilterStage filterStage) override {} oops::Variables requiredVars() const override {return geovars_;} - oops::Variables requiredHdiagnostics() const override {return extradiagvars_;} + oops::ObsVariables requiredHdiagnostics() const override {return extradiagvars_;} private: void print(std::ostream &) const override; @@ -86,7 +87,7 @@ class VarObsWriter : public oops::interface::ObsFilterBase, ioda::ObsSpace & obsdb_; oops::Variables geovars_; - oops::Variables extradiagvars_; + oops::ObsVariables extradiagvars_; std::shared_ptr> flags_; std::shared_ptr> obsErrors_; std::vector varchannels_; diff --git a/src/opsinputs/VarObsWriter.interface.F90 b/src/opsinputs/VarObsWriter.interface.F90 index b4e920e2..eb4bd6ff 100644 --- a/src/opsinputs/VarObsWriter.interface.F90 +++ b/src/opsinputs/VarObsWriter.interface.F90 @@ -44,6 +44,7 @@ function opsinputs_varobswriter_create_c(c_self, c_conf, c_comm_is_valid, c_comm c_varlist, c_varlist_diags) & bind(c,name='opsinputs_varobswriter_create_f90') use oops_variables_mod +use obs_variables_mod implicit none integer(c_int), intent(inout) :: c_self type(c_ptr), value, intent(in) :: c_conf @@ -61,14 +62,14 @@ function opsinputs_varobswriter_create_c(c_self, c_conf, c_comm_is_valid, c_comm type(fckit_configuration) :: f_conf integer(gc_int_kind) :: f_comm type(oops_variables) :: f_varlist -type(oops_variables) :: f_varlist_diags +type(obs_variables) :: f_varlist_diags call opsinputs_varobswriter_registry%setup(c_self, self) f_conf = fckit_configuration(c_conf) f_comm = c_comm f_varlist = oops_variables(c_varlist) -f_varlist_diags = oops_variables(c_varlist_diags) +f_varlist_diags = obs_variables(c_varlist_diags) if (opsinputs_varobswriter_create(self, f_conf, c_comm_is_valid, f_comm, c_channels, & f_varlist, f_varlist_diags)) then opsinputs_varobswriter_create_c = 1 diff --git a/src/opsinputs/VarObsWriter.interface.h b/src/opsinputs/VarObsWriter.interface.h index a3103e4d..73281395 100644 --- a/src/opsinputs/VarObsWriter.interface.h +++ b/src/opsinputs/VarObsWriter.interface.h @@ -9,6 +9,7 @@ #include #include "ioda/ObsSpace.h" +#include "oops/base/ObsVariables.h" #include "oops/base/Variables.h" #include "ufo/Fortran.h" @@ -34,7 +35,7 @@ extern "C" { const MPI_Fint &comm, const int &nchannels, const int *channels, - oops::Variables &, oops::Variables &); + oops::Variables &, oops::ObsVariables &); void opsinputs_varobswriter_delete_f90(F90check &); void opsinputs_varobswriter_prior_f90(const F90check &, const ioda::ObsSpace &, const ufo::F90goms &); diff --git a/src/opsinputs/opsinputs_cxwriter_mod.F90 b/src/opsinputs/opsinputs_cxwriter_mod.F90 index 6767bbbe..67738a66 100644 --- a/src/opsinputs/opsinputs_cxwriter_mod.F90 +++ b/src/opsinputs/opsinputs_cxwriter_mod.F90 @@ -22,6 +22,7 @@ module opsinputs_cxwriter_mod use obsspace_mod, only: & obsspace_get_db, & obsspace_get_nlocs +use obs_variables_mod, only: obs_variables use oops_variables_mod, only: oops_variables use opsinputs_cxfields_mod use opsinputs_fill_mod, only: & @@ -173,7 +174,7 @@ module opsinputs_cxwriter_mod type(ufo_geovals), pointer :: GeoVals type(opsinputs_jeditoopslayoutmapping) :: JediToOpsLayoutMapping - type(oops_variables) :: varnames + type(obs_variables) :: varnames real(c_double), pointer :: hofx(:, :) end type opsinputs_cxwriter @@ -501,7 +502,7 @@ subroutine opsinputs_cxwriter_post(self, ObsSpace, GeoVals, Flags, varnames, hof type(c_ptr), value, intent(in) :: ObsSpace type(ufo_geovals), intent(in), pointer :: GeoVals type(c_ptr), value, intent(in) :: Flags -type(oops_variables), intent(in) :: varnames +type(obs_variables), intent(in) :: varnames real(c_double), intent(in), target :: hofx(:, :) ! Local declarations: diff --git a/src/opsinputs/opsinputs_fill_mod.F90 b/src/opsinputs/opsinputs_fill_mod.F90 index 9f544501..e016154e 100644 --- a/src/opsinputs/opsinputs_fill_mod.F90 +++ b/src/opsinputs/opsinputs_fill_mod.F90 @@ -17,6 +17,7 @@ module opsinputs_fill_mod use obsspace_mod, only: & obsspace_has, & obsspace_get_db +use obs_variables_mod, only: obs_variables use oops_variables_mod, only: oops_variables use ufo_geovals_mod, only: & ufo_geoval, & @@ -1487,7 +1488,7 @@ subroutine opsinputs_fill_fillreal2dfromgeovalorhofx( & character(len=*), intent(in) :: JediVarName type(opsinputs_jeditoopslayoutmapping), intent(in) :: JediToOpsLayoutMapping real(c_double), intent(in) :: hofx(:, :) -type(oops_variables), intent(in) :: varnames +type(obs_variables), intent(in) :: varnames character(len=*), intent(in), optional :: JediObsName logical, intent(in), optional :: WriteHofXIntoCX diff --git a/src/opsinputs/opsinputs_obsdatavector_f.cc b/src/opsinputs/opsinputs_obsdatavector_f.cc index 0be6a677..b918bc98 100644 --- a/src/opsinputs/opsinputs_obsdatavector_f.cc +++ b/src/opsinputs/opsinputs_obsdatavector_f.cc @@ -24,7 +24,7 @@ int opsinputs_obsdatavector_nlocs_f(const ioda::ObsDataVector &vec) { } template -const oops::Variables * opsinputs_obsdatavector_varnames_f( +const oops::ObsVariables * opsinputs_obsdatavector_varnames_f( const ioda::ObsDataVector &vec) { return &vec.varnames(); } @@ -50,7 +50,7 @@ int opsinputs_obsdatavector_int_nlocs_f(const ioda::ObsDataVector &vec) { return opsinputs_obsdatavector_nlocs_f(vec); } -const oops::Variables * opsinputs_obsdatavector_int_varnames_f( +const oops::ObsVariables * opsinputs_obsdatavector_int_varnames_f( const ioda::ObsDataVector &vec) { return opsinputs_obsdatavector_varnames_f(vec); } @@ -70,7 +70,7 @@ int opsinputs_obsdatavector_float_nlocs_f(const ioda::ObsDataVector &vec) return opsinputs_obsdatavector_nlocs_f(vec); } -const oops::Variables * opsinputs_obsdatavector_float_varnames_f( +const oops::ObsVariables * opsinputs_obsdatavector_float_varnames_f( const ioda::ObsDataVector &vec) { return opsinputs_obsdatavector_varnames_f(vec); } diff --git a/src/opsinputs/opsinputs_obsdatavector_f.h b/src/opsinputs/opsinputs_obsdatavector_f.h index 408c0e50..460480ac 100644 --- a/src/opsinputs/opsinputs_obsdatavector_f.h +++ b/src/opsinputs/opsinputs_obsdatavector_f.h @@ -15,6 +15,7 @@ namespace ioda { } // namespace ioda namespace oops { + class ObsVariables; class Variables; } // namespace oops @@ -22,7 +23,7 @@ namespace opsinputs { extern "C" { int opsinputs_obsdatavector_int_nlocs_f(const ioda::ObsDataVector &vec); - const oops::Variables * opsinputs_obsdatavector_int_varnames_f( + const oops::ObsVariables * opsinputs_obsdatavector_int_varnames_f( const ioda::ObsDataVector &vec); bool opsinputs_obsdatavector_int_has_f(const ioda::ObsDataVector &vec, const char *variable); @@ -31,7 +32,7 @@ extern "C" { const size_t &length, int* data); int opsinputs_obsdatavector_float_nlocs_f(const ioda::ObsDataVector &vec); - const oops::Variables * opsinputs_obsdatavector_float_varnames_f( + const oops::ObsVariables * opsinputs_obsdatavector_float_varnames_f( const ioda::ObsDataVector &vec); bool opsinputs_obsdatavector_float_has_f(const ioda::ObsDataVector &vec, const char *variable); diff --git a/src/opsinputs/opsinputs_varobswriter_mod.F90 b/src/opsinputs/opsinputs_varobswriter_mod.F90 index fd5b6593..5856a791 100644 --- a/src/opsinputs/opsinputs_varobswriter_mod.F90 +++ b/src/opsinputs/opsinputs_varobswriter_mod.F90 @@ -25,6 +25,7 @@ module opsinputs_varobswriter_mod obsspace_get_gnlocs, & obsspace_get_nlocs, & obsspace_has +use obs_variables_mod, only: obs_variables use oops_variables_mod, only: oops_variables use opsinputs_fill_mod, only: & opsinputs_fill_fillcoord2d, & @@ -219,7 +220,7 @@ function opsinputs_varobswriter_create(self, f_conf, comm_is_valid, comm, channe integer(gc_int_kind), intent(in) :: comm integer(c_int), intent(in) :: channels(:) type(oops_variables), intent(inout) :: geovars ! GeoVaLs required by the VarObsWriter. -type(oops_variables), intent(inout) :: diagvars ! HofXDiags required by the VarObsWriter. +type(obs_variables), intent(inout) :: diagvars ! HofXDiags required by the VarObsWriter. logical :: opsinputs_varobswriter_create ! Local declarations: @@ -622,7 +623,7 @@ subroutine opsinputs_varobswriter_addrequireddiagvars(self, diagvars) ! Subroutine arguments: type(opsinputs_varobswriter), intent(in) :: self -type(oops_variables), intent(inout) :: diagvars +type(obs_variables), intent(inout) :: diagvars ! Local declarations: integer(integer64) :: VarFields(ActualMaxVarfield) diff --git a/test/opsinputs/CxChecker.h b/test/opsinputs/CxChecker.h index 1355c08b..53bf8ca9 100644 --- a/test/opsinputs/CxChecker.h +++ b/test/opsinputs/CxChecker.h @@ -14,6 +14,7 @@ #include "../opsinputs/CxCheckerParameters.h" #include "ioda/ObsDataVector.h" +#include "oops/base/ObsVariables.h" #include "oops/base/Variables.h" #include "oops/interface/ObsFilterBase.h" #include "oops/util/ObjectCounter.h" @@ -70,7 +71,7 @@ class CxChecker : public oops::interface::ObsFilterBase, void checkFilterData(const oops::FilterStage filterStage) override {} oops::Variables requiredVars() const override {return geovars_;} - oops::Variables requiredHdiagnostics() const override {return extradiagvars_;} + oops::ObsVariables requiredHdiagnostics() const override {return extradiagvars_;} private: struct PrintCxFileOutput; @@ -94,7 +95,7 @@ class CxChecker : public oops::interface::ObsFilterBase, ioda::ObsSpace & obsdb_; oops::Variables geovars_; - oops::Variables extradiagvars_; + oops::ObsVariables extradiagvars_; std::shared_ptr> flags_; std::shared_ptr> obsErrors_; diff --git a/test/opsinputs/ResetFlagsToPass.cc b/test/opsinputs/ResetFlagsToPass.cc index 87a2c295..e4da069c 100644 --- a/test/opsinputs/ResetFlagsToPass.cc +++ b/test/opsinputs/ResetFlagsToPass.cc @@ -9,7 +9,6 @@ #include "ioda/ObsDataVector.h" #include "ioda/ObsSpace.h" -#include "oops/base/Variables.h" #include "oops/util/IntSetParser.h" // for contains() #include "oops/util/Logger.h" #include "ufo/filters/QCflags.h" diff --git a/test/opsinputs/ResetFlagsToPass.h b/test/opsinputs/ResetFlagsToPass.h index 715e0fac..9fae44c7 100644 --- a/test/opsinputs/ResetFlagsToPass.h +++ b/test/opsinputs/ResetFlagsToPass.h @@ -13,6 +13,7 @@ #include "../opsinputs/ResetFlagsToPassParameters.h" #include "ioda/ObsDataVector.h" +#include "oops/base/ObsVariables.h" #include "oops/base/Variables.h" #include "oops/interface/ObsFilterBase.h" #include "oops/util/ObjectCounter.h" @@ -62,14 +63,14 @@ class ResetFlagsToPass : public oops::interface::ObsFilterBase, void checkFilterData(const oops::FilterStage filterStage) override {} oops::Variables requiredVars() const override {return geovars_;} - oops::Variables requiredHdiagnostics() const override {return extradiagvars_;} + oops::ObsVariables requiredHdiagnostics() const override {return extradiagvars_;} private: void print(std::ostream &) const override; ioda::ObsSpace & obsdb_; oops::Variables geovars_; - oops::Variables extradiagvars_; + oops::ObsVariables extradiagvars_; std::shared_ptr> flags_; ResetFlagsToPassParameters parameters_; diff --git a/test/opsinputs/VarObsChecker.cc b/test/opsinputs/VarObsChecker.cc index ce4a4a08..a0820c4a 100644 --- a/test/opsinputs/VarObsChecker.cc +++ b/test/opsinputs/VarObsChecker.cc @@ -19,7 +19,6 @@ #include "ioda/ObsDataVector.h" #include "ioda/ObsSpace.h" -#include "oops/base/Variables.h" #include "oops/mpi/mpi.h" #include "oops/util/Logger.h" diff --git a/test/opsinputs/VarObsChecker.h b/test/opsinputs/VarObsChecker.h index 82a55d50..1f2f64c4 100644 --- a/test/opsinputs/VarObsChecker.h +++ b/test/opsinputs/VarObsChecker.h @@ -13,6 +13,7 @@ #include "../opsinputs/VarObsCheckerParameters.h" #include "ioda/ObsDataVector.h" +#include "oops/base/ObsVariables.h" #include "oops/base/Variables.h" #include "oops/interface/ObsFilterBase.h" #include "oops/util/ObjectCounter.h" @@ -69,7 +70,7 @@ class VarObsChecker : public oops::interface::ObsFilterBase, void checkFilterData(const oops::FilterStage filterStage) override {} oops::Variables requiredVars() const override {return geovars_;} - oops::Variables requiredHdiagnostics() const override {return extradiagvars_;} + oops::ObsVariables requiredHdiagnostics() const override {return extradiagvars_;} private: struct PrintVarObsOutput; @@ -87,7 +88,7 @@ class VarObsChecker : public oops::interface::ObsFilterBase, ioda::ObsSpace & obsdb_; oops::Variables geovars_; - oops::Variables extradiagvars_; + oops::ObsVariables extradiagvars_; std::shared_ptr> flags_; std::shared_ptr> obsErrors_;