-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug-fix: get_dist calculation for observations with VERTISUNDEF in WRF #510
Conversation
…RTISUNDEF fixes #486 Previously observations with VERTISUNDEF were given a large distance, because the verical coordinate is missing: local_array(3) == missing_r8 The location_mod::get_dist uses horizontal distance only if VERTISUNDEF for either location.
@hkershaw-brown the general fix here looks great, which adds the check for VERTISUNDEF obs that calculates the 2D dist before converting the local vert coordinate. I have a few logistical questions: The first is about this comment ( #486 (comment) ) where you explain why you changed the value of dist for testing. Should we maybe keep this change, even outside of testing, so that we have a different value for initialization and missing/failed vert coordinates? And the second is just revisiting a question that you initially asked in the notes of the issue, which is whether or not we should set whichvert_obs_in_localization_coord = 0 here -
As you noted it doesn't match any of the values in the 3D sphere location_mod:
On the flip side, could we potentially change the parameter value for VERTISUNDEF to 0 for in threed_sphere/location_mod.f90? |
I thought about this too. I was using a debugger to trap on various values, which i think nice debugging technique, but Note there is an upcoming project to simplify a lot of the wrf model_mod #404 and part of that is to not have so many if statements in get_close.
VERTISUNDEF is in a world where the vertical dimension exists, but the observation is not at one point in the vertical (e.g. maybe it is the integral of a whole column of atmosphere) I think DART/assimilation_code/modules/assimilation/assim_tools_mod.f90 Lines 613 to 617 in 1b76f3a
but
I'm guessing that 0 was picked because it is not a valid value for the vertical so if you start to use it, it should trigger an error.
I don't think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Like you said, we can revisit any of these issues when we refactor. Approved.
Description:
Previously observations with VERTISUNDEF were given a large distance, because the vertical coordinate is missing: local_array(3) == missing_r8
DART/models/wrf/model_mod.f90
Lines 6423 to 6424 in 1b76f3a
The location_mod::get_dist uses horizontal distance only if VERTISUNDEF for either location.
Fixes issue
Fixes #486
Types of changes
Documentation changes needed?
Tests
Please describe any tests you ran to verify your changes.
Tested using an example case from Lukas K.
#486 and main...lukas-vertundef-wrf
Note lukas-vertundef-wrf has changes for wrf v4, this pull request only has the VERTISUNDEF bug fix.
Checklist for merging
Checklist for release
Testing Datasets