OOPS
ObsSpaceBase.cc
Go to the documentation of this file.
1
/*
2
* (C) Copyright 2018 UCAR
3
*
4
* This software is licensed under the terms of the Apache Licence Version 2.0
5
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6
*/
7
8
#include "
oops/base/ObsSpaceBase.h
"
9
10
#include "eckit/config/LocalConfiguration.h"
11
#include "eckit/exception/Exceptions.h"
12
13
#include "oops/util/DateTime.h"
14
#include "oops/util/Duration.h"
15
#include "oops/util/Logger.h"
16
17
namespace
oops
{
18
19
// -----------------------------------------------------------------------------
20
int
ObsSpaceBase::instances_
= 0;
21
// -----------------------------------------------------------------------------
22
23
ObsSpaceBase::ObsSpaceBase
(
const
eckit::Configuration & conf,
const
eckit::mpi::Comm & comm,
24
const
util::DateTime & bgn,
const
util::DateTime & end)
25
: winbgn_(bgn), winend_(end), instance_(++instances_) {
26
//
27
// Determine seed for random number generator that is reproducible when re-running
28
// but does not repeat itself over analysis cycles, ensemble members or obs type
29
//
30
util::DateTime ref(1623, 6, 19, 0, 0, 0);
31
ASSERT(
winbgn_
> ref);
32
util::Duration dt(
winbgn_
- ref);
33
seed_
= dt.toSeconds();
34
35
// Won't repeat if more seconds between analysis cycles than members in EDA
36
seed_
+= conf.getInt(
"obs perturbations seed"
, 0);
37
38
// 31622400 seconds max in 1 year
39
// 12197962800 seed at this step for 2010-01-01T03:00:00Z
40
seed_
+= 100000000000 *
instance_
;
41
42
Log::debug() <<
"ObsSpaceBase: seed = "
<<
seed_
<< std::endl;
43
}
44
45
// -----------------------------------------------------------------------------
46
47
}
// namespace oops
oops
The namespace for the main oops code.
Definition:
ErrorCovarianceL95.cc:22
oops::ObsSpaceBase::winbgn_
const util::DateTime winbgn_
Definition:
ObsSpaceBase.h:47
oops::ObsSpaceBase::instances_
static int instances_
Definition:
ObsSpaceBase.h:45
oops::ObsSpaceBase::seed_
int64_t seed_
Definition:
ObsSpaceBase.h:49
oops::ObsSpaceBase::instance_
const int instance_
Definition:
ObsSpaceBase.h:50
oops::ObsSpaceBase::ObsSpaceBase
ObsSpaceBase(const eckit::Configuration &, const eckit::mpi::Comm &, const util::DateTime &, const util::DateTime &)
Definition:
ObsSpaceBase.cc:23
ObsSpaceBase.h
fv3-bundle
oops
src
oops
base
ObsSpaceBase.cc
Generated on Sun Oct 25 2020 12:42:58 for OOPS by
1.8.18