14 #include "oops/util/Logger.h" 41 std::vector<double>
lats =
conf.getDoubleVector(
"lats");
42 std::vector<double> lons =
conf.getDoubleVector(
"lons");
44 ASSERT(
lats.size() == lons.size());
45 int nloc =
lats.size();
49 if (
conf.has(
"Nrandom")) {
50 int Nrandom =
conf.getInt(
"Nrandom");
52 std::unique_ptr<std::mt19937> generator;
54 if (
conf.has(
"random_seed")) {
55 int rseed =
conf.getInt(
"random_seed");
56 generator.reset(
new std::mt19937(rseed));
58 generator.reset(
new std::mt19937(
time(0)));
61 static std::uniform_real_distribution<double> distribution(-90, 90);
65 std::vector<double> xx(Nrandom, 0.0);
66 for (
size_t jj=0; jj < Nrandom; ++jj) xx[jj] = distribution(*generator);
67 lats.insert(
lats.end(), xx.begin(), xx.end());
68 for (
size_t jj=0; jj < Nrandom; ++jj) xx[jj] = 2.0*distribution(*generator) + 180.0;
69 lons.insert(lons.end(), xx.begin(), xx.end());
73 if (
conf.has(
"Rdist")) {
74 rdist =
conf.getInt(
"Rdist");
100 os <<
"Locations: " <<
nobs <<
" locations: ";
108 <<
"lat = " <<
lat <<
", lon = " <<
lon << std::endl;
void ioda_locs_create_f90(F90locs &, const int &, const double *, const double *, const int &)
Interface to Fortran IODA routines.
l_size ! loop over number of fields ke do je do i
real(fvprc), dimension(:), allocatable lon
void ioda_locs_coords_f90(const F90locs &, int &, double &, double &)
Locations(const F90locs key)
real(fvprc), dimension(:), allocatable lat
void ioda_locs_nobs_f90(const F90locs &, int &)
void print(std::ostream &os) const
void ioda_locs_delete_f90(F90locs &)