You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@mlee03 has noticed a very interesting and suspicious code relationship. In function do_scalar_conserve_interp, for second order conservative regridding, for cell_methods SUM or cell_measure true, field_in.area and grid_in.cell_area are indexed by a 3D index, with the horizontal component by itself being NX*NY:
...
n1 = k * nx1 * ny1 + j1 * nx1 + i1;
else if (cell_measures)
area *= (field_in[tile].area[n1] / grid_in[tile].cell_area[n1]);
...
However, the arrays seem to be to small , of size NX * NY as determined by code inspection. For example, in function get_input_data , for the cell measure case:
field[n].area = (double *)malloc(nx * ny * sizeof(double));
Without some side effect programming or hidden correction of the array sizes, the code may be incorrect and
it merits further investigation. If somehow the code is correct it should be documented. If its not correct, a clean code / non-mysterious software should be created.
This mystery can be seen in the baseline code, circa 2023.
The text was updated successfully, but these errors were encountered:
@mlee03 has noticed a very interesting and suspicious code relationship. In function
do_scalar_conserve_interp
, for second order conservative regridding, for cell_methods SUM or cell_measure true, field_in.area and grid_in.cell_area are indexed by a 3D index, with the horizontal component by itself being NX*NY:However, the arrays seem to be to small , of size NX * NY as determined by code inspection. For example, in function
get_input_data
, for the cell measure case:Without some side effect programming or hidden correction of the array sizes, the code may be incorrect and
it merits further investigation. If somehow the code is correct it should be documented. If its not correct, a clean code / non-mysterious software should be created.
This mystery can be seen in the baseline code, circa 2023.
The text was updated successfully, but these errors were encountered: