8 #include "oops/util/CompareNVectors.h"
9 #include "oops/util/Logger.h"
10 #include "oops/util/missingValues.h"
11 #include "oops/util/PropertiesOfNVectors.h"
17 const float orogGeoVaLs,
18 std::vector <float> &zRhoGeoVaLs,
19 std::vector <float> &zThetaGeoVaLs)
21 const std::vector <float> &etaThetaGeoVaLs = options.
etaTheta;
22 const std::vector <float> &etaRhoGeoVaLs = options.
etaRho;
24 if (!oops::allVectorsSameNonZeroSize(etaThetaGeoVaLs,
27 oops::Log::warning() <<
"At least one vector is the wrong size. "
28 <<
"Model height calculation will not be performed." << std::endl;
29 oops::Log::warning() <<
"Vector sizes: "
30 << oops::listOfVectorSizes(etaThetaGeoVaLs,
36 const float missingValueFloat = util::missingValue(missingValueFloat);
37 const float zModelTop = options.
zModelTop;
39 const size_t NumModLevels = etaThetaGeoVaLs.size();
41 zRhoGeoVaLs.assign(NumModLevels + 1, missingValueFloat);
42 zThetaGeoVaLs.assign(NumModLevels, missingValueFloat);
45 for (
int jlev = 0; jlev < NumModLevels; ++jlev) {
46 zRhoGeoVaLs[jlev] = etaRhoGeoVaLs[jlev] * zModelTop;
47 zThetaGeoVaLs[jlev] = etaThetaGeoVaLs[jlev] * zModelTop;
50 zRhoGeoVaLs[NumModLevels] =
51 zThetaGeoVaLs[NumModLevels - 1] * 2.0 - zRhoGeoVaLs[NumModLevels - 1];
53 for (
int k = 0; k < firstConstantRhoLevel; ++k) {
54 zRhoGeoVaLs[k] += orogGeoVaLs *
55 std::pow(1.0 - etaRhoGeoVaLs[k] / etaRhoGeoVaLs[firstConstantRhoLevel], 2.0);
56 zThetaGeoVaLs[k] += orogGeoVaLs *
57 std::pow(1.0 - etaThetaGeoVaLs[k] / etaRhoGeoVaLs[firstConstantRhoLevel], 2.0);
Options related to GeoVaLs used in the profile QC code.
oops::Parameter< float > zModelTop
Height of the upper boundary of the highest model layer.
oops::Parameter< std::vector< float > > etaTheta
Values of terrain-following height coordinate (eta) on theta levels.
oops::Parameter< int > firstConstantRhoLevel
oops::Parameter< std::vector< float > > etaRho
Value of terrain-following height coordinate (eta) on rho levels.
void CalculateModelHeight(const ModelParameters &options, const float orogGeoVaLs, std::vector< float > &zRhoGeoVaLs, std::vector< float > &zThetaGeoVaLs)
Calculate model heights on rho and theta levels. The calculation uses the terrain-following height co...