SoilBalance Module

History

current version 1.6 - 20th July 2023

version date comment
1.0 28/Jun/2010 Initial code. chiara corbari and davide rabuffetti
1.1 03/May/2011 Correct energy fluxes when snow is present
1.2 10/Nov/2016 Module rewritten to add new infiltration models and different soil properties management
1.3 25/Jul/2022 subsurface flow changed from muskingum to darcy. Runon option removed
1.4 27/Jan/2023 bug correction: percolationcell set to zero on hillslope and rivers in SetSoilDepth
1.5 10/Feb/2023 modified to not use river network
1.6 20/Jul/2023 SetSoilDepth renamed to PercolationAndCaprise and modified

License

license: GNU GPL http://www.gnu.org/licenses/

Module Description

Solve soil water and energy balance to update soil moisture and compute actual evapotranspiration, runoff, and groundwater recharge. Soil column is assumed to be divided in two layers:

  • the surface layer where roots develop (root zone)

  • the lower unsaturated layer that transfers water to recharge groundwater in landplain (transmission zone)



Variables

Type Visibility Attributes Name Initial
type(grid_real), public :: Ge
type(grid_real), public :: Hse
type(grid_real), public :: QinSoilSub

input discharge in soil subsurface [m3/s]

type(grid_real), public :: QoutSoilSub

output discharge from soil subsurface [m3/s]

type(grid_real), public :: Rnetta
type(grid_real), public :: Ta_prec
type(grid_real), public :: Ts
type(grid_real), public :: Ts_prec
type(grid_real), public :: Xle
type(grid_real), public :: balanceError

balance error [mm]

type(grid_real), public :: capRise

capillary rise [m/s]

type(grid_real), public :: deltaSoilMoisture

time step soil mositure variation (m)

integer(kind=short), public :: dtSoilBalance
type(grid_real), public :: et

actual evapotranspiration rate [m/s]

type(grid_real), public :: infilt

infiltration rate [m/s]

type(grid_integer), public :: interstormDuration

interstorm duration [s]

type(grid_real), public :: ksat_sub
type(grid_real), public :: percolation

deep percolation through soil [m/s]

type(grid_real), public :: percolationFactor

deep percolation factor [-]

type(grid_real), public :: rainBalance

actual rainfall rate as input to soil balance [m/s]

type(grid_integer), public :: rainFlag

set if it is raining in a cell

type(grid_real), public :: runoff

runoff rate [m/s]

type(grid_real), public :: soilDepth

soil depth [m]

type(grid_real), public :: soilDepthRZ

root zone depth [m]

type(grid_real), public :: soilDepthTZ

transmission zone depth [m]

type(grid_real), public :: soilMoisture

mean volumetric water content [m3/m3]

type(grid_real), public :: soilMoistureRZ

root zone volumetric water content [m3/m3]

type(grid_real), public :: soilMoistureTZ

transmission zone volumetric water content [m3/m3]

type(grid_real), public :: soilSat

mean soil relative saturation [0-1]

type(grid_real), public :: soilSatRZ

root zone soil relative saturation [0-1]

type(grid_real), public :: soilSatTZ

transmission zone soil relative saturation [0-1]

integer, private, parameter :: CHANNEL = 1
integer, private, parameter :: HILLSLOPE = 0
integer, private, parameter :: LAKE = 2
integer, private, parameter :: LANDPLAIN = 3
type(grid_integer), private :: balanceId

id code for solving water balance

real(kind=float), private :: interstorm
real(kind=float), private :: isd

initial saturation degree, used for cold start

logical, private :: saturatedByGroundwater

groundwater table intercepts root zone

real(kind=float), private :: thresholdStartEvent
type(DateTime), private, ALLOCATABLE :: wetBegin(:)
integer, private, ALLOCATABLE :: wetCode(:)
type(DateTime), private, ALLOCATABLE :: wetEnd(:)
type(grid_integer), private :: wetland

Functions

private function WetlandIsWet(wetland, row, col, time) result(wet)

return .TRUE. if wetland is flooded

Arguments

Type IntentOptional Attributes Name
type(grid_integer) :: wetland
integer, intent(in) :: row
integer, intent(in) :: col
type(DateTime), intent(in) :: time

Return Value logical


Subroutines

public subroutine InitSoilBalance(inifile, flowDirection, time)

Initialize soil water balance

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: inifile

stores configuration information

type(grid_integer), intent(in) :: flowDirection

flow direction map

type(DateTime), intent(in) :: time

start time

public subroutine SolveSoilBalance(time, rain, irrigation, flowdir, vf, vadose)

Solve soil water balance

Arguments

Type IntentOptional Attributes Name
type(DateTime), intent(in) :: time
type(grid_real), intent(in) :: rain

rainfall rate [m/s]

type(grid_real), intent(in) :: irrigation

irrigation rate [m/s]

type(grid_integer), intent(in) :: flowdir
type(grid_real), intent(in) :: vf

vegetation fraction [0-1]

type(grid_real), intent(in) :: vadose

private subroutine PercolationAndCaprise(id, i, j, rain, vadose, pet, soilDepthCell, percolationcellRZ, percolationcellTZ, runoffcell)

compute percolation and capilalry rise

Arguments

Type IntentOptional Attributes Name
integer(kind=short), intent(in) :: id

soil balance id

integer(kind=short), intent(in) :: i
integer(kind=short), intent(in) :: j
real(kind=float), intent(in) :: rain
type(grid_real), intent(in) :: vadose

vadose zone depth

type(grid_real), intent(in) :: pet

potential evapotranspiration

real(kind=double), intent(out) :: soilDepthCell
real(kind=float), intent(out) :: percolationcellRZ
real(kind=float), intent(out) :: percolationcellTZ
real(kind=double), intent(out) :: runoffcell

private subroutine SetInitialCondition(iniDB)

set initial condition for soilwater balance

Arguments

Type IntentOptional Attributes Name
type(IniList), intent(in) :: iniDB

private subroutine SetWetland(iniDB, inifile)

set wetland for soilwater balance

Arguments

Type IntentOptional Attributes Name
type(IniList), intent(in) :: iniDB
character(len=*), intent(in) :: inifile

private subroutine UpdateSoilMoisture(id, i, j, dt, soilDepthCell, percolationcellRZ, percolationcellTZ, runoffcell, Qin, Qout)

update soil moisture

Arguments

Type IntentOptional Attributes Name
integer(kind=short), intent(in) :: id

soil balance id

integer(kind=short), intent(in) :: i
integer(kind=short), intent(in) :: j
integer(kind=short), intent(in) :: dt
real(kind=double), intent(in) :: soilDepthCell
real(kind=float), intent(inout) :: percolationcellRZ
real(kind=float), intent(inout) :: percolationcellTZ
real(kind=double), intent(inout) :: runoffcell
real(kind=float), intent(in) :: Qin
real(kind=float), intent(in) :: Qout