Skip to content
Snippets Groups Projects
Commit 153a15d4 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Fix run-time warning generated by GRB1 tests.

parent 328dbc52
No related branches found
No related tags found
2 merge requests!91Add alternative code path for huge buffers.,!89Miscellaneous fixes and CDI-PIO improvements
......@@ -142,6 +142,10 @@ modelRun(const struct model_config *setup, MPI_Comm comm)
{
double lscale = 1.0 / (double) (setup->max_nlev - 1);
for (size_t i = 0; i < (size_t) setup->max_nlev; ++i) levs[i] = 101300.0 - 13000.0 * expm1(2.173 * (double) i * lscale);
/* GRIB1 only supports integral hPa values in pressure levels */
if (setup->filetype == CDI_FILETYPE_GRB)
for (size_t i = 0; i < (size_t) setup->max_nlev; ++i)
levs[i] = round(levs[i]*0.01) * 100.0;
}
vlistID = vlistCreate();
......
......@@ -109,6 +109,10 @@ modelRun(const struct model_config *setup, MPI_Comm comm)
{
double lscale = 1.0 / (double) (setup->max_nlev - 1);
for (size_t i = 0; i < (size_t) setup->max_nlev; ++i) levs[i] = 101300.0 - 13000.0 * expm1(2.173 * (double) i * lscale);
/* GRIB1 only supports integral hPa values in pressure levels */
if (setup->filetype == CDI_FILETYPE_GRB)
for (size_t i = 0; i < (size_t) setup->max_nlev; ++i)
levs[i] = round(levs[i]*0.01) * 100.0;
}
vlistID = vlistCreate();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment