OOPS
ObsOpBaseTLAD.cc
Go to the documentation of this file.
1
/*
2
* (C) Copyright 2017-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 "
model/ObsOpBaseTLAD.h
"
9
10
#include "eckit/config/Configuration.h"
11
#include "oops/util/abor1_cpp.h"
12
#include "oops/util/Logger.h"
13
14
namespace
qg
{
15
16
// -----------------------------------------------------------------------------
17
18
ObsOpTLADFactory::ObsOpTLADFactory
(
const
std::string & name) {
19
if
(
getMakers
().find(name) !=
getMakers
().end()) {
20
oops::Log::error
() << name <<
" already registered in qg::ObsOpTLADFactory."
<< std::endl;
21
ABORT(
"Element already registered in ObsOpTLADFactory."
);
22
}
23
getMakers
()[name] =
this
;
24
}
25
26
// -----------------------------------------------------------------------------
27
28
ObsOpBaseTLAD
*
ObsOpTLADFactory::create
(
const
ObsSpaceQG
& odb,
29
const
eckit::Configuration & conf) {
30
oops::Log::trace() <<
"ObsOpBaseQG::create starting"
<< std::endl;
31
oops::Log::debug() <<
"ObsOpBaseQG::create conf"
<< conf << std::endl;
32
const
std::string
id
= conf.getString(
"obs type"
);
33
typename
std::map<std::string, ObsOpTLADFactory*>::iterator
34
jloc =
getMakers
().find(
id
);
35
if
(jloc ==
getMakers
().end()) {
36
oops::Log::error
() <<
id
<<
" does not exist in observation operator factory."
<< std::endl;
37
ABORT(
"Element does not exist in ObsOpTLADFactory."
);
38
}
39
ObsOpBaseTLAD
* ptr = jloc->second->make(odb, conf);
40
oops::Log::trace() <<
"ObsOpBaseQG::create done"
<< std::endl;
41
return
ptr;
42
}
43
44
// -----------------------------------------------------------------------------
45
46
}
// namespace qg
qg
The namespace for the qg model.
Definition:
qg/model/AnalyticInit.cc:13
qg::ObsOpTLADFactory::getMakers
static std::map< std::string, ObsOpTLADFactory * > & getMakers()
Definition:
ObsOpBaseTLAD.h:62
ObsOpBaseTLAD.h
qg::ObsSpaceQG
ObsSpace for QG model.
Definition:
ObsSpaceQG.h:44
qg::ObsOpTLADFactory::create
static ObsOpBaseTLAD * create(const ObsSpaceQG &, const eckit::Configuration &)
Definition:
ObsOpBaseTLAD.cc:28
qg::ObsOpTLADFactory::ObsOpTLADFactory
ObsOpTLADFactory(const std::string &)
Definition:
ObsOpBaseTLAD.cc:18
compare.error
int error
Definition:
compare.py:168
qg::ObsOpBaseTLAD
Base class for observation operators.
Definition:
ObsOpBaseTLAD.h:35
fv3-bundle
oops
qg
model
ObsOpBaseTLAD.cc
Generated on Sun Oct 25 2020 12:42:58 for OOPS by
1.8.18