forked from jhamman/DHSVM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InterceptionStorage.c
executable file
·74 lines (67 loc) · 2.57 KB
/
InterceptionStorage.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* SUMMARY: InterceptionStorage.c - Calculate interception storage
* USAGE: Part of DHSVM
*
* AUTHOR: Bart Nijssen
* ORG: University of Washington, Department of Civil Engineering
* E-MAIL: [email protected]
* ORIG-DATE: Apr-96
* DESCRIPTION: Calculate interception storage
* DESCRIP-END.
* FUNCTIONS: InterceptionStorage()
* COMMENTS:
* $Id: InterceptionStorage.c,v 1.5 2003/11/12 20:01:51 colleen Exp $
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "settings.h"
#include "data.h"
#include "DHSVMerror.h"
#include "massenergy.h"
#include "constants.h"
/*****************************************************************************
InterceptionStorage()
*****************************************************************************/
void InterceptionStorage(int NMax, int NAct, float *MaxInt, float *Fract,
float *Int, float *Precip, float *MomentSq, float *Height,
unsigned char Understory, float Dt, float MS_Rainfall,
float LD_FallVelocity)
{
float Available; /* Available storage */
float Intercepted; /* Amount of water intercepted during this
timestep */
int i; /* counter */
float OriginalPrecip;
OriginalPrecip = *Precip;
/* The precipitation is multiplied by the fractional coverage, since if the
vegetation covers only 10% of the grid cell, only 10% can be intercepted as a
maximum */
for (i = 0; i < NAct; i++) {
Available = MaxInt[i] - Int[i];
if (Available > *Precip * Fract[i])
Intercepted = (*Precip) * Fract[i];
else
Intercepted = Available;
*Precip -= Intercepted;
Int[i] += Intercepted;
}
/* Find momentum squared of rainfall for use by the sediment model. */
if(Understory)
/* Since the understory is assumed to cover the entire grid cell, all
momentum is associated with leaf drip, eq. 2, Wicks and Bathurst (1996) */
*MomentSq = pow(LD_FallVelocity * WATER_DENSITY, 2) * PI/6 *
pow(LEAF_DRIP_DIA, 3) * (*Precip)/Dt;
else
/* If no understory, part of the rainfall reaches the ground as direct throughfall. */
*MomentSq = (pow(LD_FallVelocity * WATER_DENSITY, 2) * PI/6 *
pow(LEAF_DRIP_DIA, 3) * (*Precip)/Dt) + (1-Fract[0]) *
MS_Rainfall;
/* WORK IN PROGESS */
/* It should be checked whether the following statement can cause a "loss"
of water. When there is interception storage at timestep t, and snow
will cover this vegetation layer at t = T+1, the amount of water in
storage will be lost */
/* for (i = NAct; i < NMax; i++) */
/* Int[i] = 0; */
}