5.13.2-dev0
mHM
The mesoscale Hydrological Model
Loading...
Searching...
No Matches
mo_snow_accum_melt.f90
Go to the documentation of this file.
1!> \file mo_snow_accum_melt.f90
2!> \brief \copybrief mo_snow_accum_melt
3!> \details \copydetails mo_snow_accum_melt
4
5!> \brief Snow melting and accumulation.
6!> \details This module calculates snow melting and accumulation.
7!> \authors Vladyslav Prykhodko
8!> \date Dec 2012
9!> \copyright Copyright 2005-\today, the mHM Developers, Luis Samaniego, Sabine Attinger: All rights reserved.
10!! mHM is released under the LGPLv3+ license \license_note
11!> \ingroup f_mhm
13
14 USE mo_kind, ONLY : dp
15
16 IMPLICIT NONE
17
18 PRIVATE
19
20 PUBLIC :: snow_accum_melt
21
22 ! ------------------------------------------------------------------
23
24CONTAINS
25
26 ! ------------------------------------------------------------------
27
28 ! NAME
29 ! snow_accum_melt
30
31 ! PURPOSE
32 !> \brief Snow melting and accumulation.
33
34 !> \details Separates throughfall into rain and snow by comparing the temperature with the treshhold.
35 !> by comparing the temperature with the treshhold.
36 !> Calculates degree daily factor.
37 !> Calculates snow melting rates.
38 !> Calculates snow, rain and effective precipitation depth
39 !> and snow pack.
40
41 ! INTENT(IN)
42 !> \param[in] "REAL(dp) :: deg_day_incr" Increase of the Degree-day factor per mm of increasein
43 !> precipitation [s-1 degreeC-1]
44 !> \param[in] "REAL(dp) :: deg_day_max" Maximum Degree-day factor [m-1 degreeC-1]
45 !> \param[in] "REAL(dp) :: deg_day_noprec" Degree-day factor with no precipitation [m-1 degreeC-1]
46 !> \param[in] "REAL(dp) :: prec" Daily mean precipitation [m]
47 !> \param[in] "REAL(dp) :: temperature" Daily mean temperature [degreeC]
48 !> \param[in] "REAL(dp) :: temperature_thresh" Threshold temperature for snow/rain [degreeC]
49 !> \param[in] "REAL(dp) :: thrfall" Throughfall [m TS-1]
50
51 ! INTENT(INOUT)
52 !> \param[inout] "REAL(dp) :: snow_pack" Snow pack [m]
53
54 ! INTENT(OUT)
55 !> \param[out] "REAL(dp) :: deg_day" Degree-day factor [m s-1 degreeC-1]
56 !> \param[out] "REAL(dp) :: melt" Melting snow depth [m TS-1]
57 !> \param[out] "REAL(dp) :: prec_effect" Effective precipitation depth (snow melt + rain) [m]
58 !> \param[out] "REAL(dp) :: rain" Rain precipitation depth [m]
59 !> \param[out] "REAL(dp) :: snow" Snow precipitation depth [m]
60
61 ! HISTORY
62 !> \authors Vladyslav Prykhodko
63
64 !> \date Dec 2012
65
66 ! Modifications:
67 ! JM Aug 2013 - ordering of arguments changed
68 ! Robert Schweppe Jun 2018 - refactoring and reformatting
69
70 SUBROUTINE snow_accum_melt(deg_day_incr, deg_day_max, deg_day_noprec, prec, temperature, temperature_thresh, thrfall, &
71 snow_pack, deg_day, melt, prec_effect, rain, snow)
72 implicit none
73
74 ! Increase of the Degree-day factor per mm of increasein precipitation [s-1 degreeC-1]
75 REAL(dp), INTENT(IN) :: deg_day_incr
76
77 ! Maximum Degree-day factor [m-1 degreeC-1]
78 REAL(dp), INTENT(IN) :: deg_day_max
79
80 ! Degree-day factor with no precipitation [m-1 degreeC-1]
81 REAL(dp), INTENT(IN) :: deg_day_noprec
82
83 ! Daily mean precipitation [m]
84 REAL(dp), INTENT(IN) :: prec
85
86 ! Daily mean temperature [degreeC]
87 REAL(dp), INTENT(IN) :: temperature
88
89 ! Threshold temperature for snow/rain [degreeC]
90 REAL(dp), INTENT(IN) :: temperature_thresh
91
92 ! Throughfall [m TS-1]
93 REAL(dp), INTENT(IN) :: thrfall
94
95 ! Snow pack [m]
96 REAL(dp), INTENT(INOUT) :: snow_pack
97
98 ! Degree-day factor [m s-1 degreeC-1]
99 REAL(dp), INTENT(OUT) :: deg_day
100
101 ! Melting snow depth [m TS-1]
102 REAL(dp), INTENT(OUT) :: melt
103
104 ! Effective precipitation depth (snow melt + rain) [m]
105 REAL(dp), INTENT(OUT) :: prec_effect
106
107 ! Rain precipitation depth [m]
108 REAL(dp), INTENT(OUT) :: rain
109
110 ! Snow precipitation depth [m]
111 REAL(dp), INTENT(OUT) :: snow
112
113 ! Auxiliary helping variable [-]
114 REAL(dp) :: aux_help
115
116
117 !separate throughfall into rain and snow
118 if(temperature > temperature_thresh) then
119 snow = 0.0_dp
120 rain = thrfall
121 else
122 snow = thrfall
123 rain = 0.0_dp
124 end if
125
126 ! calculate degree daily factor
127 if (prec <= (deg_day_max - deg_day_noprec) / deg_day_incr) then
128 deg_day = deg_day_noprec + deg_day_incr * prec
129 else
130 deg_day = deg_day_max
131 end if
132
133 ! melting/snow accumulation
134 if (temperature > temperature_thresh) then
135 ! melting
136 if (snow_pack > 0.0_dp) then
137 aux_help = deg_day * (temperature - temperature_thresh)
138 if (aux_help > snow_pack) then
139 melt = snow_pack
140 snow_pack = 0.0_dp
141 else
142 melt = aux_help
143 snow_pack = snow_pack - aux_help
144 end if
145 else
146 melt = 0.0_dp
147 snow_pack = 0.0_dp
148 end if
149 else
150 ! snow accumulation
151 melt = 0.0_dp
152 snow_pack = snow_pack + snow
153 end if
154
155 ! effective precipitation
156 prec_effect = melt + rain
157
158 END SUBROUTINE snow_accum_melt
159
160END MODULE mo_snow_accum_melt
Snow melting and accumulation.
subroutine, public snow_accum_melt(deg_day_incr, deg_day_max, deg_day_noprec, prec, temperature, temperature_thresh, thrfall, snow_pack, deg_day, melt, prec_effect, rain, snow)
Snow melting and accumulation.