DOI: 10.5281/zenodo.15653323
title: Data and codes for Lessons learned from a detailed exploration of APEX as a tool to represent corn residue management and cover crops

description: Code used to generate information used in Arnillas et al. (2025) "Lessons learned from a detailed exploration of APEX as a tool to represent corn residue management and cover crops", the information generated, and the codes to process and visualize it.

The codes have not been tested independently, hence, edits will be necessary.

For some codes, it may be necessary to download apex_functions_2.R from https://github.com/carlos-arnillas/apex_io/tree/main. apex_functions_2.R is a library of functions developed during this project to support I/O of the several text files used by APEX. 

 

winter_crops_test_adj4.R

Code that run the simulation as a set of modifications of the input files in run1wc.zip controlled by the scenarios stored in winter_crops_test5b.RData.

 

winter_crops_test_adj4_detailed.R

Code that reads the data stored in winter_crops_test5b.RData and generate several figures that support the analyses reported in the manuscript and several otherm figures.

 

run1wc.zip

Input file with the descriptors of soil, crops, weather, crop management, and several input parameters required by APEX.

 

winter_crops_test5b.RData

File containing all the information generated to test APEX in our study case and the variables describing the scenarios tested and the parameters of the simulation.

lres

List of results of each simulation. Each simulation is stored as an element of the list. The name of the element correspond to the name column in the scenarios table. The results of each scenario is stored in several tables. The structure and meaning of the following tables correspond to the structure and meaning of the tables as described in the APEX Theoretical Documentation (https://epicapex.tamu.edu/manuals-and-publications/): 



sao

sad

dgz

dhy

dgn

msa

swn

dws

asa

wss

awp

dcn

acn

aws

mws

mgz


The following tables have been added to report complementary information:



out_txt: text showing errors and other messages.

sad1: same information from than the one stored in SAD, but with crop information listed in long instead of wide format.

cvf: table reporting intermediate values necesary to estimate the cover factor (CVF). 

cvrs: table reporting intermediate values necesary to estimate the above ground crop residue (CVRS). 

uw: table reporting intermediate values necesary to estimate daily water uptake by soil layer (UW). 

rwt: table reporting intermediate values necesary to estimate the root weight by soil layer (RWT). 


scenarios

Table describing the conditions used to run each of the scenarios (when relevant, the column names match the correspoing variable being modified in the APEX simulation). Relevant variables used in this simulation are:



CPNM: Code of the crop used as cover crop in the simulation. Values: NA means no cover crop, CLVR: Red clover, COAT: Oats, RYE: Rye.

ORHI: Values describing the fraction of crop biomass removed from the main crop (corn) after harvesting the grains.

weather: Simulation using a repetitive pattern with always the same weather year after year (s, static) or an scenario in which after certain year the weather pattern changes (m, mixed).

 CNUM: Numeric code representing the crop being used as cover crop. Values: NA means no cover crop, 2397: Red clover, 2363: Oats, 2364: Rye.

HU: Heat units of the corresponding cover crop (used to describe the crop growth pattern).

SeedDensity: Number seeds added by the model during the planting operation of the cover crop.

name: Name of the scenario. The scenario is composed by the soil code (always  "O"), and the values from the columns ORHI, CPNM, and weather.

CPNMf: A factor (sensu R) created from CPNM to facilitate the presentation of results.

ORHIf: A factor (sensu R) created from ORHI to facilitate the presentation of results.


responses

Table describing the several response variables generated by APEX (including the ones created for this project). 



var_code: Code name of the variable.

Description: Description of the variable.

SAD: Is the variable present in the SAD file?

ACY: Is the variable present in the ACY file?

ASA: Is the variable present in the ASA file?

DGN: Is the variable present in the DGN file?

DHY: Is the variable present in the DHY file?

MSA: Is the variable present in the MSA file?

Any: Is the variable present in any of the previous files?

Group: Does the variable is important to describe any of these topics (Plant growth, Nitrogen, Phosphorus, Water dynamics, Erosion, or Soil)? 

Count (not used)

units: Unit of the variable.

var_number: Does the variable correspond to any of the variables reported in table X of the APEX user manual?

Daily: Is the variable reported on a daily time scale?

Extension: Extensions of the files in which the variable can be found.

PrintID: Codes of the files in which the variable can be found.

main_out (not used) 

Boundary (not used)


folders

Internal variable describing where to find the information needed to prepare the simulation. 

opc

Table resembling the operation file used APEX to describe the management implemented in any given field. Some values in there are replaced before running the simulation (see file winter_crops_test-adj4.R).

run_fd

Folder name of the current simulation.