L5_Design document for generic BGC interface
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
In the table below 4.Equ means Equations and Algorithms, 5.Ver means Verification, 6.Perf - Performance, 7. Val - Validation, - completed, - in progress, - not done
Title: Add generic BioGeoChemistry interface for coupling ALM with alternative soil BGC modules
Requirements and Design
ACME Land Group
Date:
Summary
Requirements
Requirement: Provide a generic data structure
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
Provide a generic data structure that includes potential input and output variables.
Requirement: Provide generic functions/subroutines to facilitate the use of the interface
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
Provide generic functions/subroutines to implement data passing between the vegetation and soil BGC sub-models
Requirement: Modify ALM code to separate soil BGC sub-model from vegetation sub-model
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
Modify ALM subroutines to make the soil BGC sub-model standalone. Thus any alternative soil BGC sub-model (e.g., pflotran or BeTR) can be called to replace the original ALM soil BGC sub-model.
Requirement: Run ALM soil BGC sub-model through the interface
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
Enable running the standalone ALM soil BGC sub-model by using the interface data structure and functions/subroutines.
Algorithmic Formulations
Design solution: Provide a generic data structure
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
No new algorithmic formulations are required.
Design solution:Provide generic functions/subroutines to facilitate the use of the interface
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
No new algorithmic formulations are required.
Design solution:Modify ALM code to separate soil BGC sub-model from vegetation sub-model
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
No new algorithmic formulations are required.
Design solution: Run ALM soil BGC sub-model through the interface
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
No new algorithmic formulations are required.
Design and Implementation
Implementation: Provide a generic data structure
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
Implementation: Provide generic functions/subroutines to facilitate the use of the interface
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
STEP-2: (1) pass data from clm_bgc_data to soil BGC sub-model
(2) run soil BGC sub-model
(3) update clm_bgc_data from soil BGC sub-model
STEP-3: update ALM variables from clm_bgc_data
Implementation:Modify ALM code to separate soil BGC sub-model from vegetation sub-model
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
Major code revisions include:
- break down the subroutine 'CNEcosystemDynNoLeaching' into two subroutines:
(1) CNEcosystemDynNoLeaching1: called before running soil BGC sub-model
(2) CNEcosystemDynNoLeaching2: called after running soil BGC sub-model - break down the subroutine 'CNDecompAlloc' into two subroutines:
(1) CNDecompAlloc: the standalone ALM soil BGC module that keeps the majority of code in original 'CNDecompAlloc', only Phase-2 of CNAllocation (i.e., CNAllocation2_ResolveNPLimit) is called in this subroutine.
(2) CNDecompAlloc2: integration of net_nmin/pmin, gross_nmin/pmin to column level is moved from original CNDecompAlloc to this subroutine; Phase-3 of CNAllocation (i.e., CNAllocation3_PlantCNPAlloc) is implemetned in this subroutine. Additional calculations required by specific soil BGC sub-model may also be included in this subroutine, e.g, integration of plant N/P uptake to column level and calculation of fpg and fpi while pflotran is coupled to ALM. - break down the subroutine 'CNAllocation' into three subroutines
(1) CNAllocation1_PlantNPDemand: calculate plant N/P demand; called in CNEcosystemDynNoLeaching1.
(2) CNAllocation2_ResolveNPLimit: Resolve N/P Limitation; called in CNDecompAlloc
(3) CNAllocation3_PlantCNPAlloc: Plant C/N/P Allocation; called in CNDecompAlloc2
The code structure with the BGC interface is shown in the figure below:
In summary, 30 files have been changed:
- models/lnd/clm/bld/CLMBuildNamelist.pm
- models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml
- models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml
- models/lnd/clm/src/biogeochem/CNAllocationMod.F90
- models/lnd/clm/src/biogeochem/CNBalanceCheckMod.F90
- models/lnd/clm/src/biogeochem/CNCStateUpdate1Mod.F90
- models/lnd/clm/src/biogeochem/CNCStateUpdate2Mod.F90
- models/lnd/clm/src/biogeochem/CNCStateUpdate3Mod.F90
- models/lnd/clm/src/biogeochem/CNCarbonFluxType.F90
- models/lnd/clm/src/biogeochem/CNCarbonStateType.F90
- models/lnd/clm/src/biogeochem/CNDecompMod.F90
- models/lnd/clm/src/biogeochem/CNEcosystemDynMod.F90
- models/lnd/clm/src/biogeochem/CNNStateUpdate1Mod.F90
- models/lnd/clm/src/biogeochem/CNNStateUpdate2Mod.F90
- models/lnd/clm/src/biogeochem/CNNStateUpdate3Mod.F90
- models/lnd/clm/src/biogeochem/CNNitrogenFluxType.F90
- models/lnd/clm/src/biogeochem/CNNitrogenStateType.F90
- models/lnd/clm/src/biogeochem/PStateUpdate1Mod.F90
- models/lnd/clm/src/biogeochem/PStateUpdate2Mod.F90
- models/lnd/clm/src/biogeochem/PStateUpdate3Mod.F90
- models/lnd/clm/src/biogeochem/PhosphorusFluxType.F90
- models/lnd/clm/src/biogeochem/PhosphorusStateType.F90
- models/lnd/clm/src/main/clm_bgc_interfaceMod.F90
- models/lnd/clm/src/main/clm_bgc_interface_data.F90
- models/lnd/clm/src/main/clm_driver.F90
- models/lnd/clm/src/main/clm_initializeMod.F90
- models/lnd/clm/src/main/clm_pflotran_interfaceMod.F90
- models/lnd/clm/src/main/clm_varctl.F90
- models/lnd/clm/src/main/controlMod.F90
- models/lnd/clm/src/utils/clm_time_manager.F90
Implementation: Run ALM soil BGC sub-model through the interface
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
- Two options are added into the namelist 'clm_inparm':
(1) use_bgc_interface: whether to use BGC interface or not.
(2) use_clm_bgc: whether to run ALM soil BGC sub-model through interface - sequential of subroutines in 'clm_drv':
(1) call CNEcosystemDynNoLeaching1
(2) if (use_bgc_interface) call get_clm_bgc_data
(3) if (use_clm_bgc) call clm_bgc_run; call update_bgc_date_clm2clm
(4) call CNEcosystemDynNoLeaching2
Planned Verification and Unit Testing
Verification and Unit Testing: Run ALM soil BGC sub-model through the interface
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
This design requirement will be verified on the basis of BFB testing. All capability of the ACME model will be reproduced in the point and global run w/ or w/o running ALM soil BGC sub-model through the interface.
Planned Validation Testing
Validation Testing: Run ALM soil BGC sub-model through the interface
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
Since the model run of clm-bgc through interface is BFB compared to original ALM, the validation of the BGC interface will follow the validation tests of L6_Add phosphorus cycle.
Planned Performance Testing
Performance Testing: Run ALM soil BGC sub-model through the interface
Date last modified:
Contributors: Gangsheng Wang (Unlicensed)
Performance impacts of the addition of topographic units will be evaluated using the built-in timing tools while conducting verification tests described above (BFB testing).