sumanager56 / SWAP-WOFOST

0 stars 0 forks source link

Solute transport parameters #2

Open julieshortridge opened 1 year ago

julieshortridge commented 1 year ago

@sumanager56 To represent nitrogen-limited plant growth we will need to start editing the swp files in the "Cases_CNmodule/Maize(Cran16)" folder provided with SWAP installation. The process for specifying and calibrating soil hydrologic parameters can continue in the files you've been working in, but you should also start familiarizing yourself with the files and processes in this case study.

sumanager56 commented 1 year ago

The following results are obtained after updating the "Cases_CNmodule/Maize(Cran16)" file and running a detailed Swap-Wofost module instead of just the simple SWAP model. I tried to keep all the parameters similar to what I used before (LAI, depth discretization, crop factor, groundwater level, van-genuchten parameters). However, for the crop file, I kept almost all the detailed crop parameters (e.g., root density distribution, temperature for germination and maturity, assimilation coefficients, reduction factors for assimilation and respiration, co2 impact factors, drought and o2 stress, etc.) the same as in this new case study file.

soilmois ET_PET combined

sumanager56 commented 1 year ago

Code for formatting and saving multi-year weather data into a plain text file for direct input into SWAP. Now onwards, there is no need to copy and paste into a reference met file like before.

There were 137 negative solar radiation values giving errors in SWAP, so I just considered them positive for now.

install.packages("stringi") library(dplyr) library(dplyr) library(stringi)

Data1 <- read.csv("Historic_metdatacopy.csv") for(i in 1:nrow(Data1)){ if(Data1$RAD[i]<0){ Data1$RAD[i] <- abs(Data1$RAD[i]) } } Data1$Rad <- format(Data1$RAD,digits=3) Data1$Tmax <- ((Data1$TMAX)-32)5/9 Data1$Tmin <- ((Data1$TMIN)-32)5/9 Data1$Tavg <- (Data1$Tmax+Data1$Tmin)/2 Data1$Wind <- Data1$AWND Data1$RH <- (Data1$HUM)/100 Data1$Rain <- (Data1$PRCP)*25.4 Data1$ETref <- -99.9 Data1$Wet <- -99.9

Calculate e and save

Data1$es <- 6.1110^((7.5Data1$Tavg)/(273.3+Data1$Tavg)) Data1$e <- (Data1$es (Data1$RH))0.1 Data1$Hum <- Data1$e Data1$Station <- "'Tidewater'" Data1$DATE <- as.Date(Data1$DATE, format = "%m/%d/%Y") Data1$DD <- format(Data1$DATE, format="%d") Data1$MM <- format(Data1$DATE, format="%m") Data1$YYYY <- format(Data1$DATE, format="%Y") Data2<-Data1%>% select(Station,DD,MM,YYYY,Rad,Tmin,Tmax,Hum,Wind,Rain,ETref,Wet)

Saving into multiple year files

dates<-unique(Data2$YYYY) Timeseries <- split(Data2, as.character(Data2$YYYY)) for (i in 1:length(Timeseries)){ year <- dates[i] ext <- stri_sub(year,-3,-1) mypath <- file.path("G:","Shared drives","Tidewater-HydSignatures", "SWAP-suman working","InstallPackageSwap401", "Corn_Tidewater","InputData","Weather","Multiyear", paste("Tidewater",ext,sep=".")) write.table(format(Timeseries[[i]],digits=3),mypath,quote=FALSE,row.names=FALSE,sep=",") }

write.csv(Data2,"Hist_metdata_Rout.csv")

julieshortridge commented 1 year ago

Ok, thanks - I suspect those negative radiation values are just stemming from a missing data issue in the weatherstem data. I'll take a look later today and correct those.

julieshortridge commented 1 year ago

I corrected the negative radiation values, you should be able to use this version instead (it's the same file as the one I just posted in the weather generation issue). Historic_Met_2002-2022.csv