B14 Flow of Agriculture Nitrogen Design Document

The Design Document page provides a description of the algorithms, implementation and planned testing including unit, verification, validation and performance testing. Please read  Step 1.3 Performance Expectations that explains feature documentation requirements from the performance group point of view. 

Design Document

 Click here for instructions to fill up the table below ......

The first table in Design Document gives overview of this document, from this info the Design Documents Overview page is automatically created.

In the overview table below 4.Equ means Equations and Algorithms, 5.Ver means Verification, 6.Perf - Performance, 7. Val - Validation

  • Equations: Document the equations that are being solved and describe algorithms
  • Verification Plans: Define tests that will be run to show that implementation is correct and robust. Involve unit tests to cover range of inputs as well as benchmarks.
  • Performance expectations: Explain the expected performance impact from this development
  • Validation Plans: Document what process-based, stand-alone component, and coupled model runs will be performed, and with what metrics will be used to assess validity

Use the symbols below (copy and paste) to indicate if the section is in progress or done or not started.

In the table below 4.Equ means Equations and Algorithms, 5.Ver means Verification, 6.Perf - Performance, 7. Val - Validation,   (tick) - competed, (warning) - in progress, (error) - not done

Overview table for the owner and an approver of this feature

1.Description

Flow of Agricultural Nitrogen
2.OwnerBeth Drewniak
3.Created 
4.Equ(error)
5.Ver(error)
6.Perf(error)
7.Val(error)
8.Approver
9.Approved Date
 Click here for Table of Contents ...

Table of Contents



Title: bbye/lnd/fertilizer: Flow of Agriculture Nitrogen

Requirements and Design

E3SM Land  Group

Date:   

Summary

The purpose of this code is to add NH3 emissions from fertilizer and livestock waste under different environmental conditions. Volatilization of ammonia is a major pathway of nutrient loss in ecosystems and is the largest emission source of atmospheric NH3. Atmospheric emission, transport, and deposition of NH3 is an important component of the nitrogen cycle, and is sensitive to environmental conditions which are not captured with static emission inventories. This code includes volatilization of NH3 from both livestock manure and synthetic fertilizer as documented in Riddick et al. (2016) and Vira et al. (2020). I will include some of the major requirements in the following design documentation, but full details can be found in the published manuscripts linked. There are several modes that FAN can operate with: fan_offline (emission calculation only), fan_soil (fan coupled to the soil biogeochemistry), fan_atm (fan coupled to the atmosphere only) and fan_full (coupled to both atmosphere and soil). Of these modes, only fan_offline and fan_atm will be scientifically validated as fan_soil and fan_full do not have nitrogen balance checks between ELM and FAN (the N is balanced within FAN and ELM independently). FAN includes manure applications to grasslands; NH3 emissions are calculated at the sub-grid level separately for grasslands and managed crop.

This code also includes updates to the cropland fertilizer subroutines. Modifications include a gridded synthetic fertilizer dataset of both nitrogen and phosphorous for each crop type, as opposed to the current fixed rates of nitrogen only. These changes are incorporated into the surface dataset and include modifications to the mksurfdat tool for generating surface input data. The fixed fertilizer rate that was used previously will be converted to a manure input, which will be replaced by the FAN stream data when FAN is on. FAN will always use the ELM synthetic fertilizer data inputs and timing of fertilizer application.


Requirements


Requirement: Calculate NH3 emissions from manure and synthetic fertilizer application

Date last modified:    
Contributors: Beth Drewniak


This feature will bring in the code modifications to calculate NH3 emissions from agriculture, titled the Flow of Agriculture Nitrogen (FAN), which was originally written and tested by Peter Hess and Julius Vira. The model simulates the flow of nitrogen that comes from fertilizer applied to agriculture and pastures in the form of manure and synthetic fertilizer. Additionally, volatilization of ammonia from soils, animal housings and manure storage is included. Manure emissions are broken into several components - barns and storage, grazing, and manure applied as slurry. Synthetic nitrogen fertilizer is separated into urea and other fertilizer.

Requirement: Couple new emissions with atmospheric model and biogeochemistry model

Date last modified:    
Contributors: Beth Drewniak


The default version of the FAN model just calculates emissions and is not coupled to the rest of the E3SM. Options need to be added to include coupling to EAM so atmospheric chemistry can be performed, and coupling to ELM biogeochemistry to tie in with the nitrogen cycle for plants and soil. Although the coupling options will be available to users, they are not validated and therefore considered use at your own risk.

Requirement: Add gridded synthetic fertilizer application for nitrogen and phosphorus

Date last modified:    
Contributors: Beth Drewniak


In order to improve NH3 emission calculations, the synthetic fertilizer for agriculture needed to be updated. This includes a more robust fertilizer application that varies with grid cell and crop type rather than with only crop type. Since phosphorus was not included in fertilizer applications previously, phosphorus fertilizer was also added. Since new crop types are included as placeholders in ELM, the gridded fertilizer datasets include data for all the new crop types (when available) based on Mueller et al., 2012. When the FAN model is not in use, a manure application will also be applied (nitrogen only). When FAN is turned on, the FAN input dataset for manure application is used.


Algorithmic Formulations

Design solution: Add numerical routines to handle age segregated N pools and calculate losses from volatilization and leaching from various nitrogen fertilizer

Date last modified:   
Contributors: Beth Drewniak


The algorithms included in the FAN model are detailed in Vira et al., 2020 and Riddick et al., 2016. FAN tracks total ammoniacal nitrogen (TAN) in the form of gaseous, dissolved and adsorbed NH3 and NH4, urea, and two organic forms of manure. Concentration of TAN is assumed to be in the top 2 cm of soil and all emissions originate from this depth. The transport of TAN between the surface soil, deep soil, and atmosphere is represented by a resistance model as shown in Figure 1 from Vira et al., (2020). In order to scale the heterogeneity of TAN up to a grid cell in E3SM, the nitrogen is characterized by age classes (estimated as time since previous N addition), each characterized by specific pH and water content. An example of the age classes for the two types of manure and synthetic fertilizer is shown below in Figure 2 from Vira et al., (2020).



Figure 1. 

 

Figure 2.


Design and Implementation

Implementation: Add subroutines that calculate ammonia emissions

Date last modified:  
Contributors: Beth Drewniak


Two main subroutines are added to ELM: FanMod and FanUpdate. FanUpdate is the main subroutine that interfaces FAN with ELM. It includes the driver (fan_eval), initialization (fanInit), couple to biogeochemistry (fan_to_sminn), and some parameters. fanInit reads the namelist to set up the fan mode. FAN modes include: fan_soil (coupled to soil biogeochemistry), fan_atm (coupled to atmosphere), fan_full (coupled to bgc and atm), and fan_offline (default mode that isn't coupled to the other parts of the model, i.e., only emissions are calculated). fan_eval evaluates the N fluxes and updates the FAN pool states. Fertilizer comes from the crop model and manure comes from the fan stream file. When coupled to the biogeochemistry, fan_to_sminn passes FAN fluxes to the ELM N cycle.

The FanMod implements the physical parameterizations of the FANv2 (Flow of Agricultural Nitrogen version 2) process model, and includes the numerical routines for handling age-seggregated N pools. The model evaluates nitrogen losses due to volatilization and leaching from livestock manure and mineral fertilizers.

FAN is implemented on column level. Synthetic fertilizer application is taken from the ELM crop model and remains in crop columns. Manure N is read from a stream (by fanStreamMod) which distinguishes pastoral and mixed/landless livestock systems. Manure in pastures is allocated to the native soil column. The mixed/landless systems are associated with crop columns, however, some N may be transferred to the native column due to manure spreading or seasonal grazing.

Within FAN, the nitrogen is distributed to several pools which represent different types of input (manures, fertilizers) and different "age" (time since fertilizer/manure application). The age determines properties like pH. The pools of same type but different age are called age classes in the FAN description paper. The model includes 4 slurry (manure) age classes, 3 grazing manure age classes, 2 urea age classes, 3 age classes for ammonium produced from urea, and 1 age class for non-urea NH4 fertilizer N.

Implementation: Updates to cime to couple with atmosphere and ELM to couple with biogeochemistry

Date last modified:  
Contributors: Beth Drewniak


Changes to cime are limited to sending the nh3 emissions to the atmosphere model. There is no chemistry performed, but future users will be able to use them if ammonia chemistry is enabled. 

There are no changes to cime when coupled to biogeochemistry. Turning on coupling allows FAN manure to be used with crops instead of the default manure read in from the parameter file. 

Implementation: Add gridded fertilizer data into the surface data with options to mksurfdat for users to generate any resolution required

Date last modified:  

Contributors: Beth Drewniak


New gridded fertilizer data comes from Mueller et al., (2012) data at a 5 min resolution for 17 crop types. The data was extrapolated to fill in more area to accommodate potentially expanding crop harvest area for future transient land use cases using a poisson grid fill with zonal average. Not all the crop types in the data are included in the model and some crops in ELM are not in the dataset. Missing crops are currently set to zero fertilizer. Potato in the dataset is used for Roots_Tubers in ELM. A mksrf_fert dataset was created for use in the mksurfdat file to generate surface data at user required resolutions. Updates to mksurfdat include a new subroutine to generate nitrogen and phosphorus fertilizer application which will be added to the surface data. The namelist will need to point to the mksrf_fert data, which should be added to the raw data directory.


Planned Verification and Unit Testing 

Verification and Unit Testing: short-desciption-of-testing-here

Date last modified:  
Contributors: (add your name to this list if it does not appear)


How will XXX be tested? i.e. how will be we know when we have met requirement XXX. Will these unit tests be included in the ongoing going forward?

Planned Validation Testing 

Validation Testing: short-desciption-of-testing-here

Date last modified:
Contributors: (add your name to this list if it does not appear)


How will XXX be tested? What observational or other dataset will be used?  i.e. how will be we know when we have met requirement XXX. Will these unit tests be included in the ongoing going forward?

Planned Performance Testing 

Performance Testing: short-desciption-of-testing-here

Date last modified:
Contributors: (add your name to this list if it does not appear)


How will XXX be tested? i.e. how will be we know when we have met requirement XXX. Will these unit tests be included in the ongoing going forward?