FV3-JEDI
GetValues.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2020 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 
9 
10 namespace fv3jedi {
11 
12 // -------------------------------------------------------------------------------------------------
13 
14 GetValues::GetValues(const Geometry & geom, const ufo::Locations & locs) : locs_(locs),
15  geom_(new Geometry(geom)), model2geovals_() {
16  oops::Log::trace() << "GetValues::GetValues starting" << std::endl;
17 
18  // Create the variable change object
19  {
20  util::Timer timervc(classname(), "VarChaModel2GeoVaLs");
21  char sep = '.';
22  eckit::LocalConfiguration dummyconfig(sep);
23  model2geovals_.reset(new VarChaModel2GeoVaLs(geom, dummyconfig));
24  }
25 
26  // Call GetValues consructor
27  {
28  util::Timer timergv(classname(), "GetValues");
30  oops::Log::trace() << "GetValues::GetValues done" << std::endl;
31  }
32 }
33 
34 // -------------------------------------------------------------------------------------------------
35 
37  oops::Log::trace() << "GetValues::~GetValues starting" << std::endl;
39  oops::Log::trace() << "GetValues::~GetValues done" << std::endl;
40 }
41 
42 // -------------------------------------------------------------------------------------------------
43 
44 void GetValues::fillGeoVaLs(const State & state, const util::DateTime & t1,
45  const util::DateTime & t2, ufo::GeoVaLs & geovals) const {
46  oops::Log::trace() << "GetValues::fillGeovals starting" << std::endl;
47  const util::DateTime * t1p = &t1;
48  const util::DateTime * t2p = &t2;
49 
50  // Create state with geovals variables
51  State stategeovalvars(*geom_, geovals.getVars(), state.validTime());
52 
53  {
54  util::Timer timervc(classname(), "changeVar");
55  model2geovals_->changeVar(state, stategeovalvars);
56  }
57 
58  oops::Log::trace() << "GetValues::fillGeovals changeVar done" << stategeovalvars << std::endl;
59 
60  // Fill GeoVaLs
61  util::Timer timergv(classname(), "fillGeoVaLs");
63  stategeovalvars.toFortran(), &t1p, &t2p, locs_.toFortran(),
64  geovals.toFortran());
65 
66  oops::Log::trace() << "GetValues::fillGeovals done" << geovals << std::endl;
67 }
68 
69 // -------------------------------------------------------------------------------------------------
70 
71 void GetValues::print(std::ostream & os) const {
72  os << " GetValues for fv3-jedi" << std::endl;
73 }
74 
75 // -------------------------------------------------------------------------------------------------
76 
77 } // namespace fv3jedi
fv3jedi::GetValues::GetValues
GetValues(const Geometry &, const ufo::Locations &)
Definition: GetValues.cc:14
GetValues.h
fv3jedi::GetValues::locs_
ufo::Locations locs_
Definition: GetValues.h:63
fv3jedi::Geometry::toFortran
F90geom & toFortran()
Definition: Geometry.h:53
fv3jedi::GetValues::fillGeoVaLs
void fillGeoVaLs(const State &, const util::DateTime &, const util::DateTime &, ufo::GeoVaLs &) const
Definition: GetValues.cc:44
fv3jedi::GetValues::classname
static const std::string classname()
Definition: GetValues.h:52
fv3jedi::GetValues::~GetValues
virtual ~GetValues()
Definition: GetValues.cc:36
fv3jedi::GetValues::keyGetValues_
F90getvalues keyGetValues_
Definition: GetValues.h:62
fv3jedi::State::toFortran
int & toFortran()
Definition: State.h:87
fv3jedi::GetValues::geom_
std::shared_ptr< const Geometry > geom_
Definition: GetValues.h:64
fv3jedi::fv3jedi_getvalues_create_f90
void fv3jedi_getvalues_create_f90(F90getvalues &, const F90geom &, const F90locs &)
fv3jedi::State::validTime
const util::DateTime & validTime() const
Definition: State.h:83
fv3jedi::fv3jedi_getvalues_delete_f90
void fv3jedi_getvalues_delete_f90(F90getvalues &)
fv3jedi::Geometry
Geometry handles geometry for FV3JEDI model.
Definition: Geometry.h:41
fv3jedi::State
Definition: State.h:45
fv3jedi::GetValues::print
void print(std::ostream &) const
Definition: GetValues.cc:71
fv3jedi::fv3jedi_getvalues_fill_geovals_f90
void fv3jedi_getvalues_fill_geovals_f90(const F90getvalues &, const F90geom &, const F90state &, const util::DateTime **, const util::DateTime **, const F90locs &, const F90goms &)
fv3jedi
Configuration files should be formatted as e.g.
Definition: ErrorCovariance.cc:20
fv3jedi::VarChaModel2GeoVaLs
Definition: VarChaModel2GeoVaLs.h:24
fv3jedi::GetValues::model2geovals_
std::unique_ptr< VarChaModel2GeoVaLs > model2geovals_
Definition: GetValues.h:65