Modelling And Simulating Biogeochemical Cycles: The BCS Freeware

The use of simulation is a scientic-recognized way of studying biogeochemical cycles. That assumption is even more relevant when the study scope involves one or more disturbances: in that case, simulation helps students gain insight into the response dynamics of the respective biogeochemical cycle. The development of simulation tools for high school and undergraduate courses did not progress much for the last couple of decades, despite of the advances in computer science. Trying to �ll in that gap, this paper presents the BCS (Biogeochemical Cycles Simulator) freeware, an up-to-dated choice for older simulators. The BCS is a light-weighted, user-friendly, Windows ® -based simulator, whose results are in accordance with two former simulation tools. In fact, using the sulfur biogeochemical cycle as an example, the simulation results from two sequential disturbances were compared with those of the former tools: the sum of relative errors between the three tools was never greater than 2.7%. The major improvements made include: a friendly graphical user interface, unlimited number of reservoirs, direct input of mass �uxes, multi-disturbance assessment, and fully customizable plots. The BCS has been used in case studies, in a Biogeochemical Cycles course of a B.S. in Chemistry at the University of São Paulo, Brazil. One can observe that simulation helped students to develop decision-making and group-working skills, as well as enhanced data interpretation. Moreover, the students were able to recognize how even small disturbances can cause short-and long-term negative impacts on biogeochemical cycles.


Introduction
Global biogeochemistry links biology, geology, and chemistry to investigate the surface environment of the Earth. The global biogeochemical cycles of the elements are at the very core of it, involving countless processes that transform and transport several substances throughout the Earth's ecosphere García-Herreros and Gómez (2013) point out that the use of modeling software is very useful in developing students' skills such as the understanding of mathematical models, algorithms, and physical interpretations of quantitative results. All those abilities are required for a good-quality engineering undergraduate course development. Weiman et al. (2008) concluded that the same set of skills is reached for students in general as computational simulations are used in science teaching.
Historically, during the rst NBC's "Earth Week" (Philadelphia, April 16 th to 22 nd , 1970), anthropologist Margaret Mead stated: "Now (that) we've got computers, we can look at the whole system, we can make a simulation of this whole planet and the atmosphere around it, and say what's happening. We can really look at wholes instead of looking at little parts." (MORGAN; WEINBERG, 1972). Kwoc, Langlois, and Ellison (1971) modeled and simulated the global transport of carbon monoxide. Morgan and Weinberg (1972) built a simpli ed compartmental model of three biogeochemical cycles (carbon, nitrogen, and phosphorus) and simulated the biomass ows among them.
Twenty-ve years later, Chameides and Perdue (1997) published a book that came along with a computer program based on the compartmental approach, which enabled the reader to build a numerical model of a biogeochemical cycle and its dynamics (its response to a perturbation) with minimal knowledge of differential equations and numerical techniques: the BOXES software. It was designed to run on computers with MS-DOS version 5.0 or higher.
In the next decade, at a website from The Faculty of Sciences of the University of Lisbon, one could nd a free software also called Boxes. That website is still operational (GONÇALVES, 2021). It is written in Matlab (MathWorks ® ) version 6.0 or higher. The code is based on the software developed by Chameides and Perdue (1997). It is said to be under development and that it was especially designed for undergraduate courses on Geochemical Cycles. This paper presents the BCS (Biogeochemical Cycles Simulator) freeware, available at http://ldtamb.iqsc.usp.br/softwares/bcs-simulator/. It is also based on the BOXES software; however, the purpose of developing this freeware was threefold: (1) to provide students with a light-weighted, userfriendly, Windows ® -based simulator; (2) to use a totally free environment (Java Runtime Environment), easily available to all users; and (3) to improve the simulation results presentation with customizable graphs, even for multiple disturbances.
The BCS freeware was developed as a learning tool for the students taking the undergraduate course on To work properly, the BCS freeware requires a runtime environment (JRE, Java Runtime Environment), with versions 1.8 or higher. This environment is a set of tools, including Java Virtual Machine (JMA) and supporting libraries, which allow the loading of class les and ensure the access to the system memory and other resources. An appropriate version of JRE could be easily and freely downloaded at the o cial Oracle website (ORACLE FOUNDATION, 2021).

Biogeochemistry Cycles Algorithm
The algorithm that simulates biogeochemistry cycles was based on the one described by Chameides and Perdue (1997), which assumes that the content of each reservoir is a time-dependent term of an Ordinary Differential Equation (ODE).

The BCS Freeware Accuracy and Ease of Use
As a strategy for validating the freeware accuracy and ease of use, its responses were compared with the ones obtained by using of the tools developed by Chameides and Perdue (1997) and Gonçalves (2021).
The rst tool was delivered by Chameides and Perdue's (1997), which can be found in their book Biogeochemical cycles: A computer-interactive study of earth system science and global change. This tool is made available as a Disk Operating System (DOS) supported software, which in this comparison was simulated in DOSBox 0.74-3 (VEENSTRA et al., 2019). Likewise, Gonçalves (2021) developed a script (.m extension) that could be read in a matrix calculation software, e.g., MATLAB R2015a (MATHWORKS, 2021). Those tools from now on will be labeled T-D (DOS-based tool) and T-M (matrixbased tool). This comparison was made by using the generated simulation results for the sulfur biogeochemical cycle, initially at steady-state conditions (CHAMEIDES; PERDUE, 1997). For comparison purposes, Chameides and Perdue's (1997) results were considered accurate, that is, the standard response. All of the calculation were performed with Microsoft Windows 10 Pro operational system, using an Intel Core i7-7700HQ processor (2.80 GHz) and 32 GB RAM.

The BCS Freeware as Teaching Tool
The BCS freeware was used as an evaluation tool on the Biogeochemical Cycles course from the São Carlos Institute of Chemistry, University of São Paulo (IQSC/USP). This course is mandatory to those students taking BS in Chemistry, with a minor in Environmental Chemistry. Its ultimate goal is to make the students capable of understanding the environmental impacts anthropogenic disturbances may have on selected biogeochemical cycles (water, oxygen, carbon, nitrogen, sulfur, and phosphorous).
Qualitative and quantitative aspects are taken into consideration for that assessment.
Quantitative aspects were explored with the aid of the BCS being applied to case studies, as they are suitable to be used together with computer simulations. This kind of approach is mainly useful for developing problem-solving skills, which are di cult to be obtained by traditional teaching methodologies (CROWE et al. 2011).
Four case studies (related to the carbon, nitrogen, sulfur, and phosphorous biogeochemical cycles) were presented to the students. The class was split into groups of four students. After each biogeochemical cycle was fully discussed during the lectures, students received a owchart representing the correspondent cycle at steady state. Disturbances were proposed to the students, including some of those performed by Chameides and Perdue (1997).
The groups' tasks were to devise: (a) how to implement a certain disturbance by making changes to the K matrix; (b) what kind of impacts those disturbances may pose to distinct compartments (atmosphere, hydrosphere, lithosphere, and biosphere); and (c) what kind of anthropogenic activities may cause such disturbances. The simulation results and the related discussions were presented as a scienti c report, after two or three weeks, depending on the cycle.

The BCS Freeware Operation
The key steps of the BCS freeware operation for the simulation of a biogeochemical cycle is herein described. The rst interaction between the user and the BCS freeware is a blank window ( Figure 1). The starting window is divided into two major areas: Tables Area (TA) and Information Area (IA).
The following step consists in creating a biogeochemical cycle and including the respective boxes information, which are shown in the IA. BCS freeware allows for the inclusion of an unlimited number of boxes, each one of them with its own name and reservoir. Then, a spreadsheet appears in the TA, prompting for matter transfers between boxes throughout the biogeochemical cycle (K matrix). That matrix, described in Section S1 (Supplementary Information), is calculated by the ratio between the reservoir and a certain ux. Nevertheless, the BCS freeware also allows the user to include uxes directly. Figure 2 shows an example of a window containing the K matrix (TA) and a list of the boxes (IA) that compose the biogeochemical cycle.
The nal step is setting the time span of the simulation. The BCS freeware makes it possible to use discrete time values (days, months, years) or an implemented automatic time span selection. For the second alternative, a halting criterium must be provided (reservoir difference between iterations).
Finally, a results window is shown (Figure 3). That window shows all of the input information, as well as the data matrices used by the algorithm. It also displays interactive charts which present the reservoirs temporal pro les.
Single or multiple disturbances in a biogeochemical cycle can be easily implemented in the BCS freeware. Once a simulation ends, it is possible to generate a new K matrix and boxes list, containing the respective simulated end values. That second K matrix is fully editable, making it possible to simulate disturbances by changing the content of its cells. The previous process can be repeated inde nitely, making it possible to simulate multiple in-series disturbances. Figure 4 shows a owchart of the BCS freeware operation.

BCS Freeware Accuracy
In order to check the accordance between the results obtained using the BCS freeware and the other two existing software, the sulfur biogeochemical cycle (Figure 5a) was taken as an example. The corresponding K matrix is given (CHAMEIDES; PERDUE, 1997) (Figure 5b). That cycle is at steady-state conditions, what can be in Figure 6, which shows the graphs for two compartments (Soils and Atmosphere), generated by the BCS freeware. Those two compartments are the ones that really change after perturbations, due to their respective small reservoirs (compared to the other three compartments).
One disturbance was tested and the respective results compared (the cycle behavior until another steady state is reached): 1 st ) an increase in the mass transfer rate between S sediments and Soil reservoirs, caused by mining and other land usages; and 2 nd ) an increase in the mass transfer rate between S reduced sediments and Atmosphere reservoirs, caused by the burning of fossil fuels. That perturbation was implemented by changing k 12 from 2.5 × 10 -9 to 2.0 × 10 -9 , k 23 from 5.0 × 10 -9 to 4.0 × 10 -9 and k 24 from 4.47 × 10 -9 to 1.3 × 10 -8 , respectively (CHAMEIDES; PERDUE, 1997).
This scenario lasted for 130 years. Afterwards, the mass-transfer coe cients were returned to their original values (2.5 × 10 -9 , 5.0 × 10 -9 and 4.47 × 10 -9 ) for further 1000 years. Figure 7 summarizes the results showing the nal responses for the Atmosphere reservoir, which is the more affected one by the proposed anthropogenic perturbation.
The pairwise cumulative standard errors (%) between the software outputs were calculated (Table 1). At steady-state conditions, the outputs were virtually the same. However, small differences were noted during the perturbations performed. It is noteworthy that, T-D and T-M themselves produce slightly different outputs. BCS outputs are closer to the T-D ones. All of the errors between BCS and T-D and T-M, but one (perturbation 2, compartment 3), are smaller than the ones between T-D and T-M. Nevertheless, those are all smaller than or equal to 2.7%, which are fairly acceptable. The raw outputs are shown in Section S2.

BCS Freeware Ease of Use
Although statistically identical, the three software differ mainly on their ease of use. The BCS freeware was designed to be a standalone software, with an easy graphical user interface (GUI), which is familiar to undergraduate students. It is also capable of directly simulating high numbers of reservoirs, even with multiple-stage perturbations. T-D is limited by the technology available at that time and does not have several functionalities which are presently easily performed by the BCS freeware, not mentioning an outdated and unfamiliar GUI. Although T-M is able to perform all of the functionalities present in the BCS freeware, it requires that the user has previous knowledge of matrix calculation software, which may not be the case depending on the course taken and the user's seniority. Table 2 presents the key features of the three software. The BCS freeware has a simpler con guration, even requiring the JRE. In fact, the JRE might be already present on the user's computer, as it is also necessary to a large number of other software and functionalities. If not, the JRE is easily installed.
T-D has an outdated, less interactive user interface, as it runs on a non-windows environment, impairing parallel tasks. T-M relies mainly on command lines in the selected matrix calculation software. Those command lines usually have speci c, although similar, syntaxes for each software. The BCS freeware, on the other hand, was created with Java Swing components, which include usual GUI structures, requiring less time for new users to master its use.
Two relevant advantages of the BCS freeware are: 1) the possibility of directly inputting mass uxes instead of mass-transfer coe cients; and 2) multi-stage simulation. T-D requires uxes to be transformed into mass-transfer coe cients, adding a somewhat tedious step to the simulation. T-M only accepts mass uxes, but they must be inputted one by one, each one of them in a different prompt line. If the user mistypes any of the inputs, he/she is forced to restart the whole feeding routine. When performing a multi-stage simulation (multiple perturbations), T-D and T-M work with batch calculations, which the user setting up each perturbation manually. With the BCS freeware, the user can do that by simply pushing a button. It is worth mentioning that the BCS freeware retain all of the data of multi-stage simulations, making it possible to observe all the perturbations performed in a single graph.
Finally, the BCS freeware provides fully interactive and customizable graphs as part of the simulation results. T-D produces rudimentary graphs, with a low number of points. Alternatively, T-D provides the polynomial expression for each reservoir, in order the user to plot the data somewhere else. Nevertheless, that polynomial must be manually copied to the graphing software, what is tiresome and prone to add typing mistakes, especially when a large number of reservoirs are simulated. T-M provides graphs, whose only functionality is the zoom in and zoom out tool, besides a table with the x,y coordinates of the graph.

BCS Freeware as Teaching Tool
In the end of course, the students anonymously answered an assessment questionnaire. Statements were given and ve answers were possible (totally agree, partially agree, neither agree nor disagree, partially disagree, totally disagree), besides open questions. When questioned about the use of case studies as evaluation tools instead of written exams, the students consistently preferred the former. "The simulation tasks were very useful to the learning process, as they make it possible to analyze and understand the biogeochemical cycles in a more practical way. The simulator was very well explored and the written reports were a proper form of evaluation. The deadlines were enough for running the simulations, but the assistance of the tutor was necessary." "I believe that the use of the simulation tool was important to the learning process in the course. I believe that it was well explored, and it would be even better, if the simulated problems were even closer to reallife problems. The deadlines were OK." Furthermore, during the elaboration of the reports, the students were also able to evaluate whether the computational output data had real physical meaning and related well with what they have learnt in classes, what is an important discussion as computational modeling becomes increasingly used in scientists daily lives (CHAMIZO, 2013).
It was interesting the fact that the students began to relate the simulation results with possible environmental problems, once the biogeochemical cycles were disturbed. It became clear their evolution throughout the course, as they started to realize how small disturbances would call for very high periods of time for reaching the new stationary state; moreover, they started to wonder whether that new state would be suitable for human beings to thrive. As they handed out the reports, they also attempted to identify short-, medium-, and long-term consequences of the proposed disturbances.

Conclusion
The BCS freeware properly simulated the sulfur biogeochemical cycle and the mass transfers between its reservoirs.
The BCS freeware simulation results were similar (regarding the standard error) to the ones of the standard tool, making it safe to be used as an alternative.
The BCS freeware has two unique features: (a) the direct addition of the uxes matrix (instead of the K-matrix) and (b) the performance of a new disturbance, retaining the data of previous simulations, for multi-stage problems.
Students pointed out that the use of the BCS freeware for solving case studies was a very good evaluation strategy.
The simulation approach helped the students to grasp the physical meaning of computer-derived data, increasing their common sense, as well as group-working and decision-making skills.
Declarations FUNDING National Council for Scienti c and Technological Development (CNPq) and The Coordination for the Improvement of Higher Education Personnel (CAPES -Finance Code 001).

CONFLICTS OF INTEREST
The authors declare that they have no known competing nancial interests or personal relationships that could have appeared to in uence the work reported in this paper.

AVAILABILITY OF DATA AND MATERIAL
The raw data can be found in Supplementary Information and a Google Drive repository. Supplementary Information contains the raw output of the herein discussed software. Google Drive repository contains two spreadsheets, regarding the error assessment and the students' evaluations for BCS software. https://drive.google.com/drive/folders/1jwWVtSIAfQ8K9T6qQxH0-ow4H9vGjzqO?usp=sharing

SOFTWARE AVAILABILITY
The BCS software is a freely available software. In order to obtain a copy of it, one may access the group webpage, http://ldtamb.iqsc.usp.br/softwares/bcs-simulator/. The available package includes BCS and JRE 8u281 installers. A user guide is also available. BCS freeware starting window: Table Area (TA, red) and Information Area (IA, green).

Figure 3
Example of a simulation output.
Page 16/18      BCS responses for Soils and Atmosphere reservoirs after disturbances.

Supplementary Files
This is a list of supplementary les associated with this preprint. Click to download. SupplementaryInformation.docx