diff --git a/models/wrf/model_mod.f90 b/models/wrf/model_mod.f90 index d8a5211528..8fc1592ca9 100644 --- a/models/wrf/model_mod.f90 +++ b/models/wrf/model_mod.f90 @@ -6403,6 +6403,13 @@ subroutine get_close(gc, base_loc, base_type, locs, loc_qtys, & local_loc = locs(t_ind) local_which = nint(query_location(local_loc)) + if (present(dist)) then + if (local_which == VERTISUNDEF) then + dist(k) = get_dist(base_loc, local_loc, base_type, loc_qtys(t_ind)) + cycle + endif + endif + ! Convert local vertical coordinate to requested vertical coordinate if necessary. ! This should only be necessary for obs priors, as state location information already ! contains the correct vertical coordinate (filter_assim's call to get_state_meta_data).