forked from ua-snap/atm-tundra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathice_thickness.py
30 lines (24 loc) · 978 Bytes
/
ice_thickness.py
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
import numpy as np
import gdal, os, sys, glob, random
import pylab as pl
"""
This module sets the ice thickness in each element using a modified Stefan Equation as
described in set_lake_ice_constant.py file.
h : ice thickness (m)
alpha : Stefan coefficient (set in set_lake_ice_constant.py)
FDD : Freezing Degree days
100 : Conversion from cm to m
h = (alpha * sqrt(FDD))/100.0
"""
def ice_thickness(self, time, element):
if self.Met['met_distribution'].lower() == 'point':
self.ice_thickness[element] = (self.Lake_Ice_Depth_alpha[element] * \
np.sqrt(-1.*self.degree_days[time,2]))/100.
else:
self.ice_thickness[element] = (self.Lake_Ice_Depth_alpha[element] * \
np.sqrt(-1. * self.FDD[time,element]))/100.
# ----------------
# self test
# ----------------
# if element == 1600:
# print 'Ice thickness is :', self.ice_thickness[element]