@@ -87,7 +87,7 @@ ic_process <- function(settings, input, dir, overwrite = FALSE){
8787
8888 start_date <- settings $ run $ start.date
8989 end_date <- settings $ run $ end.date
90- } else if (input $ source == " BADM" ){
90+ }else if (input $ source == " BADM" ){
9191
9292 outfolder <- file.path(dir , paste0(input $ source , " _site_" , str_ns ))
9393 if (! dir.exists(outfolder )) dir.create(outfolder )
@@ -104,47 +104,18 @@ ic_process <- function(settings, input, dir, overwrite = FALSE){
104104 settings $ run $ inputs [[' poolinitcond' ]]$ path <- newfile
105105
106106 return (settings )
107- } else if (input $ source == " SoilGrids" ){
108-
109- outfolder <- file.path(dir , paste0(input $ source , " _site_" , str_ns ))
110- if (! dir.exists(outfolder )) dir.create(outfolder )
111-
112- # Check if files already exist in the expected SoilGrids directory
113- newfile <- list.files(outfolder , " *.nc$" , full.names = TRUE ) %> %
114- as.list()
115- names(newfile ) <- rep(" path" , length(newfile ))
116-
117- if (length(newfile ) == 0 || overwrite $ getveg ) {
118- soilgrids_result <- PEcAn.data.land :: soilgrids_ic_process(
119- settings = settings ,
120- dir = dir ,
121- overwrite = overwrite $ getveg ,
122- verbose = TRUE
123- )
124-
125- site_files <- soilgrids_result [[str_ns ]]
126- if (! is.null(site_files ) && length(site_files ) > 0 ) {
127- newfile <- as.list(unlist(site_files , use.names = FALSE ))
128- names(newfile ) <- rep(" path" , length(newfile ))
129- } else {
130- PEcAn.logger :: logger.severe(sprintf(" No SoilGrids files generated for site %s" , str_ns ))
131- }
132- }
133-
134- settings $ run $ inputs [[' poolinitcond' ]]$ path <- newfile
135- return (settings )
136- } else if (input $ source == " NEON_veg" ){
107+ }else if (input $ source == " NEON_veg" ){
137108 # For debugging purposes I am hard coding in the start and end dates, will revisit and adjust once extract_NEON_veg is working within ic_process
138109 start_date = as.Date(input $ startdate )
139110 end_date = as.Date(input $ enddate )
140111 # start_date = as.Date("2020-01-01")
141112 # end_date = as.Date("2021-09-01")
142113 # Note the start and end dates for ICs are not the same as those for the forecast runs
143114 # please check out NEON products DP1.10098.001 for your desired site to check data availability before setting start and end dates
144- } else if (! is.null(input $ startdate ) && ! is.null(input $ enddate )){
115+ }else if (! is.null(input $ startdate ) && ! is.null(input $ enddate )){
145116 start_date <- as.Date(input $ startdate )
146117 end_date <- as.Date(input $ enddate )
147- } else {
118+ } else {
148119
149120 query <- paste0(" SELECT * FROM inputs where id = " , input $ id )
150121 input_file <- PEcAn.DB :: db.query(query , con = con )
0 commit comments