R/nr_fix_crop.R

Defines functions nr_fix_crop

#' nr_fix_crop
#'
#' @param fulldata data to perform actions on
#'
#' @author Jan-Philipp Dietrich
# biological fixation by crops
nr_fix_crop<-function(fulldata) {
    fixrate<-readGDX(fulldata,name="f51_nr_fix_ndfa", format="first_found")
    kcr<-expand.set(fulldata,"kcr")
    out <- fixrate[,,kcr] * (
        as.magpie(nr_harvest(fulldata, nutrient="nr")[,,kcr] 
                  + nr_ag_res(fulldata, nutrient="nr")[,,kcr] 
                  + nr_bg_res(fulldata, nutrient="nr")[,,kcr])
    )
    return(out)
}
pik-piam/nitrogen documentation built on Nov. 5, 2019, 12:48 a.m.