Soil Water Balance (SWB2)
Loading...
Searching...
No Matches
mass_balance__snow.F90
Go to the documentation of this file.
2
3 use iso_c_binding, only : c_short, c_int, c_float, c_double
4 implicit none
5
6contains
7
8 elemental subroutine calculate_snow_mass_balance( snow_storage, &
9 potential_snowmelt, &
10 snowmelt, &
11 net_snowfall )
12
13 real (c_float), intent(inout) :: snow_storage
14 real (c_float), intent(inout) :: snowmelt
15 real (c_float), intent(in) :: potential_snowmelt
16 real (c_float), intent(in) :: net_snowfall
17
18
19 snow_storage = max(0.0_c_float, snow_storage + net_snowfall )
20
21 if( snow_storage > potential_snowmelt ) then
22
23 snowmelt = potential_snowmelt
24 snow_storage = snow_storage - snowmelt
25
26 else ! not enough snowcover to satisfy the amount that *could* melt
27
28 snowmelt = snow_storage
29 snow_storage = 0.0_c_float
30
31 end if
32
33 end subroutine calculate_snow_mass_balance
34
35end module mass_balance__snow
elemental subroutine calculate_snow_mass_balance(snow_storage, potential_snowmelt, snowmelt, net_snowfall)