diff --git a/workspace/R/utils.R b/workspace/R/utils.R index 7ed0a6f06f50d9a2a48d067f92a1f658a4285ff2..f7303cd3fd87cf5cc3599ca1de667aa8e002a2f0 100644 --- a/workspace/R/utils.R +++ b/workspace/R/utils.R @@ -203,7 +203,11 @@ clean_net <- function(net, net_new, nwm) { # NOTE: just being explicit about this for clarity. candidate <- select(net_new, comid, tocomid, nwm_tocomid) %>% - filter(!comid %in% avoid) + filter(!comid %in% avoid) %>% + # only use nwm changes where they are reconnecting the network + # this is key since enhd changed the flow direction of some divergences + # and those changes would be lost if we do not use this filter + filter(tocomid == 0 & nwm_tocomid != 0) mismatch <- candidate[candidate$tocomid != candidate$nwm_tocomid, ]