Open nancycollins opened 1 year ago
@nancycollins are these the lines with the bug?
If not can you give a link to the lines:
yep, those are them.
i'm sorry i didn't make this clear in the bug report. i am intending to do the test once cheyenne comes back up (all the test case code is there).
Describe the bug
In reviewing the mpas_atm model_mod code, the subroutine find_vert_indices() calls find_vert_level() which calls find_height_bounds(). find_height_bounds uses either the zGridCenter array or the zGridEdge for vertical locations. it returns the lower and upper model level numbers that enclose that vertical location, along with the fraction of the level.
in convert_vert_distrib() if the requested outgoing vertical is VERTISHEIGHT, after computing the level numbers based on cell centers, it indexes into the zGridFace array for the heights instead of zGridCenter or zGridEdge.
this seems wrong and needs to be tested - possibly with a version of model_mod_check which includes a call to convert_vert.
note that if W interpolation is added, this code will need to distinguish between cell centered data in the vertical and data on the cell faces, where the existing code might be correct for the new case.
To reproduce/test the bug
set the namelist so it will localize in the vertical on height. test a location of a variable located on the cell center (T, Q) in the vertical on a known level (VERTISLEVEL) look at the location after vertical conversion. the height should match the height of the cell center, not the cell face.
Error Message
This will not provoke any error messages, but would increase the distances used in localization by half a vertical cell.
Which model(s) are you working with?
mpas_atm
Version of DART
This code is in the main branch
Have you modified the DART code?
there is a modified version that includes other changes which is not in the dart repo.
Build information
This was discovered by inspecting the code. The tests can be run anyplace but based on the size of the mpas test cases, it probably needs to be run on cheyenne.