Skip to content

Commit

Permalink
made the decision to put an “-9999” into the netCDF for gridCells wh…
Browse files Browse the repository at this point in the history
…ere there aren’t any deep soil values (b/c soil isn’t deep enough)
  • Loading branch information
aestears committed Aug 29, 2024
1 parent be54497 commit f7d7d48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main/implementation/01.2_input-values-into-ncdfs.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ for(n in seq_along(netCDFnames)){
co <- c(1, 1, 30, tdim[n])
# ammend the 'st' vecotr, which tells the ncvar_put function where to start writing the data
st_n <- c(st, 1)
}
#write!
}
## add something to deal w/ the fact that there may not be a "deep" soil layer
#value if the soil isn't deep enough in a given location write!
if (n %in% grep("Deep", valueName)) {
vals <- rep_len(-9999, length.out = co[3])
}
RNetCDF::var.put.nc(ncfile = get(netCDFnames[n]),
variable = varName[n],
data = vals,
Expand Down

0 comments on commit f7d7d48

Please sign in to comment.