Articles | Volume 15, issue 1
Geosci. Model Dev., 15, 75–104, 2022
https://doi.org/10.5194/gmd-15-75-2022
Geosci. Model Dev., 15, 75–104, 2022
https://doi.org/10.5194/gmd-15-75-2022

Model description paper 07 Jan 2022

Model description paper | 07 Jan 2022

Implementing the Water, HEat and Transport model in GEOframe (WHETGEO-1D v.1.0): algorithms, informatics, design patterns, open science features, and 1D deployment

Implementing the Water, HEat and Transport model in GEOframe (WHETGEO-1D v.1.0): algorithms, informatics, design patterns, open science features, and 1D deployment
Niccolò Tubini1 and Riccardo Rigon2 Niccolò Tubini and Riccardo Rigon
  • 1Department of Civil, Environmental and Mechanical Engineering, University of Trento, Via Mesiano 77, 38123 Trento, Italy
  • 2Center Agriculture Food Environment, University of Trento, Via Mesiano 77, 38123 Trento, Italy

Correspondence: Niccolò Tubini (niccolo.tubini@unitn.it)

Abstract

This paper presents WHETGEO and its 1D deployment: a new physically based model simulating the water and energy budgets in a soil column. The purpose of this contribution is twofold. First, we discuss the mathematical and numerical issues involved in solving the Richardson–Richards equation, conventionally known as the Richards equation, and the heat equation in heterogeneous soils. In particular, for the Richardson–Richards equation (R2) we take advantage of the nested Newton–Casulli–Zanolli (NCZ) algorithm that ensures the convergence of the numerical solution in any condition. Second, starting from numerical and modelling needs, we present the design of software that is intended to be the first building block of a new customizable land-surface model that is integrated with process-based hydrology. WHETGEO is developed as an open-source code, adopting the object-oriented paradigm and a generic programming approach in order to improve its usability and expandability. WHETGEO is fully integrated into the GEOframe/OMS3 system, allowing the use of the many ancillary tools it provides. Finally, the paper presents the 1D deployment of WHETGEO, WHETGEO-1D, which has been tested against the available analytical solutions presented in the Appendix.

1 Introduction

The Earth's critical zone (CZ) is defined as the heterogeneous near-surface environment in which complex interactions involving rock, soil, water, air, and living organisms regulate the natural habitat and determine the availability of life-sustaining resources (National Research Council2001). Clear interest in studying the CZ is spurred on by ever-increasing pressure due to growth in the human population and climatic changes. Central to simulating the processes in the CZ is the study of soil moisture dynamics (Clark et al.2015a; Tubini et al.2021b). In the following we suggest that studying the CZ requires tools that are not yet readily available to researchers; then we propose one of our own. These tools should be flexible enough to allow the quick embedding of advancements in science.

1.1 Setting up the water budget

It is generally accepted in the field that the motion of water in soil is regulated by a Darcian–Stokesian flow, meaning that any force is immediately dissipated and water under a gradient of generalized forces acquires a velocity (the Darcy velocity) which is linearly proportional to the gradient of the generalized force. This law is known as the Darcy–Buckingham law and reads

(1) J = K ( θ ) ψ + z ,

where the forces acting are gravity (z; L) and the matric potential ψ [L] and where J [L T−1] is the Darcian flux, K [L T−1] is the hydraulic conductivity, θ [L3 L−3] is the dimensionless volumetric water content, [L−1] is the gradient operator, and z [L] is the vertical coordinate positive-upward. The assumptions under which such a law is derived from Newton's law are presented in Whitaker (1986) and Di Nucci (2014). The hydraulic conductivity depends on soil type (texture and structure) and water content, while the thermodynamic forces must be understood as gradients of the chemical potential of water, which, in turn, can be split in matric potential, osmotic potential, and other potentials (Nobel1999, chap. 2). However, in Eq. (1) we consider only the action of the matric potential. On the basis of the law of motion in Eq. (1), the mass conservation reads

(2) θ t = K ( θ ) ψ + z ,

where ∇⋅ [L−1] is the divergence operator. Equation (2) is usually known as the Richards equation (Richards1931) but was previously formulated by Richardson (1922). Therefore, in the following we call it the R2 equation to remind the reader of this double origin. There are very informative reviews that cover its general, historical, and numerical aspects, such as Paniconi and Putti (2015), Farthing and Ogden (2017), and Zha et al. (2019). Therefore, it is not deemed necessary to further summarize the matter here. The R2 equation is a function of two variables, θ and ψ, and its resolution requires another relation between these two quantities. This relation is known as soil water retention curves (SWRCs), written in the plural because we have many SWRCs depending on soil characteristics. The reader may be aware that the R2 is an exact description of unsaturated flow only if we assume that soil is a bundle of capillaries and that the largest capillaries drain first and are filled last (Mualem1976). In fact, in this case a relation can be obtained between the radius of the capillaries and the suction, which was fully derived (Kosugi1999). However, there are various reasons to take the capillary bundle concept as a rough approximation of natural soil. Some of the issues are enumerated below.

  1. Firstly, pores in soils are not bundles of well-defined capillaries of a single diameter; in fact, they can have quite random structures, as revealed, for instance, by tomography (Yang et al.2018).

  2. Secondly, logic and pore scale simulations, as in Tomin and Lunati (2016), for example, indicate that fluids fill the cavities where they fall, and only eventually are they redistributed according to the microstructure of the soil; that is to say that fluids do not move instantaneously from the largest pores to the smallest ones.

  3. A set of relatively large pores can, in certain conditions, preferentially drive the flow of water in a short timescale according to laminar viscous flow driven by gravity before any redistribution happens (Germann and Beven1981).

  4. The role of living matter, such as bacteria, animals, fungi, vegetation, and roots, is usually eliminated from the hydrological picture, but it should have a relevant place (Benard et al.2019).

In addition are the following points.

  • 5.

    Capillary forces are not the only ones acting at the microscale (Lu2016). In fact, measured suction values are far below pressures that can be sustained by capillarity alone.

  • 6.

    Temperature affects water viscosity; infiltration is faster at warm temperatures and slower at cold ones (Constantz and Murphy1991).

  • 7.

    In high-latitude and high-elevation environments, soils may be subject to freezing and thawing processes which affect pore volume and water dynamics (Dall'Amico et al.2011).

These facts certainly do not threaten the nature of mass conservation in Eq. (2). However, they can certainly alter the statistics which generate the closure equations, i.e. the SWRCs we currently use.

  • Requirement I – without entering into further details, we can observe that the aforementioned issues have consequences that would require new software to include the possibility of adopting new parameterizations of SWRCs and hydraulic conductivity quickly, easily, and neatly.

1.2 The three or four worlds

The flow of water obeys the general laws of physics for conservation of mass and momentum, but, since the seminal works of Freeze and Harlan (1969), the scientific community has split up (Furman2008) into three groups: groundwater people, vadose zone scientists, and surface water hydrologists. This compartmentalization of the scientific community was fostered to deepen the knowledge within single branches, with the interactions between the different parts having been governed in models by assigning boundary conditions (Furman2008). However, these boundary conditions are intrinsically inadequate and inappropriate in representing the physics of interactions between different domains whose interactions depend strictly on the state of the system. When these conditions are prescribed a priori (Furman2008), the proper dynamics of the CZ fluxes cannot be obtained. There is a need to overcome this situation.

  • Requirement II – the boundary conditions hard-wired into algorithm implementation should be removed in favour of a simultaneous treatment of the three compartments (surface waters, vadose zone, and groundwater).

Fortunately, Šimůnek et al. (2012) found the way to smoothly extend the Richards equation into the groundwater equation. This and other similar approaches are now used in various codes, such as Hydrus, ParFlow (Ashby and Falgout1996; Jones and Woodward2001; Kollet and Maxwell2006), CATHY (Paniconi and Wood1993; Paniconi and Putti1994), and GEOtop 2.0 (Rigon et al.2006a; Endrizzi et al.2014). To extend the R2 equation into the saturated domain it is necessary to include the contribution of groundwater storativity due to matrix and fluid compressibility. The common approach is to write the R2 equation as

(3) θ t + S s θ θ s θ t = K ( ψ ) ( ψ + z ) ,

where Ss [L−1] is the specific storage coefficient, defined as

(4) S s = ρ g ( n β + α ) ,

with ρ [M L−3] being the water density, g [L T−2] gravitational acceleration, n [L3 L−3] the soil porosity, β [L T2 M−1] the liquid compressibility, and α [L T2 M−1] the matrix compressibility. On the left-hand side of Eq. (3), the first term accounts for changes in liquid saturation, while the second term accounts for the compression or expansion of the porous medium and the water. The left-hand-side term in Eq. (3) can be rewritten as

(5) c + S s θ θ s ψ t ,

where c [L−1] is the water retention capacity. Comparing the two terms in brackets, we can see that for ψ<0, then cSsθθs; this means that under unsaturated conditions, the contribution of the specific storage is negligible. Whereas when the soil is saturated and ψ>0, then c=0 and therefore what counts is the specific storage. Because of this, it is possible to account for groundwater specific storage simply by modifying the SWRC as

(6) θ ( ψ ) = θ ( ψ ) if   ψ < 0 θ s + S s ψ if   ψ > 0 .

Furthermore, switching from Richards to shallow water was made possible in the equation writing thanks to, for example, Casulli (2017) and Gugole et al. (2018). Therefore, switching to a fully integrated, simultaneous treatment of the three domains is now possible.

1.3 The necessary coupling with the energy budget

As remarked in point 6 above, temperature affects water viscosity, which effectively doubles in passing from 5 to 20 C (Eisenberg et al.2005), with a positive feedback on the infiltration process. This has been clearly observed in natural systems (Ronan et al.1998; Eisenberg et al.2005; Engeler et al.2011) wherein infiltration rates follow diurnal and seasonal temperature cycles. In fact, according to Muskat and Meres (1936), the unsaturated hydraulic conductivity can be expressed as

(7) K ( θ ) = κ r ( θ ) κ ρ g ν ,

where κr(θ) [] is the relative permeability, κ [L2] is the intrinsic permeability, ρ [L3 M−1] is the liquid density, g is the acceleration of gravity, and ν [L2 T−1] is the kinematic viscosity of the liquid. Thus, for constant θ, variations in K(θ) due to temperature can be accounted for as (Constantz and Murphy1991)

(8) K ( θ , T 2 ) = K ( θ , T 1 ) ν ( T 1 ) ν ( T 2 ) ,

In Eq. (8), T1 is a reference temperature, while T2 is the soil water temperature. Temperature is also responsible for the phase change of water (point 7), and because of pore ice, as well as excess ice, infiltration rates and subsurface flows are significantly modified (Walvoord et al.2012).

  • Requirement III – to account for thermodynamic effects, temperature should at least be present in the R2 equation as a parameter, as in Eq. (8). However, for a more accurate approximation of the water dynamics, the option to solve the water and energy budgets simultaneously must be present.

Soil thermal properties are important physical parameters in modelling land-surface processes (Dai et al.2019) since they control the partitioning of energy at the soil surface and its redistribution within the soil (Ochsner et al.2001). For a multi-phase material like soil, their definition is always problematic since they depend on the physical properties of each phase and their variations (Dong et al.2015; Dai et al.2019; Nicolsky and Romanovsky2018). In the literature different models have been proposed with such a scope, and further studies on it are recommended (Dai et al.2019): nonetheless, when considering the phase change of water, the estimation of the unfrozen and frozen water fraction is still an unresolved issue for which different models, usually referred to as SFCCs or soil freezing characteristics curves, have been proposed (Kurylyk and Watanabe2013). Thus, it is clear that the aspects related to the estimation of soil thermal properties fall fully within Requirement I too. Moreover, there are other reasons for which the equations of the water and energy budgets should be solved in a coupled manner (Rigon et al.2006a): for instance, this makes it possible to include an appropriate treatment of evaporation and transpiration processes (Bonan2019; Bisht and Riley2019), as well as of the heat advection (Frampton et al.2013; Walvoord and Kurylyk2016; Wierenga et al.1970; Ronan et al.1998; Engeler et al.2011; Zhang et al.2019).

Finally, there is a great urge to model solute transport according to the water movements. The range of applications for solute, tracers, and pollutants spans from agriculture to industry to research itself. In fact, in recent years there has been a tumultuous increase in the number of studies using tracers to assess the various pathways of water (Hrachowitz et al.2016). However, so far these studies have mostly used lumped models with limited capability to investigate water age selection processes, with are processes that have become very important in the most recent literature, e.g. Penna et al. (2018). Using more complex modelling can benefit both the investigation of the processes and the construction of more refined water budget closures. Even though in this paper we do not detail the work on tracers, they must be kept in mind in software design so that the modules can be implemented eventually.

1.4 Heat transport

Under the conditions defined above, the governing equation for the transport of energy in variably saturated porous media is given by the following energy conservation equation:

(9) h ( ψ , T ) t = λ ( ψ ) T - ρ w c w ( T - T ref ) J w ,

where h is the specific enthalpy of the medium [L2 T−2], λ [MLΘ-1T-3] is the thermal conductivity of the soil, T [Θ] is the temperature, ρw [M L−3] is the water density, cw [L2Θ-1T-2] is the specific heat capacity of water, Tref [Θ] is a reference temperature used to define the enthalpy, and Jw is the water flux [L T−1]. The first term on the right-hand side is the heat conduction flux, described by the Fourier's law, and the second term is the sensible heat advection of liquid water. The specific enthalpy of a control volume of soil Vc [L3] can be calculated as the sum of the enthalpy of the soil particles and liquid water:

(10) h = ρ sp c sp ( 1 - θ s ) ( T - T ref ) + ρ w c w θ ( ψ ) ( T - T ref ) ,

where ρsp and ρw are the densities of the soil particles and the water, and csp and cw are the specific heat capacities of the soil particles and the water. Equation (9) is the so-called conservative form.

1.5 Informatics

Amateurism in software (model) building may be reflected in an incorrect analysis of the hydrological processes, threatening the development of science from the offset. Also, in recent years a new paradigm in evaluating scientific productivity, and therefore software productivity, has gained importance (see e.g. project IDEAS2021), with the aim of reducing the effort, time, and cost of software development, maintenance, and support. More in general, the scientific community has recognized the need to transition to open, accessible, re-usable, and reproducible research, which requires the adoption of new software engineering practices. Our intention, therefore, is to build robust and reliable tools that are without unknown side effects and designed to be easily inspected by third parties.

As discussed in Serafin (2019), computing programmes have usually been developed as monolithic code; this has serious drawbacks for maintainability and development, as has been shown by our own experience with the GEOtop model (Rigon et al.2006a; Endrizzi et al.2014) and by experiences with other modelling frameworks (Clark et al.2015b, 2021; Bisht and Riley2019). The main limit of the monolithic approach can be identified in its absence of separation of concerns (Martin2009; Newman2015). This results in huge, unreadable code bases that mix several different scientific and/or mathematical concepts (David et al.2013), which are characteristics that impede easy reviews of models. Being aware of these past experiences, the WHETGEO-1D code has therefore been developed by adopting object-oriented programming (OOP) and a generic programming strategy whose contents are explained below. In this manner it is possible to split up the code into smaller structures, with each one implementing a specific scientific and/or mathematical concept and also to decouple the algorithms from concrete data representation with gains in code maintainability and algorithm inspection.

Moreover, WHETGEO-1D has been integrated into the Object Modelling System v3 (OMS3) framework (David et al.2013); see Appendix B. OMS3 is a component-based environmental modelling framework that allows the developers to create a component for each single modelling concept, thus having a second level of separation of concerns. Because of the modularity of OMS3, the WHETGEO-1D components can be used seamlessly at runtime by connecting them with the OMS3 DSL language based on Groovy (https://groovy-lang.org, last access: 21 December 2021). OMS3 provides the basic services and, among these, tools for calibration and implicit parallelization of component runs.

WHETGEO is also part of GEOframe (Formetta et al.2014a; Bancheri2017; Bancheri et al.2020), a system of OMS3 components; see Appendix A. GEOframe provides various components for precipitation treatment, radiation estimation in complex terrain, and evaporation and transpiration. Conversely, with WHETGEO-1D the GEOframe system is enriched with new components now able to cope with different spatial resolutions and configurations compared to what was offered by the existing tools (Bancheri et al.2020).

1.6 Organization and scope

This paper describes the implementation and content of the WHETGEO-1D (Water, HEat and Transport in GEOframe) software, in observance of Requirements I to III and aware of the hydrologic facts described in points 1 to 7 of Sect. 1.1. Actually, we do not seek to address all the issues listed but focus instead on getting the proper software design that their implementation requires. The first objective is to not have to break and rewrite existing codes and then be able to code incrementally, in step with the progressing research in hydrological processes.

Further requirements derive from numerics and mathematics. In fact, translating the R2 and the heat equations into discretized numerical codes implies overcoming some challenges that are well known in the hydrology community, as illustrated in the next sections. Our contribution aims to make available to the public for the first time integration algorithms that ensure the conservation of mass and energy for any time step size and for a great variety of conditions. It is interesting to note that some of these algorithms were presented almost a decade ago in the math community, remaining a little concealed, however. Although WHETGEO is meant to deal with the transport of solutes and tracers, this topic will be covered in a dedicated paper since its physics and numerics are slightly different from those of the water and energy budgets.

Moreover, WHETGEO-1D represents the first brick of a new expandable land-surface model (Bisht and Riley2019): the forthcoming development of WHETGEO-1D and its inclusion in the GEO-SPACE (Soil Plant Atmosphere Continuum Estimator) model that aims to simulate the soil–plant continuum (D'Amato et al.2022).

In the following section we discuss the mathematical issues and the numerics of our implementation. In the subsequent one, we describe the informatics and software engineering issues, as well as how we solved them. Finally, we discuss WHETGEO-1D implementation by testing it against some analytical solutions available for simplified parameterizations and boundary conditions; for details of these see Appendix C.

2 Mathematical issues and numerics

Translating these equations into numerical discretized codes implies overcoming some challenges, as we illustrate in the next sections by exploring, at first, the issues posed by each of the equations.

2.1 General issues of the R2 equation

Equation (2) is said to be written in “mixed form” because it is expressed in terms of θ and ψ (and uses the SWRC to connect the two variables).

The “ψ-based form” is derived from Eq. (2) by applying the chain rule for derivatives:

(11) c ( ψ ) ψ t = K ( ψ ) ( ψ + z ) ,

where

(12) c ( ψ ) = θ ( ψ ) ψ ,

with dimension [L−1] as the specific moisture capacity, also called hydraulic capacity. Even though Eqs. (2) and (11) are analytically equivalent under the assumption that the water content is a differentiable variable, this is not generally true in the discrete domain where the derivative chain rule is not always valid (Farthing and Ogden2017). Because of this the ψ-based form may suffer from large balance errors in the presence of big nonlinearities and strong gradients, as discussed in Casulli and Zanolli (2010), Farthing and Ogden (2017), Zha et al. (2019), and literature therein. The specific moisture capacity c, which appears in the storage term, itself depends on ψ and so is not constant over a discrete time interval during which ψ changes value. Let us discretize the time derivative in Eq. (11) by using the backward Euler scheme and obtain

(13) c ̃ i ψ i n + 1 - ψ i n Δ t ,

where c̃i is the discrete operator of the soil moisture capacity, c(ψ). In order to preserve the chain rule of derivatives at the discrete level, i.e. the equality cψ/t=θ(ψ)/t, c̃i has to satisfy the requirement (Roe1981)

(14) c ̃ i ψ i n + 1 - ψ i n = θ ψ i n + 1 - θ ψ i n .

As can be seen from the above equation, the right definition of c̃i depends on the solution itself. To overcome this problem, in the literature different techniques have been presented to improve the evaluation of c̃i, but none ensures mass conservation (Farthing and Ogden2017).

There is a third form of Eq. (2), the so-called “θ-based form”, that reads as

(15) θ t = D ( θ ) θ + K ( θ ) ,

where all is made explicit by inverting the SWRC, and D(θ)=K(θ)ψ/θ is the soil water diffusivity [L2 T−1]. The first term on the right-hand side represents the water flow due to capillary forces, while the second term is the contribution due to gravity (Farthing and Ogden2017). The θ-based form is mass-conserving, and it can be solved perfectly by mass conservative methods (Casulli and Zanolli2010). However, its applicability is limited to the unsaturated zone since water content varies between θr and θs, whereas water suction is not bounded. This formulation is intrinsically not suited to fulfilling our Requirement III. Moreover, water content is discontinuous across layered soil since the SWRCs are soil-specific, whereas water suction is continuous even in inhomogeneous soils (Farthing and Ogden2017; Bonan2019).

In WHETGEO, we directly use the conservative form of the R2 equation, Eq. (2), which seems the easiest way to deal with both the mass conservation issues and the extension of the equation to the saturated case.

2.1.1 The discretization of the R2 equation

The implicit finite-volume discretization of Eq. (2) reads as

(16) θ i ( ψ i n + 1 ) = θ i ( ψ i n ) + Δ t [ K i + 1 2 n + 1 ψ i + 1 n + 1 - ψ i n + 1 Δ z i + 1 2 + K i + 1 2 n + 1 - K i - 1 2 n + 1 ψ i n + 1 - ψ i - 1 n + 1 Δ z i - 1 2 - K i - 1 2 n + 1 + S i n ] ,

where Δt is the time step size,

(17) S i = Ω i S d Ω

is an optional source–sink term in volume, and θi(ψ) is the ith water volume given by

(18) θ i ( ψ ) = Ω i θ ( ψ ) d Ω .

Equation (16) can be written in matrix form as

(19) θ ( ψ ) + T ψ = b ,

where ψ={ψi} is the tuple of unknowns, θ(ψ)=θi(ψi) is a tuple function representing the discrete water volume, T is the flux matrix, and b is the right-hand-side vector of Eq. (16), which is properly augmented by the known Dirichlet boundary condition when necessary. For a given initial condition ψi0, at any time step n=1,2,, Eq. (16) constitutes a nonlinear system for ψin+1, with the nonlinearity affecting only the diagonal of the system and being represented by the water volume θi(ψin+1). This set of equations is a consistent and conservative discretization of Eq. (2). Therefore, regardless of the chosen spatial and temporal resolution, ψin+1 is a conservative approximation of the new water suction.

2.1.2 Surface boundary condition

The definition of the type of surface boundary condition (Neumann vs. Dirichlet) for the R2 equation is a nontrivial task since it can depend on the state of the system. In the literature several approaches are used (Furman2008). These approaches are mainly based on a switch of the type of the boundary condition from a prescribed head to prescribed flux and vice versa. This switching often causes numerical difficulties that need to be addressed (Furman2008).

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f01

Figure 1Scheme of the computational domain to solve the R2 equation in 1D. The uppermost node represents the water depth at the soil surface. By considering this additional computational node the boundary condition does not change its nature depending on the solution.

Download

To overcome this problem we have included an additional computational node at the soil surface. As will be made clear in the following, for it we prescribe an “equation state” like that presented in Casulli (2009):

(20) H ( ψ ) = ψ if   ψ > 0 0 otherwise ,

where H [L] is the water depth, which also represents the pressure if the ponding is assumed to happen in hydrostatic conditions. By doing so, it is possible to prescribe as the surface boundary condition the rainfall intensity (Neumann type) without resorting to any switching techniques to reproduce infiltration excess or saturation excess processes. In this case the system in Eq. (19) must be modified to account for the additional computational node describing the state of the soil surface.

(21) H N ( ψ N n + 1 ) - Δ t 0 - K N - 1 2 n ψ N n + 1 - ψ N - 1 n + 1 Δ z N - 1 2 = H N ( ψ N n ) + Δ t J n - K N - 1 2 n  if  i = N θ i ( ψ i n + 1 ) - Δ t K i + 1 2 n ψ i + 1 n + 1 - ψ i n + 1 Δ z i + 1 2 - K i - 1 2 n ψ i n + 1 - ψ i - 1 n + 1 Δ z i - 1 2 = θ i ( ψ i n ) + Δ t K i + 1 2 n - K i - 1 2 n  if  i = 1 , 2 , , N - 1

Here, Jn is the rainfall intensity and represents the Neumann boundary condition used to drive the system at the soil surface. For any time step, Eq. (21) can be written in matrix form, similar to (Eq. 19), as

(22) V ( ψ ) + T ψ = b ,

where ψ={ψi} is the tuple of unknowns, V(ψ)=(θi(ψi)) for i=1,2,,N-1, VN(ψ)=H(ψ) is a tuple function representing the discrete water volume, T is the flux matrix, and b is the right-hand-side vector of Eq. (16), which is properly augmented by the known Dirichlet boundary condition when necessary. For a given initial condition ψi0, at any time step n=1,2, Eq. (22) constitutes a nonlinear system for ψin+1, with the nonlinearity affecting only the diagonal of the system and being represented by the water volume Vi(ψin+1). Therefore, regardless of the chosen spatial and temporal resolution, ψin+1 is a conservative approximation of the new water suction.

2.2 Heat transport numerics issues

Equation (9) is said to be written in conservative form and expresses an important property, which is the conservation of the scalar quantity, in this case the specific enthalpy. It is interesting to note that by making use of the mass conservation equation (Eq. 2), Eq. (9) can be written in an analytically equivalent form, the so-called nonconservative form (Sophocleous1979; Šimůnek et al.2005):

(23) c T T t = λ 2 T - ρ w c w J w T .

Equation (23) expresses another important property, which is the maximum principle (Casulli and Zanolli2005); i.e. the analytical solution is always bounded, above and below, by the maximum and minimum of its initial and boundary values, as shown in Greenspan and Casulli (1988, chap. 7.3).

Although Eqs. (9) and (23) are analytically equivalent, once they are discretized the corresponding numerical solution will, in general, either be conservative or satisfy a discrete max–min property (Casulli and Zanolli2005), but not both as would be required.

As in the case of the water flow, thermal budget issues can be subdivided into three aspects: the discretization of the equation, the inclusion of the appropriate boundary conditions, and the implementation of some closure equation for the thermal capacity and conductivity.

2.2.1 The discretization of the heat equation

The key feature (Casulli and Zanolli2005) to obtaining a numerical solution for the heat transport equation that is both conservative and possesses the max–min property is to solve the conservative form of the heat equation by using the velocity field obtained in solving the continuity equation (Eq. 2). By making use of the upwind scheme for the advection part and the centred difference scheme for the diffusion part we have

CTin+1Tin+1=CTinTin-ρwcwΔt[12J1+12n+1Ti+1n+1+Tin+1-12|J1+12n+1|Ti+1n+1+Tin+1-12J1-12n+1Tin+1+Ti-1n+1+12|J1-12n+1|Ti+1n+1+Tin+1](24)+Δtλi+12nTi+1n+1-Tin+1Δz-λi-12nTin+1-Ti-1n+1Δz,

where

(25) C T i = Ω i ρ sp c sp ( 1 - θ s ) + ρ w c w θ ( ψ ) d Ω .

When the heat equation does not consider water phase changes, it is decoupled from the R2 equation and the finite-volume discretization leads to a linear algebraic system of equations. However, once freezing and thawing processes are considered, the heat equation is fully coupled with the R2 equation, as in Dall'Amico et al. (2011) for instance, and the enthalpy function becomes nonlinear. At this point, since the enthalpy function is nonlinear the NCZ algorithm is required to linearize it, as shown in Tubini et al. (2021b). So far, we have not considered the problem of water flow in freezing soils; however, being aware of this issue is important for the future developments and code design.

2.2.2 Driving the heat equation with the surface energy budget

At the soil surface the heat equation is driven by the surface energy balance. The heat flux exchanged between the soil and the atmosphere, the surface heat flux, [M T−3], is given as

(26) F = S in - S out + L in - L out + H - L E ,

where Sin is the incoming shortwave radiation, Sout is the outgoing shortwave radiation, Lin is the incoming longwave radiation, Lout is the outgoing longwave radiation, and H and LE are respectively the turbulent fluxes of sensible heat and latent heat. Fluxes are positive when directed toward the soil surface and all have the dimension of an energy per unit area per unit time [M T−3].

Similarly to the definition of the surface boundary condition for the water flow, the surface boundary condition for the energy equation is also system-dependent. In fact, in Eq. (26) the only fluxes that do not depend on the soil temperature and/or moisture are the incoming shortwave and longwave radiation fluxes, Sin and Lin. The outgoing shortwave radiation flux is usually parameterized as

(27) S out = α S in ,

where the surface albedo α [] can be assumed to vary with the soil moisture content (Saito et al.2006) and radiation wavelength. The outgoing longwave surface radiation is

(28) L out = ( 1 - ϵ ) L in + ϵ σ T s 4 ,

where Ts [Θ] the temperature of the topmost layer of soil, ϵ is the soil emissivity, and σ is the Stefan–Boltzmann constant. The sensible heat flux H is taken as

(29) H = ρ a c a r H ( T a - T s ) ,

where ρa is the air density [M L−3], and ca is the thermal capacity of air per unit mass [L2T-2Θ-1]. Regarding the aerodynamic resistances rH [T L−1], it should be noted that it can be evaluated with different degrees of approximation and may require a specific modelling solution. For instance, the aerodynamic resistance rH can be evaluated with models ranging from semi-empirical models to the Monin–Obukhov similarity (Liu et al.2007) or even by solving the turbulent dynamics with direct methods (Raupach and Thom1981; Mcdonough2004).

The latent heat flux is taken here as given by a formula of the type

(30) L E = l ρ a E P r H r v r H + r v ,

where l [M L2 T−2] is the specific latent heat of vaporization of water, EP is the potential evapotranspiration, and rH and rv [T L−1] are respectively the aerodynamic resistance and the soil surface resistance to water vapour flow. The latent heat flux it is the sum of two distinct processes: evaporation and transpiration. Compared to the other fluxes, latent heat flux presents further complications because evaporation is both an energy- and a water-limited process, and transpiration also depends on the physiology of trees (as well as root distribution and growth and leaf cover). The latent heat flux is associated with the water flux that must be accounted for in the R2 equation. Here we present a simplified treatment of the latent heat flux as an external driving force and/or prescribed boundary condition. A more exhaustive and physically based treatment of the latent heat flux, and the related water flux, is addressed in the ongoing development of the GEO-SPACE model (D'Amato2021).

Including the surface energy budget boundary condition requires the computation of additional quantities such as the incoming radiation fluxes, the shortwave radiation and the longwave radiation, and the potential evapotranspiration flux. These quantities can be easily computed within the GEOframe system in which WHETGEO-1D is embedded. The proper estimation of the incoming radiation fluxes is far from being a simple task, and it is often oversimplified in hydrological problems. Our approach is to use the tools already developed inside the system GEOframe, which were tested independently and accurately (Formetta et al.2013, 2014a). Similarly, the evapotranspiration can be computed with other GEOframe components (Bottazzi2020; Bottazzi et al.2021).

2.3 Algorithms

By using a numerical method, here the finite-volume method, a partial differential equation is transformed into a system of nonlinear algebraic equations, as has already been shown. The system has to be solved with iterative methods, and, at their core, these reduce the problem to using a linear system solver. The solver can be of various types, according to the dimension of the problem. For instance, in 1D, the final system of finite-volume problems we present is tridiagonal and can be conveniently solved with the Thomas algorithm (Quarteroni et al.2010), which is a fast direct method. In 2D or 3D, the final matrix is not tridiagonal, and a different solution method must be used: for instance, the conjugate gradient (Shewchuk1994). These algorithms are well known and do not need to be explained here.

However, the reduction of a nonlinear system to a linear one is not trivial. We illustrate the issues by taking the R2 equation as an example. As discussed in depth in Zha et al. (2019), Farthing and Ogden (2017), and references therein, the linearization of the R2 equation is challenging. Following the work of Celia et al. (1990), a lot of advancements have been made in this direction: Hydrus, CATHY, and ParFlow use variants of the Newton and Picard iteration methods (Zha et al.2019; Paniconi and Putti1994), while GEOtop 2.0 implements a suitable globally convergent Newton method (Kelley2003). Although current algorithms are relatively stable, they may fail to converge or require a considerable computational cost (Zha et al.2019). This has significant impacts on both the reliability of the solution, which can have mass balance errors, and the computational cost to produce it (Farthing and Ogden2017; Zha et al.2019). Since Casulli and Zanolli (2010) and Brugnano and Casulli (2008), a new method was found, called nested Newton by the authors and NCZ in the following, that guarantees convergence in any situation, even with the use of large time steps and grid sizes.

As clearly pointed out by Casulli and Zanolli (2010), what makes the linearization of the R2 equation difficult is the nonmonotonic behaviour of the soil moisture capacity. A mathematical proof of convergence for NCZ exists (Brugnano and Casulli2008, 2009; Casulli and Zanolli2010, 2012), which is not repeated here. However, we take the time to illustrate this new algorithm with care.

Let us start again from the nonlinear system (Casulli and Zanolli2012):

(31) V ( ψ ) + T ψ = b ,

where ψ=(ψi) is the tuple of unknowns, V(ψ)=(Vi(ψi)) is a non-negative vectorial function, and the Vi(ψi) terms are defined for all ψi∈ℝ and can be expressed as

(32) V i ( ψ i ) = - ψ i a i ( ξ ) d ξ .

For all i=1,2,,N, the following assumptions are made for the functions ai(ψ) (we are quite literally following Casulli and Zanolli2010 here):

  • A1:

    ai(ψ) is defined for all ψ∈ℝ and is a non-negative function with bounded variations;

  • A2:

    ψi*R exists such that ai(ψ) is strictly positive and nondecreasing in (-,ψi*) and nonincreasing in (ψi*,+).

T in Eq. (31) is the so-called matrix flux, and it is a symmetric and (at least) positive semi-definite matrix satisfying one of the following properties:

  • T1:

    T is a Stieltjes matrix, i.e. a symmetric M matrix, or

  • T2:

    T is irreducible, null(T)≡span(v), with v>0 (componentwise), and T+D is a Stieltjes matrix for all diagonal matrices Dhttps://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-g01O, with O denoting the null matrix.

Finally, b is the vector of the known terms. When T satisfies property T2, then for Eq. (31) to be physically and mathematically compatible, the following assumption about b is required:

(33) 0 < v b < v V Max ,

where VMax=-+ai(ξ)dξ.

Having assumed that the ai(ψ) terms are non-negative functions of bounded variations, they are differentiable almost everywhere, admit only discontinuities of the first kind, and can be expressed as the difference of two non-negative, bounded, and nondecreasing functions, say pi(ψ) and qi(ψ), such that

(34)ai(ψ)=pi(ψ)-qi(ψ)00q(ψ)p(ψ)

for all ψ∈ℝ. When a(ψ) terms satisfy assumptions A1 and A2, the corresponding decomposition (known as the Jordan decomposition as in Chistyakov1997, and presented in Fig. 2) is given by

(35) p i ( ψ ) = a i ( ψ ) q i ( ψ ) = 0 if    ψ ψ i * p i ( ψ ) = a i ( ψ i * ) q i ( ψ ) = p i ( ψ ) - a i ( ψ ) if    ψ > ψ i * ,

where ψi* is the position of the maximum of pi. Thereafter, V(ψ) can be expressed as

(36) V ( ψ ) = V 1 ( ψ ) - V 2 ( ψ ) ,

where the ith component of V1(ψ) and V2(ψ) is defined as

(37) V 1 , i ( ψ i ) = - ψ i p i ( ξ ) d ξ V 2 , i ( ψ i ) = - ψ i q i ( ξ ) d ξ .

By making use of Eq. (36) the algebraic system in Eq. (31) can be written as

(38) V 1 ( ψ ) - V 2 ( ψ ) + T ψ = b .

It is necessary here to point out exactly how the nonlinear system in Eq. (31) reads when considering only the R2 equation and when the water depth function is used to properly define the surface boundary condition. In the first case, i.e. when Neumann or Dirichlet boundary conditions are used, the vectorial function is defined as V(ψ)=(θi(ψi)) for i=1,2,,N.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f02

Figure 2Graphical representation of the Jordan decomposition for soil water content using the SWRC model by Van Genuchten (1980) for a clay loam soil (Bonan2019). (a) The Jordan decomposition of c(ψ) as in Eq. (35). For ψ=ψ*, c(ψ) presents a maximum: for ψ<ψ* it is increasing, and for ψ>ψ* it is decreasing. This nonmonotonic behaviour causes problems when solving the nonlinear system. c(ψ) is thus replaced by p(ψ) (in green) and q(ψ) (in blue), which are two monotonic functions whose difference is the original function c. Consequently, (b) θ(ψ) is replaced by θ1(ψ) and θ2(ψ) (Eq. 36).

Download

Instead, when we consider the water depth function to describe the computational node at the soil surface, the vectorial function is defined as V(ψ)=(θi(ψi)) for i=1,2,,N-1 and VN(ψ)=H(ψ). Therefore, the nonlinear system in Eq. (38) is valid to describe both the subsurface and surface waters when the symbols are appropriately understood.

This aspect, the use of two different equation states, and the fact that the NCZ algorithm can be successfully re-used to solve other problems (Casulli and Zanolli2012; Tubini et al.2021b), requires a careful design of its implementation, as discussed in the following sections.

3 Design and deployment of WHETGEO-1D

The concepts and requirements previously illustrated must be cast into software whose usability, expandability, and inspectability are demanded by good software design, which adds further requirements. The software design requirements and the software deployment are explained below.

3.1 Design requirements

One of the major difficulties encountered by a research group concerns the development and re-use of scientific software (Berti2000) and the writing of structurally clean code, i.e. a code that is easily readable and understandable, with objects that have a specified and possibly unique responsibility (Martin2009).

An object-oriented programming approach, with the adoption of standard design patterns (DPs) (Gamma et al.1995; Freeman et al.2004) and the creation of new ones, has been adopted for the internal class design and hierarchy.

The design principles followed by the WHETGEO-1D software can be summarized as follows.

  • a.

    The software should be open-source to allow inspection and improvements by third parties.

  • b.

    For the same reason it should be organized into parts, each with a clear functional meaning and possibly a single responsibility.

  • c.

    The software can be extended with minimal effort and without modifications (according to the “open to extensions, closed to modifications” principle; Freeman et al.2004). In particular, the parts to be modified are those that, according to the discussion in the previous sections, could be changed to try new closures, i.e. the SWRCs and the hydraulic conductivities in the case of the R2 equation and the thermal capacity and thermal conductivity in the case of the energy budget. Adding a new SWRC type or a new conductivity function should be easy.

  • d.

    The largest set of boundary conditions should be smoothly manageable.

  • e.

    The implementation of equations should be abstract, according to the principle of “programming to interfaces and not to concrete classes”, which is the core of contemporary OOP (Gamma et al.1995). The different equations describing the processes should be implemented within the set of classes by implementing a common interface.

  • f.

    The implementation of algorithms should not depend on the data formats of inputs and outputs.

Another requirement has to do with the user experience. In fact, solvers of partial differential equations (PDEs) (Menard et al.2020) tend to be complex to understand and run when features are added. In particular, the number of inputs grows exponentially when features are added, and the user has to overcome a steep learning curve before being able to use these software packages to appreciate all the cases implemented and their physics.

  • g.

    To simplify this situation, WHETGEO-1D has to be implemented is such a way that any of the alternative implementations must come only with their own parameters and variables, as well as appear to the user to be as simple as possible, though not too simple.

There is finally a last requirement to consider.

  • h.

    For computational and research purposes, there will be one-, two-, and three-dimensional (1D, 2D, 3D) implementations of the aforementioned equations. Therefore, as much of the code as possible should be shared across these. In particular, the NCZ and Newton algorithms should be shareable across the various applications.

This requirement implies that the geometry of the domain, as well as the topology, should be specified in an abstract manner to cope with the specifics of each dimensionality.

The rest of this section is organized to respond to points (a) to (h). Point (a) is actually responded to in the next section describing where the software can be downloaded and with which open license. Points (b) and (c) are accomplished by studying an appropriate design of classes and the use of design patterns (Gamma et al.1995; Freeman et al.2004). For (d), generic programming is used and specific classes are implemented. Point (e) is resolved by deploying a set of classes that implement a common interface with an extension that allows it to obtain the required functionalities.

To respond to the issues raised in (f) and (g), WHETGEO-1D is implemented as various components of OMS3, as shown below, each one with its own inputs. Therefore, the number of flags to check and the number of unused inputs are reduced to the minimum required by the solvers and parameterizations that the user chooses. If users want to solve the R2 equation alone, for instance, they can pick out the appropriate component and do not need to know about the inputs and details of the energy budget. The separation into components has two other advantages. First, it eases the testing of a single process against available analytical solutions and against other model results (Bisht and Riley2019). Second, it improves the model structure, facilitating the representation of new processes (Clark et al.2021).

Point (h) is solved by deploying new components for the 1D, 2D, and 3D cases. In the following section we mainly deal with points (b) to (e). Before discussing details of some classes, a few general choices have to be reported. Data of any type are stored internally in vectors of doubles, which in turn encapsulated in appropriate Java objects. OOP good practice would suggest that an object should be immutable (Bloch2001), but we decided that the main classes have to be mutable and allocated once forever as singletons (Gamma et al.1995; Freeman et al.2004). This potentially exposes the software to side effects but frees it to allocate new objects at any time step and decreases the computational burden and memory occupancy generated by deallocating unused obsolete objects at runtime. This approach may be considered a specific design pattern for partial differential equation solvers.

3.2 The software organization

The more visible effect of our choices is that we have built various OMS3 components.

  • whetgeo1d-1.0-beta

  • netcdf-1.0-beta

  • closureequation-1.0-beta

  • buffer-1.0-beta

  • numerical-1.0-beta

Internally, the classes are assembled by using some interfaces and abstract classes, since WHETGEO-1D is coded using the Java language.

In order to improve the re-usability of the Java code we adopted a generic programming approach (Berti2000) that consists of decoupling of algorithm implementations from the concrete data representation while preserving efficiency. The generic approach has been balanced with domain-specific ones that can improve the computational efficiency of the software, as is the case of the previously mentioned Thomas algorithm used in 1D implementations.

Another requirement regards the division of software classes into three main groups, as the lack of a proper separation between the parameterization of physical processes and their numerical solutions has been recognized as one of the weak points of existing land-surface models (Clark et al.2015b, 2021). One group describes the mathematical–physical problem, the second one implements the numerical solution (Berti2000), and the third one contains the growing group of concrete classes. The first group contains the SWRC, as well as hydraulic and thermal conductivity, and it forms a stand-alone library since its content can eventually be re-used in the 2D and 3D version of WHETGEO-1D. Similarly, we grouped the classes that solve linear and nonlinear algebraic systems, containing the Thomas conjugate gradient and the various Netwon types of algorithms, into a second stand-alone library. The third group of classes gathers the concrete implementations and the variety of OMS3 components that are deployed.

The classes used, and their repository for third-party inspection, are illustrated in the 00_Notebooks referred to in Sect. 4 and in the Supplement. However, there are three pivotal groups of classes that we want to mention here: these contain the description of the geometry of the integration domain, the closure equation, and the state equation.

3.2.1 Computational domain, i.e. the Geometry class

One of the key aspects to have in a generic solver regards the management of the grid and, in particular, the definition of its topology, or how grid elements are connected to each other. In the 1D case the description of the topology is quite simple since it can be implicitly contained in the vector representation: each element of the vector corresponds to a control volume of the grid, and it is only connected with the elements preceding and following it. It is worth noting that this approach is peculiar to 1D problems and cannot be adopted for the 2D and 3D domains, where, especially when unstructured grids are used, the grid topology requires a smart implementation of the incidence and adjacency matrices.

For each control volume it is necessary to store its geometrical quantities, their position and dimension, its variables, its parameter set, and the form of the equation to be solved there, referred to in the following as “equation state”. The appropriate arrangement of information, together with the internal design of the classes, allows us to create a generic finite-volume solver.

3.2.2 Closure equations, i.e. the ClosureEquation abstract class

The ClosureEquation class is shown in the Unified Modeling Language (UML) diagram in Fig. 3. As explained in the Introduction, one of the core concepts of modelling water and heat transport in soils is the SWRC. Soil is a multi-phase material, and thus knowledge of its composition is of crucial importance in defining its unsaturated hydraulic conductivity as well as its thermal properties, specific internal energy, and thermal conductivity.

An abstract class, ClosureEquation, is defined to contain only abstract methods that would be overwritten by the concrete classes implementing it. The ClosureEquation class essentially defines a new data type. A closer inspection of Fig. 3 reveals that the ClosureEquation is composed by aggregation with the Parameter class, which contains all the physical parameters of the model. Moreover, the Parameter class is implemented by using the Singleton pattern (Freeman et al.2004). This design pattern is functional to have only one instance of the Parameter class shared by all the ClosureEquation objects and to provide a global point of access to the Parameter instance.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f03

Figure 3UML class diagram for the Java Simple Factory applied for the choice of the SWRC model. The ClosureEquation defines the interface that is implemented by the concrete classes SWRCVanGenucthen and SWRCBrooksCorey. The ClosureEquation is aggregated with the class Parameters containing the physical parameters of the model. Parameters is implemented by using the Singleton pattern, and its instance is inherited by the concrete classes SWRCVanGenucthen and SWRCBrooksCorey.

Download

The Simple Factory pattern SoilWaterRetentionCurvesFactory accomplishes the task of implementing the concrete classes. By preferring polymorphism to inheritance and using the Simple Factory pattern (Gamma et al.1995; Freeman et al.2004), the developers can easily include and extend existing code or new formulations or parameterizations of SWRC. Also, the Simple Factory fulfils the dependency inversion principle (Eckel2003), and thus new extensions cannot affect the functioning of existing code. The same closure equation, for instance a particular SWRC, can be used to compute the soil water volume when solving the R2 equation and the specific enthalpy of the soil when solving the heat equation.

3.2.3 Equation state, i.e. the EquationState class

The EquationState class in Fig. 4 contains the implementation of the discretized form of the equation state of the PDE under scrutiny. It contains a reference to the ClosureEquation object, the Geometry object, and the ProblemVariables object.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f04

Figure 4UML class diagram for the Java Simple Factory applied for the choice of the EquationState model. The EquationState defines the interface that is implemented by the concrete classes SoilWaterVolumeVanGenucthen and SoilInternalEnergy. The EquationState contains a reference to a ClosureEquation object.

Download

Notably, the solver of a PDE problem can refer to the abstract class and to its abstract object without implying the specific concrete equation to be solved or its concrete parameterizations. Moreover, the compositionality of the EquationState allows the creation of new solvers from existing closures without the need to add new subclasses. As shown in the UML in Fig. 4, the EquationState class defines methods used to linearize the PDE when it is nonlinear. For instance, it computes the first and second derivatives and the functions necessary to define the Jordan decomposition as required by the NCZ algorithm. Specifically, these methods are p, q, pIntegral, qIntegral, and computeXStar.

In our code design the ClosureEquation class is limited to computing a physical parameterization, whereas the EquationState class is used to discretize the equation state of the PDE and whenever required to properly linearize it. Any new concrete EquationState subclass can either have the same physics of another with a different solver or different physics with the same solver.

3.3 Generic programming at work

As explained in Sect. 2.1.2, the definition of the surface boundary condition for the R2 equation can require the introduction of an additional computation node at the soil surface to simulate the water depth. This means that we have two different equation states: one for the soil water content and one for the water depth. On the other hand, when considering the Neumann or Dirichlet boundary condition we have only one equation state for the soil water content. The nonlinear solver of the NCZ algorithm must work seamlessly with any type of boundary condition used and with any type of equation involved in the problem.

Let us consider, for example, the case of the R2 equation with water depth as the surface boundary condition. Figure 5 reports the pseudocode for computing the nonlinear functions in the NCZ algorithm using a procedural approach. When traversing the computational grid we need to resort to an if-else statement to compute the nonlinear function of each control volume: the control volume N represents the control volume for the surface water, and in this case we need to use the water depth equation state, H(ψ) in Fig. 5. The remaining control volumes represent the soil moisture, and for them we need to use the SWRC equation state, θ(ψ) in Fig. 5. The main limit of this approach is that the computation of the nonlinear functions, H(ψ) and θ(ψ), is hard-wired into the code of the NCZ algorithm. This presents a shortcoming for the re-usability of the code since, as the boundary condition changes and the physical problem changes, it is necessary to modify the for loop and the name of the objects computing the nonlinear functions.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f05

Figure 5Adopting a procedural approach, the computation of the equation states is hard-wired into the code. The behaviour of each control volume is determined by an if-else statement according to the position of the element in the grid. In this case the properties of the grid, here the equation state, are joined with the topology. Here the nonlinear function V(ψ) is replaced with either H(ψ) or θ(ψ) according to the position of the node. To keep the pseudocode short, H(ψ) and θ(ψ) stand for all the nonlinear functions used in the NCZ algorithm, and the method f stands for one of the methods defined in the EquationState class.

Download

Adopting the OOP and generic programming approach (Fig. 6), it is possible to implement the NCZ algorithm in such a way that enhances its re-usability. The key feature is the decoupling of the computational grid from the algorithm (data) (Berti2000). This is achieved through two elements. The first consists of creating a container of the objects that deal with the equation states of the problem, equationState, eS in Fig. 6. Second, we use a label equationStateID, eSID in Fig. 6, to specify the behaviour of each control volume. So, the behaviour of each control volume is determined by this label and not by the position of the element in the grid. Specifically, when we traverse the grid we use the equationStateID to determine which object inside the container equationState to use.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f06

Figure 6Adopting OOP with a generic programming approach, the computation of the equation states is independent from the grid. In fact, the behaviour of each control volume is determined by the vector eSID – equationStateID in the code – that determines which object belonging to the class EquationState of eS – equationState in the code – must be used to compute the equation state. In this manner it is possible to traverse the computation domain without resorting to the if-else statement. Here the nonlinear function V(ψ) is consistently replaced with either H(ψ) or θ(ψ) according to the position of the node. To keep the pseudocode short, H(ψ) and θ(ψ) stand for all the nonlinear functions used in the NCZ algorithm, and the method f stands for one of the methods defined in the class EquationState.

Download

The NCZ algorithm has been implemented in the NestedNewtonThomas class. The NestedNewtonThomas contains a reference to the Thomas object, whose task is to solve a linear system, and to a list of EquationState objects (Fig. 7). Considering the ubiquity of nonlinear problems in hydrology and the robustness of the NCZ algorithm, the NCZ algorithm has been encapsulated in a stand-alone library.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f07

Figure 7UML class diagram of the NestedNewtonThomas class. This class deals with the solution of the nonlinear system. The NestedNewtonThomas contains a reference to the Thomas object, whose task it is to solve a linear system, and to a list of EquationState objects.

Download

The example has been illustrated in 1D, but it becomes even more effective when working in 2D or 3D, especially with an unstructured grid.

4 Information for users and developers

While most of what has been written so far is of general application, the deployment shown here is 1D. Information on WHETGEO-1D for users and developers is provided in the Supplement, where there is a Jupyter Notebook that contains the guidelines for executing the codes for any of the components. Its name starts with “00_”, and we call it “Notebook Zero” of the components. The latest executable code can be downloaded from

and can be compiled by following the instructions therein. The version of the OMS3 compiled project can be found here: https://github.com/GEOframeOMSProjects/OMS_Project_WHETGEO1D (last access: 21 December 2021). The code can be executed in the OMS3 console, which can be downloaded and installed according to the instructions given at

Some brief information about GEOframe can be found in Appendix B, and more comprehensive information is at

To run the tests, please follow the instructions on the GitHub repository of the GEOframe components. If a user wants to compile the code themselves, they can use the appropriate Gradle script that guarantees independence from any IDE.

For further information about input and output formats for WHETGEO-1D, please see the Notebook 00_WHETGEO1D_Richards.ipynb in the folder documentation of the Zenodo distribution.

4.1 Workflow for users

Examples of uses of WHETGEO-1D can be found in the form of Python Notebooks in the directory Notebooks/Jupyter. Documentation can be found in the form of Python Notebooks in the directory documentation. Simulations with WHETGEO-1D are run as OMS3 simulations. Therefore, the first operation to accomplish is to prepare the appropriate .sim files. For new users, many simulation files are available in the directory simulation of the Zenodo distribution. As shown in Fig. 8, in the modelling solutions that involve WHETGEO-1D, there is always a “main” component that is in charge of running the core code for solving the PDE. The inputs and the outputs are treated by other OMS3 components. They are tied together by a domain-specific language (DSL) based on Groovy. This allows for great flexibility in using various input and output formats.

4.2 Inputs and outputs

Input data can be broadly classified into time series, computational grid data, and simulation parameters. Time series are used to specify the boundary conditions of the problem. Time series are contained in .csv files with a specific format that is OMS3-compliant (David2021). With computational grid data we refer to the domain discretization, initial condition, and soil parameters. All these data are stored in a NetCDF file. Time series and computational grid data are elaborated with dedicated Python modules distributed under the geoframepy package (Tubini and Rigon2021a). The simulation parameters, such as the start date and end date of the simulation, time step size, and file paths, are specified by the user in the OMS3 .sim file.

For the design of the output workflow we took advantage of the OMS3 system that allows the user to connect stand-alone components. Figure 8 shows the output workflow for saving output data with Main, Buffer, and netCDF writer as the stand-alone OMS3 components. Main stands for the generic component having the responsibility of solving the PDE. Buffer has the responsibility of temporarily storing output data, and Writer handles the saving of data to the disk. The Buffer component has the sole purpose of storing data, and this has two important advantages. The first is that it limits the number of accesses to the disk to save output, i.e. reducing the computational time. The second is that it introduces a layer separating the Main component from the netCDF writer. This increases the flexibility of the modelling solution, as future developers can adopt different file formats or develop different writer components that, instead of saving all the outputs, can save discrete outputs or aggregated outputs. The advantage is that developers need only know the legacy of the Buffer component and customize both the output file format and memory optimization strategy, such as chuncking, according to their need. Currently all outputs are stored in a NetCDF-3 format (Unidata2021). NetCDF is a self-describing portable data format developed and maintained by UCAR Unidata. NetCDF is commonly used by the geoscience community, and there is an ever-growing number of tools for processing and visualization.

The choice of including the Buffer component in the workflow of the modelling solution is motivated by earlier experiences of the GEOtop community with the GEOtop model and by more recent experience with the FreeThaw1D model (Tubini et al.2021b), according to which long spin-ups of the model (∼1500 years) were required with consequently large output files ( GB). Furthermore, in anticipation of the 2D and 3D developments, the NetCDF-3 format is probably not the most appropriate and could be abandoned in favour of more performing file formats (Unidata2021a, b), such as NetCDF-4 or HDF5.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f08

Figure 8Workflow of WHETGEO-1D. The boundary condition readers, computational grid reader, Main, Buffer, and netCDF writer are stand-alone OMS3 components. Main stands for the generic component with the responsibility of solving the PDE; the Buffer temporarily stores output data that are later passed to the netCDF writer component, which in turn saves data to the disk. The Buffer component has the sole purpose of storing data. This has two advantages: the first one is to limit the number of accesses to the disk to save output, i.e. reducing the computational time, and the second one is to introduce a layer separating the Main component, which handles the numerical solution of the PDE, and the component responsible for saving outputs.

Download

WHETGEO-1D can be integrated with the built-in calibration component LUCA (Hay et al.2006; Formetta et al.2014a) and the Verification component, as shown in Fig. 9. The former is used to calibrate optimal parameters and the latter to compute the indices of goodness of simulated data versus measured data. Besides the LUCA component and the Verification component, it is necessary to add two more components, specifically the Buffer calibration parameters and the Measurement points data. The Buffer calibration parameters are needed to interface the Main component with the LUCA component. In fact, in the WHETGEO-1D Main component, physical parameters are stored as vectors, whilst LUCA handles calibration parameters as scalars (single value). The Buffer calibration component receives the optimal parameter set from the LUCA component and returns them packed in appropriate vectors. The Verification component receives as input two OMS3-compliant time series: one for measured data and one for simulated data. In this case it is necessary to extract from the simulation output only the simulated data at the measurement points of the variable used to calibrate the model. These data are then saved as OMS3 time series. It interesting that the integration of WHETGEO-1D with the OMS3 built-in calibration components is achieved by adding two new stand-alone components without modifying the source code of the existing components, i.e. the Main component, the Buffer component, and the netCDF writer.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f09

Figure 9Workflow of WHETGEO-1D integrated with LUCA. The cyan lines identify components required to integrate WHETGEO-1D with LUCA. The LUCA and Verification components are built-in OMS3 components. The former is used to calibrate optimal parameters and the latter to compute the indices of goodness of simulated data versus measured data. To integrate WHETGEO-1D with the OMS3 calibration components it is necessary to add two other components into the workflow, specifically the Buffer calibration parameters component and the Measurement points data component. LUCA handles scalar parameters, whilst WHETGEO-1D uses vectorial parameters. Buffer calibration parameters creates an interface between these two components, simply creating vectorial parameters from scalar parameters. The Verification component requires the input time series as a .csv file of simulated data at the measurement points. To accomplish this requirement, it is necessary to modify the output strategy: the Buffer component passes output data to the Measurement points data component. This component extracts only the simulated variables at the measurement points and passes them to the OMS3 time series writer, .csv writer, which saves the simulated time series as a .csv file. Notably, if the user is not interested in saving all the output of each run of the model during calibration, it is possible to remove the netCDF writer component.

Download

4.3 Workflow for developers

Here, as an example, we present how to add the Brooks–Corey (Brooks and Corey1964) model as an extension of the code base. The constitutive relationships are given by

(39)θ(ψ)=θr+(θs-θr)ψdψnif   ψψdθsif   ψ>ψd,(40)K(ψ)=Ksθ(ψ)-θrθs-θr3+2n,

where θs and θr are the saturated and residual values of the volumetric water content, respectively, ψd is the air-entry water suction value, n is the pore size distribution index, and Ks is the saturated hydraulic conductivity at saturation.

The standard approach to adding a new SWRC parameterization, here the Brooks and Corey model, requires the definition of a new class that extends the abstract class ClosureEquation. This new class, SWRCBrooksCorey, provides the implementation of the abstract methods defined in the super class ClosureEquation and inherits the association with the Parameters class. Specifically, the SWRCBrooksCorey class overrides the following methods:

  • f calculates the water content for a given water suction value and set of parameters (Eq. 39);

  • df calculates the first derivative of Eq. (39);

  • ddf calculates the second derivative of Eq. (39).

In order to use the Brooks–Corey model in the Richards equation it is necessary to define a new class, SoilWaterVolumeBrooksCorey, that extends the abstract class StateEquation. Specifically, the SoilWaterVolumeBrooksCorey class overrides the following methods.

  • equationState calculates the water volume using the Brook–Corey model for a given water suction value and set of parameters (Eq. 18).

  • dEquationState calculates the first derivative of the equationState function, in case this the moisture capacity function. This method is used within the linearization algorithm.

  • ddEquationState calculates the second derivative of the equationState function. This method is relevant for models for which the ψ* cannot be computed analytically but requires the application of a root-finding method such as the bisection method. An example is the soil internal energy function when considering the phase change of water (Tubini et al.2021b).

  • p calculates the p function of the Jordan decomposition.

  • pIntegral calculates the V1 function of the Jordan decomposition.

  • computeXStar calculates the ψ* value to properly define the functions p and V1.

  • initialGuess calculates the initial guess for the linearization algorithm.

5 Conclusions

In this paper we discussed the issues raised by implementing a new expandable system to model the Earth's CZ, WHETGEO, the core of which is a reliable and robust integrator of the Richards–Richardson equation and the associated energy budget.

We would like to stress the following.

  • WHETGEO makes available the NCZ algorithm, which has a priori convergence ensured for any choice of time step and for a great variety of boundary and initial conditions.

  • The coupling between the R2 equation and the heat advection diffusion equation is done using a recent algorithm (Casulli and Zanolli2005) that, to our knowledge, has not been applied before for the same scope.

  • The application of our methods could benefit a large range of Earth science models, which at present require complicated workarounds (Regenass et al.2021).

  • The adoption of the mixed form of the equation allows the joint modelling of the saturated and unsaturated soil and groundwater conditions.

  • Moreover, the coupling strategy with ponding water makes WHETGEO naturally suitable to investigate the partitioning of infiltration and surface runoff without any of the issues documented for other software (e.g. Šimůnek et al.2005).

The implementation of WHETGEO has been shown to solve three software requirements and the (a) to (h) design specifications. Each of these was analysed and thus influenced the choice of algorithms and code implementation. Of the hydrological issues presented in seven observations, the issues 1 to 4 were also solved, and the code provided some answers for observations 5 to 7 because of the following.

  • The code allows for the easy changing of soil water retention curves; therefore, for instance, it would be easy to implement new ones taking more accurate account of the different processes in the various ranges of suction. A description of how to add a new soil water retention curve is presented in Sect. 4.3.

  • The effect of temperature on viscosity has been included, and, in the Supplement, we have shown that temperature changes in soil have relevant effects on infiltration and runoff production.

  • Freezing and thawing processes coupled with the R2 equation will be inserted. As an intermediate step, the heat conduction with phase change has been implemented in the energy budget solver.

The flexibility of the code was obtained with the creation of the 𝚂𝚝𝚊𝚝𝚎𝙴𝚚𝚞𝚊𝚝𝚒𝚘𝚗 and the 𝙲𝚕𝚘𝚜𝚞𝚛𝚎𝙴𝚚𝚞𝚊𝚝𝚒𝚘𝚗 classes, as illustrated in Sect. 3. Their organization can be considered a new programming pattern that can be re-used by programmers to implement the solution of partial differential equations independently of our use of the Java language. Furthermore, we also chose to implement the objects containing data by adopting the Singleton pattern. This choice violates the safety prescription that objects should preferably be immutable, but, by avoiding the continuous allocation and deallocation (through the Java garbage collector) of new objects, we aimed at saving computational time. Also, this scheme can be considered a design choice that can be replicated by anyone interested in scientific computing.

The first deployment of the concepts was the 1D stand-alone water budget as well as the coupled water and energy budget WHETGEO versions. The water budget was tested against analytical solutions presented in Srivastava and Yeh (1991) and Vanderborght et al. (2005). Some behavioural simulations were also performed to show some features of the code, such as the ability to deal with switching boundary conditions. Also, we showed that WHETGEO can be easily extended to simulate the thermal regime in frozen soils, as described in Tubini et al. (2021b), by merely adding the SFC model presented by Dall'Amico et al. (2011).

The model is an entirely new code that was accurately designed to allow easy inspection and to support code literacy and class re-use. It is open-source and built with open-source tools. It and its documentation fulfil the requirements of open science (Hall et al.2021). In a science for which a lot of daily research activities are based on computer simulations, this is a requirement that most existing models do not fulfil but that the authors believe is profitable for the progress of science. Also, WHETGEO is built with a chain of open-source tools, making it available to all researchers who want to peruse it without constraint. Its documentation was produced using only open-source tools and is available together with the distribution of the main code.

Appendix A: GEOframe

WHETGEO-1D was implemented as a Java component within the GEOframe, an open-source, component-based hydrological modelling system. Within GEOframe, each part of the hydrological cycle is implemented in a self-contained building block, an OMS3 component (David et al.2013). Components can be joined together to obtain multiple modelling solutions that can accomplish simple to very complicated tasks. GEOframe has shown great flexibility and robustness in several applications (Bancheri et al.2020; Abera et al.2017a, b). There are more than 50 components available that can be grouped into the following categories:

  • geomorphic and DEM analyses;

  • spatial extrapolation or interpolation of meteorological variables;

  • estimation of the radiation budget;

  • estimation of evapotranspiration;

  • estimation of runoff production with integral distributed models;

  • channel routing;

  • travel time analysis;

  • calibration algorithms.

Using the components for geomorphic and DEM analyses (Rigon et al.2006b), the basin can be discretized into hydrological response units (HRUs), i.e. hydrologically similar parts, such as a catchment or a hillslope or one of its parts. The meteorological forcing data can be spatially interpolated using a geostatistical approach, such as the kriging technique (Bancheri et al.2018). Both shortwave and longwave radiation components are available for the estimation of the radiation budget (Formetta et al.2013, 2016). Evapotranspiration can be estimated using three different formulations: the FAO evapotranspiration model (Allen et al.1998), the Priestley–Taylor model (Priestley and Taylor1972), and the Prospero model (Bottazzi2020; Bottazzi et al.2021). Snow melting and the snow water equivalent can also be simulated with three models, as described in Formetta et al. (2014b). Runoff production is performed by using the Embedded Reservoir Model (ERM) or a combination of its reservoirs (Bancheri et al.2020). The discharge generated at each hillslope is routed to the outlet using the Muskingum–Cunge method (Bancheri et al.2020). Travel time analysis of a generic pollutant within the catchment can be done using the approach proposed in Rigon et al. (2016b, a). Model parameters can be calibrated using two algorithms and several objective functions: Let us calibrate (LUCA) (Hay et al.2006) and particle swarm optimization (PSO) (Kennedy and Eberhart1995). A graph-based structure, called NET3 (Serafin2019), is employed for the management of process simulations. NET3 is designed using a river network and graph structure analogy, whereby each HRU is a node of the graph, and the channel links are the connections between the nodes. In any NET3 node, a different modelling solution can be implemented and nodes (HRUs or channels) can be connected or disconnected at runtime through scripting. GEOframe is open-source and helps the reproducibility and replicability of research (Bancheri2017). Developers and users can easily collaborate, share documentation, and archive examples and data within the GEOframe community.

Appendix B: OMS3

The Object Modelling System v.3 (OMS3) is a component-based environmental modelling framework that provides a consistent and efficient way to (1) create science simulation components; (2) develop, parameterize, and evaluate environmental models, as well as modify and adjust them as science advances; and (3) re-purpose environmental models for emerging customer requirements (David et al.2013).

In OMS3 the term component refers to self-contained, separate software units that implement independent functions in a context-independent manner (David et al.2013). This means that developers and researchers can build their model as a composition of stand-alone components, moving away from the monolithic approach. The entire GEOframe system, and therefore WHETGEO-1D, is built upon the OMS3 framework.

Compared to other environmental modelling frameworks (EMFs), OMS3 is characterized by being a noninvasive and lightweight framework (Lloyd et al.2011). That is to say that the model code is not tightly coupled with the underlying framework – OMS3; i.e. the environmental modeller does not need a deep knowledge of the API, and the modelling components can still function and continue to evolve outside the framework (David et al.2013). In fact, OMS3 relies on specific annotations to provide metadata for Java code. These annotations describe elements such as classes, fields, and methods and are used by the framework to interpret the component as a building block of the modelling solution (MS), hence controlling its connectivity and data flow (David et al.2013). It is worth noting that, being metadata, these annotations do not directly affect the execution of the source code outside the OMS3 noninvasive and lightweight framework.

Besides the technical aspects, the adoption of a software framework has a positive effect on “nonfunctional” quality attributes, such as maintainability, portability, re-usability, and understandability (David et al.2013). The component-based approach allows the developer to break down the problem into smaller parts, each one tackled by a specific component. Hence, the components are joined together to build the desired modelling solution (point b). This facilitates the construction of new MSs, thanks to the plug-in system of model components (David et al.2013; Peckham et al.2013; Serafin2019). Thanks to the modularity, the updating of a component with the most recent scientific advances is facilitated and has no side effects on the other components. The other advantage regards the long-term development of the code. From past experiences, one of the main limits to model development and maintenance was related to the lack of a proper software architectural design (Rizzoli et al.2006; David et al.2013; Formetta et al.2014a; Bancheri2017; Serafin2019). Moreover, it is interesting to note that the component-based approach encourages collective model development (Serafin2019) and also eases the attribution of authorship since any component is a stand-alone chunk of code and can be authored separately.

Also, the adoption of an environmental modelling framework promotes the concept of reproducible research, easing third-party inspection and providing consistent and verifiable model results (Formetta et al.2013; Bancheri2017; Serafin2019).

Another advantage of using OMS3 is represented by the opportunity to keep the code development transparent to the user.

Appendix C:R2 test cases

In this section we test the solver of the R2 equation against the analytical solutions presented by Srivastava and Yeh (1991) and by Vanderborght et al. (2005). Then we present and discuss two “behavioural” test cases to try out WHETGEO-1D in simulating both the infiltration excess and the saturation excess process.

C1 Analytical solution Srivastava and Yeh (1991)

Srivastava and Yeh (1991) derived an analytical solution describing the one-dimensional transient infiltration in a homogeneous and layered soil. The hydraulic properties of the soil are described by the following constitutive relations:

(C1)K(ψ)=Kseαψ,(C2)θ(ψ)=θr+(θs-θr)eαψ,

where Ks is the saturated hydraulic conductivity, θr is the residual water content, θs is the saturated water content, and α is the soil pore size distribution parameter representing the desaturation rate of the SWRC. The lower boundary condition is represented by the water table, ψ=0, while the upper boundary condition is subjected to a constant flux, q. The initial condition corresponds to the steady-state profile due to a prescribed initial flux at the soil surface and prescribed pressure at the lower boundary. The analytical solution is derived by linearizing the Richards equation and using Laplace transformation. Details on the analytical solution can be found in Srivastava and Yeh (1991).

C1.1 Homogeneous soil

We consider a one-dimensional homogeneous soil layer of 1m depth (TP1). The saturated hydraulic conductivity value is assumed to be 1.0cm h−1, with θs=0.45m3 m−3, θr=0.2m3 m−3, and α=0.01cm−1. The initial condition is determined by imposing as a lower boundary condition ψ=0m and a constant water flux at the soil surface of qA=0.1cm h−1. For times greater than 0 the water flux at the soil surface is qB=0.9cm h−1. The domain is discretized with a uniform grid space Δz=0.001m and the time step is Δt=60s. The model accuracy is enhanced by allowing two Picard iterations per time step. Figure C1 shows a comparison between the numerical and the analytical solutions.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f10

Figure C1Comparison between the analytical and numerical solutions for the test problem TP1.

Download

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f11

Figure C2Relative water suction error for the test problem TP1.

Download

C1.2 Layered soil

In this numerical problem (TP2) we consider one-dimensional vertical infiltration toward the water table through a layered soil. The initial condition is determined by imposing as a lower boundary condition ψ=0m and a constant water flux at the soil surface of qA=0.1cm h−1. For times greater than 0 the water flux at the soil surface is qB=0.9cm h−1. The domain is discretized with a uniform grid space Δz=0.001m and the time step is Δt=60s. The model accuracy is enhanced by allowing two Picard iterations per time step. The hydraulic conductivity at the interface is computed as the harmonic mean of the neighbours (Romano et al.1998). Comparison between the numerical and the analytical solution for water suction is shown in Fig. C3.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f12

Figure C3Comparison between the analytical and numerical solutions for the test problem TP2.

Download

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f13

Figure C4Comparison of relative water suction error δ for the test problem TP2 using different interface hydraulic conductivity algorithms. (a) Computed with max, (b) with harmonic mean, and (c) with geometric mean. As reported in Romano et al. (1998), the harmonic mean offers the best agreement with the analytical solution. This is particularly evident at the interface between the two layers.

Download

C2 Analytical solution of Vanderborght et al. (2005)

The next test case was defined by Vanderborght et al. (2005) to evaluate the steady-state flux in layered soil profiles. For this numerical problem (TP3) we consider a soil column of 2m depth with one soil type for depth 00.5m overlying another soil type for depth 0.52m, specifically for loam over sand, sand over loam, and clay over sand. The soil parameters are defined in Table C1. The initial condition for water suction is a uniform profile with ψ=-20m, the surface boundary condition is a constant flux of q=5.79×10-8m s−1, and at the bottom we impose a free drainage boundary condition. The domain is discretized with a uniform grid space Δz=0.01m and the time step is Δt=3600s. In order to reach the steady-state condition the simulation lasts 2 years. Comparison between the numerical and the analytical solution is shown in Fig. C5.

Table C1 Hydraulic properties for the three soil types used in the Vanderborght test case (TP3).

Download Print Version | Download XLSX

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f14

Figure C5Comparison between the analytical and the numerical solution for the test problem TP3. The three panels show the vertical profile of water suction at steady state for a constant flow rate of 5.79×10-8m s−1: (a) clay–sand soil profile, (b) loam–sand soil profile, and (c) sand–loam soil profile.

Download

C3 Surface boundary condition

The definition of the surface boundary condition is a nontrivial task since it is a system-dependent boundary condition. The infiltration rate through the soil surface depends on precipitation, rainfall intensity J, and on the moisture condition of the soil. Because of this, the surface boundary condition may change from the Dirichlet type – prescribed water suction – to the Neumann type – prescribed flux – and vice versa. The works by Horton (1933) and Dunne and Black (1970) establish the conceptual framework to explain the runoff generation.

The infiltration excess or Horton runoff occurs when the rainfall intensity is larger than the infiltration capacity of the soil:

(C3) | J | > | - K ( ψ ) z ( ψ + z ) | z = 0 .

Infiltration excess is most commonly observed with short-duration, intense rainfall.

The saturation excess or Dunnian runoff occurs when the soil is saturated and additional water exfiltrates at the soil surface. Saturation excess generally occurs with long-duration, moderate rainfall or with a series of successive precipitation events. In this case the soil depth or the presence of shallow fragipan is the determining factor for saturation excess. Another possible cause is the rise of the water table up to the soil surface.

C3.1 Infiltration excess

In this numerical experiment we consider a homogeneous soil of 3m depth. Soil hydraulic properties are described with the Van Genuchten model (Table C2).

Table C2Hydraulic properties of the silty clay loam soil (Bonan2019) for the Horton runoff numerical experiment.

Download Print Version | Download XLSX

The initial condition is assumed to be hydrostatic with ψ=0m at the bottom. The surface boundary condition is synthetic rainfall, as in Fig. C6a, lasting 15min with constant intensity of 0.028mm s−1. At the bottom we prescribed a Dirichlet boundary condition with constant ψ=0m so the transient is driven only by the surface boundary condition. In Fig. C6a, the time is indicated when it would be necessary to switch from the Neumann-type to the Dirichlet-type boundary condition.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f15

Figure C6(a) A comparison between the rainfall intensity J and actual soil infiltration i. The rainfall intensity exceeds the actual infiltration rate so water builds up at the soil surface (blue line). (b) The time evolution of the water suction within the soil. From the numerical point of view, as water builds up at the soil surface it would be necessary to switch the boundary condition from Neumann type to Dirichlet type.

Download

Figure C7 shows a comparison of water ponding at the soil surface considering two different initial conditions of the soil: wet and dry. For the wet case, the initial condition is hydrostatic with ψ=0m at the bottom. For the dry case, the initial condition is hydrostatic with ψ=-100m at the bottom. In the wet initial condition the hydraulic conductivity is higher than for the dry initial condition; however, in the dry case the capillary gradient is larger and because of this the soil infiltration capacity is higher, as in Fig. C7a. With regards to the water ponding, the maximum value is almost the same in both cases, 1mm higher in the wet case, but the time evolution is different: in the wet case the water only infiltrates completely 13h later than the dry case. This delay may seem counter-intuitive since wetter conditions are associated with higher values of hydraulic conductivity (Fig. C8), but in the wet soil the capillary gradients are smaller than in the dry soil (Fig. C9).

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f16

Figure C7(a) A comparison between the infiltration rate for two cases: wet and dry initial condition. In the dry case, soil infiltration is greater than the wet case even though the hydraulic conductivity is smaller. This is due to the higher capillary gradients that develop in the soil. (b) The time evolution of the water ponding at the soil surface.

Download

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f17

Figure C8(a) The hydraulic conductivity field for the case of wet soil and (b) the hydraulic conductivity field for the case of dry soil.

Download

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f18

Figure C9(a) The capillary gradient for the case of wet soil and (b) the capillary gradient for the case of dry soil. As can be seen, in the dry soil the capillary gradient is 2 orders of magnitude larger than in the wet soil. Because of this higher gradient water infiltrates faster in the dry soil than in the wet soil.

Download

C3.2 Saturation excess

In this section we present two numerical experiments to simulate the saturation excess process. Saturation excess is more critical, in terms of simulation stability, than the infiltration excess (PC Progress Discussion Forums2021). We consider two cases: one in which the water table reaches the soil surface and another in which the total rainfall amount is larger than the maximum water-holding capacity but the rainfall intensity is less than the maximum infiltration rate.

Firstly, we consider a layered soil of 3m depth. The thicknesses of the loamy layer and clay layer are 0.5 and 2.5m, respectively. The soil hydraulic properties are described with the Van Genuchten model (Table C3). The initial condition is assumed to be hydrostatic with ψ=0m at the bottom. At the surface boundary condition we prescribe no rainfall, while at the bottom a variable Dirichlet boundary condition is prescribed (Fig. C10a). The transient is driven by variation of the water table. In Fig. C10a the time is indicated when it would be necessary to switch the surface boundary condition from the Neumann-type to the Dirichlet-type boundary condition and vice versa.

Table C3 Hydraulic properties of the loam layer and clay layer in Bonan (2019) for the numerical experiment on Dunnian runoff due to water table rising.

Download Print Version | Download XLSX

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f19

Figure C10(a) The water table position, Dirichlet boundary condition, and the water ponding at the soil surface. The dotted red lines indicate the times at which the boundary condition at the soil surface should be switched. The first line indicates the switch from the Neumann type to the Dirichlet type since water starts building up. The second line indicates the switch form the Dirichlet type to the Neumann type because there is no water at the soil surface. (b) The time evolution of the water suction within the soil.

Download

Table C4Hydraulic properties of the loamy sand layer and clay layer in Bonan (2019) for the numerical experiment on Dunnian runoff due to rainfall.

Download Print Version | Download XLSX

Secondly, we consider a layered soil of 3m depth. The thicknesses of the loamy sand layer and the clay layer are 0.3 and 2.7m, respectively. The soil hydraulic properties are described with the Van Genuchten model (Table C4). The initial condition is assumed to be hydrostatic with ψ=-2m at the bottom. The surface boundary condition is synthetic rainfall (Fig. C11a), and at the bottom we prescribed a Dirichlet boundary condition with constant ψ=-2m so the transient is driven only by the surface boundary condition. Figure C11b shows the time evolution of the degree of saturation within the soil. Initially water infiltrates into the soil but then the clay layer, which is characterized by a lower conductivity than the loam–sand layer, limits the deep infiltration causing the saturation of the loam–sand layer from below.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f20

Figure C11(a) The rainfall and the water ponding at the soil surface. Initially rainfall can infiltrate into the soil and no water builds up at the soil surface. As the uppermost layer of the soil saturates water starts ponding at the soil surface. The dotted red lines indicate the times at which the boundary condition at the soil surface should be switched. (b) The time evolution of the saturation degree within the soil.

Download

Repeating the above numerical experiment with a thicker loam–sandy layer (Fig. C12), there is no water ponding at the soil surface. In this case all the rainfall can infiltrate into the loam–sandy layer thanks to the increased water storage capacity.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f21

Figure C12In this numerical experiment there is no saturation excess since the greater thickness of the uppermost layer ensures sufficient water storage capacity for the forcing rainfall.

Download

Appendix D: Energy budget

Here we present a behavioural test case on the pure heat conduction considering the surface energy balance. The purpose of this simulation is twofold. First, we show an application of WHETGEO-1D that exploits existing GEOframe components to model the external components of the surface energy budget, specifically the incoming shortwave radiation (Formetta et al.2013), the incoming longwave radiation (Formetta et al.2016), and the latent heat flux. Second, we show how to easily include the phase change of water by adding a new closure equation that describes the SFC model presented by Dall'Amico et al. (2011)

The soil column is 30m deep, and the initial condition is a constant temperature profile T=12C. Figure D1a shows the components of the surface energy fluxes and the thermal regime of the uppermost 2m of the soil column. As can be seen in panel (b), the soil temperature falls below 0C; therefore, it is not reasonable to neglect freezing and thawing processes.

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f22

Figure D1Behavioural test case of pure heat conduction in soil considering the surface energy budget. (a) The surface energy fluxes driving the simulation. The external fluxes, incoming shortwave and longwave radiation, and the latent heat flux are computed with existing GEOframe components. (b) The thermal regime of the uppermost 2m of the soil column. As can be seen, during winter the temperature of the uppermost layer goes below 0C, and the grey line is the 0C isotherm; therefore, it is not reasonable to overlook the phase change of water.

Download

Table D1Parameters of the SFC model.

Download Print Version | Download XLSX

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f23

Figure D2Behavioural test case of pure heat conduction in soil considering the surface energy budget and the phase change of water. (a) The surface energy fluxes driving the simulation. The external fluxes, incoming shortwave and longwave radiation, and the latent heat flux are computed with existing GEOframe components. (b) The thermal regime of the uppermost 2m of the soil column.

Download

https://gmd.copernicus.org/articles/15/75/2022/gmd-15-75-2022-f24

Figure D3(a) A comparison of the soil temperature at 0.05m with the phase change of water and without. As can be seen, in the latter case the soil temperature reaches a lower value and fluctuates more: when considering the phase change of water we include in the problem the latent heat of water that increases the thermal inertia of the soil. (b) A comparison of the position of the zero isotherm in the two simulations. When the phase of water is not included the zero isotherm goes deeper into the ground.

Download

By including the closure equation of the SFC presented by Dall'Amico et al. (2011), it is possible to consider the phase change of water. Moreover, compared to the FreeThaw-1D model (Tubini et al.2021b), in WHETGEO-1D it is possible to drive the simulation of the soil thermal regime by using the surface energy budget. This aspect represents a novelty with respect to FreeThaw-1D and was obtained with minimum effort thanks to the code design we adopted. The soil column is of 30m depth, and the initial condition is a constant temperature profile T=12C. The parameters of the SFC are presented in Table D1. Figure D1 shows in panel (a) the components of the surface energy fluxes and the thermal regime of the uppermost 2m of the soil column. As can be seen in panel (b), the soil temperature falls below 0C, and thus neglecting freezing and thawing processes results in a strong approximation.

Figure D3 shows a comparison between the two simulations.

Code availability

The source code is written in Java using the object-oriented programming paradigm. The source code can be found at https://github.com/geoframecomponents/WHETGEO-1D (last access: 21 December 2021) and a frozen version at https://doi.org/10.5281/zenodo.5112727 (Tubini and Rigon2021c). The OMS3 project can be found at https://github.com/GEOframeOMSProjects/OMS_Project_WHETGEO1D (last access: 21 December 2021), and a frozen version is available on Zenodo at https://doi.org/10.5281/zenodo.4749319 (Tubini and Rigon2021b). The source code of external dependencies is provided in the README of the GitHub page at https://github.com/geoframecomponents/WHETGEO-1D (last access: 21 December 2021). WHETGEO-1D is deployed as an open-source code to work alone or within the Object Modelling System version 3 framework (David et al.2013, https://doi.org/10.1016/j.envsoft.2012.03.006). In the latter case it can be connected at runtime with the many other components developed in the GEOframe system to provide hydrometeorological forcings and other fluxes, such as evapotranspiration. The code must be run within the OMS3 console or using the Dockerized version of OMS3. To set up the environment please follow the steps described in the README file present in the GitHub repository at https://github.com/GEOframeOMSProjects/OMS_Project_WHETGEO1D (last access: 21 December 2021). and in the GEOframe pages at https://geoframe.blogspot.com/2021/05/whetgeo-1d.html (last access: 18 May 2021, GEOframe2021b). Once you have installed OMS3, please follow the instructions contained in the documentation folder. They contain all the details about simulation inputs and parameters. For those interested in using WHETGEO-1D and applying it in their research, it is available as part of the material for the first GEOframe Summer School held in Trento on 4–7 October 2021 at http://geoframe.blogspot.com/2021/06/geoframe-summer-school-2021-gss2021.html (last access: 21 December 2021, GEOframe Summer School2021). The material of the school is available here: https://doi.org/10.17605/OSF.IO/Z53C6 (Tubini et al.2021a). The fair use and publication policy of the GEOframe group is available here: https://osf.io/wgdyq/ (last access: 21 December 2021, GEOframe2021a).

Data availability

The simulations and data presented here can be found at https://doi.org/10.5281/zenodo.4749319 (Tubini and Rigon2021b).

Supplement

The supplement related to this article is available online at: https://doi.org/10.5194/gmd-15-75-2022-supplement.

Author contributions

RR and NT were responsible for conceptualization. NT and RR developed the methodology. NT and RR were responsible for software engineering. NT performed code writing. RR and NT performed code revision. NT was responsible for data curation and simulations. NT and RR contributed to paper writing, review, and editing. NT and RR were responsible for documentation. RR acquired funding.

Competing interests

The contact author has declared that neither they nor their co-author has any competing interests.

Disclaimer

Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Acknowledgements

The authors would like to thank Professor Vincenzo Casulli and Professor Michael Dumbser of the Department of Civil, Environmental and Mechanics Engineering at the University of Trento for their fruitful discussions on the numerical aspects of the work. We thank Concetta D'Amato for the help in preparing the supporting material. We would like to thank Joseph Eamonn Tomasi for his invaluable help with the linguistic revision. We especially thank the two anonymous reviewers for their constructive comments that helped to improve our paper.

Financial support

This work has been partially supported by a PhD grant by the Department of Civil, Environmental and Mechanics Engineering at the University of Trento and by the Italian MIUR project (PRIN 2017) “WATer mixing in the critical ZONe: observations and predictions under environmental changes-WATZON” (project code: 2017SL7ABC).

Review statement

This paper was edited by Min-Hui Lo and reviewed by three anonymous referees.

References

Abera, W., Formetta, G., Borga, M., and Rigon, R.: Estimating the water budget components and their variability in a pre-alpine basin with JGrass-NewAGE, Adv. Water Resour., 104, 37–54, https://doi.org/10.1016/j.advwatres.2017.03.010, 2017a. a

Abera, W., Formetta, G., Brocca, L., and Rigon, R.: Modeling the water budget of the Upper Blue Nile basin using the JGrass-NewAge model system and satellite data, Hydrol. Earth Syst. Sci., 21, 3145–3165, https://doi.org/10.5194/hess-21-3145-2017, 2017b. a

Allen, R. G., Pereira, L. S., Raes, D., and Smith, M.: Crop evapotranspiration-Guidelines for computing crop water requirements, Fao, Rome, FAO Irrigation and drainage paper 56, 300(9), D05109, 1998. a

Ashby, S. F. and Falgout, R. D.: A parallel multigrid preconditioned conjugate gradient algorithm for groundwater flow simulations, Nucl. Sci. Eng., 124, 145–159, https://doi.org/10.13182/NSE96-A24230, 1996. a

Bancheri, M.: A flexible approach to the estimation of water budgets and its connection to the travel time theory, PhD thesis, University of Trento, 2017. a, b, c, d

Bancheri, M., Serafin, F., Bottazzi, M., Abera, W., Formetta, G., and Rigon, R.: The design, deployment, and testing of kriging models in GEOframe with SIK-0.9.8, Geosci. Model Dev., 11, 2189–2207, https://doi.org/10.5194/gmd-11-2189-2018, 2018. a

Bancheri, M., Rigon, R., and Manfreda, S.: The GEOframe-NewAge Modelling System Applied in a Data Scarce Environment, Water, 12, 86, https://doi.org/10.3390/w12010086, 2020. a, b, c, d, e

Benard, P., Zarebanadkouki, M., and Carminati, A.: Physics and hydraulics of the rhizosphere network, J. Plant Nutr. Soil Sc., 182, 5–8, https://doi.org/10.1002/jpln.201800042, 2019. a

Berti, G.: Generic software components for Scientific Computing, PhD thesis, Von der Fakultät für Mathematik, Naturwissenschaften und Informatik der Brandenburgischen Technischen Universität Cottbus, 2000. a, b, c, d

Bisht, G. and Riley, W. J.: Development and verification of a numerical library for solving global terrestrial multiphysics problems, J. Adv. Model. Earth Sy., 11, 1516–1542, https://doi.org/10.1029/2018MS001560, 2019. a, b, c, d

Bloch, J.: Effective Java: Programming Language Guide, Addison-Wesley Professional, ISBN: 9780201310054, 2001. a

Bonan, G.: Climate change and terrestrial ecosystem modeling, Cambridge University Press, https://doi.org/10.1017/9781107339217, 2019. a, b, c, d, e, f

Bottazzi, M.: Transpiration theory and the Prospero component of GEOframe, PhD thesis, University of Trento, 2020. a, b

Bottazzi, M., Bancheri, M., Mobilia, M., Bertoldi, G., Longobardi, A., and Rigon, R.: Comparing evapotranspiration estimates from the GEOframe-Prospero model and three empirical models under different climate conditions, Water, 13, 1221–1243, https://doi.org/10.3390/w13091221, 2021. a, b

Brooks, R. H. and Corey, T. A.: Hydraulic properties of porous media Hydrology Paper No. 3, Civil Engineering Department, Colorado State University, Fort Collins, CO, 1964. a

Brugnano, L. and Casulli, V.: Iterative solution of piecewise linear systems, SIAM J. Sci. Comput., 30, 463–472, https://doi.org/10.1137/070681867, 2008. a, b

Brugnano, L. and Casulli, V.: Iterative solution of piecewise linear systems and applications to flows in porous media, SIAM J. Sci. Comput., 31, 1858–1873, https://doi.org/10.1137/08072749X, 2009. a

Casulli, V.: A high-resolution wetting and drying algorithm for free-surface hydrodynamics, Int. J. Numer. Meth. Fl., 60, 391–408, https://doi.org/10.1002/fld.1896, 2009. a

Casulli, V.: A coupled surface-subsurface model for hydrostatic flows under saturated and variably saturated conditions, Int. J. Numer. Meth. Fl., 85, 449–464, https://doi.org/10.1002/fld.4389, 2017. a

Casulli, V. and Zanolli, P.: High resolution methods for multidimensional advection–diffusion problems in free-surface hydrodynamics, Ocean Model., 10, 137–151, https://doi.org/10.1016/j.ocemod.2004.06.007, 2005. a, b, c, d

Casulli, V. and Zanolli, P.: A nested Newton-type algorithm for finite volume methods solving Richards' equation in mixed form, SIAM J. Sci. Comput., 32, 2255–2273, https://doi.org/10.1137/100786320, 2010. a, b, c, d, e, f

Casulli, V. and Zanolli, P.: Iterative solutions of mildly nonlinear systems, J. Comput. Appl. Math., 236, 3937–3947, https://doi.org/10.1016/j.cam.2012.02.042, 2012. a, b, c

Celia, M. A., Bouloutas, E. T., and Zarba, R. L.: A general mass-conservative numerical solution for the unsaturated flow equation, Water Resour. Res., 26, 1483–1496, https://doi.org/10.1029/WR026i007p01483, 1990. a

Chistyakov, V.: On mappings of bounded variation, J. Dyn. Control Syst., 3, 261, https://doi.org/10.1007/BF02465896, 1997. a

Clark, M. P., Fan, Y., Lawrence, D. M., Adam, J. C., Bolster, D., Gochis, D. J., Hooper, R. P., Kumar, M., Leung, L. R., Mackay, D. S., Maxwell, R. M., Shen, C., Swenson, S. C., and Zeng, X.: Improving the representation of hydrologic processes in Earth System Models, Water Resour. Res., 51, 5929–5956, https://doi.org/10.1002/2015WR017096, 2015a. a

Clark, M. P., Nijssen, B., Lundquist, J. D., Kavetski, D., Rupp, D. E., Woods, R. A., Freer, J. E., Gutmann, E. D., Wood, A. W., Brekke, L. D., Arnold, J. R., Gochis, D. J., and Rasmussen, R. M.: A unified approach for process-based hydrologic modeling: 1. Modeling concept, Water Resour. Res., 51, 2498–2514, https://doi.org/10.1002/2015WR017198, 2015b. a, b

Clark, M. P., Zolfaghari, R., Green, K. R., Trim, S., Knoben, W. J. M., Bennet, A., and Nijssen, B.: The numerical implementation of land models: problem formulation and laugh tests, J. Hydrometeorol., 22, 1627–1648, https://doi.org/10.1175/JHM-D-20-0175.1, 2021. a, b, c

Constantz, J. and Murphy, F.: The temperature dependence of ponded infiltration under isothermal conditions, J. Hydrol., 122, 119–128, https://doi.org/10.1016/0022-1694(91)90175-H, 1991. a, b

Dai, Y., Wei, N., Yuan, H., Zhang, S., Shangguan, W., Liu, S., Lu, X., and Xin, Y.: Evaluation of soil thermal conductivity schemes for use in land surface modeling, J. Adv. Model. Earth Sy., 11, 3454–3473, https://doi.org/10.1029/2019MS001723, 2019. a, b, c

Dall'Amico, M., Endrizzi, S., Gruber, S., and Rigon, R.: A robust and energy-conserving model of freezing variably-saturated soil, The Cryosphere, 5, 469–484, https://doi.org/10.5194/tc-5-469-2011, 2011. a, b, c, d, e

D'Amato, C.: BrokerGEO, GitHub [code], available at: https://github.com/geoframecomponents/BrokerGEO, last access: 20 April 2021. a

D'Amato, C., Tubini, N., Benettin, P., Rinaldo, A., Noto, V., and Rigon, R.: Investigation of a critical zone column with the GEOframe Plant Atmosphere Continuum Estimator (GEO-SPACE), Hydrol. Earth Syst. Sci., in preparation, 2022. a

David, O.: CSV Data Files, codeBeamer [data set], available at: https://alm.engr.colostate.edu/cb/wiki/16970, last access: 1 April 2021. a

David, O., Ascough II, J. C., Lloyd, W., Green, T. R., Rojas, K., Leavesley, G. H., and Ahuja, L. R.: A software engineering perspective on environmental modeling framework design: The Object Modeling System, Environ. Modell. Softw., 39, 201–213, https://doi.org/10.1016/j.envsoft.2012.03.006, 2013. a, b, c, d, e, f, g, h, i, j, k

Di Nucci, C.: Theoretical derivation of the conservation equations for single phase flow in porous media: a continuum approach, Meccanica, 49, 2829–2838, https://doi.org/10.1007/s11012-014-0022-y, 2014. a

Dong, Y., McCartney, J. S., and Lu, N.: Critical review of thermal conductivity models for unsaturated soils, Geotech. Geol. Eng., 33, 207–221, https://doi.org/10.1007/s10706-015-9843-2, 2015. a

Dunne, T. and Black, R. D.: An experimental investigation of runoff production in permeable soils, Water Resour. Res., 6, 478–490, https://doi.org/10.1029/WR006i002p00478, 1970. a

Eckel, B.: Thinking in JAVA, Prentice Hall Professional, 2003. a

Eisenberg, D., Kauzmann, W., and Kauzmann, W.: The structure and properties of water, Oxford University Press, ISBN: 9780198570264, 2005. a, b

Endrizzi, S., Gruber, S., Dall'Amico, M., and Rigon, R.: GEOtop 2.0: simulating the combined energy and water balance at and below the land surface accounting for soil freezing, snow cover and terrain effects, Geosci. Model Dev., 7, 2831–2857, https://doi.org/10.5194/gmd-7-2831-2014, 2014. a, b

Engeler, I., Franssen, H. H., Müller, R., and Stauffer, F.: The importance of coupled modelling of variably saturated groundwater flow-heat transport for assessing river–aquifer interactions, J. Hydrol., 397, 295–305, https://doi.org/10.1016/j.jhydrol.2010.12.007, 2011. a, b

Farthing, M. W. and Ogden, F. L.: Numerical solution of Richards' equation: A review of advances and challenges, Soil Sci. Soc. Am. J., 81, 1257–1269, https://doi.org/10.2136/sssaj2017.02.0058, 2017. a, b, c, d, e, f, g, h

Formetta, G., Rigon, R., Chávez, J. L., and David, O.: Modeling shortwave solar radiation using the JGrass-NewAge system, Geosci. Model Dev., 6, 915–928, https://doi.org/10.5194/gmd-6-915-2013, 2013. a, b, c, d

Formetta, G., Antonello, A., Franceschi, S., David, O., and Rigon, R.: Hydrological modelling with components: A GIS-based open-source framework, Environ. Modell. Softw., 55, 190–200, https://doi.org/10.1016/j.envsoft.2014.01.019, 2014a. a, b, c, d

Formetta, G., Kampf, S. K., David, O., and Rigon, R.: Snow water equivalent modeling components in NewAge-JGrass, Geosci. Model Dev., 7, 725–736, https://doi.org/10.5194/gmd-7-725-2014, 2014b. a

Formetta, G., Bancheri, M., David, O., and Rigon, R.: Performance of site-specific parameterizations of longwave radiation, Hydrol. Earth Syst. Sci., 20, 4641–4654, https://doi.org/10.5194/hess-20-4641-2016, 2016. a, b

Frampton, A., Painter, S. L., and Destouni, G.: Permafrost degradation and subsurface-flow changes caused by surface warming trends, Hydrogeol. J., 21, 271–280, https://doi.org/10.1007/s10040-012-0938-z, 2013. a

Freeman, E., Robson, E., Bates, B., and Sierra, K.: Head first design patterns, O'Reilly Media, Inc., ISBN 9780596007126, 2004. a, b, c, d, e, f

Freeze, R. A. and Harlan, R. L.: Blueprint for a physically-based, digitally-simulated hydrologic response model, J. Hydrol., 9, 237–258, 1969. a

Furman, A.: Modeling coupled surface–subsurface flow processes: A review, Vadose Zone J., 7, 741–756, https://doi.org/10.2136/vzj2007.0065, 2008. a, b, c, d, e

Gamma, E., Helm, R., Johnson, R., Vlissides, J., and Patterns, D.: Elements of Reusable Object-Oriented Software, Design Patterns, Addison-Wesley Publishing Company, Massachusetts, 1995. a, b, c, d, e

GEOframe: FairUse&Publication Policy_v1.pdf, OSF, available at: https://osf.io/wgdyq/, last access: 21 December 2021a. a

GEOframe: WHETGEO-1D, available at: https://geoframe.blogspot.com/2021/05/whetgeo-1d.html, last access: 18 May 2021b. a

GEOframe Summer School: http://geoframe.blogspot.com/2021/06/geoframe-summer-school-2021-gss2021.html, last access: 21 December 2021. a

Germann, P. and Beven, K.: Water flow in soil macropores I. An experimental approach, J. Soil Sci., 32, 1–13, https://doi.org/10.1111/j.1365-2389.1981.tb01681.x, 1981. a

Greenspan, D. and Casulli, V.: Numerical Analysis for Applied Mathematics, Science, and Engineering, Addison Wesley, https://doi.org/10.1201/9780429493393, 1988. a

Gugole, F., Dumbser, M., and Stelling, G.: An efficient three-dimensional semi-implicit finite volume scheme for the solution of coupled free-surface and variably saturated sub-surface flow, in: EGU General Assembly Conference Abstracts, 600, 2018. a

Hall, C. A., Saia, S. M., Popp, A. L., Dogulu, N., Schymanski, S. J., Drost, N., van Emmerik, T., and Hut, R.: A Hydrologist's Guide to Open Science, Hydrol. Earth Syst. Sci. Discuss. [preprint], https://doi.org/10.5194/hess-2021-392, in review, 2021. a

Hay, L. E., Leavesley, G. H., Clark, M. P., Markstrom, S. L., Viger, R. J., and Umemoto, M.: Step wise, multiple objective calibration of a hydrologic model for a snowmelt dominated basin 1, J. Am. Water Resour. As., 42, 877–890, https://doi.org/10.1111/j.1752-1688.2006.tb04501.x, 2006. a, b

Horton, R. E.: The role of infiltration in the hydrologic cycle, EOS T. Am. Geophys. Un., 14, 446–460, https://doi.org/10.1029/TR014i001p00446, 1933. a

Hrachowitz, M., Benettin, P., Van Breukelen, B. M., Fovet, O., Howden, N. J., Ruiz, L., Van Der Velde, Y., and Wade, A. J.: Transit times–The link between hydrology and water quality at the catchment scale, WIREs Water, 3, 629–657, https://doi.org/10.1002/wat2.1155, 2016. a

IDEAS: Methodologies and “How To”, available at: https://ideas-productivity.org/ideas-classic/how-to/, last access: 20 October 2021. a

Jones, J. E. and Woodward, C. S.: Newton–Krylov-multigrid solvers for large-scale, highly heterogeneous, variably saturated flow problems, Adv. Water Resour., 24, 763–774, https://doi.org/10.1016/S0309-1708(00)00075-0, 2001. a

Kelley, C. T.: Solving nonlinear equations with Newton's method, SIAM, https://doi.org/10.1137/1.9780898718898, 2003. a

Kennedy, J. and Eberhart, R.: Particle swarm optimization, in: Proceedings of ICNN'95-international conference on neural networks, Perth, WA, Australia, 27 November–1 December 1995, IEEE, vol. 4, 1942–1948, 1995. a

Kollet, S. J. and Maxwell, R. M.: Integrated surface–groundwater flow modeling: A free-surface overland flow boundary condition in a parallel groundwater flow model, Adv. Water Resour., 29, 945–958, https://doi.org/10.1016/j.advwatres.2005.08.006, 2006. a

Kosugi, K.: General model for unsaturated hydraulic conductivity for soils with lognormal pore-size distribution, Soil Sci. Soc. Am. J., 63, 270–277, https://doi.org/10.2136/sssaj1999.03615995006300020003x, 1999. a

Kurylyk, B. L. and Watanabe, K.: The mathematical representation of freezing and thawing processes in variably-saturated, non-deformable soils, Adv. Water Resour., 60, 160–177, https://doi.org/10.1016/j.advwatres.2013.07.016, 2013. a

Liu, S., Lu, L., Mao, D., and Jia, L.: Evaluating parameterizations of aerodynamic resistance to heat transfer using field measurements, Hydrol. Earth Syst. Sci., 11, 769–783, https://doi.org/10.5194/hess-11-769-2007, 2007. a

Lloyd, W., David, O., Ascough II, J. C., Rojas, K. W., Carlson, J. R., Leavesley, G. H., Krause, P., Green, T. R., and Ahuja, L. R.: Environmental modeling framework invasiveness: Analysis and implications, Environ. Modell. Softw., 26, 1240–1250, https://doi.org/10.1016/j.envsoft.2011.03.011, 2011. a

Lu, N.: Generalized soil water retention equation for adsorption and capillarity, J. Geotech. Geoenviron., 142, 04016051, https://doi.org/10.1061/(ASCE)GT.1943-5606.0001524, 2016. a

Martin, R. C.: Clean code: a handbook of agile software craftsmanship, Pearson Education, ISBN-13: 978-0-13-235088-4, 2009. a, b

Mcdonough, J. M.: Introductory Lectures on Turbulence: Physics, Mathematics and Modeling, Mechanical Engineering Textbook Gallery, 2, available at: https://uknowledge.uky.edu/me_textbooks/2 (last access: 21 December 2021), 2007. a

Menard, C. B., Essery, R., Krinner, G., Arduini, G., Bartlett, P., Boone, A., Brutel-Vuilmet, C., Burke, E., Cuntz, M., Dai, Y., Decharme, B., Dutra, E., Fang, X., Fierz, C., Gusev, Y., Hagemann, S., Haverd, V., Kim, H., Lafaysse, M., Marke, T., Nasonova, O., Nitta, T., Niwano, M., Pomeroy, J., Schädler, G., Semenov, V. A., Smirnova, T., Strasser, U., Swenson, S., Turkov, D., Wever, N., and Yuan, H.: Scientific and human errors in a snow model intercomparison, B. Am. Meteorol. Soc., 102, E61–E79, https://doi.org/10.1175/BAMS-D-19-0329.1, 2020. a

Mualem, Y.: A new model for predicting the hydraulic conductivity of unsaturated porous media, Water Resour. Res., 12, 513–522, https://doi.org/10.1029/WR012i003p00513, 1976. a

Muskat, M. and Meres, M. W.: The flow of heterogeneous fluids through porous media, Physics, 7, 346–363, https://doi.org/10.1063/1.1745403, 1936. a

National Research Council: Basic Research Opportunities in Earth Science, The National Academies Press, Washington, DC, https://doi.org/10.17226/9981, 2001. a

Newman, S.: Building Microservices: Designing Fine-Grained Systems, ISBN-10: 1491950358, 2015. a

Nicolsky, D. and Romanovsky, V. E.: Modeling long-term permafrost degradation, J. Geophys. Res.-Earth, 123, 1756–1771, https://doi.org/10.1029/2018JF004655, 2018. a

Nobel, P. S.: Physicochemical & environmental plant physiology, Academic Press, ISBN 0-12-520025-0, 1999. a

Ochsner, T. E., Horton, R., and Ren, T.: A new perspective on soil thermal properties, Soil Sci. Soc. Am. J., 65, 1641–1647, https://doi.org/10.2136/sssaj2001.1641, 2001. a

Paniconi, C. and Putti, M.: A comparison of Picard and Newton iteration in the numerical solution of multidimensional variably saturated flow problems, Water Resour. Res., 30, 3357–3374, https://doi.org/10.1029/94WR02046, 1994. a, b

Paniconi, C. and Putti, M.: Physically based modeling in catchment hydrology at 50: Survey and outlook, Water Resour. Res., 51, 7090–7129, https://doi.org/10.1002/2015WR017780, 2015. a

Paniconi, C. and Wood, E. F.: A detailed model for simulation of catchment scale subsurface hydrologic processes, Water Resour. Res., 29, 1601–1620, https://doi.org/10.1029/92WR02333, 1993. a

PC Progress Discussion Forums: https://www.pc-progress.com/forum/viewtopic.php?f=3&t=3632, last access: 20 April 2021. a

Peckham, S. D., Hutton, E. W., and Norris, B.: A component-based approach to integrated modeling in the geosciences: The design of CSDMS, Comput. Geosci., 53, 3–12, https://doi.org/10.1016/j.cageo.2012.04.002, 2013. a

Penna, D., Hopp, L., Scandellari, F., Allen, S. T., Benettin, P., Beyer, M., Geris, J., Klaus, J., Marshall, J. D., Schwendenmann, L., Volkmann, T. H. M., von Freyberg, J., Amin, A., Ceperley, N., Engel, M., Frentress, J., Giambastiani, Y., McDonnell, J. J., Zuecco, G., Llorens, P., Siegwolf, R. T. W., Dawson, T. E., and Kirchner, J. W.: Ideas and perspectives: Tracing terrestrial ecosystem water fluxes using hydrogen and oxygen stable isotopes – challenges and opportunities from an interdisciplinary perspective, Biogeosciences, 15, 6399–6415, https://doi.org/10.5194/bg-15-6399-2018, 2018. a

Priestley, C. H. B. and Taylor, R. J.: On the assessment of surface heat flux and evaporation using large-scale parameters, Mon. Weather Rev., 100, 81–92, https://doi.org/10.1175/1520-0493(1972)100<0081:OTAOSH>2.3.CO;2, 1972. a

Quarteroni, A., Sacco, R., and Saleri, F.: Numerical mathematics, vol. 37, Springer Science and Business Media, ISBN-10: 3642071015, 2010. a

Raupach, M. and Thom, A. S.: Turbulence in and above plant canopies, Annu. Rev. Fluid Mech., 13, 97–129, https://doi.org/10.1146/annurev.fl.13.010181.000525, 1981. a

Regenass, D., Schlemmer, L., Jahr, E., and Schär, C.: It rains and then? Numerical challenges with the 1D Richards equation in kilometer-resolution land surface modelling, Hydrol. Earth Syst. Sci. Discuss. [preprint], https://doi.org/10.5194/hess-2021-426, in review, 2021. a

Richards, L. A.: Capillary conduction of liquids through porous mediums, Physics, 1, 318–333, https://doi.org/10.1063/1.1745010, 1931. a

Richardson, L. F.: Weather prediction by numerical process, Cambridge University Press, https://doi.org/10.1002/qj.49704820311, 1922. a

Rigon, R., Bertoldi, G., and Over, T. M.: GEOtop: A distributed hydrological model with coupled water and energy budgets, J. Hydrometeorol., 7, 371–388, https://doi.org/10.1175/JHM497.1, 2006a. a, b, c

Rigon, R., Ghesla, E., Tiso, C., and Cozzini, A.: The HORTON machine: a system for DEM analysis The reference manual, Tech. rep., University of Trento, ISBN 9788884431479, available at: http://hdl.handle.net/11572/48576 (last access: 21 December 2021), 2006b. a

Rigon, R., Bancheri, M., Formetta, G., and de Lavenne, A.: The geomorphological unit hydrograph from a historical-critical perspective, Earth Surf. Proc. Land., 41, 27–37, https://doi.org/10.1002/esp.3855, 2016a. a

Rigon, R., Bancheri, M., and Green, T. R.: Age-ranked hydrological budgets and a travel time description of catchment hydrology, Hydrol. Earth Syst. Sci., 20, 4929–4947, https://doi.org/10.5194/hess-20-4929-2016, 2016b. a

Rizzoli, A., Svensson, M., Rowe, E., Donatelli, M., Muetzelfeldt, R., van der Wal, T., van Evert, F., and Villa, F.: Modelling framework (SeamFrame) requirements, Tech. rep., SEAMLESS, 2006. a

Roe, P. L.: Approximate Riemann solvers, parameter vectors, and difference schemes, J. Comput. Phys., 43, 357–372, https://doi.org/10.1016/0021-9991(81)90128-5, 1981. a

Romano, N., Brunone, B., and Santini, A.: Numerical analysis of one-dimensional unsaturated flow in layered soils, Adv. Water Resour., 21, 315–324, https://doi.org/10.1016/S0309-1708(96)00059-0, 1998. a, b

Ronan, A. D., Prudic, D. E., Thodal, C. E., and Constantz, J.: Field study and simulation of diurnal temperature effects on infiltration and variably saturated flow beneath an ephemeral stream, Water Resour. Res., 34, 2137–2153, https://doi.org/10.1029/98WR01572, 1998. a, b

Saito, H., Šimůnek, J., and Mohanty, B. P.: Numerical analysis of coupled water, vapor, and heat transport in the vadose zone, Vadose Zone J., 5, 784–800, https://doi.org/10.2136/vzj2006.0007, 2006. a

Serafin, F.: Enabling modeling framework with surrogate modeling capabilities and complex networks, PhD thesis, University of Trento, 2019. a, b, c, d, e, f

Shewchuk, J. R.: An Introduction to the Conjugate Gradient Method Without the Agonizing Pain, available at: https://www.bibsonomy.org/bibtex/2175fea4e807e879ebcb76b79a9992437/timo (last access: 21 December 2021), 1994. a

Šimůnek, J., Van Genuchten, M. T., and Sejna, M.: The HYDRUS-1D software package for simulating the one-dimensional movement of water, heat, and multiple solutes in variably-saturated media, University of California-Riverside Research Reports, 3, 1–240, 2005. a, b

Šimůnek, J., Van Genuchten, M. Th., and Šejna, M.: The HYDRUS-1D software package for simulating the one-dimensional movement of water, heat, and multiple solutes in variably-saturated media. Version 3.0, HYDRUS Softw., Ser. 1, Dep. of Environ. Sci., Univ. of California, Riverside, CA, 2012. a

Sophocleous, M.: Analysis of water and heat flow in unsaturated-saturated porous media, Water Resour. Res., 15, 1195–1206, https://doi.org/10.1029/WR015I005P01195, 1979. a

Srivastava, R. and Yeh, T.-C. J.: Analytical solutions for one-dimensional, transient infiltration toward the water table in homogeneous and layered soils, Water Resour. Res., 27, 753–762, https://doi.org/10.1029/90WR02772, 1991. a, b, c, d

Tomin, P. and Lunati, I.: Investigating Darcy-scale assumptions by means of a multiphysics algorithm, Adv. Water Resour., 95, 80–91, https://doi.org/10.1016/j.advwatres.2015.12.013, 2016. a

Tubini, N. and Rigon, R.: GEOframePy, available at: https://pypi.org/project/geoframepy/, last access: 22 October 2021a. a

Tubini, N. and Rigon, R.: OMS project for WHETGEO-1D, v-1.0-beta, Zenodo [data set], https://doi.org/10.5281/zenodo.4749319, 2021b (data available at: https://github.com/GEOframeOMSProjects/OMS_Project_WHETGEO1D, last access: 21 December 2021). a, b

Tubini, N. and Rigon, R.: WHETGEO-1D v1.0-beta, Zenodo [code], https://doi.org/10.5281/zenodo.5112727, 2021c (data available at: https://github.com/geoframecomponents/WHETGEO-1D, last access: 21 December 2021). a

Tubini, N., Formetta, G., Rigon, R., Bancheri, M., Serafin, F., Bottazzi, M., Tasin, S., Dalla Torre, D., and D'Amato, C.: Day 1-2 WHETGEO-1D, OSF [code], https://doi.org/10.17605/OSF.IO/Z53C6, 2021a. a

Tubini, N., Gruber, S., and Rigon, R.: A method for solving heat transfer with phase change in ice or soil that allows for large time steps while guaranteeing energy conservation, The Cryosphere, 15, 2541–2568, https://doi.org/10.5194/tc-15-2541-2021, 2021b. a, b, c, d, e, f, g

Unidata: Chunking Data with NetCDF-4, available at: https://www.unidata.ucar.edu/software/netcdf/workshops/2008/nc4chunking/index.html, last access: 1 April 2021a. a

Unidata: Formats and Performance, available at: https://www.unidata.ucar.edu/software/netcdf/workshops/2008/performance/index.html, last access: 1 April 2021b. a

Unidata: NetCDF version 4.3.22, UCAR/Unidata Program Center, Boulder, CO, https://doi.org/10.5065/D6H70CW6, 2021. a

Van Genuchten, M. T.: A closed-form equation for predicting the hydraulic conductivity of unsaturated soils, Soil Sci. Soc. Am. J., 44, 892–898, https://doi.org/10.2136/sssaj1980.03615995004400050002x, 1980. a

Vanderborght, J., Kasteel, R., Herbst, M., Javaux, M., Thiéry, D., Vanclooster, M., Mouvet, C., and Vereecken, H.: A set of analytical benchmarks to test numerical models of flow and transport in soils, Vadose Zone J., 4, 206–221, https://doi.org/10.2113/4.1.206, 2005. a, b, c

Walvoord, M. A. and Kurylyk, B. L.: Hydrologic impacts of thawing permafrost–A review, Vadose Zone J., 15, 1–20, https://doi.org/10.2136/vzj2016.01.0010, 2016.  a

Walvoord, M. A., Voss, C. I., and Wellman, T. P.: Influence of permafrost distribution on groundwater flow in the context of climate-driven permafrost thaw: Example from Yukon Flats Basin, Alaska, United States, Water Resour. Res., 48, W07524, https://doi.org/10.1029/2011WR011595, 2012. a

Whitaker, S.: Flow in porous media I: A theoretical derivation of Darcy's law, Transport Porous Med., 1, 3–25, https://doi.org/10.1007/BF01036523, 1986. a

Wierenga, P., Hagan, R. M., and Nielsen, D.: Soil temperature profiles during infiltration and redistribution of cool and warm irrigation water, Water Resour. Res., 6, 230–238, https://doi.org/10.1029/WR006i001p00230, 1970. a

Yang, Y., Wu, J., Zhao, S., Han, Q., Pan, X., He, F., and Chen, C.: Assessment of the responses of soil pore properties to combined soil structure amendments using X-ray computed tomography, Sci. Rep.-UK, 8, 695–705, https://doi.org/10.1038/s41598-017-18997-1, 2018. a

Zha, Y., Yang, J., Zeng, J., Tso, C.-H. M., Zeng, W., and Shi, L.: Review of numerical solution of Richardson–Richards equation for variably saturated flow in soils, WIREs Water, 6, e1364, https://doi.org/10.1002/wat2.1364, 2019. a, b, c, d, e, f

Zhang, S., Meurey, C., and Calvet, J.-C.: Identification of soil-cooling rains in southern France from soil temperature and soil moisture observations, Atmos. Chem. Phys., 19, 5005–5020, https://doi.org/10.5194/acp-19-5005-2019, 2019. a

Download
Short summary
This paper presents WHETGEO and its 1D deployment: a new physically based model simulating the water and energy budgets in a soil column. WHETGEO-1D is intended to be the first building block of a new customisable land-surface model that is integrated with process-based hydrology. WHETGEO is developed as an open-source code and is fully integrated into the GEOframe/OMS3 system, allowing the use of the many ancillary tools it provides.