UFO
ufo::GeoVaLs Class Reference

GeoVaLs: geophysical values at locations. More...

#include <GeoVaLs.h>

Inheritance diagram for ufo::GeoVaLs:
Collaboration diagram for ufo::GeoVaLs:

Public Member Functions

 GeoVaLs (std::shared_ptr< const ioda::Distribution >, const oops::Variables &)
 Deprecated default constructor - does not allocate fields. More...
 
 GeoVaLs (const Locations &, const oops::Variables &)
 Deprecated constructor given Locations and Variables. More...
 
 GeoVaLs (const Locations &locs, const oops::Variables &vars, const std::vector< size_t > &nlevs)
 Allocating constructor for specified Locations locs, Variables vars and number of levels nlevs. More...
 
 GeoVaLs (const eckit::Configuration &, const ioda::ObsSpace &, const oops::Variables &)
 Constructor for tests. More...
 
 GeoVaLs (const GeoVaLs &, const int &)
 Construct a new GeoVaLs with just one location. More...
 
 GeoVaLs (const GeoVaLs &)
 Copy constructor. More...
 
 ~GeoVaLs ()
 
GeoVaLsoperator= (const GeoVaLs &)
 Copy operator. More...
 
GeoVaLsoperator*= (const double)
 Multiply by a constant scalar. More...
 
GeoVaLsoperator*= (const std::vector< float > &)
 Multiply by a constant scalar for each profile. More...
 
GeoVaLsoperator+= (const GeoVaLs &)
 Add another GeoVaLs. More...
 
GeoVaLsoperator-= (const GeoVaLs &)
 Subtract another GeoVaLs. More...
 
GeoVaLsoperator*= (const GeoVaLs &)
 Multiply another GeoVaLs. More...
 
double dot_product_with (const GeoVaLs &) const
 Scalar product of two GeoVaLs. More...
 
void split (GeoVaLs &, GeoVaLs &) const
 Split two GeoVaLs. More...
 
void merge (const GeoVaLs &, const GeoVaLs &)
 Merge two GeoVaLs. More...
 
void allocate (const int &nlev, const oops::Variables &vars)
 Deprecated method. Allocates GeoVaLs for vars variables with nlev number of levels. More...
 
void zero ()
 Zero out the GeoVaLs. More...
 
void reorderzdir (const std::string &, const std::string &)
 Reorder GeoVaLs in vertical dimension based on vertical coordinate variable. More...
 
void random ()
 Randomize GeoVaLs. More...
 
double rms () const
 Calculate rms. More...
 
double normalizedrms (const GeoVaLs &) const
 Calculate normalized rms. More...
 
bool has (const std::string &var) const
 
const oops::Variables & getVars () const
 
size_t nlevs (const std::string &var) const
 Return number of levels for a specified variable. More...
 
void get (std::vector< double > &, const std::string &var) const
 Get 2D GeoVaLs for variable var (fails for 3D GeoVaLs) More...
 
void get (std::vector< float > &, const std::string &var) const
 Get 2D GeoVaLs for variable var (fails for 3D GeoVaLs), and convert to float. More...
 
void get (std::vector< int > &, const std::string &var) const
 Get 2D GeoVaLs for variable var (fails for 3D GeoVaLs), and convert to int. More...
 
void getAtLevel (std::vector< double > &, const std::string &, const int) const
 Get GeoVaLs at a specified level. More...
 
void getAtLevel (std::vector< float > &, const std::string &, const int) const
 Get GeoVaLs at a specified level and convert to float. More...
 
void getAtLevel (std::vector< int > &, const std::string &, const int) const
 Get GeoVaLs at a specified level and convert to int. More...
 
void getAtLocation (std::vector< double > &, const std::string &, const int) const
 Get GeoVaLs at a specified location. More...
 
void getAtLocation (std::vector< float > &, const std::string &, const int) const
 Get GeoVaLs at a specified location and convert to float. More...
 
void getAtLocation (std::vector< int > &, const std::string &, const int) const
 Get GeoVaLs at a specified location and convert to int. More...
 
void putAtLevel (const std::vector< double > &vals, const std::string &var, const int lev) const
 Put GeoVaLs for double variable var at level lev. More...
 
void putAtLevel (const std::vector< float > &vals, const std::string &var, const int lev) const
 Put GeoVaLs for float variable var at level lev. More...
 
void putAtLevel (const std::vector< int > &vals, const std::string &var, const int lev) const
 Put GeoVaLs for int variable var at level lev. More...
 
void putAtLocation (const std::vector< double > &vals, const std::string &var, const int loc) const
 Put GeoVaLs for double variable var at location loc. More...
 
void putAtLocation (const std::vector< float > &vals, const std::string &var, const int loc) const
 Put GeoVaLs for float variable var at location loc. More...
 
void putAtLocation (const std::vector< int > &vals, const std::string &var, const int loc) const
 Put GeoVaLs for int variable var at location loc. More...
 
void read (const eckit::Configuration &, const ioda::ObsSpace &)
 Read GeoVaLs from the file. More...
 
void write (const eckit::Configuration &) const
 Write GeoVaLs to the file. More...
 
size_t nlocs () const
 Return the number of geovals. More...
 
int & toFortran ()
 
const int & toFortran () const
 

Static Public Member Functions

static const std::string classname ()
 

Private Member Functions

void print (std::ostream &) const
 Output GeoVaLs to a stream. More...
 

Private Attributes

F90goms keyGVL_
 
oops::Variables vars_
 
std::shared_ptr< const ioda::Distribution > dist_
 

Detailed Description

GeoVaLs: geophysical values at locations.

Definition at line 38 of file src/ufo/GeoVaLs.h.

Constructor & Destructor Documentation

◆ GeoVaLs() [1/6]

ufo::GeoVaLs::GeoVaLs ( std::shared_ptr< const ioda::Distribution >  dist,
const oops::Variables &  vars 
)

Deprecated default constructor - does not allocate fields.

Please do not use this constructor in new code.

Definition at line 35 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ GeoVaLs() [2/6]

ufo::GeoVaLs::GeoVaLs ( const Locations locs,
const oops::Variables &  vars 
)

Deprecated constructor given Locations and Variables.

Please do not use in any new code. This constructor is currently only used for ObsDiagnostics and will be removed soon. Use the GeoVaLs(const Locations &, const oops::Variables &, const std::vector<size_t> &) constructor instead. This ufo::GeoVaLs constructor is used to initialize GeoVaLs for specified ufo::Locations and oops::Variables hold all. Note that nothing is allocated when this constructor is called.

Definition at line 54 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ GeoVaLs() [3/6]

ufo::GeoVaLs::GeoVaLs ( const Locations locs,
const oops::Variables &  vars,
const std::vector< size_t > &  nlevs 
)

Allocating constructor for specified Locations locs, Variables vars and number of levels nlevs.

This ufo::GeoVaLs constructor is used in all oops H(x) and DA applications. Sizes of GeoVaLs for i-th variable at a single location are defined by i-th value of nlevs.

Definition at line 71 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ GeoVaLs() [4/6]

ufo::GeoVaLs::GeoVaLs ( const eckit::Configuration &  config,
const ioda::ObsSpace &  obspace,
const oops::Variables &  vars 
)

Constructor for tests.

This ufo::GeoVaLs constructor is typically used in tests, GeoVaLs are read from the file.

Definition at line 86 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ GeoVaLs() [5/6]

ufo::GeoVaLs::GeoVaLs ( const GeoVaLs other,
const int &  index 
)

Construct a new GeoVaLs with just one location.

This ufo::GeoVaLs constructor takes a GeoVaLs object and an index to create a new GeoVaLs with just one location

Definition at line 103 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ GeoVaLs() [6/6]

ufo::GeoVaLs::GeoVaLs ( const GeoVaLs other)

Copy constructor.

Definition at line 113 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ ~GeoVaLs()

ufo::GeoVaLs::~GeoVaLs ( )

Definition at line 122 of file GeoVaLs.cc.

Here is the call graph for this function:

Member Function Documentation

◆ allocate()

void ufo::GeoVaLs::allocate ( const int &  nlev,
const oops::Variables &  vars 
)

Deprecated method. Allocates GeoVaLs for vars variables with nlev number of levels.

Please do not use in any new code. This method is currently only used for ObsDiagnostics and will be removed soon. Rely on GeoVaLs(const Locations &, const oops::Variables &, const std::vector<size_t> &) to allocate GeoVaLs correctly. Fails if at least one of the vars doesn't exist in GeoVaLs. Only allocates variables that haven't been allocated before. Fails if one of vars is already allocated with number of levels different than nlev; doesn't reallocate variables that are already allocated with nlev.

Definition at line 128 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ classname()

static const std::string ufo::GeoVaLs::classname ( )
inlinestatic

Definition at line 41 of file src/ufo/GeoVaLs.h.

◆ dot_product_with()

double ufo::GeoVaLs::dot_product_with ( const GeoVaLs other) const

Scalar product of two GeoVaLs.

Definition at line 229 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ get() [1/3]

void ufo::GeoVaLs::get ( std::vector< double > &  vals,
const std::string &  var 
) const

Get 2D GeoVaLs for variable var (fails for 3D GeoVaLs)

Return all values for a specific 2D variable.

Definition at line 359 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get() [2/3]

void ufo::GeoVaLs::get ( std::vector< float > &  vals,
const std::string &  var 
) const

Get 2D GeoVaLs for variable var (fails for 3D GeoVaLs), and convert to float.

Return all values for a specific 2D variable.

Call method to get double values (Fortran data structure stores data in double) and convert to floats

Definition at line 319 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ get() [3/3]

void ufo::GeoVaLs::get ( std::vector< int > &  vals,
const std::string &  var 
) const

Get 2D GeoVaLs for variable var (fails for 3D GeoVaLs), and convert to int.

Return all values for a specific 2D variable.

Call method to get double values (Fortran data structure stores data in double) and convert to ints

Definition at line 369 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ getAtLevel() [1/3]

void ufo::GeoVaLs::getAtLevel ( std::vector< double > &  vals,
const std::string &  var,
const int  lev 
) const

Get GeoVaLs at a specified level.

Return all values for a specific variable and level.

Definition at line 330 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAtLevel() [2/3]

void ufo::GeoVaLs::getAtLevel ( std::vector< float > &  vals,
const std::string &  var,
const int  lev 
) const

Get GeoVaLs at a specified level and convert to float.

Return all values for a specific variable and level and convert to float.

Definition at line 340 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ getAtLevel() [3/3]

void ufo::GeoVaLs::getAtLevel ( std::vector< int > &  vals,
const std::string &  var,
const int  lev 
) const

Get GeoVaLs at a specified level and convert to int.

Return all values for a specific variable and level and convert to int.

Definition at line 350 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ getAtLocation() [1/3]

void ufo::GeoVaLs::getAtLocation ( std::vector< double > &  vals,
const std::string &  var,
const int  loc 
) const

Get GeoVaLs at a specified location.

Return all values for a specific variable and location.

Definition at line 380 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAtLocation() [2/3]

void ufo::GeoVaLs::getAtLocation ( std::vector< float > &  vals,
const std::string &  var,
const int  loc 
) const

Get GeoVaLs at a specified location and convert to float.

Return all values for a specific variable and location and convert to float.

Definition at line 392 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ getAtLocation() [3/3]

void ufo::GeoVaLs::getAtLocation ( std::vector< int > &  vals,
const std::string &  var,
const int  loc 
) const

Get GeoVaLs at a specified location and convert to int.

Return all values for a specific variable and location and convert to int.

Definition at line 403 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ getVars()

const oops::Variables& ufo::GeoVaLs::getVars ( ) const
inline

Definition at line 86 of file src/ufo/GeoVaLs.h.

Here is the caller graph for this function:

◆ has()

bool ufo::GeoVaLs::has ( const std::string &  var) const
inline

Definition at line 85 of file src/ufo/GeoVaLs.h.

Here is the caller graph for this function:

◆ merge()

void ufo::GeoVaLs::merge ( const GeoVaLs other1,
const GeoVaLs other2 
)

Merge two GeoVaLs.

Definition at line 267 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlevs()

size_t ufo::GeoVaLs::nlevs ( const std::string &  var) const

Return number of levels for a specified variable.

Definition at line 310 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlocs()

size_t ufo::GeoVaLs::nlocs ( ) const

Return the number of geovals.

Definition at line 502 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalizedrms()

double ufo::GeoVaLs::normalizedrms ( const GeoVaLs other) const

Calculate normalized rms.

Definition at line 160 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ operator*=() [1/3]

GeoVaLs & ufo::GeoVaLs::operator*= ( const double  zz)

Multiply by a constant scalar.

Definition at line 177 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ operator*=() [2/3]

GeoVaLs & ufo::GeoVaLs::operator*= ( const GeoVaLs other)

Multiply another GeoVaLs.

Definition at line 221 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ operator*=() [3/3]

GeoVaLs & ufo::GeoVaLs::operator*= ( const std::vector< float > &  vals)

Multiply by a constant scalar for each profile.

Definition at line 185 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ operator+=()

GeoVaLs & ufo::GeoVaLs::operator+= ( const GeoVaLs other)

Add another GeoVaLs.

Definition at line 205 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ operator-=()

GeoVaLs & ufo::GeoVaLs::operator-= ( const GeoVaLs other)

Subtract another GeoVaLs.

Definition at line 213 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ operator=()

GeoVaLs & ufo::GeoVaLs::operator= ( const GeoVaLs rhs)

Copy operator.

Definition at line 197 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ print()

void ufo::GeoVaLs::print ( std::ostream &  os) const
private

Output GeoVaLs to a stream.

Verbose print statement (debug mode)

\detail If the min value across all variables is positive, then this may be an error measurement. If so, compute the rms over the vertical profile and tell the user where the maximum rms value occurs, in terms of the observation number and the variable number. This is intended to help with debugging.

Definition at line 275 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ putAtLevel() [1/3]

void ufo::GeoVaLs::putAtLevel ( const std::vector< double > &  vals,
const std::string &  var,
const int  lev 
) const

Put GeoVaLs for double variable var at level lev.

Put double values for a specific variable and level.

Definition at line 414 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ putAtLevel() [2/3]

void ufo::GeoVaLs::putAtLevel ( const std::vector< float > &  vals,
const std::string &  var,
const int  lev 
) const

Put GeoVaLs for float variable var at level lev.

Put float values for a specific variable and level.

Definition at line 426 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ putAtLevel() [3/3]

void ufo::GeoVaLs::putAtLevel ( const std::vector< int > &  vals,
const std::string &  var,
const int  lev 
) const

Put GeoVaLs for int variable var at level lev.

Put int values for a specific variable and level.

Definition at line 439 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ putAtLocation() [1/3]

void ufo::GeoVaLs::putAtLocation ( const std::vector< double > &  vals,
const std::string &  var,
const int  loc 
) const

Put GeoVaLs for double variable var at location loc.

Put double values for a specific variable and location.

Definition at line 451 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ putAtLocation() [2/3]

void ufo::GeoVaLs::putAtLocation ( const std::vector< float > &  vals,
const std::string &  var,
const int  loc 
) const

Put GeoVaLs for float variable var at location loc.

Put float values for a specific variable and location.

Definition at line 462 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ putAtLocation() [3/3]

void ufo::GeoVaLs::putAtLocation ( const std::vector< int > &  vals,
const std::string &  var,
const int  loc 
) const

Put GeoVaLs for int variable var at location loc.

Put int values for a specific variable and location.

Definition at line 474 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ random()

void ufo::GeoVaLs::random ( )

Randomize GeoVaLs.

Definition at line 170 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ read()

void ufo::GeoVaLs::read ( const eckit::Configuration &  config,
const ioda::ObsSpace &  obspace 
)

Read GeoVaLs from the file.

Definition at line 487 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ reorderzdir()

void ufo::GeoVaLs::reorderzdir ( const std::string &  varname,
const std::string &  vardir 
)

Reorder GeoVaLs in vertical dimension based on vertical coordinate variable.

Definition at line 143 of file GeoVaLs.cc.

Here is the call graph for this function:

◆ rms()

double ufo::GeoVaLs::rms ( ) const

Calculate rms.

Definition at line 151 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ split()

void ufo::GeoVaLs::split ( GeoVaLs other1,
GeoVaLs other2 
) const

Split two GeoVaLs.

Definition at line 259 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toFortran() [1/2]

int& ufo::GeoVaLs::toFortran ( )
inline

Definition at line 129 of file src/ufo/GeoVaLs.h.

◆ toFortran() [2/2]

const int& ufo::GeoVaLs::toFortran ( ) const
inline

Definition at line 130 of file src/ufo/GeoVaLs.h.

◆ write()

void ufo::GeoVaLs::write ( const eckit::Configuration &  config) const

Write GeoVaLs to the file.

Definition at line 495 of file GeoVaLs.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zero()

void ufo::GeoVaLs::zero ( )

Zero out the GeoVaLs.

Definition at line 136 of file GeoVaLs.cc.

Here is the call graph for this function:

Member Data Documentation

◆ dist_

std::shared_ptr<const ioda::Distribution> ufo::GeoVaLs::dist_
private

Definition at line 137 of file src/ufo/GeoVaLs.h.

◆ keyGVL_

F90goms ufo::GeoVaLs::keyGVL_
private

Definition at line 135 of file src/ufo/GeoVaLs.h.

◆ vars_

oops::Variables ufo::GeoVaLs::vars_
private

Definition at line 136 of file src/ufo/GeoVaLs.h.


The documentation for this class was generated from the following files: