Skip to content

Commit

Permalink
Get cohort outputs only after spinup years
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura Marques committed May 16, 2024
1 parent bf97d31 commit bc12809
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions R/run_biomee_f_bysite.R
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ run_biomee_f_bysite <- function(
n = as.integer(nrow(forcing)), # n here is for hourly (forcing is hourly), add n for daily and annual outputs
n_daily = as.integer(n_daily),
n_annual = as.integer(runyears),
#n_annual_cohorts = as.integer(params_siml$nyeartrend), # to get cohort outputs after spinup year
n_annual_cohorts = as.integer(runyears), # to get cohort outputs from year 1
n_annual_cohorts = as.integer(params_siml$nyeartrend), # to get cohort outputs after spinup year
#n_annual_cohorts = as.integer(runyears), # to get cohort outputs from year 1
forcing = as.matrix(forcing)
)

Expand Down
8 changes: 4 additions & 4 deletions src/sofun_r.f90
Original file line number Diff line number Diff line change
Expand Up @@ -772,13 +772,13 @@ subroutine biomee_f( &
! To get outputs only after spinupyears make if below and
! also in run_biomee_f_bysite.R make n_annual_cohorts = as.integer(params_siml$nyeartrend)

!if (.not. myinterface%steering%spinup) then
if (.not. myinterface%steering%spinup) then

!idx = yr - myinterface%params_siml%spinupyears
idx = yr - myinterface%params_siml%spinupyears

! To get outputs for all runyears idx=yr and also in run_biomee_f_bysite.R make n_annual_cohorts = as.integer(runyears)

idx = yr
!idx = yr

output_annual_cohorts_year(idx, :) = dble(out_biosphere%annual_cohorts(:)%year)
output_annual_cohorts_cID(idx, :) = dble(out_biosphere%annual_cohorts(:)%cID)
Expand Down Expand Up @@ -813,7 +813,7 @@ subroutine biomee_f( &
output_annual_cohorts_Nfix(idx, :) = dble(out_biosphere%annual_cohorts(:)%Nfix)
output_annual_cohorts_deathrate(idx, :) = dble(out_biosphere%annual_cohorts(:)%deathrate)

!end if
end if

end do yearloop

Expand Down

0 comments on commit bc12809

Please sign in to comment.