This page was generated from /home/docs/checkouts/readthedocs.org/user_builds/blm/checkouts/latest/docs/tasks/task5.ipynb.
Interactive online version:
Slideshow:
1.6. Modelling \(Q_E\) and \(Q_H\) with Penman-Monteith¶
1.6.1. Objectives¶
Calculate \(Q_E\) and \(Q_H\) using Penman-Monteith
Evaluate the above results with EC measurements
Tips:
The Penman Monteith equation assumes energy balance closure at each model time step.
Identify parameter values used initially.
Use the calculated roughness length and the canopy resistances to calculate the PM fluxes (QH and QE) for the same period. What is the impact on the evaluation statistics?
1.6.2. Task explained¶
1.6.2.1. basic equations¶
The Penman-Monteith equation:
where
\(s\): the slope of saturation vapour pressure curve at temperature \(T_a\);
\(Q^*\): net all-wave radiation;
\(Q_G\): ground heat flux;
\(\rho\): air density;
\(c_p\): heat capacity of air;
\(e_s\): saturation vapour pressure at temperature \(T_a\);
\(e\): actual vapour pressure;
\(\gamma\): psychrometric constant;
\(r_s\): surface resistance;
\(r_H\): aerodynamic resistance for heat transfer;
\(r_a\): aerodynamic resistance for momentum transfer.
The surface energy balance equation:
where \(Q^*\) is the net all-wave radiation, \(Q_G\) the ground heat flux, \(Q_E\) the latent heat flux and \(Q_H\) the sensible heat flux.
1.6.2.2. specific aims¶
Before starting coding, we need to interpret the problem into the following major task: With atmospheric forcing conditions and other variables in your specific AmeriFlux dataset, one needs
to model \(Q_E\) using the above equation and \(Q_H\) using surface energy balance (SEB) equation; and
to evaluate the modelled \(Q_E\) and \(Q_H\) against their observed counterparts using quantitative metrics.
1.6.2.3. assumptions¶
For simplicity, we make the following assumptions:
perfect SEB closure;
known outgoing longwave radiation; and
equivalence between \(r_H\) and \(r_a\): i.e. :math:`r_H=r_a`.
1.6.2.4. guide questions for modelling \(Q_E\)¶
As \(Q_H\) would be easily obtained as residual of other terms (i.e., \(Q_H=Q^*-Q_G-Q_E\)), let’s first focus on how to get \(Q_E\) by thinking the following questions:
What are the known and unknown terms in the above given the progress so far?
For each of the unknown terms, is it related to atmospheric forcing or surface properties?
1.6.2.5. input data we have¶
As a reminder, we know that we have the following atmospheric forcing variables available in the AmeriFlux dataset:
incoming solar radiation \(K_\downarrow\);
incoming longwave radiation \(L_\downarrow\);
outgoing longwave radiation \(L_\uparrow\);
air temperature \(T_a\);
relative humidity \(RH\);
atmospheric pressure \(p\);
wind speed \(u\); and
precipitation \(P\) (note this is NOT used in this task).
Other variables are provided either as auxiliary data to derive surface properties (e.g., friction velocity \(u_*\)) or as observed values for evaluation of modeled variables (e.g., sensible heat flux \(Q_H\)).
Now let’s move onto the calculations below: more specific hints are provided in comments of cells below.
1.6.3. Tasks¶
1.6.3.1. load necessary packages¶
[3]:
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pathlib import Path
Note:
The following cell enables the autoreload module, which allows auto-reloading of external packages. This would be particularly useful if we make changes in the utility.py file: such changes will take immediate effec in this notebook without restarting the Jupyter kernal as one would usually do.
[1]:
%load_ext autoreload
%autoreload 2
1.6.3.2. load data¶
[4]:
group_number = 5
path_dir = Path.cwd() / 'data' / f'{group_number}'
# examine available files in your folder
list(path_dir.glob('*gz'))
[4]:
[PosixPath('/Users/sunt05/Dropbox/6.Repos/task-5-blm2019/data/5/US-Slt_clean.csv.gz'),
PosixPath('/Users/sunt05/Dropbox/6.Repos/task-5-blm2019/data/5/US-UMB_clean.csv.gz')]
[ ]:
# specify the site name
name_of_site = 'US-UMB'
[ ]:
# load dataset
site_file = name_of_site + '_clean.csv.gz'
path_data = path_dir / site_file
df_data = pd.read_csv(path_data, index_col='time', parse_dates=['time'])
df_data.head()
1.6.3.3. Calculate \(Q_E\) using Penman-Monteith¶
1.6.3.3.1. calculate \(Q^*\) using surface radiation balance¶
Note: we’ve got albedo in Task 1.
[ ]:
# your code
1.6.3.3.2. calculate \(Q_G\) using a simple linear model¶
Note: we’ve done this in Task 4.
[ ]:
# your code
1.6.3.3.3. calculate \(r_a\)¶
Note: we’ve done this in Task 3.
[ ]:
# your code
1.6.3.3.4. calculate \(r_s\)¶
Note: we’ve done this in Task 4.
[ ]:
# your code
1.6.3.3.5. calculate other atmospheric states¶
Note: related functions are all provided in the utility.py file.
[ ]:
# slope `s`:
# s = cal_des_dta(Temp_C, Press_hPa)
[ ]:
# psychrometric constant `gamma`:
# gamma = cal_gamma(Press_hPa)
[ ]:
# air density `rho`
# rho = cal_dens_air(Press_hPa, Temp_C)
[ ]:
# specific heat capacity of air mass `cp`
# cp = cal_cpa(Temp_C, RH_pct, Press_hPa)
[ ]:
# vapour pressure deficit `es-e`, or `vpd`
# vpd = cal_vpd(Temp_C, RH_pct, Press_hPa)
1.6.3.3.6. integrate the above results to get \(Q_E\)¶
[ ]:
# your code
1.6.3.4. calculate \(Q_H\) using SEB equation¶
[ ]:
# your code
1.6.3.5. evaluation of modelled \(Q_E\) and \(Q_H\)¶
[ ]:
# calculate MAE to see the overal performance
[ ]:
# calculate MBE to see if your model is overestimating or underestimating the variables
[ ]:
# plot observed and modelled values on the same chart with a 1:1 line
# note: we've done this in task 3 for `ra`