-
Notifications
You must be signed in to change notification settings - Fork 23
/
CalcSnowAlbedo.c
executable file
·40 lines (36 loc) · 1.1 KB
/
CalcSnowAlbedo.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
/*
* SUMMARY: CalcSnowAlbedo.c - Calculate snow albedo
* USAGE: Part of DHSVM
*
* AUTHOR: Bart Nijssen
* ORG: University of Washington, Department of Civil Engineering
* E-MAIL: nijssen@u.washington.edu
* ORIG-DATE: Apr-96
* DESCRIPTION: Calculate the snow albedo as a function of snow age
* DESCRIP-END.
* FUNCTIONS: CalcSnowAlbedo()
* COMMENTS:
* $Id: CalcSnowAlbedo.c,v 1.4 2003/07/01 21:26:10 olivier Exp $
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "settings.h"
#include "constants.h"
#include "data.h"
#include "Calendar.h"
#include "functions.h"
/*****************************************************************************
CalcSnowAlbedo()
*****************************************************************************/
float CalcSnowAlbedo(float TSurf, unsigned short Last, SNOWTABLE * SnowAlbedo)
{
if (Last > (unsigned short) DAYPYEAR)
Last = (unsigned short) DAYPYEAR;
/* Accumulation season */
if (TSurf < 0.0)
return SnowAlbedo[Last].Freeze;
/* Melt season */
else
return SnowAlbedo[Last].Thaw;
}