Possible bugs in interpolation and nesting
Posted: Mon Mar 27, 2017 12:43 pm
Hi,
I'm having difficulties including gridded weather data in COHERENS V2.9 (and in V2.10.3). Both the model grid and the weather grid are uniform rectangular (nhtype=1), but different sizes. The weather grid has more coarse resolution.
The problem is that weather data doesn't interpolate correctly (or at all) in some calculation domains when using more than 10 domains (V2.9) or the model crashes in the initialisation phase or in early running (V2.10.3). The interpolation seemed to work better in COHERENS V2.5.1. Here are some example pictures of air temperature interpolation in V2.5.1 and in V2.9: Interpolation examples. The same effect is seen in other variables too. The problems seem to be the same regardless of whether the weather grid is applied to lake or marine cases (Cartesian or spherical coordinates).
My colleagues have been able to find some suspect code rows in several files that might or might not be related to the issue, but even trying to fix these hasn't solved the problem yet. These are listed below. There seems to be some trouble in interpolation and nesting. Nesting issues are probably unrelated to the interpolation problems, but I will list them here too.
I'd really appreciate some help with these issues.
In V2.9 the main issue seems to be the incorrect interpolation. In V2.10.3 initialisation seems unable to recognize that the model grid indeed is totally within the surface data grid.
Possible bugs:
V2.9: grid_interp.F90, rows 1389 and 1392:
outvals(i,j,:) = outflag ! Should this be flagout or 0.0? If flagout, the model crashes later as it tries to calculate with too large values.
V2.9: Nested_grids.F90, row 2761:
Looks like we need to add filepars = modfiles(io_nstgrd,iset,2) after the call to set_modfiles_atts, which changes the %novars attribute. Otherwise nesting crashes.
V2.10.3: grid_interp.F90, row 1658:
j.LT.lbounds(1) --> Should this be: j.LT.lbounds(2) ?
V2.10.3: grid_interp.F90, row 2856:
CALL hrel_coords_rect_unif: the parameters delxdat, delydat might be from the wrong grid (model vs. weather grid)?
Also, nesting with multiple variables (novars>1) seems unstable and writing/reading multivariable NetCDF files doesn't seem to work properly.
Regards,
- Janne
I'm having difficulties including gridded weather data in COHERENS V2.9 (and in V2.10.3). Both the model grid and the weather grid are uniform rectangular (nhtype=1), but different sizes. The weather grid has more coarse resolution.
The problem is that weather data doesn't interpolate correctly (or at all) in some calculation domains when using more than 10 domains (V2.9) or the model crashes in the initialisation phase or in early running (V2.10.3). The interpolation seemed to work better in COHERENS V2.5.1. Here are some example pictures of air temperature interpolation in V2.5.1 and in V2.9: Interpolation examples. The same effect is seen in other variables too. The problems seem to be the same regardless of whether the weather grid is applied to lake or marine cases (Cartesian or spherical coordinates).
My colleagues have been able to find some suspect code rows in several files that might or might not be related to the issue, but even trying to fix these hasn't solved the problem yet. These are listed below. There seems to be some trouble in interpolation and nesting. Nesting issues are probably unrelated to the interpolation problems, but I will list them here too.
I'd really appreciate some help with these issues.
In V2.9 the main issue seems to be the incorrect interpolation. In V2.10.3 initialisation seems unable to recognize that the model grid indeed is totally within the surface data grid.
Possible bugs:
V2.9: grid_interp.F90, rows 1389 and 1392:
outvals(i,j,:) = outflag ! Should this be flagout or 0.0? If flagout, the model crashes later as it tries to calculate with too large values.
V2.9: Nested_grids.F90, row 2761:
Looks like we need to add filepars = modfiles(io_nstgrd,iset,2) after the call to set_modfiles_atts, which changes the %novars attribute. Otherwise nesting crashes.
V2.10.3: grid_interp.F90, row 1658:
j.LT.lbounds(1) --> Should this be: j.LT.lbounds(2) ?
V2.10.3: grid_interp.F90, row 2856:
CALL hrel_coords_rect_unif: the parameters delxdat, delydat might be from the wrong grid (model vs. weather grid)?
Also, nesting with multiple variables (novars>1) seems unstable and writing/reading multivariable NetCDF files doesn't seem to work properly.
Regards,
- Janne