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

Adapt to name changes in ufo #867

Merged
merged 4 commits into from
Apr 25, 2023
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
2 changes: 1 addition & 1 deletion src/soca/AnalyticInit/AnalyticInit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace soca {
static oops::AnalyticInitMaker<ufo::ObsTraits, AnalyticInit>
makerAnalyticInit_("soca_ana_init");

void AnalyticInit::fillGeoVaLs(const ufo::Locations & locs,
void AnalyticInit::fillGeoVaLs(const ufo::SampledLocations & locs,
ufo::GeoVaLs & geovals) const {
soca_analytic_geovals_f90(geovals.toFortran(), locs);
}
Expand Down
2 changes: 1 addition & 1 deletion src/soca/AnalyticInit/AnalyticInit.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace soca {
typedef AnalyticInitParameters Parameters_;

explicit AnalyticInit(const Parameters_ &) {}
void fillGeoVaLs(const ufo::Locations &, ufo::GeoVaLs &) const override;
void fillGeoVaLs(const ufo::SampledLocations &, ufo::GeoVaLs &) const override;
};

} // namespace soca
Expand Down
4 changes: 2 additions & 2 deletions src/soca/AnalyticInit/AnalyticInitFortran.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

// Forward declarations
namespace ufo {
class Locations;
class SampledLocations;
}

namespace soca {

extern "C" {
void soca_analytic_geovals_f90(F90goms &, const ufo::Locations &);
void soca_analytic_geovals_f90(F90goms &, const ufo::SampledLocations &);
}
} // namespace soca
#endif // SOCA_ANALYTICINIT_ANALYTICINITFORTRAN_H_
8 changes: 4 additions & 4 deletions src/soca/AnalyticInit/soca_analytic.interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module soca_analytic_mod_c

USE ufo_geovals_mod, ONLY : ufo_geovals
USE ufo_geovals_mod_c, ONLY : ufo_geovals_registry
USE ufo_locations_mod, ONLY : ufo_locations
USE ufo_sampled_locations_mod, ONLY : ufo_sampled_locations

use soca_analytic_mod

Expand All @@ -28,13 +28,13 @@ subroutine soca_analytic_geovals_c(c_key_geovals, c_locs) &
type(c_ptr), value, intent(in) :: c_locs

type(ufo_geovals), pointer :: geovals
type(ufo_locations) :: locs
type(ufo_sampled_locations) :: locs

call ufo_geovals_registry%get(c_key_geovals, geovals)
locs = ufo_locations(c_locs)
locs = ufo_sampled_locations(c_locs)

call soca_analytic_geovals(geovals, locs)

end subroutine

end module
end module
10 changes: 5 additions & 5 deletions src/soca/AnalyticInit/soca_analytic_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module soca_analytic_mod

use kinds, only : kind_real
use ufo_geovals_mod, only : ufo_geovals
use ufo_locations_mod, only : ufo_locations
use ufo_sampled_locations_mod, only : ufo_sampled_locations
use soca_state_mod, only : soca_state


Expand All @@ -26,21 +26,21 @@ module soca_analytic_mod
!! \see soca_analytic_val
subroutine soca_analytic_geovals(geovals, locs)
type(ufo_geovals), intent(inout) :: geovals !< output geovals
type(ufo_locations), intent(in) :: locs !< input locations
type(ufo_sampled_locations), intent(in) :: locs !< input locations

real(kind=kind_real), allocatable :: lons(:), lats(:)
integer :: ivar, iloc, ival
real(kind=kind_real) :: val
character(len=:), allocatable :: name

allocate(lons(locs%nlocs()))
allocate(lats(locs%nlocs()))
allocate(lons(locs%npaths()))
allocate(lats(locs%npaths()))
call locs%get_lons(lons)
call locs%get_lats(lats)

do ivar = 1, geovals%nvar
name = geovals%variables(ivar)
do iloc = 1, geovals%geovals(ivar)%nlocs
do iloc = 1, geovals%geovals(ivar)%nprofiles
do ival = 1, geovals%geovals(ivar)%nval
val = soca_analytic_val(&
name, lats(iloc), lons(iloc), ival*1.0_kind_real)
Expand Down
1 change: 0 additions & 1 deletion src/soca/Increment/Increment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "oops/util/Logger.h"

#include "ufo/GeoVaLs.h"
#include "ufo/Locations.h"

using oops::Log;

Expand Down
1 change: 0 additions & 1 deletion src/soca/Increment/Increment.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace eckit {
}
namespace ufo {
class GeoVaLs;
class Locations;
}
namespace soca {
class Geometry;
Expand Down
1 change: 0 additions & 1 deletion src/soca/State/State.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "oops/util/Logger.h"

#include "ufo/GeoVaLs.h"
#include "ufo/Locations.h"

using oops::Log;

Expand Down
1 change: 0 additions & 1 deletion src/soca/State/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace eckit {
}
namespace ufo {
class GeoVaLs;
class Locations;
}
namespace soca {
class Geometry;
Expand Down