-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
123 changed files
with
13,177 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#' Convert a hob object to a time series data frame | ||
#' | ||
#' @param hob hob object | ||
#' @param dis dis object | ||
#' @param prj prj object | ||
#' @return time series data frame containing name, time and head columns | ||
#' @export | ||
convert_hob_to_time_series <- function(hob, | ||
dis, | ||
prj) { | ||
toffset <- lubridate::days(ifelse(hob$irefsp==1,0,cumsum(dis$perlen)[hob$irefsp-1]) + hob$toffset * hob$tomulth) | ||
time_series <- data.frame(name = hob$obsloc, time = prj$starttime + toffset, head = hob$hobs) | ||
return(time_series) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#' Convert a huf to a mask object | ||
#' | ||
#' @param huf huf object | ||
#' @param dis dis object, corresponding to the huf object | ||
#' @param bas bas object, corresponding to the huf object | ||
#' @return mask rmodflow_3d_array | ||
#' @export | ||
convert_huf_to_mask <- function(huf, dis, bas) { | ||
mask <- RMODFLOW::convert_huf_to_nlay(huf = huf, dis = dis, bas = bas) | ||
mask[which(mask==0)] <- NA | ||
mask <- mask/mask | ||
mask[which(huf$thck==0)] <- NA | ||
return(mask) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#' Convert a huf object to an rmodflow_3d_array with the number of numerical layers per hydrogeological unit | ||
#' | ||
#' @param huf huf object | ||
#' @param dis dis object, corresponding to the huf object | ||
#' @param bas bas object, corresponding to the huf object | ||
#' @return nlay rmodflow_3d_array | ||
#' @export | ||
convert_huf_to_nlay <- function(huf, dis, bas) { | ||
nlay <- huf$top * 0 | ||
huf_coordinates <- RMODFLOW::cell_coordinates(huf, dis = dis, include_faces = TRUE) | ||
dis_coordinates <- RMODFLOW::cell_coordinates(dis, include_faces = TRUE) | ||
ibound <- abs(bas$ibound) | ||
for(i in 1:huf$nhuf) { | ||
for(j in 1:dis$nlay) { | ||
nlay[,,i] <- nlay[,,i] + (!(dis_coordinates$upper[,,j] < huf_coordinates$lower[,,i] | dis_coordinates$lower[,,j] > huf_coordinates$upper[,,i])) * ibound[,,j] | ||
} | ||
} | ||
return(nlay) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.