Skip to content

Commit

Permalink
Bugfix 2531 compilation errors (#2533)
Browse files Browse the repository at this point in the history
* Resolve error: more than one instance of overloaded function isnan matches the argument list

* Ensure RTD build passes

* Added std:: in front of isnan for compilation on Hera

* Add -std=c++11 to CXXFLAGS

* Added note about C++11
  • Loading branch information
jprestop authored May 5, 2023
1 parent 2220a8f commit 48f9ffb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build:
os: ubuntu-22.04
tools:
python: "3.10"

# Optionally set the version of Python and requirements required to build your
# docs
python:
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,9 @@ AM_CONDITIONAL([ENABLE_DEVELOPMENT], [test -n "$MET_DEVELOPMENT"])

CPPFLAGS=$CPPFLAGS' -DMET_BASE="\"$(pkgdatadir)\""'

# Add -std=c++11 to CXXFLAGS
CXXFLAGS=$CXXFLAGS' -std=c++11'

# Define other variables for the makefiles

AC_SUBST(FC_LIBS, [-lgfortran])
Expand Down
2 changes: 2 additions & 0 deletions docs/Users_Guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Programming Languages

The MET package, including MET-TC, is written primarily in C/C++ in order to be compatible with an extensive verification code base in C/C++ already in existence. In addition, the object-based MODE and MODE-TD verification tools rely heavily on the object-oriented aspects of C++. Knowledge of C/C++ is not necessary to use the MET package. The MET package has been designed to be highly configurable through the use of ASCII configuration files, enabling a great deal of flexibility without the need for source code modifications.

With the release of MET-11.1.0, C++11 is now the minimum required version of the C++ programming language standard.

NCEP's BUFRLIB is written entirely in Fortran. The portion of MET that handles the interface to the BUFRLIB for reading PrepBUFR point observation files is also written in Fortran.

The MET package is intended to be a tool for the modeling community to use and adapt. As users make upgrades and improvements to the tools, they are encouraged to offer those upgrades to the broader community by offering feedback to the developers.
Expand Down
4 changes: 2 additions & 2 deletions src/libcode/vx_grid/goes_grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,13 @@ void GoesImagerData::compute_lat_lon()
mlog << Error << method_name << " index=" << index
<< " too big than " << buf_len << "\n";
else {
if (isnan(lat_rad)) lat = bad_data_float;
if (std::isnan(lat_rad)) lat = bad_data_float;
else {
lat = lat_rad * deg_per_rad;
if (lat > lat_max) {lat_max = lat; idx_lat_max = index; }
if (lat < lat_min) {lat_min = lat; idx_lat_min = index; }
}
if (isnan(lon_rad)) lon = bad_data_float;
if (std::isnan(lon_rad)) lon = bad_data_float;
else {
lon = lon_of_projection_origin - (lon_rad * deg_per_rad);
if (lon > lon_max) {lon_max = lon; idx_lon_max = index; }
Expand Down
2 changes: 1 addition & 1 deletion src/libcode/vx_statistics/compute_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ void compute_aggregated_seeps_grid(const DataPlane &fcst_dp, const DataPlane &ob
else count_diagonal++;
}
seeps_score = seeps_mpr->score;
if (isnan(seeps_score)) {
if (std::isnan(seeps_score)) {
nan_count++;
seeps_score = bad_data_double;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcode/vx_statistics/contable_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ for (j=0; j<Nrows; ++j) {
// replace nan with bad data
//

if (isnan(sum)) sum = bad_data_double;
if (std::isnan(sum)) sum = bad_data_double;

//
// done
Expand Down

0 comments on commit 48f9ffb

Please sign in to comment.