Skip to content

Commit

Permalink
Merge branch 'release/1.22.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaciel committed Jul 16, 2024
2 parents 4979034 + fe81ab3 commit 190efed
Show file tree
Hide file tree
Showing 35 changed files with 717 additions and 233 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.3
1.22.0
7 changes: 5 additions & 2 deletions etc/mir/classes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ index.associated:
# physical quantity whose magnitude is independent of the extent (size) of the system (typical units: no typical units)
intensity: {}

# radiant intensity per unit frequency or wavelength
# measure per unit frequency or wavelength, per unit solid angle
intensity.spectral-density: {}

# radiant intensity per unit frequency or wavelength, per unit solid angle
intensity.spectral-intensity: {}

# radiance of a surface per unit frequency or wavelength (also called "spectral intensity")
# radiance of a surface per unit frequency or wavelength, per unit solid angle (also called "spectral intensity")
intensity.spectral-radiance: {}

# quantity interpreted as accumulated in time (typical units: [<original unit> s])
Expand Down
87 changes: 81 additions & 6 deletions etc/mir/parameter-class.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,8 @@ vector-space.2d-vector-v:
vector-space.2d-vector.associated:
- 138 # Vorticity (relative)
- 155 # Divergence
- 235138 # Time-mean vorticity (relative)
- 235155 # Time-mean divergence

vector-space.3d-vector-u:
- 150133 # Ocean U wind component
Expand Down Expand Up @@ -1776,20 +1778,41 @@ intensity:
- 235090 # Time-mean lake mix-layer temperature
- 235091 # Time-mean lake mix-layer depth
- 235094 # Time-mean soil temperature
- 235097 # Time-mean wind speed
- 235098 # Time-mean pressure
- 235100 # Time-mean potential vorticity
- 235103 # Time-mean eta-coordinate vertical velocity
- 235117 # Time-mean most-unstable CAPE
- 235129 # Time-mean geopotential
- 235130 # Time-mean temperature
- 235131 # Time-mean U component of wind
- 235132 # Time-mean V component of wind
- 235134 # Time-mean surface pressure
- 235135 # Time-mean vertical velocity
- 235138 # Time-mean vorticity (relative)
- 235151 # Time-mean mean sea level pressure
- 235152 # Time-mean logarithm of surface pressure
- 235155 # Time-mean divergence
- 235159 # Time-mean boundary layer height
- 235165 # Time-mean 10 metre U wind component
- 235166 # Time-mean 10 metre V wind component
- 235168 # Time-mean 2 metre dewpoint temperature
- 235238 # Time-mean temperature of snow layer
- 235244 # Time-mean forecast surface roughness
- 235245 # Time-mean forecast logarithm of surface roughness for heat
- 235257 # Time-mean K index
- 235258 # Time-mean total totals index
- 235262 # Time-mean clear air turbulence (CAT)
- 235271 # Time-mean soil wetness index (total layer)
- 235272 # Time-mean soil wetness index (root zone)
- 235273 # Time-mean soil wetness index(layer)
- 235274 # Time-mean floodplain depth
- 235276 # Time-mean floodplain flooded area
- 235278 # Time-mean river area
- 235280 # Time-mean area of river coverage plus river related flooding
- 237117 # Time-maximum most-unstable CAPE
- 238117 # Time-minimum most-unstable CAPE
- 239117 # Time-standard-deviation most-unstable CAPE
- 240011 # Cross sectional area of flow in channel
- 240014 # River storage of water
- 240015 # Floodplain storage of water
Expand All @@ -1798,6 +1821,10 @@ intensity:
- 240029 # Groundwater lower storage
- 240030 # Lake depth
- 240031 # River depth
- 240035 # Floodplain depth
- 240037 # Floodplain flooded area
- 240039 # River area
- 240041 # Area of river coverage plus river related flooding
- 260004 # Heat index
- 260005 # Wind chill factor
- 260006 # Minimum dew point depression
Expand Down Expand Up @@ -1899,6 +1926,13 @@ intensity:
- 260649 # Sea ice surface temperature
- 260650 # Snow on ice depth
- 260651 # Surface roughness length for heat
- 260658 # Standardised Precipitation Index (SPI)
- 260659 # Standardised Precipitation Evapotranspiration Index (SPEI)
- 260660 # Standardised Streamflow Index (SSFI)
- 260661 # Standardised Reservoir Supply Index (SRSI)
- 260662 # Standardised Water-level Index (SWI)
- 260663 # Standardised Snowmelt and Rain Index (SMRI)
- 260664 # Streamflow Drought Index (SDI)
- 261001 # Universal thermal climate index
- 261002 # Mean radiant temperature
- 261014 # Wet bulb globe temperature
Expand Down Expand Up @@ -2040,7 +2074,12 @@ intensity:
- 300012 # Virtual temperature
- 404000 # Dry deposition velocity
- 450000 # Aerosol number density
- 457000 # Aerosol optical depth

intensity.spectral-density:
- 460000 # Aerosol backscatter from top of atmosphere
- 461000 # Aerosol backscatter from ground

intensity.spectral-intensity:
- 3119 # Radiance (with respect to wave number)
- 260550 # Cloudy radiance (with respect to wave number)
Expand Down Expand Up @@ -2164,6 +2203,13 @@ numerics.mean:
- 235094 # Time-mean soil temperature
- 235095 # Time-mean snow depth
- 235096 # Time-mean snow cover
- 235097 # Time-mean wind speed
- 235098 # Time-mean pressure
- 235100 # Time-mean potential vorticity
- 235101 # Time-mean specific rain water content
- 235102 # Time-mean specific snow water content
- 235103 # Time-mean eta-coordinate vertical velocity
- 235117 # Time-mean most-unstable CAPE
- 235129 # Time-mean geopotential
- 235130 # Time-mean temperature
- 235131 # Time-mean U component of wind
Expand All @@ -2173,8 +2219,11 @@ numerics.mean:
- 235135 # Time-mean vertical velocity
- 235136 # Time-mean total column water
- 235137 # Time-mean total column vertically-integrated water vapour
- 235138 # Time-mean vorticity (relative)
- 235141 # Time-mean snow depth
- 235151 # Time-mean mean sea level pressure
- 235152 # Time-mean logarithm of surface pressure
- 235155 # Time-mean divergence
- 235157 # Time-mean relative humidity
- 235159 # Time-mean boundary layer height
- 235165 # Time-mean 10 metre U wind component
Expand All @@ -2183,12 +2232,27 @@ numerics.mean:
- 235186 # Time-mean low cloud cover
- 235187 # Time-mean medium cloud cover
- 235188 # Time-mean high cloud cover
- 235203 # Time-mean ozone mass mixing ratio
- 235238 # Time-mean temperature of snow layer
- 235243 # Time-mean forecast albedo
- 235244 # Time-mean forecast surface roughness
- 235245 # Time-mean forecast logarithm of surface roughness for heat
- 260441 # Time-mean total precipitation rate
- 260477 # Time-mean snow melt rate in the last 24h
- 235246 # Time-mean specific cloud liquid water content
- 235247 # Time-mean specific cloud ice water content
- 235248 # Time-mean fraction of cloud cover
- 235257 # Time-mean K index
- 235258 # Time-mean total totals index
- 235262 # Time-mean clear air turbulence (CAT)
- 235271 # Time-mean soil wetness index (total layer)
- 235272 # Time-mean soil wetness index (root zone)
- 235273 # Time-mean soil wetness index(layer)
- 235274 # Time-mean floodplain depth
- 235275 # Time-mean floodplain flooded fraction
- 235276 # Time-mean floodplain flooded area
- 235277 # Time-mean river fraction
- 235278 # Time-mean river area
- 235279 # Time-mean fraction of river coverage plus river related flooding
- 235280 # Time-mean area of river coverage plus river related flooding
- 263000 # Time-mean sea ice thickness
- 263001 # Time-mean sea ice area fraction
- 263002 # Time-mean snow thickness over sea ice
Expand Down Expand Up @@ -2767,7 +2831,6 @@ numerics.accumulated:
- 260427 # Accumulated surface upward short-wave radiation flux, clear sky
- 260428 # Accumulated surface downward long-wave radiation flux, clear sky
- 260430 # Percolation
- 260434 # Time-integrated evapotranspiration rate in the last 24h
- 260564 # Energy release component (as defined by the U.S Forest Service National Fire-Danger Rating System)
- 260645 # Time integral of total solid precipitation flux
- 260652 # Time-integrated eastward turbulent surface stress due to orographic form drag
Expand Down Expand Up @@ -4344,12 +4407,9 @@ rate.mass-flux:
- 260365 # Percolation rate
- 260430 # Percolation
- 260433 # Evapotranspiration rate
- 260434 # Time-integrated evapotranspiration rate in the last 24h
- 260436 # Potential evapotranspiration rate
- 260441 # Time-mean total precipitation rate
- 260443 # Water runoff and drainage rate
- 260475 # Snow melt rate
- 260477 # Time-mean snow melt rate in the last 24h
- 260645 # Time integral of total solid precipitation flux
- 262130 # Net surface upward water flux
- 262131 # Fresh water flux into sea water (from rivers)
Expand Down Expand Up @@ -4418,6 +4478,7 @@ rate.mass-flux:
- 453000 # Aerosol source/gain mass flux

rate.volume:
- 235270 # Time-mean discharge from rivers or streams
- 240032 # River outflow of water
- 240033 # Floodplain outflow of water
- 240034 # Floodpath outflow of water
Expand Down Expand Up @@ -4782,6 +4843,7 @@ ratio:
- 261010 # Anopheles vector to host ratio
- 409000 # Volume-mean total column mixing ratio
- 454000 # Mass mixing ratio from volcanoes
- 459000 # Asymmetry Factor

ratio.area:
- 66 # Leaf area index, low vegetation
Expand Down Expand Up @@ -5010,7 +5072,14 @@ ratio.fraction:
- 235044 # Sunshine duration fraction
- 235093 # Time-mean fraction of snow cover
- 235243 # Time-mean forecast albedo
- 235248 # Time-mean fraction of cloud cover
- 235275 # Time-mean floodplain flooded fraction
- 235277 # Time-mean river fraction
- 235279 # Time-mean fraction of river coverage plus river related flooding
- 240016 # Water fraction
- 240036 # Floodplain flooded fraction
- 240038 # River fraction
- 240040 # Fraction of river coverage plus river related flooding
- 260039 # Rain fraction of total cloud water
- 260103 # Cloud amount
- 260117 # Ice fraction of total condensate
Expand All @@ -5035,6 +5104,7 @@ ratio.fraction:
- 263005 # Time-mean sea ice albedo
- 263017 # Time-mean sea ice melt pond fraction
- 263020 # Time-mean sea ice fraction tendency due to parameterization
- 458000 # Single scattering albedo

ratio.mass:
- 75 # Specific rain water content
Expand Down Expand Up @@ -5427,7 +5497,12 @@ ratio.mass:
- 232015 # Dense dead wood moisture content
- 235006 # Mean specific humidity tendency due to parametrisations
- 235089 # Time-mean 2 metre specific humidity
- 235101 # Time-mean specific rain water content
- 235102 # Time-mean specific snow water content
- 235133 # Time-mean specific humidity
- 235203 # Time-mean ozone mass mixing ratio
- 235246 # Time-mean specific cloud liquid water content
- 235247 # Time-mean specific cloud ice water content
- 260017 # Condensate
- 260018 # Cloud mixing ratio
- 260019 # Ice water mixing ratio
Expand Down
2 changes: 2 additions & 0 deletions src/mir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ list(APPEND mir_srcs
method/Cropping.h
method/FailMethod.cc
method/FailMethod.h
method/Matrix.cc
method/Matrix.h
method/MatrixCacheCreator.cc
method/MatrixCacheCreator.h
method/Method.cc
Expand Down
24 changes: 7 additions & 17 deletions src/mir/api/MIRJob.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ static const std::map<std::string, std::string> aliases{


static const std::string& resolveAliases(const std::string& name) {
auto j = aliases.find(name);
if (j != aliases.end()) {
if (auto j = aliases.find(name); j != aliases.end()) {
Log::debug() << "MIRJob: changing [" << name << "] to [" << j->second << "]" << std::endl;
return j->second;
}
Expand Down Expand Up @@ -186,8 +185,9 @@ MIRJob& MIRJob::set(const std::string& name, long long value) {
}

MIRJob& MIRJob::set(const std::string& name, size_t value) {
ASSERT(size_t(long(value)) == value);
_setScalar(resolveAliases(name), long(value));
ASSERT(static_cast<size_t>(static_cast<long>(value)) == value);

_setScalar(resolveAliases(name), static_cast<long>(value));
return *this;
}

Expand Down Expand Up @@ -246,31 +246,21 @@ MIRJob& MIRJob::set(const std::string& name, const std::vector<std::string>& val

MIRJob& MIRJob::set(const std::string& name, double v1, double v2) {
std::vector<double> v(2);
v[0] = v1;
v[1] = v2;
_setVector(resolveAliases(name), v, 2);
_setVector(resolveAliases(name), std::vector<double>{v1, v2}, 2);
return *this;
}


MIRJob& MIRJob::set(const std::string& name, double v1, double v2, double v3, double v4) {
std::vector<double> v(4);
v[0] = v1;
v[1] = v2;
v[2] = v3;
v[3] = v4;
_setVector(resolveAliases(name), v, 4);
_setVector(resolveAliases(name), std::vector<double>{v1, v2, v3, v4}, 4);
return *this;
}


MIRJob& MIRJob::representationFrom(const input::MIRInput& input) {

const data::MIRField field = input.field();
const repres::Representation* repres = field.representation();
repres::RepresentationHandle repres(input.field().representation());
ASSERT(repres);

// Log::debug() << "Copy from " << *repres << std::endl;
repres->fillJob(*this);

return *this;
Expand Down
2 changes: 1 addition & 1 deletion src/mir/caching/legendre/SharedMemoryLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ SharedMemoryLoader::SharedMemoryLoader(const param::MIRParametrisation& parametr
std::ostringstream msg("SharedMemoryLoader: ");

msg << "path='" << real << "', hostname='" << eckit::Main::hostname() << "'";
Log::info() << msg.str() << std::endl;
Log::debug() << msg.str() << std::endl;

if (real.asString().size() >= INFO_PATH - 1) {
Log::warning() << msg.str() << ", path name too long, maximum=" << INFO_PATH;
Expand Down
2 changes: 1 addition & 1 deletion src/mir/caching/matrix/SharedMemoryLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ SharedMemoryLoader::SharedMemoryLoader(const std::string& name, const eckit::Pat
std::ostringstream msg("SharedMemoryLoader: ");

msg << "path='" << real << "', hostname='" << eckit::Main::hostname() << "'";
Log::info() << msg.str() << std::endl;
Log::debug() << msg.str() << std::endl;

if (real.asString().size() >= INFO_PATH - 1) {
Log::warning() << msg.str() << ", path name too long, maximum=" << INFO_PATH;
Expand Down
27 changes: 18 additions & 9 deletions src/mir/key/grid/TypedGrid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "mir/param/SimpleParametrisation.h"
#include "mir/repres/regular/Lambert.h"
#include "mir/repres/regular/LambertAzimuthalEqualArea.h"
#include "mir/repres/regular/PolarStereographic.h"
#include "mir/util/Exceptions.h"
#include "mir/util/Log.h"

Expand Down Expand Up @@ -61,16 +62,16 @@ void TypedGrid::parametrisation(const std::string& grid, param::SimpleParametris
// set a new parametrisation containing only required or optional keys
param::SimpleParametrisation p;
for (auto& kv_str : eckit::StringTools::split(";", grid)) {
auto kv = eckit::StringTools::split("=", kv_str);
if (kv.size() != 2) {
throw exception::UserError("Gridded2TypedGrid: invalid key=value pair, got '" + kv_str + "'");
if (auto it = kv_str.find("="); it != std::string::npos) {
if (auto k = kv_str.substr(0, it), v = kv_str.substr(it + 1); !k.empty() && !v.empty()) {
if (requiredKeys_.find(k) != requiredKeys_.end() || optionalKeys_.find(k) != optionalKeys_.end()) {
p.set(k, v);
continue;
}
}
}

auto& key = kv[0];
auto& value = kv[1];
if (requiredKeys_.find(key) != requiredKeys_.end() || optionalKeys_.find(key) != optionalKeys_.end()) {
p.set(key, value);
}
throw exception::UserError("TypedGrid: invalid key=value pair, got '" + kv_str + "'");
}

// check for missing keys, set return parametrisation
Expand All @@ -84,7 +85,7 @@ size_t TypedGrid::gaussianNumber() const {
param::SimpleParametrisation param;
parametrisation(key_, param);

long N;
long N = 0;
return param.get("gaussianNumber", N) && N > 0 ? size_t(N) : default_gaussian_number();
}

Expand Down Expand Up @@ -179,4 +180,12 @@ static const TypedGenericPattern<TypedGeneric<repres::regular::LambertAzimuthalE
{"gaussianNumber", "shapeOfTheEarth", "radius", "earthMajorAxis", "earthMinorAxis"});


static const TypedGenericPattern<TypedGeneric<repres::regular::PolarStereographic>> __pattern3(
"^gridType=polar_stereographic;.*$",
{"proj", "LaDInDegrees", "orientationOfTheGridInDegrees", "southPoleOnProjectionPlane", "Ni", "Nj", "grid",
"latitudeOfFirstGridPointInDegrees", "longitudeOfFirstGridPointInDegrees"},
{"gaussianNumber", "shapeOfTheEarth", "radius", "earthMajorAxis", "earthMinorAxis", "iScansNegatively",
"jScansPositively"});


} // namespace mir::key::grid
Loading

0 comments on commit 190efed

Please sign in to comment.