Modular Crop Growth Simulations
Overview
A cross-platform representation of models as sets of equations that facilitates modularity in model building and allows users to harness modern techniques for numerical integration and data visualization. Documentation is provided by several vignettes included in this package; also see Lochocki et al. (2022) doi:10.1093/insilicoplants/diac003.
Minor User-Facing Changes
- Made canopy photosynthesis integral explicit for
c3_canopyandc4_canopymodules: canopy photosynthesis is now computed using numerical quadrature, making the integration over canopy depth explicit. This change addresses a long-standing design goal and results in a significant performance improvement. Several other changes are related to this change: - Added numerical quadrature library: A new C++ header file
quad.hinsrc/math/quadrature/ - New
canopy_light_distributionmodule: Added a new module that computes light distribution through the canopy at any given cumulative LAI depth, allowing users to examine canopy light profiles by layer. - The internal temperature response functions, such as
arrhenius_exponential, now return values normalized to the parameter value at a reference temperature (25 degrees C). Because of this, several "scaling" parameters such asVcmax_c,Jmax_c,RL_c, etc, are no longer required.
Show all changes in 3.4.0Hide the rest of the changes in 3.4.0
- Several new temperature response functions, including
peaked_arrhenius_response, were also added totemperature_response_functions.h - The Dekker method is now used to check for consistent values of stomatal conductance when solving the combined assimilation + energy balance models in the
BioCro:c3_leaf_photosynthesis,BioCro:c3_canopy,BioCro:c4_leaf_photosynthesis, andBioCro:c4_canopymodules. - Added two new years of weather data (2023 and 2025) to the
weatherdata set and one year of globally-averaged atmospheric CO2 concentration (2025) to thecatm_datadata set. - Added several new modules for simulating soil water dynamics, which are generally based on DSSAT and its original sources:
BioCro:atmospheric_pressure_from_elevationBioCro:multi_layer_soil_profileBioCro:multilayer_soil_profile_avgBioCro:soil_evaporation_ritchieBioCro:soil_surface_runoffBioCro:soil_type_selectorBioCro:soil_water_downflowBioCro:soil_water_dynamic_rootingBioCro:soil_water_tiledrainBioCro:soil_water_upflowBioCro:soil_water_uptake
These modules are now used in the soybean_sw model. Eventually, soybean_sw
will replace the original soybean model, but it will take some time to
ensure that all examples that currently use soybean will be able to to work
with soybean_sw.
- The
BioCro:stomata_water_stress_linearmodule was updated to be more flexible, and a related module was added (BioCro:stomata_water_stress_bilinear). The soybean model now uses the bilinear version since it produces more realistic results when the soil is dry. - The new stomata water stress modules use input parameters called
StomataWS_gradientandStomataWS_intercept. A script for calibrating the values of these parameters for soybean has been added to the package:inst/extdata/optimize_StomataWS_linear.R. - The C3 photosynthesis calculations now include mesophyll conductance, and they determine
Ccalong withCi. Settinggm_at_25to infinity will ensure thatCc = Ci, reproducing the behavior of previous BioCro versions. - The
inst/extdata/parameterize_soybean.Rscript has been updated to use a better approach, where the evolutionary optimizer is followed by a Nelder-Mead optimizer. - The upper bound for the
grc_parameters in the parmaterization script was changed to a safer value. - The behavior of the
BioCro:partitioning_growth_calculatormodule was changed so that respiratory losses are subtracted from each tissue proportional to its biomass, rather than proportional to its partitioning factor.
Internal changes
- Refactored code organization:
- Renamed
sunMLstruct/function tocanopy_lightandLight_modeltoatmosphere_light_scatteringfor improved clarity. - Moved canopy light distribution functions to
canopy_light_helpers.h. - Moved atmospheric light scattering calculations to
atmosphere_light_scattering.h. - Added photosynthesis utilities including the new
leaf_assimvector-space type andcanopy_integrandfunctor tophotosynthesis.h. - New tests were added to
test.cumulative_modules.Rto ensure that all carbon and water mass is conserved.
Bug Fixes
- Changed the minimum version of macOS checked by the R-CMD-check from 4.2.0 to 4.3.0.
- CRAN now only provides R versions 4.2.3 and above for Mac.
- Somehow the vignette builder cannot find the
knitrpackage when using the the online testing setup for R version 4.2.0 or 4.2.3 even whenknitris installed, causing a spurious test failure. This problem does not occur for R version 4.3.0. - A small typo was fixed in the
BioCro:solar_position_michalskymodule; this typo had no influence on the model outputs.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK12 OK2026-04-25
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 36
- Examples that run
- 100%18 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 83%
- Median days to close, 50 most recently updated closed issues
- 23
- Median days to close, 50 most recently updated closed PRs
- 2
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
7 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/biocro/biocro on 2026-10-18.
The R CMD check workflow runs on Linux
Show all practicesHide 1 practice
Dependencies
Installing BioCro adds no packages beyond those that come with R.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 3.4.0Latest
- RR 4.6.0 released · 2026-04-24
- 3.3.12026-02-06 · diff ↗
- 3.3.02025-12-14 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 3.2.02025-03-07 · diff ↗ ·
added 5 exports
compare_model_output, model_test_case, module_write, run_model_test_cases, update_stored_model_results - 3.1.32024-04-30
- RR 4.4.0 released · 2024-04-24
Package metadata
- First published
- 2024-04-30
- Total releases
- 5 / 2 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 2.1 MB / 15 files
- Download size
- 5.8 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("BioCro")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-20, which the citation names so these numbers can be found later. More on citing and the projects behind them.