Calculate the Nitrogen and Carbon Content of a Fertilizer Application
Source:R/look_up_fertilizer_components.R
look_up_fertilizer_components.RdThis function calculates the different forms of nitrogen (NO3-N, NH4-N, organic N) and organic carbon (C_org) in a fertilizer application.
It can determine fertilizer nitrogen and carbon content using either a lookup table based on
the SWAT model's fertilizer.frt
file, determine the fertilizer's nutrient content based on NN-PP-KK format, or use user-specified
fractions of organic nitrogen and carbon.
Usage
look_up_fertilizer_components(
type,
amount,
fraction_organic_n = NULL,
fraction_organic_c = NULL
)Arguments
- type
Character string specifying the type of fertilizer. Valid values include NN-PP-KK format (e.g., "45-5-10") as well as enumerated types including: "urea", "ammonium_nitrate", "compost", "manure", "dairy_fr", "beef_fr". See notes for full list of valid types.
- amount
Numeric value specifying the amount of fertilizer applied in kg/ha.
- fraction_organic_n
Optional numeric value specifying the fraction of the organic matter that is nitrogen. Used to define organic matter additions if not provided in the dataset.
- fraction_organic_c
Optional numeric value specifying the fraction of the organic matter that is carbon. Used to define organic matter additions if not provided in the dataset.
Value
A list containing:
type: The type of fertilizer used.NO3_N: The amount of nitrate nitrogen (NO3-N) in kg/ha.NH4_N: The amount of ammonium nitrogen (NH4-N) in kg/ha.N_org: The amount of organic nitrogen in kg/ha.C_org: The amount of organic carbon in kg/ha.
Details
Consistent with assumptions in DayCent, DSSAT, and other models, urea is treated as NH3 because the transformation typically occurs within a day.
Note
The following is a list of valid fertilizer names:
Mineral fertilizers: ammonium_nitrate, anhydrous_ammonia, urea
Fresh manures: manure, beef_fr, broil_fr, dairy_fr, duck_fr, goat_fr, horse_fr, layer_fr, sheep_fr, swine_fr, trkey_fr, veal_fr
Compost: org_compost
Examples
# View all available fertilizer types
unique(PEcAn.data.land::fertilizer_composition_data$name)
#> [1] "elem_n" "elem_p" "p"
#> [4] "anhydrous_ammonia" "urea" "46_00_00"
#> [7] "33_00_00" "31_13_00" "30_80_00"
#> [10] "30_15_00" "28_10_10" "28_03_00"
#> [13] "26_13_00" "25_05_00" "25_03_00"
#> [16] "24_06_00" "22_14_00" "20_20_00"
#> [19] "18_46_00" "18_04_00" "16_20_20"
#> [22] "15_15_15" "15_15_00" "13_13_13"
#> [25] "12_20_00" "11_52_00" "11_15_00"
#> [28] "10_34_00" "10_28_00" "10_20_20"
#> [31] "10_10_10" "08_15_00" "08_08_00"
#> [34] "07_07_00" "07_00_00" "06_24_24"
#> [37] "05_10_15" "05_10_10" "05_10_05"
#> [40] "04_08_00" "03_06_00" "02_09_00"
#> [43] "00_15_00" "00_06_00" "dairy_fr"
#> [46] "beef_fr" "veal_fr" "swine_fr"
#> [49] "sheep_fr" "goat_fr" "horse_fr"
#> [52] "layer_fr" "broil_fr" "trkey_fr"
#> [55] "duck_fr" "ceap_p_n" "ceap_p_p"
#> [58] "ceap_h_n" "ceap_h_p" "org_compost"
#> [61] "manure" "ammonium_nitrate"
# Calculate components for different fertilizer types
look_up_fertilizer_components("urea", 200)
#> $type
#> [1] "urea"
#>
#> $NO3_N
#> [1] 0
#>
#> $NH4_N
#> [1] 92
#>
#> $N_org
#> [1] 0
#>
#> $C_org
#> [1] 0
#>
look_up_fertilizer_components("45-00-00", 200)
#> $type
#> [1] "45-00-00"
#>
#> $NO3_N
#> [1] 90
#>
#> $NH4_N
#> [1] 0
#>
#> $N_org
#> [1] 0
#>
#> $C_org
#> [1] 0
#>
look_up_fertilizer_components("org_compost", 1000)
#> $type
#> [1] "org_compost"
#>
#> $NO3_N
#> [1] 8
#>
#> $NH4_N
#> [1] 0
#>
#> $N_org
#> [1] 12
#>
#> $C_org
#> [1] 0
#>
look_up_fertilizer_components("dairy_fr", 500)
#> $type
#> [1] "dairy_fr"
#>
#> $NO3_N
#> [1] 0
#>
#> $NH4_N
#> [1] 3
#>
#> $N_org
#> [1] 16
#>
#> $C_org
#> [1] 195
#>
look_up_fertilizer_components("manure", 1000, fraction_organic_n = 0.02, fraction_organic_c = 0.08)
#> $type
#> [1] "manure"
#>
#> $NO3_N
#> [1] 0
#>
#> $NH4_N
#> [1] 0
#>
#> $N_org
#> [1] 20
#>
#> $C_org
#> [1] 80
#>