Skip to content

Commit

Permalink
Finished test.R but slurm job-submission not working.
Browse files Browse the repository at this point in the history
  • Loading branch information
minoli-pik committed Aug 12, 2022
1 parent e9de549 commit 7654a61
Show file tree
Hide file tree
Showing 3 changed files with 282 additions and 111 deletions.
7 changes: 1 addition & 6 deletions cropCalendars/R/calcMonthlyClimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,17 @@ calcMonthlyClimate <- function(lat = NULL,
d_dates <- date_to_doy(dates, skip_feb29 = TRUE)


# Compute PET (Potential ET)
cat("Computing daily PET ...\n")
# Compute daily PET (Potential ET)
pet <- NULL
for (i in seq_len(length(temp))) {
pet_today <- calcPET(temp = temp[i], lat = lat, day = d_dates[i])
pet <- c(pet, pet_today)
}

# Compute monthly climate for each year
cat("Computing monthly climate ...\n")

mtemp_y <- array(NA, dim = c(nyears, nmonths))
mprec_y <- mpet_y <- mppet_y <- mtemp_y


for (yy in seq_len(nyears)) {
for (mm in seq_len(nmonths)) {

Expand All @@ -74,7 +70,6 @@ calcMonthlyClimate <- function(lat = NULL,
}

# Compute 20-years Average
cat("Computing climate 20-years mean ...\n")
mtemp <- round(apply(mtemp_y, 2, mean), digits = 5)
mprec <- round(apply(mprec_y, 2, mean), digits = 5)
mpet <- round(apply(mpet_y, 2, mean), digits = 5)
Expand Down
Loading

0 comments on commit 7654a61

Please sign in to comment.