WSL/SLF GitLab Repository

Commit 7fb8a803 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Small fixes to compile cleanly at cscs (still the size_t stuff...)

parent cf6784d4
......@@ -269,8 +269,8 @@ void GRIBIO::getDate(grib_handle* h, Date &base, double &d1, double &d2) {
GRIB_CHECK(grib_get_long(h,"dataDate",&dataDate),0);
GRIB_CHECK(grib_get_long(h,"dataTime",&dataTime),0);
const int year=dataDate/10000, month=dataDate/100-year*100, day=dataDate-month*100-year*10000;
const int hour=dataTime/100, minutes=dataTime-hour*100;
const int year=static_cast<int>(dataDate/10000), month=static_cast<int>(dataDate/100-year*100), day=static_cast<int>(dataDate-month*100-year*10000);
const int hour=static_cast<int>(dataTime/100), minutes=static_cast<int>(dataTime-hour*100);
base.setDate(year, month, day, hour, minutes, tz_in);
//reading offset to base date/time, as used for forecast, computed at time t for t+offset
......@@ -314,8 +314,8 @@ void GRIBIO::getDate(grib_handle* h, Date &base, double &d1, double &d2) {
throw InvalidFormatException(ss.str(), AT);
}
d1 = startStep*step_units;
d2 = endStep*step_units;
d1 = static_cast<double>(startStep*step_units);
d2 = static_cast<double>(endStep*step_units);
}
Coords GRIBIO::getGeolocalization(grib_handle* h, double &cell_x, double &cell_y)
......@@ -916,7 +916,7 @@ bool GRIBIO::readMeteoMeta(std::vector<Coords>& vecPoints, std::vector<StationDa
return true;
}
bool GRIBIO::readMeteoValues(const double& marsParam, const long& levelType, const long& i_level, const Date& i_date, const long& npoints, double *lats, double *lons, double *values)
bool GRIBIO::readMeteoValues(const double& marsParam, const long& levelType, const long& i_level, const Date& i_date, const size_t& npoints, double *lats, double *lons, double *values)
{
GRIB_CHECK(grib_index_select_double(idx,"marsParam",marsParam),0);
GRIB_CHECK(grib_index_select_long(idx,"indicatorOfTypeOfLevel", levelType),0);
......
......@@ -20,6 +20,7 @@
#include <meteoio/Graphics.h>
#include <meteoio/meteolaws/Meteoconst.h>
#include <cstring>
#include <algorithm>
#include <errno.h>
#include <zlib.h>
......@@ -197,7 +198,7 @@ void PNGIO::parse_size(const std::string& size_spec, size_t& width, size_t& heig
}
}
double PNGIO::getScaleFactor(const double& grid_w, const double& grid_h)
double PNGIO::getScaleFactor(const size_t& grid_w, const size_t& grid_h)
{
if(grid_w==0 || grid_h==0) {
return 1.;
......@@ -376,7 +377,7 @@ void PNGIO::setFile(const std::string& filename, png_structp& png_ptr, png_infop
size_t PNGIO::setLegend(const size_t &ncols, const size_t &nrows, const double &min, const double &max, Array2D<double> &legend_array)
{
if(has_legend) {
const legend leg(nrows, min, max);
const legend leg(static_cast<unsigned int>(nrows), min, max);
legend_array = leg.getLegend();
size_t nx, ny;
legend_array.size(nx,ny);
......@@ -657,7 +658,7 @@ void PNGIO::writeWorldFile(const Grid2DObject& grid_in, const std::string& filen
const double cellsize = grid_in.cellsize;
Coords world_ref = grid_in.llcorner;
world_ref.setProj(coordout, coordoutparam);
world_ref.moveByXY(.5*cellsize, (grid_in.nrows+.5)*cellsize); //moving to center of upper left cell
world_ref.moveByXY(.5*cellsize, (double(grid_in.nrows)+.5)*cellsize); //moving to center of upper left cell
std::ofstream fout;
fout.open(world_file.c_str());
......
......@@ -65,7 +65,7 @@ class PNGIO : public IOInterface {
private:
void setOptions();
void parse_size(const std::string& size_spec, size_t& width, size_t& height);
double getScaleFactor(const double& grid_w, const double& grid_h);
double getScaleFactor(const size_t& grid_w, const size_t& grid_h);
void createMetadata(const Grid2DObject& grid);
void writeMetadata(png_structp &png_ptr, png_infop &info_ptr);
Grid2DObject scaleGrid(const Grid2DObject& grid_in);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment